/* ONIA pages (onia.html, onia-regulament.html). They load styles.css first and reuse its pieces:
   section eyebrows and titles, glass cards, hero buttons, the timeline, the rules banner and the
   facts rows. Only what is new for ONIA lives here. */

.onia-page {
   --onia-glass: rgba(62, 54, 103, 0.3);
   --onia-line: rgba(255, 255, 255, 0.1);
}

.onia-section {
   position: relative;
   padding-top: var(--section-gap);
}

.onia-nowrap {
   white-space: nowrap;
}

/* a section with the TJA pattern behind its top part, faded in and out so it has no hard edges */
.onia-pattern {
   isolation: isolate;
}

.onia-pattern::before {
   content: '';
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   z-index: -1;
   aspect-ratio: 2840 / 1594;
   background: url("../assets/img/bg2.webp") center top / 100% auto no-repeat;
   -webkit-mask-image: linear-gradient(transparent, #000 25%, #000 60%, transparent);
   mask-image: linear-gradient(transparent, #000 25%, #000 60%, transparent);
   pointer-events: none;
}

/* ---------- hero ---------- */

.onia-hero {
   position: relative;
   isolation: isolate;
   padding: 11rem 0 2rem;
   color: #fff;
}

/* pattern and glow behind the hero; they fade out and reach a little into the next section,
   so there is no hard edge where the hero ends */
.onia-hero::before {
   content: '';
   position: absolute;
   inset: 0 0 -160px;
   z-index: -1;
   background:
      radial-gradient(45% 55% at 80% 40%, rgba(135, 99, 253, 0.16), transparent 70%),
      url("../assets/img/bg3.webp") center top / 100% auto no-repeat;
   -webkit-mask-image: linear-gradient(#000 45%, transparent);
   mask-image: linear-gradient(#000 45%, transparent);
   pointer-events: none;
}

.onia-hero-title {
   margin: 0 0 20px;
   font-size: 3.4rem;
   font-weight: 700;
   line-height: 1.1;
   letter-spacing: -0.01em;
   text-wrap: balance;
}

.onia-hero-lead {
   max-width: 620px;
   margin: 0;
   font-size: 1.15rem;
   line-height: 1.7;
   color: rgba(255, 255, 255, 0.75);
}

.onia-hero-meta {
   display: flex;
   flex-wrap: wrap;
   gap: 14px 0;
   margin: 30px 0 0;
   padding: 0;
   list-style: none;
}

.onia-hero-meta li {
   display: flex;
   align-items: flex-start;
   gap: 12px;
   line-height: 1.5;
   color: rgba(255, 255, 255, 0.85);
}

/* a thin rule between date and place, the icons sit bare next to the first line */
.onia-hero-meta li+li {
   margin-left: 28px;
   padding-left: 28px;
   border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.onia-hero-meta i {
   flex: none;
   width: 1.1em;
   margin-top: 0.25em;
   text-align: center;
   color: #a699f8;
   font-size: 1rem;
}

.onia-hero-meta strong {
   color: #fff;
}

.onia-hero-actions {
   justify-content: flex-start;
   margin-top: 32px;
}

.onia-hero-note {
   display: flex;
   align-items: center;
   gap: 10px;
   margin: 22px 0 0;
   font-size: 0.95rem;
   color: rgba(255, 255, 255, 0.6);
}

.onia-hero-note i {
   color: #a699f8;
}

/* ---------- shared bits ---------- */

.onia-link {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   margin-top: 16px;
   padding-bottom: 3px;
   font-weight: 700;
   color: #a699f8;
   text-decoration: none;
   background: linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat;
   transition: color 0.3s;
}

.onia-link:hover {
   color: #c9c1ff;
}

.onia-link span {
   transition: translate 0.3s;
}

.onia-link:hover span {
   translate: 2px -2px;
}

.onia-card {
   position: relative;
   padding: 26px;
   border-radius: 20px;
   border: 1px solid var(--onia-line);
   background: var(--onia-glass);
   backdrop-filter: blur(12px);
   -webkit-backdrop-filter: blur(12px);
   box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
   transition: border-color 0.3s, translate 0.3s;
}

@media (hover: hover) {
   .onia-card:hover {
      translate: 0 -3px;
      border-color: rgba(166, 153, 248, 0.35);
   }
}

.onia-card p {
   margin: 0;
   font-size: 1rem;
   line-height: 1.65;
   color: rgba(255, 255, 255, 0.75);
}

.onia-card-icon {
   display: grid;
   place-items: center;
   width: 46px;
   height: 46px;
   margin-bottom: 18px;
   border-radius: 14px;
   background: rgba(135, 99, 253, 0.2);
   color: #c9c1ff;
   font-size: 1.15rem;
}

.onia-card .onia-card-label {
   margin-bottom: 6px;
   font-size: 0.78rem;
   font-weight: 700;
   letter-spacing: 0.14em;
   text-transform: uppercase;
   color: #a699f8;
}

.onia-card-title {
   margin: 0 0 10px;
   font-size: 1.25rem;
   font-weight: 700;
   line-height: 1.3;
   color: #fff;
}

.onia-note {
   display: flex;
   gap: 12px;
   max-width: 900px;
   margin: 26px 0 0;
   font-size: 0.95rem;
   line-height: 1.65;
   color: rgba(255, 255, 255, 0.6);
}

.onia-note i {
   margin-top: 5px;
   color: #a699f8;
}

/* intro on the left stays in view while the cards on the right scroll by */
@media (min-width: 992px) {
   .onia-split>.col-lg-5 {
      position: sticky;
      top: 120px;
      align-self: flex-start;
      padding-right: 40px;
   }
}

/* ---------- registration ---------- */

.onia-check-grid {
   display: grid;
   grid-template-columns: repeat(2, minmax(0, 1fr));
   gap: 20px;
}

/* ---------- the two rounds ---------- */

.onia-stages {
   display: grid;
   grid-template-columns: repeat(2, minmax(0, 1fr));
   gap: 24px;
}

.onia-stage {
   padding: 30px;
   border-radius: 22px;
   border: 1px solid var(--onia-line);
   background: var(--onia-glass);
   backdrop-filter: blur(12px);
   -webkit-backdrop-filter: blur(12px);
   box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.onia-stage-head {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   justify-content: space-between;
   gap: 10px;
   margin-bottom: 20px;
}

.onia-stage-step {
   padding: 4px 12px;
   border-radius: 999px;
   background: #8763fd;
   font-size: 0.78rem;
   font-weight: 700;
   letter-spacing: 0.12em;
   text-transform: uppercase;
   color: #fff;
}

.onia-stage-date {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   font-weight: 700;
   color: #fff;
}

.onia-stage-date i {
   color: #a699f8;
}

.onia-stage-date.is-pending {
   color: rgba(255, 255, 255, 0.6);
}

.onia-stage-title {
   margin: 0 0 10px;
   font-size: 1.7rem;
   font-weight: 700;
}

.onia-stage-text {
   margin: 0 0 12px;
   font-size: 1.05rem;
   line-height: 1.65;
   color: rgba(255, 255, 255, 0.75);
}

/* facts rows from the about block, sized for a half-width card */
.onia-facts .about-fact {
   grid-template-columns: 130px minmax(0, 1fr);
   gap: 16px;
   padding: 14px 0;
   text-align: left;
}

.onia-facts .about-fact+.about-fact::before {
   transform-origin: left center;
}

.onia-facts .about-fact dt {
   font-size: 0.82rem;
}

.onia-facts .about-fact dd {
   font-size: 1rem;
}

/* ---------- calendar ---------- */

/* six stages: the labels near the end get room without running into the closing one */
.onia-timeline .timeline-item:nth-last-child(3) .timeline-content {
   width: min(200px, calc(150% - 30px));
}

.onia-timeline .timeline-item:nth-last-child(2) .timeline-content {
   width: min(220px, calc(150% + 18px));
}

.onia-timeline .timeline-item.is-final .timeline-content {
   width: 190px;
}

.onia-timeline .timeline-item.is-final .timeline-title {
   font-size: 1.1rem;
   text-transform: none;
   letter-spacing: 0;
}

/* ---------- preparation ---------- */

.onia-tools {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   gap: 14px 20px;
}

.onia-tools-label {
   font-size: 0.82rem;
   font-weight: 700;
   letter-spacing: 0.14em;
   text-transform: uppercase;
   color: #a699f8;
}

.onia-chips {
   display: flex;
   flex-wrap: wrap;
   gap: 10px;
   margin: 0;
   padding: 0;
   list-style: none;
}

.onia-chips li {
   padding: 7px 16px;
   border-radius: 999px;
   border: 1px solid rgba(166, 153, 248, 0.35);
   background: rgba(135, 99, 253, 0.12);
   font-size: 0.95rem;
   font-weight: 700;
   color: #fff;
}

.onia-topics {
   display: grid;
   grid-template-columns: repeat(3, minmax(0, 1fr));
   gap: 20px;
   margin-top: 30px;
}

.onia-topic {
   display: flex;
   flex-direction: column;
   padding: 26px;
   border-radius: 20px;
   border: 1px solid var(--onia-line);
   background: var(--onia-glass);
   backdrop-filter: blur(12px);
   -webkit-backdrop-filter: blur(12px);
   box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
   transition: border-color 0.3s, translate 0.3s;
}

@media (hover: hover) {
   .onia-topic:hover {
      translate: 0 -3px;
      border-color: rgba(166, 153, 248, 0.35);
   }
}

.onia-topic-head {
   display: flex;
   align-items: baseline;
   gap: 12px;
   margin-bottom: 14px;
}

.onia-topic-num {
   font-size: 2rem;
   font-weight: 700;
   line-height: 1;
   color: rgba(166, 153, 248, 0.55);
}

.onia-topic-area {
   font-size: 0.78rem;
   font-weight: 700;
   letter-spacing: 0.14em;
   text-transform: uppercase;
   color: #a699f8;
}

.onia-topic-title {
   margin: 0 0 10px;
   font-size: 1.35rem;
   font-weight: 700;
}

.onia-topic-text {
   margin: 0 0 14px;
   line-height: 1.65;
   color: rgba(255, 255, 255, 0.75);
}

.onia-topic-tools {
   margin: 0 0 18px;
   font-size: 0.9rem;
   font-weight: 700;
   color: #c9c1ff;
}

/* "ce să exersezi": pinned to the bottom so the cards line up */
.onia-topic-practice {
   margin: auto 0 0;
   padding: 14px 16px;
   border-radius: 14px;
   border: 1px dashed rgba(166, 153, 248, 0.3);
   background: rgba(255, 255, 255, 0.03);
   font-size: 0.95rem;
   line-height: 1.55;
   color: rgba(255, 255, 255, 0.85);
}

.onia-kit {
   margin-top: 32px;
}

.onia-kit-action {
   display: flex;
   flex-direction: column;
   align-items: center;
   gap: 10px;
}

.onia-kit-meta {
   font-size: 0.82rem;
   letter-spacing: 0.08em;
   text-transform: uppercase;
   color: rgba(255, 255, 255, 0.55);
}

/* ---------- contest day ---------- */

.onia-rules {
   display: grid;
   grid-template-columns: repeat(2, minmax(0, 1fr));
   gap: 24px;
   margin-top: 30px;
}

.onia-checklist {
   margin: 6px 0 0;
   padding: 0;
   list-style: none;
}

.onia-checklist li {
   position: relative;
   padding-left: 32px;
   line-height: 1.6;
   color: rgba(255, 255, 255, 0.85);
}

.onia-checklist li+li {
   margin-top: 12px;
}

.onia-checklist li::before {
   content: '\f00c';
   position: absolute;
   left: 0;
   top: 2px;
   display: grid;
   place-items: center;
   width: 20px;
   height: 20px;
   border-radius: 50%;
   background: rgba(135, 99, 253, 0.25);
   font-family: 'Font Awesome 6 Free';
   font-size: 0.65rem;
   font-weight: 900;
   color: #c9c1ff;
}

.onia-integrity {
   display: flex;
   align-items: flex-start;
   gap: 18px;
   margin-top: 24px;
   padding: 22px 26px;
   border-radius: 20px;
   border: 1px solid rgba(196, 99, 253, 0.3);
   background: rgba(196, 99, 253, 0.08);
}

.onia-integrity-icon {
   flex: none;
   display: grid;
   place-items: center;
   width: 44px;
   height: 44px;
   border-radius: 50%;
   background: rgba(196, 99, 253, 0.2);
   color: #e3c6ff;
}

.onia-integrity p {
   margin: 0;
   line-height: 1.7;
   color: rgba(255, 255, 255, 0.85);
}

/* ---------- questions ---------- */

.onia-faq {
   display: flex;
   flex-direction: column;
   gap: 12px;
}

.onia-faq-item {
   border-radius: 18px;
   border: 1px solid var(--onia-line);
   background: var(--onia-glass);
   transition: border-color 0.3s, background-color 0.3s;
}

.onia-faq-item[open] {
   border-color: rgba(166, 153, 248, 0.4);
   background: rgba(135, 99, 253, 0.12);
}

.onia-faq-item summary {
   position: relative;
   padding: 20px 60px 20px 24px;
   font-size: 1.1rem;
   font-weight: 700;
   list-style: none;
   cursor: pointer;
}

.onia-faq-item summary::-webkit-details-marker {
   display: none;
}

/* plus that turns into a cross when the answer is open */
.onia-faq-item summary::after {
   content: '+';
   position: absolute;
   right: 20px;
   top: 50%;
   display: grid;
   place-items: center;
   width: 28px;
   height: 28px;
   translate: 0 -50%;
   border-radius: 50%;
   border: 1px solid rgba(166, 153, 248, 0.4);
   font-size: 1.1rem;
   line-height: 1;
   color: #c9c1ff;
   transition: rotate 0.3s ease, background-color 0.3s;
}

.onia-faq-item[open] summary::after {
   rotate: 45deg;
   background: rgba(135, 99, 253, 0.3);
}

.onia-faq-item summary:focus-visible {
   outline: 2px solid #a699f8;
   outline-offset: 3px;
   border-radius: 18px;
}

.onia-faq-item p {
   margin: 0;
   padding: 0 24px 22px;
   line-height: 1.7;
   color: rgba(255, 255, 255, 0.8);
}

.onia-reg-cta {
   margin-top: 64px;
}

/* ---------- organisers ---------- */

.onia-organizers {
   padding-bottom: calc(var(--section-gap) * 0.8);
}

.onia-org-grid {
   display: grid;
   grid-template-columns: repeat(3, minmax(0, 1fr));
   gap: 20px;
   margin-top: 30px;
}

.onia-org-logo {
   display: block;
   height: 64px;
   max-width: 160px;
   margin-bottom: 20px;
   object-fit: contain;
   object-position: left center;
}

/* a logo kept in its original colours sits on white, as in the source file */
.onia-org-logo.is-plate {
   padding: 6px 10px;
   border-radius: 10px;
   background: #fff;
}

/* ---------- footer ---------- */

/* the page colour darkens gradually into the footer's tint instead of meeting it at a hard line */
.onia-page .footer {
   position: relative;
}

.onia-page .footer::before {
   content: '';
   position: absolute;
   left: 0;
   right: 0;
   bottom: 100%;
   height: 180px;
   background: linear-gradient(transparent, rgba(0, 0, 0, 0.2));
   pointer-events: none;
}

/* ---------- regulation page ---------- */

.reg-hero {
   padding: 10rem 0 1rem;
}

.onia-back {
   display: inline-flex;
   align-items: center;
   gap: 10px;
   margin-bottom: 26px;
   font-weight: 700;
   color: #a699f8;
   text-decoration: none;
   transition: color 0.3s, gap 0.3s;
}

.onia-back:hover {
   gap: 14px;
   color: #c9c1ff;
}

.reg-hero-title {
   max-width: 900px;
   margin: 0;
   font-size: 2.8rem;
   font-weight: 700;
   line-height: 1.15;
   text-wrap: balance;
}

.reg-hero-meta {
   display: flex;
   flex-wrap: wrap;
   gap: 10px;
   margin: 24px 0 0;
   padding: 0;
   list-style: none;
}

.reg-hero-meta li {
   display: inline-flex;
   align-items: center;
   gap: 10px;
   padding: 8px 16px;
   border-radius: 999px;
   border: 1px solid var(--onia-line);
   background: var(--onia-glass);
   font-size: 0.95rem;
   color: rgba(255, 255, 255, 0.85);
}

.reg-hero-meta i {
   color: #a699f8;
}

.reg-main {
   padding-top: 40px;
   padding-bottom: var(--section-gap);
}

/* one centred reading column for the hero and the text */
.reg-narrow {
   max-width: 860px;
   margin: 0 auto;
}

.reg-doc {
   font-size: 1.05rem;
   line-height: 1.75;
   color: rgba(255, 255, 255, 0.86);
}

.reg-chapter {
   scroll-margin-top: 110px;
}

.reg-chapter+.reg-chapter {
   margin-top: 48px;
   padding-top: 40px;
   border-top: 1px solid var(--onia-line);
}

.reg-chapter-title {
   display: flex;
   flex-direction: column;
   gap: 6px;
   margin: 0 0 22px;
   font-size: 1.7rem;
   font-weight: 700;
   line-height: 1.25;
   color: #fff;
}

.reg-chapter-num {
   font-size: 0.8rem;
   letter-spacing: 0.2em;
   text-transform: uppercase;
   color: #a699f8;
}

.reg-doc p {
   margin: 0 0 16px;
}

.reg-art {
   scroll-margin-top: 110px;
}

.reg-art strong {
   color: #a699f8;
}

.reg-list {
   margin: -6px 0 20px;
   padding: 0;
   list-style: none;
   counter-reset: reg-item;
}

.reg-list li {
   position: relative;
   padding-left: 40px;
   counter-increment: reg-item;
}

.reg-list li+li {
   margin-top: 10px;
}

.reg-list li::before {
   content: counter(reg-item) ")";
   position: absolute;
   left: 0;
   top: 2px;
   min-width: 28px;
   padding: 0 6px;
   border-radius: 8px;
   background: rgba(135, 99, 253, 0.2);
   font-size: 0.85rem;
   font-weight: 700;
   line-height: 1.7;
   text-align: center;
   color: #c9c1ff;
}

.reg-list.is-bullets li::before {
   content: '';
   top: 11px;
   left: 10px;
   min-width: 0;
   width: 8px;
   height: 8px;
   padding: 0;
   border-radius: 50%;
   background: #a699f8;
}

.reg-subtitle {
   margin: 36px 0 14px;
   font-size: 1.3rem;
   font-weight: 700;
   color: #fff;
}

.reg-doc .reg-label {
   margin-bottom: 10px;
   font-weight: 700;
   color: #fff;
}

.reg-doc .reg-term {
   display: flex;
   align-items: baseline;
   gap: 12px;
   margin-bottom: 10px;
}

.reg-tag {
   flex: none;
   display: inline-block;
   padding: 2px 10px;
   border-radius: 999px;
   font-size: 0.78rem;
   font-weight: 700;
   line-height: 1.6;
   white-space: nowrap;
}

.reg-tag.is-theory {
   background: rgba(166, 153, 248, 0.18);
   color: #d6d0ff;
}

.reg-tag.is-practice {
   background: rgba(135, 99, 253, 0.3);
   color: #fff;
}

.reg-tag.is-both {
   background: rgba(196, 99, 253, 0.22);
   color: #f0d9ff;
}

.reg-table-wrap {
   margin: 0 0 24px;
   overflow-x: auto;
   border-radius: 16px;
   border: 1px solid var(--onia-line);
   background: var(--onia-glass);
}

.reg-table {
   width: 100%;
   min-width: 560px;
   border-collapse: collapse;
   font-size: 0.95rem;
   line-height: 1.5;
}

.reg-table th,
.reg-table td {
   padding: 11px 16px;
   border-bottom: 1px solid rgba(255, 255, 255, 0.07);
   text-align: left;
   vertical-align: top;
}

.reg-table thead th {
   font-size: 0.75rem;
   font-weight: 700;
   letter-spacing: 0.12em;
   text-transform: uppercase;
   color: #a699f8;
   background: rgba(135, 99, 253, 0.12);
}

.reg-table tbody th {
   width: 28%;
   border-right: 1px solid rgba(255, 255, 255, 0.07);
   font-weight: 700;
   color: #fff;
}

.reg-table tbody tr:last-child> * {
   border-bottom: 0;
}

.reg-notes-title {
   margin: 24px 0 10px;
   font-size: 1.05rem;
   font-weight: 700;
   color: #a699f8;
}

/* ---------- smaller screens ---------- */

@media (max-width: 1199px) {
   .onia-topics {
      grid-template-columns: repeat(2, minmax(0, 1fr));
   }
}

@media (max-width: 991.98px) {
   .onia-hero {
      padding-top: 8.5rem;
      text-align: center;
   }

   .onia-hero-title {
      font-size: 2.6rem;
   }

   .onia-hero-lead {
      margin: 0 auto;
   }

   /* date and place stacked, icons lined up on the left; the block itself stays centred */
   .onia-hero-meta {
      flex-direction: column;
      align-items: flex-start;
      width: fit-content;
      margin-left: auto;
      margin-right: auto;
   }

   .onia-hero-meta li {
      text-align: left;
   }

   .onia-hero-meta li+li {
      margin-left: 0;
      padding-left: 0;
      border-left: 0;
   }

   .onia-hero-actions,
   .onia-hero-note {
      justify-content: center;
   }

   .onia-split>.col-lg-5 {
      margin-bottom: 30px;
      text-align: center;
   }

   .onia-stages,
   .onia-rules,
   .onia-org-grid {
      grid-template-columns: minmax(0, 1fr);
   }

   .onia-tools {
      justify-content: center;
   }

   .onia-chips {
      justify-content: center;
   }

   .onia-note {
      margin-left: auto;
      margin-right: auto;
   }

   .onia-section>.container>.onia-link {
      display: flex;
      width: fit-content;
      margin-left: auto;
      margin-right: auto;
   }

   .onia-kit-action {
      width: 100%;
   }

   .reg-hero {
      padding-top: 8rem;
      text-align: left;
   }

   .reg-hero .section-eyebrow {
      justify-content: flex-start;
   }

   .reg-hero-title {
      font-size: 2rem;
   }
}

@media (max-width: 768px) {

   /* on narrow screens the pattern keeps a usable height and shows its middle */
   .onia-pattern::before {
      aspect-ratio: auto;
      height: 560px;
      background-size: auto 100%;
   }

   .onia-check-grid,
   .onia-topics {
      grid-template-columns: minmax(0, 1fr);
   }

   .onia-stage {
      padding: 24px;
   }

   .onia-facts .about-fact {
      grid-template-columns: minmax(0, 1fr);
      gap: 2px;
   }

   .onia-integrity {
      flex-direction: column;
   }
}

@media (max-width: 576px) {
   .onia-hero-title {
      font-size: 2.1rem;
   }

   /* the note wraps on phones: keep the icon inline with its first line */
   .onia-hero-note {
      display: block;
   }

   .onia-hero-note i {
      margin-right: 6px;
   }

   .reg-doc .reg-term {
      flex-direction: column;
      gap: 6px;
   }

   /* phones: each table row becomes a line of its own, the domain heading its group */
   .reg-table {
      min-width: 0;
   }

   .reg-table thead {
      display: none;
   }

   .reg-table tbody,
   .reg-table tr {
      display: block;
   }

   .reg-table tr {
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      justify-content: space-between;
      gap: 6px 12px;
      padding: 10px 14px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.07);
   }

   .reg-table th,
   .reg-table td {
      padding: 0;
      border: 0;
   }

   .reg-table tbody th {
      /* full row width, reaching over the row's own padding */
      flex-basis: calc(100% + 28px);
      width: auto;
      margin: -10px -14px 6px;
      padding: 10px 14px;
      border: 0;
      background: rgba(135, 99, 253, 0.12);
   }

   .reg-table td:first-of-type {
      flex: 1;
   }

   .reg-doc {
      font-size: 1rem;
   }

   .reg-chapter-title {
      font-size: 1.4rem;
   }
}
