/* ================= header ================= */
/* Values from the Figma header (every page frame, «CSS (all layers)»): a 68 px white bar; from the start side the
   ministry lockup (292 px), a 1 × 40 px divider, the menu (items 8/12 px padding, 10 px apart), the language pill,
   «بحث» and the Sadara logo. The row is 1335 px wide, centred, 20 px between its parts. */
.site-header { position: sticky; top: 0; z-index: 100; background: #fff; transition: box-shadow var(--dur) var(--ease); }
/* No line under the header in the designs; it appears once the page scrolls under the sticky header (site.js),
   drawn as a shadow so the header keeps its drawn 68 px. */
.site-header.is-scrolled { box-shadow: var(--shadow-sm); }
.site-header__inner {
  display: flex; align-items: center; gap: var(--sp-4); height: var(--header-h);
  max-width: 1440px; margin-inline: auto; padding-inline: var(--sp-7);
}
.brand { display: flex; align-items: center; gap: var(--sp-4); flex: none; width: 292px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand__short { display: none; } /* phones: the short name */
/* The logo image is drawn 44.08 × 42.32 px at (2.12, 0.21) inside a 48 px box (Figma «Image», 914:88875). */
.brand__logo-box { position: relative; flex: none; width: 48px; height: 48px; overflow: hidden; }
.brand__logo { position: absolute; left: 2px; top: .21px; width: 44px; height: 42px; max-width: none; }
.brand__text { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); width: 230px; text-align: center; }
/* Figma spaces every glyph by 0.14 px; browsers do not space joined Arabic letters, so the words take the difference. */
.brand__name { display: grid; place-items: center; height: 18px; margin-top: -2px; font-size: var(--fs-small); font-weight: 700; line-height: 14px; letter-spacing: .14px; word-spacing: 1px; white-space: nowrap; }
.brand__latin { display: grid; place-items: center; height: 10px; margin-top: 2px; font-size: 10px; font-weight: 400; line-height: 10px; opacity: .85; white-space: nowrap; } /* part of the logo lockup: exempt from the 12 px floor */
.site-header__divider { flex: none; width: 1px; height: 40px; background: var(--gold-strong); }

.main-nav { flex: 1; min-width: 0; }
.main-nav__list { display: flex; align-items: center; gap: 2px; list-style: none; } /* seven sections fit at 1440 (Desktop - 6, 899:212334) */
.main-nav__item { position: static; }
.main-nav__link {
  display: inline-flex; align-items: center; gap: var(--sp-1); height: 40px; padding: 0 var(--sp-2);
  border-radius: var(--r-sm); color: var(--text); font-size: var(--fs-ui); font-weight: 400; line-height: 19px; white-space: nowrap;
  list-style: none; cursor: pointer; position: relative;
}
.main-nav__link::-webkit-details-marker { display: none; }
.main-nav__link:hover { color: var(--gold-strong); }
.main-nav__item.is-active > .main-nav__link,
.main-nav__item.is-active > details > .main-nav__link { background: var(--selected-bg); color: var(--gold-strong); font-weight: 700; }
/* the 2 px underline sits under the label, near the bottom of the 40 px pill */
.main-nav__item.is-active > .main-nav__link::after,
.main-nav__item.is-active > details > .main-nav__link::after {
  content: ""; position: absolute; inset-inline: 5px 7px; top: 33px; height: 2px; background: var(--gold); border-radius: var(--r-sm);
}
.main-nav__item.is-active > a.main-nav__link::after { inset-inline: 6px; }
/* English labels run about 80 px longer than the Arabic ones: a little less type and air keeps the seven sections in one row */
[lang="en"] .site-header__inner { gap: var(--sp-3); }
[lang="en"] .main-nav__list { gap: 0; }
[lang="en"] .main-nav__link { padding-inline: var(--sp-1); font-size: .9375rem; }
.main-nav__chevron { width: 10px; height: 10px; opacity: .9; transition: transform var(--dur) var(--ease); }
[dir="rtl"] .main-nav__chevron { transform: rotate(90deg); }
[dir="ltr"] .main-nav__chevron { transform: rotate(-90deg); }
details[open] > .main-nav__link .main-nav__chevron,
.main-nav__item.is-active .main-nav__chevron { transform: rotate(0deg); }  /* the active section's chevron points down, as drawn */

/* mega menu (Figma «Mega Menu», Desktop-2…6): a white panel, 48/64 px padding, the section's name in 48 px gold
   behind a 3 px divider, then two 331 px columns of links; a blurred gold band shows below the panel. */
.mega { position: absolute; inset-inline: 0; top: 100%; isolation: isolate; animation: fade-in var(--dur) var(--ease); }
.mega__inner { animation: drop-in var(--dur) var(--ease); }
.mega__inner {
  display: flex; justify-content: center; align-items: center; gap: var(--sp-9); max-width: none; min-height: 294px;
  padding: var(--sp-7) var(--sp-8) var(--sp-7); background: #fff;
  box-shadow: var(--shadow-overlay);
}
.mega__section {
  order: -1; display: flex; flex-direction: column; justify-content: center; width: 422px; height: 197px;
  border-inline-end: 3px solid var(--border);
  font-size: var(--fs-h1); font-weight: 800; line-height: var(--lh-heading); color: var(--gold-strong);
}
/* The section's name opens its own page (R-73): the menu button above only opens this panel. */
a.mega__section { flex-direction: row; align-items: center; justify-content: flex-start; gap: var(--sp-3); }
a.mega__section .icon { width: 28px; height: 28px; stroke-width: 2.25; }
a.mega__section:hover { color: var(--gold-deep); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; }
.mega__groups { display: flex; gap: var(--sp-7); width: 710px; align-self: flex-start; padding-top: var(--sp-2); }
.mega__group { width: 331px; }
.mega__title { font-size: var(--fs-small); color: var(--gold-strong); margin-bottom: var(--sp-4); }
.mega__links { list-style: none; display: grid; gap: var(--sp-4); }
.mega__links li { min-height: 28px; padding-block: var(--sp-1) var(--sp-1); }
.mega__links a { color: var(--text); font-size: var(--fs-ui); font-weight: 400; line-height: 20px; }
.mega__links a:hover, .mega__links a[aria-current] { color: var(--gold-strong); }
.mega__featured { background: var(--selected-bg); border-radius: var(--r-md); padding: var(--sp-5); display: grid; gap: var(--sp-3); align-content: start; }
.mega__featured-title { font-size: var(--fs-h4); font-weight: 700; }
.mega__featured-text { color: var(--text-2); font-size: var(--fs-small); }
.mega__featured .btn { justify-self: start; margin-top: var(--sp-2); }

/* tools */
.header-tools { display: flex; align-items: center; gap: var(--sp-2); margin-inline-start: auto; flex: none; padding-inline: var(--sp-2); } /* centred in its 195 px box, as drawn */
.lang-switch {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: 40px; padding-inline: var(--sp-4);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-full);
  font-size: var(--fs-small); font-weight: 700; line-height: 1; color: var(--text);
}
.lang-switch:hover { border-color: var(--gold); color: var(--gold-strong); }
.lang-switch .icon { width: 16px; height: 16px; color: var(--gold-strong); }
.lang-switch__short { display: none; }

