/* ==========================================================================
   Arkan Academy — site top bar + header for the Coaches Version 1 pages.

   A scoped copy of the header rules in css/home.css, so Version 1 shows the
   same header as the rest of the site while keeping its own css/styles.css.
   Every rule is scoped to .ah (set on .topbar and .site-header) because
   styles.css uses the same class names (.site-header, .brand, .btn, .social…)
   and the same custom property names. Keep in step with home.css.
   Loaded after css/styles.css. Behaviour comes from js/home.js.
   ========================================================================== */

.ah {
  --navy: #0e2a47;
  --navy-2: #133a63;
  --blue: #1a62a4;
  --blue-light: #4ea0d8;
  --blue-soft: #eef6fb;
  --accent: #cd4022;
  --accent-hover: #b0361c;
  --text-2: #4f5b6b;
  --border: #e2e8f0;
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius-sm: 10px;
  --radius: 16px;
  --pill: 999px;
  --shadow-hover: 0 2px 4px rgba(14, 42, 71, .06), 0 20px 44px rgba(14, 42, 71, .13);
  --ease: cubic-bezier(.2, .7, .2, 1);

  font-family: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  letter-spacing: 0;
  color: var(--navy);
}

.ah a { color: inherit; }
.ah ul { margin: 0; padding: 0; list-style: none; }
.ah img { display: block; max-width: 100%; }
.ah :focus-visible { outline: 3px solid var(--blue-light); outline-offset: 3px; border-radius: 6px; }

.ah .container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.ah .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 10px 24px; border-radius: var(--pill);
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2; white-space: normal;
  text-decoration: none; cursor: pointer; border: 2px solid transparent;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.ah .btn:hover { transform: translateY(-1px); }