.header-search > summary { list-style: none; }
.header-search > summary::-webkit-details-marker { display: none; }
.header-search__toggle { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 40px; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); color: var(--gold-strong); font-size: var(--fs-xs); line-height: 18px; cursor: pointer; }
/* Search is an icon button at every width, the same as on phones, so the 16 px menu fits beside it. */
.header-search__toggle { width: 40px; height: 40px; padding: 0; justify-content: center; border: 1px solid var(--border); border-radius: var(--r-full); }
.header-search__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.header-search__toggle .icon { width: 18px; height: 18px; }
.header-search__panel { position: absolute; inset-inline: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-pop); padding-block: var(--sp-5); animation: drop-in var(--dur) var(--ease); }
.header-search__row { display: flex; gap: var(--sp-3); }
.header-search__row input { flex: 1; height: var(--control-h); padding-inline: var(--sp-4); border-radius: var(--r-sm); border: 1px solid var(--border-control); background: var(--surface-2); }
.sadara-link { margin-inline-start: var(--sp-3); } /* 20 px from the tools, as drawn */
.sadara-link img { width: 100px; height: 34px; }

/* drawer (mobile menu) */
.drawer { display: none; }
.drawer > summary { list-style: none; }
.drawer > summary::-webkit-details-marker { display: none; }
.drawer__toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid var(--border); cursor: pointer; }
.drawer__panel {
  position: fixed; inset-block: 0; inset-inline-end: 0; z-index: 200; width: min(360px, 88vw);
  background: var(--surface); box-shadow: var(--shadow-pop); padding: var(--sp-5); overflow-y: auto;
}
.drawer[open]::before { content: ""; position: fixed; inset: 0; background: rgb(16 19 20 / .45); z-index: 150; animation: fade-in var(--dur-slow) var(--ease); }
.drawer[open] .drawer__panel { animation: drawer-in var(--dur-slow) var(--ease); } /* slides in from the end side, where its button is */
[dir="ltr"] .drawer[open] .drawer__panel { animation-name: drawer-in-ltr; }
@keyframes drawer-in { from { transform: translateX(-100%); } }
@keyframes drawer-in-ltr { from { transform: translateX(100%); } }
.drawer__section > summary .icon { transition: transform var(--dur) var(--ease); }
.drawer__section[open] > ul { animation: rise-in var(--dur-slow) var(--ease); }
.drawer__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-4); }
.drawer__title { font-size: var(--fs-h4); font-weight: 800; }
.drawer__close { background: none; border: 0; padding: var(--sp-2); }
.drawer__list { list-style: none; }
.drawer__list > li { border-bottom: 1px solid var(--border); }
.drawer__link, .drawer__section > summary { display: flex; justify-content: space-between; align-items: center; padding-block: var(--sp-4); font-size: var(--fs-lead); font-weight: 700; cursor: pointer; list-style: none; }
.drawer__section > summary::-webkit-details-marker { display: none; }
.drawer__section[open] > summary .icon { transform: rotate(180deg); }
.drawer__section ul { list-style: none; padding: 0 0 var(--sp-3); display: grid; }
.drawer__section ul a { display: flex; align-items: center; min-height: var(--target-min); color: var(--text-2); } /* 44 px rows */
.drawer__list [aria-current="page"] { color: var(--gold-strong); font-weight: 700; }
.drawer__sadara { display: none; } /* shown on phones, where the header hides the logo */