.ah .btn--accent { background: var(--accent); color: #fff; }
.ah .btn--accent:hover { background: var(--accent-hover); }
.ah .btn--sm { min-height: 40px; padding: 8px 18px; font-size: .9375rem; }

.ah .icon { display: inline-block; width: 1.1em; height: 1.1em; flex: none; }

/* ---------- Top bar ---------- */

.topbar.ah { background: linear-gradient(90deg, var(--navy-2), var(--blue)); color: #fff; font-size: .875rem; }
.ah .topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; }
.ah .topbar__contact { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; }
.topbar.ah a { text-decoration: none; }
.topbar.ah a:hover { text-decoration: underline; }
.ah .topbar__item { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; }
.ah .topbar__item .icon { opacity: .8; }

.ah .social { display: flex; gap: 6px; }
.ah .social a {
  display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff; transition: background-color .2s;
}
.ah .social a:hover { background: rgba(255, 255, 255, .3); color: #fff; }
.ah .social svg { width: 15px; height: 15px; fill: currentColor; }

/* ---------- Header ---------- */

.site-header.ah {
  /* No backdrop-filter: it would become the containing block for the fixed mobile drawer. */
  position: sticky; top: 0; z-index: 100; background: #fff;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  border-bottom: 0; border-block-end: 1px solid transparent; box-shadow: none;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.ah.is-scrolled { border-color: var(--border); box-shadow: 0 6px 24px rgba(14, 42, 71, .06); }
.ah .header__inner { display: flex; align-items: center; gap: 24px; min-height: 80px; }

.ah .brand { display: flex; align-items: center; gap: 14px; text-decoration: none; flex: none; }
.ah .brand .brand__logo { width: 64px; height: 64px; object-fit: contain; }
.ah .brand__years {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding-inline-start: 14px; border-inline-start: 1px solid var(--border);
  color: var(--blue); line-height: 1.05; font-weight: 800;
}
.ah .brand__years strong { font-size: 1.5rem; }
.ah .brand__years span { font-size: .75rem; color: var(--text-2); font-weight: 700; }

.ah .nav { margin-inline-start: auto; }
.ah .nav__list { display: flex; align-items: center; gap: 4px; }
.ah .nav__link {
  display: block; padding: 10px 14px; border-radius: var(--pill);
  font-weight: 700; color: var(--navy); text-decoration: none; transition: background-color .2s, color .2s;
}
.ah .nav__link:hover { background: var(--blue-soft); color: var(--blue); }
.ah .nav__link[aria-current="page"] { color: var(--blue); background: var(--blue-soft); }

/* Dropdown (Our Coaches › Version 1 / Version 2) */
.ah .nav__item--sub { position: relative; }
.ah .nav__sub-toggle {
  display: flex; align-items: center; gap: 6px; border: 0; background: none;
  font: inherit; font-weight: 700; line-height: inherit; cursor: pointer;
}
.ah .nav__sub-toggle.is-current { color: var(--blue); background: var(--blue-soft); }
.ah .nav__caret { display: block; width: .75em; height: .75em; transition: transform .2s var(--ease); }
.ah .nav__sub-toggle[aria-expanded="true"] .nav__caret { transform: rotate(180deg); }
.ah .nav__sub {
  display: none; position: absolute; top: calc(100% + 8px); inset-inline-start: 0; z-index: 5;
  min-width: 240px; padding: 8px; gap: 2px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-hover);
}
.ah .nav__sub::before { content: ""; position: absolute; inset-inline: 0; bottom: 100%; height: 10px; }
.ah .nav__item--sub.is-open .nav__sub { display: grid; }
.ah .nav__sublink {
  display: block; padding: 10px 14px; border-radius: var(--radius-sm); line-height: 1.35;
  font-weight: 700; color: var(--navy); text-decoration: none;
}
.ah .nav__sublink small { display: block; margin-block-start: 2px; font-size: .8125rem; font-weight: 500; color: var(--text-2); }
.ah .nav__sublink:hover, .ah .nav__sublink[aria-current="page"] { background: var(--blue-soft); color: var(--blue); }
@media (hover: hover) and (min-width: 1101px) {
  .ah .nav__item--sub:hover .nav__sub { display: grid; }
}
@media (min-width: 1101px) and (max-width: 1280px) {
  .ah .header__inner { gap: 16px; }
  .ah .nav__list { gap: 0; }
  .ah .nav__link { padding-inline: 10px; white-space: nowrap; }
}

.ah .header__actions { display: flex; align-items: center; gap: 10px; }
.ah .lang-switch {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px;
  border: 1px solid var(--border); border-radius: var(--pill);
  font-weight: 700; color: var(--navy); text-decoration: none;
}
.ah .lang-switch:hover { border-color: var(--blue); color: var(--blue); }

.ah .nav-toggle {
  display: none; place-items: center; position: static; width: 44px; height: 44px; margin: 0; padding: 0;
  border: 1px solid var(--border); border-radius: 12px; background: #fff; color: var(--navy); cursor: pointer;
}
.ah .nav-toggle svg { display: block; width: 22px; height: 22px; }
.ah .nav__mobile-extra { display: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .ah .topbar__address { display: none; }
  .ah .nav-toggle { display: grid; }
  .ah .header__actions .btn, .ah .header__actions .lang-switch { display: none; }
  .ah .header__actions { margin-inline-start: auto; }
  .ah .nav {
    display: none; position: fixed; top: 0; bottom: 0; inset-inline-end: 0; z-index: 60; width: min(340px, 86vw);
    padding: 88px 24px 32px; background: #fff; box-shadow: var(--shadow-hover);
    overflow-y: auto;
  }
  .ah .nav.is-open { display: block; animation: ah-drawer-in .3s var(--ease); }
  .ah .nav__list { flex-direction: column; align-items: stretch; gap: 4px; }
  .ah .nav__link { padding: 14px 16px; font-size: 1.0625rem; }
  .ah .nav__sub-toggle { width: 100%; justify-content: space-between; text-align: start; }
  .ah .nav__sub { position: static; min-width: 0; padding: 4px 0; padding-inline-start: 12px; border: 0; box-shadow: none; }
  .ah .nav__sub::before { display: none; }
  .ah .nav__mobile-extra { display: grid; gap: 12px; margin-block-start: 24px; padding-block-start: 24px; border-block-start: 1px solid var(--border); }
  .ah .nav__mobile-extra .lang-switch { justify-content: center; }
  .ah .nav-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(14, 42, 71, .4); }
  .ah .nav-close { position: absolute; top: 20px; inset-inline-end: 20px; }
  .ah .nav-toggle.nav-close { display: grid; }
}

@keyframes ah-drawer-in { from { transform: translateX(100%); } }
[dir="rtl"] .ah .nav.is-open { animation-name: ah-drawer-in-rtl; }
@keyframes ah-drawer-in-rtl { from { transform: translateX(-100%); } }

@media (max-width: 640px) {
  .ah .topbar__inner { justify-content: center; }
  .ah .topbar__contact .topbar__item--email { display: none; }
  .ah .header__inner { min-height: 68px; gap: 12px; }
  .ah .brand .brand__logo { width: 52px; height: 52px; }
  .ah .brand__years strong { font-size: 1.25rem; }
}

@media (max-width: 400px) {
  .topbar.ah .social { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ah .nav.is-open { animation: none; }
}