/* 1100–1399 px: the short lockup (logo and «وزارة الرياضة») leaves the menu room (R-73). The drawer replaces the menu
   below 1100 px, and at any width where the menu would not fit (site.js adds .is-compact; editors may add items, English is longer). */
@media (min-width: 1100px) and (max-width: 1399px) {
  .site-header__inner { gap: var(--sp-3); padding-inline: var(--gutter); }
  .brand { width: auto; gap: var(--sp-3); }
  .brand__text { width: auto; align-items: flex-start; }
  .brand__name, .brand__latin, .site-header__divider { display: none; }
  .brand__short { display: block; font-size: var(--fs-ui); font-weight: 700; line-height: 1.3; white-space: nowrap; }
  .sadara-link { margin-inline-start: var(--sp-1); }
}
@media (max-width: 1099px) {
  .main-nav { display: none; }
  .drawer { display: block; }
  .site-header__inner { padding-inline: var(--gutter); }
}
.site-header.is-compact .main-nav { display: none; }
.site-header.is-compact .drawer { display: block; }
.main-nav { overflow: hidden; }
.main-nav:has(details[open]) { overflow: visible; }
@media (max-width: 640px) {
  .site-header__inner { gap: var(--sp-3); }
  .brand { gap: var(--sp-2); min-width: 0; flex: 1; }
  .brand__latin, .sadara-link, .site-header__divider, .lang-switch .icon, .lang-switch__label { display: none; }
  .lang-switch__short { display: inline; }
  .brand { width: auto; }
  .brand__text { min-width: 0; width: auto; align-items: flex-start; text-align: start; }
  .brand__name { display: none; }
  .brand__short { display: block; font-size: var(--fs-ui); font-weight: 700; line-height: 1.3; white-space: nowrap; }
  .header-tools { gap: var(--sp-2); }
  /* search stays one tap away on phones (as on mya.gov.bh): an icon button that opens the same panel */
  .header-search__toggle { width: 40px; height: 40px; padding: 0; justify-content: center; border: 1px solid var(--border); border-radius: var(--r-full); }
  .header-search__toggle .icon { width: 18px; height: 18px; }
  .header-search__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .header-search__row .btn { padding-inline: var(--sp-4); }
  .drawer__sadara { display: flex; justify-content: center; margin-top: var(--sp-5); padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-sm); }
  .drawer__sadara img { width: 100px; height: 34px; }
}

/* ================= banner ================= */
.banner { position: relative; overflow: hidden; height: var(--banner-h); }
[dir="rtl"] .banner { background: linear-gradient(to left, #E7C69B 0%, #F2E0C8 25%, var(--selected-bg) 50%, var(--banner-from) 100%); }
[dir="ltr"] .banner { --banner-fade-to: left; background: linear-gradient(to right, #E7C69B 0%, #F2E0C8 25%, var(--selected-bg) 50%, var(--banner-from) 100%); }
.banner::before {
  content: ""; position: absolute; inset: 0; background-color: var(--gold); opacity: .16;
  /* As drawn: the pattern sits on the end side and fades out by the middle of the banner. */
  --banner-fade: linear-gradient(to var(--banner-fade-to, right), #000 28%, transparent 58%);
  -webkit-mask: url("../img/pattern-sports.6f987643372c.webp") repeat 50px -43px / 902px 490px, var(--banner-fade);
          mask: url("../img/pattern-sports.6f987643372c.webp") repeat 50px -43px / 902px 490px, var(--banner-fade);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
.banner__inner { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: center; gap: var(--sp-6); padding-top: var(--sp-2); }
.banner__title { font-size: var(--fs-banner); font-weight: 700; color: var(--text); line-height: 1.15; }
/* Detail pages: a compact strip with the breadcrumb only; the page's own H1 follows. */
.banner--detail { height: auto; }
.banner--detail .banner__inner { padding-block: var(--sp-5); }
.breadcrumb__list { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); list-style: none; font-size: var(--fs-ui); font-weight: 700; line-height: 1.4; } /* a quiet wayfinding line under the title (R-67) */
.breadcrumb__item { display: inline-flex; align-items: center; gap: var(--sp-2); }
.breadcrumb__item a { color: var(--text); font-weight: 400; }
.breadcrumb__item a:hover { color: var(--gold-strong); }
.breadcrumb__home .icon { display: block; width: 20px; height: 20px; stroke-width: 2; }
.breadcrumb__sep { flex: none; width: 14px; height: 14px; stroke-width: 2.5; color: var(--text-3); }
.breadcrumb__item [aria-current="page"], .breadcrumb__item .breadcrumb__section { color: var(--gold-strong); font-weight: 700; }
@media (max-width: 640px) { .banner__inner { gap: var(--sp-4); padding-top: 0; } }

/* ================= footer ================= */
/* Values from the Figma footer (547:67585, «CSS (all layers)»): 1440 × 360, a 1 px hairline, a 306.8 px main band
   and a 59 px bar cut to 52 px by the frame. The content box is 1352 px wide, 62 px from the start edge. */
.site-footer { position: relative; isolation: isolate; color: #fff; overflow: hidden; }
[dir="rtl"] .site-footer { background: linear-gradient(90deg, var(--footer-from), var(--footer-to)); }
[dir="ltr"] .site-footer { background: linear-gradient(270deg, var(--footer-from), var(--footer-to)); }
.site-footer::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background-color: #fff; opacity: .04;
  -webkit-mask: url("../img/pattern-sports.6f987643372c.webp") repeat 0 0 / 663px 360px;
          mask: url("../img/pattern-sports.6f987643372c.webp") repeat 0 0 / 663px 360px;
}
.site-footer__main {
  border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, rgb(33 158 188 / 0) 0%, rgb(33 158 188 / .314) 50%, rgb(33 158 188 / 0) 100%) 1;
  border-bottom: .8px solid rgb(255 255 255 / .05);
}
/* The brand column (224 px) runs past its 200 px container in the drawing; the band keeps the drawn height. */
@media (min-width: 1101px) { .site-footer__main { height: 308px; } }
.site-footer__inner {
  display: grid; align-items: start;
  /* brand | gap | first column | gap | second column | Vision block, from the start side */
  grid-template-columns: minmax(0, 238.4fr) minmax(0, 318.4fr) minmax(0, 238.4fr) minmax(0, 40fr) minmax(0, 238.4fr) minmax(0, 278.4fr);
  max-width: 1352px; margin-inline: max(62px, calc(50% - 658px)) auto; padding-block: var(--sp-8) 0;
}
.footer-brand { grid-column: 1; display: flex; flex-direction: column; align-items: flex-start; width: 517px; max-width: calc(100vw - 124px); }
.footer-brand__lockup { display: flex; align-items: center; gap: var(--sp-3); height: 59px; }
.footer-brand__logo { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r-lg); background: #fff; flex: none; }
.footer-brand__logo img { width: 44px; height: 42px; object-fit: contain; }
.footer-brand__names { position: relative; top: 1px; display: flex; flex-direction: column; align-items: center; width: 268px; text-align: center; }
.footer-brand__name { display: grid; place-items: center; height: 36px; font-size: var(--fs-ui); font-weight: 800; line-height: 14px; letter-spacing: .14px; white-space: nowrap; }
.footer-brand__latin { display: grid; place-items: center; height: 24px; font-size: var(--fs-xs); font-weight: 700; line-height: 10px; opacity: .8; white-space: nowrap; }
.footer-brand__tagline {
  width: 395px; max-width: 100%; margin-inline-start: var(--sp-7); min-height: 54px; display: flex; align-items: center;
  color: var(--footer-text); font-size: var(--fs-ui); font-weight: 400; line-height: 27px; text-align: start;
}
.footer-brand__slogan { margin-inline-start: var(--sp-7); min-height: 51px; display: flex; align-items: center; font-size: var(--fs-ui); font-weight: 800; line-height: 21px; }
.footer-social { display: flex; list-style: none; padding-top: var(--sp-3); margin-inline-start: var(--sp-7); }
.footer-social__link { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm); color: #fff; }
.footer-social__link .icon { width: 22px; height: 22px; }
.footer-social__link:hover { background: rgb(255 255 255 / .12); color: #fff; }
.footer-col { grid-row: 1; }
.footer-col:nth-of-type(1) { grid-column: 3; }
.footer-col:nth-of-type(2) { grid-column: 5; }
.footer-col__title { display: flex; align-items: center; height: 24px; font-size: var(--fs-ui); font-weight: 800; line-height: 19px; }
.footer-col ul { list-style: none; display: grid; gap: var(--sp-3); padding-top: var(--sp-4); }
.footer-col li { height: 24px; padding-top: var(--sp-1); } /* links sit 4 px into their 24 px rows, as drawn */
.footer-col a { color: var(--footer-text); font-size: var(--fs-small); font-weight: 700; line-height: 19px; }
.footer-col a:hover { color: #fff; }
/* A column without a title starts with its first link in the title row, as drawn («رياضتنا»). */
.footer-col--untitled ul { padding-top: 0; }
.footer-col--untitled li:first-child { padding-top: 0; margin-bottom: var(--sp-2); }
.vision-block {
  grid-column: 6; grid-row: 1; justify-self: end; position: relative; display: block; width: 360px; height: 203px; color: #fff;
}
.vision-block:hover { color: #fff; }
.vision-block__mark { position: absolute; inset: 0; width: 360px; height: 203px; max-width: none; }
/* The title lines are centred in the mark's inner 224 px box, which sits 22 px off the block's centre. */
.vision-block__title {
  position: absolute; left: 25px; right: -25px; top: 126px; text-align: center;
  font-family: "Cairo", var(--font); font-size: var(--fs-h3); font-weight: 800; line-height: var(--lh-heading); letter-spacing: .6px;
  text-shadow: 0 1px 3px rgb(35 23 7 / .45);
}
.vision-block__subtitle {
  position: absolute; left: 24px; right: -24px; top: 161px; text-align: center; text-transform: uppercase;
  font-family: "Outfit", var(--font); font-size: var(--fs-xs); font-weight: 700; line-height: 16px; letter-spacing: 3px; color: #FDE68A;
  text-shadow: 0 1px 3px rgb(35 23 7 / .45);
}
.site-footer__bar { background: var(--footer-bar); color: #B5B8B6; font-size: var(--fs-xs); font-weight: 700; line-height: 17px; }
.site-footer__bar-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); min-height: 52px; padding: var(--sp-5) var(--sp-8) 0; }
.site-footer__links { display: flex; gap: var(--sp-5); list-style: none; padding-top: 1px; }
.site-footer__bar a { color: inherit; }
.site-footer__bar a:hover { color: #fff; }
.site-footer__copy { display: flex; align-items: center; gap: var(--sp-1); flex-wrap: wrap; }
.site-footer__credit img { display: block; width: auto; height: 19px; }

@media (max-width: 1100px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; gap: var(--sp-7); margin-inline: auto; padding: var(--sp-8) var(--gutter) var(--sp-7); }
  .footer-brand { grid-column: 1 / -1; width: auto; max-width: none; }
  .footer-col:nth-of-type(1) { grid-column: 1; grid-row: 2; }
  .footer-col:nth-of-type(2) { grid-column: 2; grid-row: 2; }
  .vision-block { grid-column: 1 / -1; grid-row: 3; justify-self: center; }
}
@media (max-width: 640px) {
  .site-footer__inner { padding-block: var(--sp-7); }
  .footer-brand__tagline, .footer-brand__slogan, .footer-social { margin-inline-start: 0; }
  .footer-brand__names { width: auto; align-items: flex-start; text-align: start; }
  .footer-brand__name, .footer-brand__latin { white-space: normal; height: auto; line-height: 1.4; }
  .site-footer__bar-inner { flex-direction: column; text-align: center; padding: var(--sp-4) var(--gutter); }
}

/* Closed <details> content is only content-visibility:hidden in current browsers,
   so positioned panels would still take part in layout. Remove them. */
details:not([open]) > .mega,
details:not([open]) > .header-search__panel,
details:not([open]) > .drawer__panel { display: none; }

/* English: the Latin line is the second line of the name, not a repeat of it. */

