/* ==========================================================================
   Bir Adım İleri — Component system v1
   Every rule is namespaced with .bai- or scoped under the .bai body class.
   No bare element selectors outside the .bai scope. No `body *`.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Base corrections
   -------------------------------------------------------------------------- */

/* The site sets scroll-behavior:smooth globally, which animates every
   keyboard scroll and anchor jump. Restrict it to explicit in-page links
   and disable it entirely under reduced motion. */
html { scroll-behavior: auto; }
html.bai-smooth-scroll { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html, html.bai-smooth-scroll { scroll-behavior: auto !important; }
}

/* Anchor targets clear the sticky header. */
.bai [id] { scroll-margin-top: 6rem; }

/* A visible, consistent focus ring everywhere. */
.bai :focus-visible {
  outline: 3px solid var(--bai-focus);
  outline-offset: 2px;
  border-radius: 2px;
}
.bai :focus:not(:focus-visible) { outline: none; }

/* Skip link renders 1×1 today; make it usable when focused. */
.bai .skip-link:focus,
.bai .skip-link:focus-visible {
  position: fixed !important;
  top: 1rem !important;
  left: 1rem !important;
  width: auto !important;
  height: auto !important;
  padding: .75rem 1.25rem !important;
  clip: auto !important;
  clip-path: none !important;
  background: var(--bai-ink-800) !important;
  color: #fff !important;
  border-radius: var(--r-md);
  z-index: 100000;
}

/* --------------------------------------------------------------------------
   1. Typography
   -------------------------------------------------------------------------- */

.bai-display, .bai-h1, .bai-h2, .bai-h3 {
  font-family: var(--bai-font);
  color: var(--bai-ink-800);
  text-wrap: balance;
  margin: 0 0 var(--s-3);
}
.bai-display { font-size: var(--t-display); line-height: var(--lh-display); letter-spacing: var(--ls-display); font-weight: 700; }
.bai-h1      { font-size: var(--t-h1);      line-height: 1.06;             letter-spacing: var(--ls-h1);      font-weight: 700; }
.bai-h2      { font-size: var(--t-h2);      line-height: 1.12;             letter-spacing: var(--ls-h2);      font-weight: 700; }
.bai-h3      { font-size: var(--t-h3);      line-height: 1.25;             letter-spacing: -.01em;            font-weight: 600; }

.bai-lede {
  font-size: var(--t-lede);
  line-height: 1.55;
  color: var(--bai-ink-500);
  max-width: var(--measure-lede);
  margin: 0 0 var(--s-4);
  text-wrap: pretty;
}
.bai-body  { font-size: var(--t-body); line-height: var(--lh-body); color: var(--bai-ink-600); max-width: var(--measure-prose); }
.bai-meta  { font-size: var(--t-meta); letter-spacing: var(--ls-meta); color: var(--bai-ink-300); }

.bai-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: var(--t-meta); font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--bai-gold-ink);          /* AA-safe on light */
  margin: 0 0 var(--s-2);
}
.bai-eyebrow::before {
  content: ""; width: 1.75rem; height: 2px; border-radius: 2px;
  background: currentColor; opacity: .55;
}

/* --------------------------------------------------------------------------
   2. Layout
   -------------------------------------------------------------------------- */

.bai-container { width: 100%; max-width: var(--w-content); margin-inline: auto; padding-inline: var(--gutter); }
.bai-container--wide  { max-width: var(--w-wide); }
.bai-container--prose { max-width: var(--w-prose); }

.bai-section { padding-block: var(--rhythm-standard); }
.bai-section--compact   { padding-block: var(--rhythm-compact); }
.bai-section--feature   { padding-block: var(--rhythm-feature); }
.bai-section--cinematic { padding-block: var(--rhythm-cinematic); }

.bai-section--paper { background: var(--bai-paper); }
.bai-section--alt   { background: var(--bai-paper-2); }
.bai-section--dark  { background: var(--bai-ink-800); color: #fff; }
.bai-section--dark .bai-display,
.bai-section--dark .bai-h1,
.bai-section--dark .bai-h2,
.bai-section--dark .bai-h3 { color: #fff; }
.bai-section--dark .bai-lede { color: #C9D4E8; }
.bai-section--dark .bai-body { color: #D7DEEC; }
.bai-section--dark .bai-eyebrow { color: var(--bai-gold-light); }

.bai-grid { display: grid; gap: var(--s-4); }
.bai-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bai-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bai-grid--asym { grid-template-columns: 7fr 5fr; align-items: center; gap: var(--s-5); }
@media (max-width: 900px) {
  .bai-grid--2, .bai-grid--3, .bai-grid--asym { grid-template-columns: 1fr; }
}

.bai-section-head { max-width: var(--measure-lede); margin-bottom: var(--s-5); }
.bai-section-head--center { margin-inline: auto; text-align: center; }

/* --------------------------------------------------------------------------
   3. Buttons — one family, replacing the eight currently in use
   -------------------------------------------------------------------------- */

/* Astra sets `.entry-content a { text-decoration: underline }` (specificity
   0,1,1), which outranks a bare `.bai-btn`. Buttons and component links must
   win explicitly — this is the only place we reach for !important. */
.bai-btn,
.bai-btn:hover,
.bai-btn:focus,
.entry-content .bai-btn,
.entry-content a.bai-btn { text-decoration: none !important; }

.bai-btn {
  --_bg: var(--bai-gold);
  --_fg: var(--bai-on-gold);
  --_bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .875rem 1.625rem;   /* px: Astra scales the root, so 3rem lands at ~43.6px */
  font: 600 var(--t-small)/1.2 var(--bai-font);
  color: var(--_fg); background: var(--_bg);
  border: 1px solid var(--_bd); border-radius: var(--r-md);
  text-decoration: none; cursor: pointer;
  transition: transform var(--d-fast) var(--e-out),
              box-shadow var(--d-fast) var(--e-out),
              background var(--d-fast) var(--e-out),
              border-color var(--d-fast) var(--e-out);
}
.bai-btn:hover  { transform: translateY(var(--hover-lift)); box-shadow: var(--e-1); }
.bai-btn:active { transform: translateY(0); }

.bai-btn--secondary { --_bg: transparent; --_fg: var(--bai-ink-800); --_bd: var(--bai-line); }
.bai-btn--secondary:hover { --_bd: var(--bai-ink-300); }

.bai-btn--ghost,
.bai-btn--ghost-dark { --_bg: transparent; --_fg: #fff; --_bd: rgba(255,255,255,.28); }
.bai-btn--ghost:hover,
.bai-btn--ghost-dark:hover { --_bd: rgba(255,255,255,.6); background: rgba(255,255,255,.06); }

/* Tertiary: a text action with a travelling arrow. */
.bai-btn--text {
  --_bg: transparent; --_bd: transparent;
  --_fg: var(--bai-gold-ink);
  min-height: auto; padding: .25rem 0;
}
.bai-btn--text:hover { transform: none; box-shadow: none; }
.bai-btn--text .bai-arrow { transition: transform var(--d-fast) var(--e-out); }
.bai-btn--text:hover .bai-arrow { transform: translateX(4px); }
.bai-section--dark .bai-btn--text { --_fg: var(--bai-gold-light); }

.bai-btn--lg { min-height: 56px; padding: 1rem 2rem; font-size: var(--t-body); }
.bai-btn-group { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }

/* One primary per viewport. Secondary actions must not compete. */

/* --------------------------------------------------------------------------
   4. Cards, editorial rows, steps
   -------------------------------------------------------------------------- */

.bai-card {
  display: flex; flex-direction: column; gap: var(--s-2);
  padding: var(--s-4);
  background: var(--bai-paper);
  border: 1px solid var(--bai-line);
  border-radius: var(--r-lg);
  transition: transform var(--d-fast) var(--e-out),
              box-shadow var(--d-fast) var(--e-out),
              border-color var(--d-fast) var(--e-out);
}
.bai-card--link:hover { transform: translateY(var(--hover-lift)); box-shadow: var(--e-1); border-color: transparent; }
.bai-card__title { font: 600 var(--t-h3)/1.25 var(--bai-font); color: var(--bai-ink-800); margin: 0; }
.bai-card__body  { font-size: var(--t-small); line-height: 1.6; color: var(--bai-ink-500); margin: 0; }

/* Domain signal: a 4px rule, never a fill. */
.bai-signal { border-top: 4px solid var(--_sig, var(--bai-gold)); padding-top: var(--s-3); }
.bai-signal--english   { --_sig: var(--sig-english); }
.bai-signal--exam      { --_sig: var(--sig-exam); }
.bai-signal--abroad    { --_sig: var(--sig-abroad); }
.bai-signal--coach     { --_sig: var(--sig-coach); }
.bai-signal--wellbeing { --_sig: var(--sig-wellbeing); }
.bai-signal--creative  { --_sig: var(--sig-creative); }

/* Editorial row — the antidote to card grids. */
.bai-row { display: grid; grid-template-columns: 6fr 6fr; gap: var(--s-5); align-items: center; }
.bai-row + .bai-row { margin-top: var(--rhythm-compact); }
.bai-row--reverse > .bai-row__media { order: -1; }
@media (max-width: 900px) {
  .bai-row { grid-template-columns: 1fr; gap: var(--s-3); }
  .bai-row--reverse > .bai-row__media { order: 0; }
}

.bai-steps { counter-reset: bai-step; display: grid; gap: var(--s-4); }
.bai-step { position: relative; padding-left: 4rem; }
.bai-step__num {
  position: absolute; left: 0; top: 0;
  width: 2.75rem; height: 2.75rem; border-radius: var(--r-pill);
  display: grid; place-items: center;
  font: 600 var(--t-small)/1 var(--bai-font);
  color: var(--bai-gold-ink); background: var(--bai-gold-wash);
  border: 1px solid rgba(185,138,46,.24);
}
.bai-section--dark .bai-step__num { color: var(--bai-gold-light); background: rgba(255,255,255,.06); border-color: var(--bai-line-dark); }

/* --------------------------------------------------------------------------
   5. Media
   -------------------------------------------------------------------------- */

.bai-media { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--bai-paper-3); }
.bai-media--square { border-radius: 0; }
.bai-media > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bai-media--4x5 { aspect-ratio: 4 / 5; }
.bai-media--3x2 { aspect-ratio: 3 / 2; }
.bai-media--16x9 { aspect-ratio: 16 / 9; }

/* --------------------------------------------------------------------------
   6. Accordion
   -------------------------------------------------------------------------- */

.bai-accordion { border-top: 1px solid var(--bai-line); }
.bai-ac__item { border-bottom: 1px solid var(--bai-line); }
.bai-ac__trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3); padding: var(--s-3) 0;
  font: 600 var(--t-h3)/1.35 var(--bai-font); text-align: left;
  color: var(--bai-ink-800); background: none; border: 0; cursor: pointer;
}
.bai-ac__icon { flex: none; width: 1.25rem; height: 1.25rem; position: relative; }
.bai-ac__icon::before, .bai-ac__icon::after {
  content: ""; position: absolute; inset: 50% 0 auto 0; height: 2px; border-radius: 2px;
  background: var(--bai-gold-ink); transform: translateY(-50%);
  transition: transform var(--d-base) var(--e-out), opacity var(--d-base) var(--e-out);
}
.bai-ac__icon::after { transform: translateY(-50%) rotate(90deg); }
.bai-ac__trigger[aria-expanded="true"] .bai-ac__icon::after { transform: translateY(-50%) rotate(0deg); opacity: 0; }
.bai-ac__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--d-base) var(--e-out); }
.bai-ac__panel[data-open="true"] { grid-template-rows: 1fr; }
.bai-ac__inner { overflow: hidden; }
.bai-ac__inner > * { padding-bottom: var(--s-3); }

/* --------------------------------------------------------------------------
   7. Forms
   -------------------------------------------------------------------------- */

.bai-field { display: grid; gap: .375rem; margin-bottom: var(--s-3); }
.bai-label { font: 600 var(--t-meta)/1.4 var(--bai-font); color: var(--bai-ink-600); }
.bai-input, .bai-select, .bai-textarea {
  width: 100%; min-height: 48px; padding: .75rem 1rem;
  font: 400 var(--t-body)/1.4 var(--bai-font); color: var(--bai-ink-800);
  background: var(--bai-paper); border: 1px solid var(--bai-line);
  border-radius: var(--r-sm);
  transition: border-color var(--d-fast) var(--e-out), box-shadow var(--d-fast) var(--e-out);
}
.bai-input:focus, .bai-select:focus, .bai-textarea:focus {
  border-color: var(--bai-ink-500);
  box-shadow: 0 0 0 4px rgba(76,141,255,.14);
  outline: none;
}
.bai-textarea { min-height: 8rem; resize: vertical; }
.bai-hint  { font-size: var(--t-meta); color: var(--bai-ink-300); }
.bai-error { font-size: var(--t-meta); color: var(--bai-danger); font-weight: 600; }

/* --------------------------------------------------------------------------
   8. Badges, pills, breadcrumbs, progress
   -------------------------------------------------------------------------- */

.bai-badge {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .3rem .7rem; border-radius: var(--r-pill);
  font: 600 var(--t-meta)/1.3 var(--bai-font);
  color: var(--bai-ink-600); background: var(--bai-paper-3);
}
.bai-section--dark .bai-badge { color: #E4EAF6; background: rgba(255,255,255,.08); }

.bai-breadcrumb { display: flex; flex-wrap: wrap; gap: .5rem; font-size: var(--t-meta); color: var(--bai-ink-300); }
.bai-breadcrumb a { color: var(--bai-ink-500); text-decoration: none; }
.bai-breadcrumb a:hover { color: var(--bai-ink-800); text-decoration: underline; }
.bai-breadcrumb li + li::before { content: "/"; margin-right: .5rem; opacity: .5; }

.bai-progress { position: fixed; inset: 0 0 auto 0; height: 2px; background: transparent; z-index: 9999; }
.bai-progress__bar { height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--bai-gold); }

/* Vertical journey rail. */
.bai-rail { position: relative; padding-left: var(--s-4); }
.bai-rail::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--bai-line); }
.bai-rail__fill { position: absolute; left: 0; top: 0; width: 2px; background: var(--bai-gold); transform-origin: 50% 0; transform: scaleY(0); transition: transform var(--d-base) linear; }

/* --------------------------------------------------------------------------
   9. Motion primitives — consumed by bai-motion.js
   -------------------------------------------------------------------------- */

/* Elements are visible by default. JS adds .bai-r only after the observer
   is confirmed active, so a JS failure can never hide content. */
.bai-r {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition: opacity var(--d-slow) var(--e-out), transform var(--d-slow) var(--e-out);
  will-change: opacity, transform;
}
.bai-r.is-in { opacity: 1; transform: none; }
.bai-r-group > * { transition-delay: calc(var(--bai-i, 0) * 60ms); }

.bai-zoom > img { transform: scale(1.04); transition: transform var(--d-cine) var(--e-soft); }
.bai-zoom.is-in > img { transform: scale(1); }

@media (prefers-reduced-motion: reduce) {
  .bai-r { opacity: 1 !important; transform: none !important; transition: none !important; }
  .bai-r-group > * { transition-delay: 0ms !important; }
  .bai-zoom > img { transform: none !important; transition: none !important; }
  .bai-progress { display: none; }
}

/* --------------------------------------------------------------------------
   10. Utilities
   -------------------------------------------------------------------------- */

.bai-sr {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.bai-stack > * + * { margin-top: var(--s-2); }
.bai-center { text-align: center; margin-inline: auto; }

/* =========================================================================
   Footer sitemap  ·  .bai-sitemap
   Rendered by bai_render_footer_sitemap() from the `footer_menu` location.
   Sits above Astra's copyright row. Namespaced; touches no theme selector.
   ====================================================================== */

.bai-sitemap {
  background: var(--bai-ink-900, #0F1A31);
  color: #C9D4E8;
  padding-block: var(--rhythm-standard, 4.5rem);
  border-top: 1px solid var(--bai-line-dark, rgba(255, 255, 255, .12));
}

.bai-sitemap__w {
  max-width: var(--w-content, 75rem);
  margin-inline: auto;
  padding-inline: var(--gutter, 1.5rem);
}

/* Collapsible groups. Ships open; JS closes them on narrow viewports only. */
.bai-sitemap__col > summary { list-style: none; cursor: default; }
.bai-sitemap__col > summary::-webkit-details-marker { display: none; }

/* The heading orients screen-reader users; sighted users read the columns. */
.bai-sitemap__h {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bai-sitemap__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--s-4, 2rem) var(--s-3, 1.5rem);
}

@media (max-width: 1100px) {
  .bai-sitemap__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .bai-sitemap__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 460px) {
  .bai-sitemap__grid { grid-template-columns: 1fr; }
}

.bai-sitemap__title {
  display: block;
  /* px, not rem: Astra scales the root font-size. */
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--bai-gold-light, #E7C77E);
  text-decoration: none;
  margin-bottom: .75rem;
  min-height: 24px;
}

.bai-sitemap__title:hover,
.bai-sitemap__title:focus-visible { text-decoration: underline; }

.bai-sitemap__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .1rem;
}

.bai-sitemap__list a {
  display: block;
  /* 44px keeps every footer link a comfortable touch target. */
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 15px;
  line-height: 1.4;
  color: #B4C2DA;
  text-decoration: none;
  transition: color var(--d-fast, .18s) var(--e-out, ease-out);
}

.bai-sitemap__list a:hover { color: #fff; }

.bai-sitemap__list a:focus-visible {
  outline: 3px solid var(--bai-focus, #4C8DFF);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .bai-sitemap__list a { transition: none; }
}

/* ---- Mobile: groups collapse, summary becomes the toggle ---------------- */
@media (max-width: 720px) {
  .bai-sitemap__col {
    border-bottom: 1px solid var(--bai-line-dark, rgba(255, 255, 255, .12));
  }
  .bai-sitemap__col > summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    /* 52px: a full-width row is the primary control on this breakpoint. */
    min-height: 52px;
    margin-bottom: 0;
  }
  .bai-sitemap__col > summary::after {
    content: "";
    flex: none;
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform var(--d-fast, .18s) var(--e-out, ease-out);
  }
  .bai-sitemap__col[open] > summary::after {
    transform: rotate(-135deg) translate(-2px, -2px);
  }
  .bai-sitemap__col > summary:focus-visible {
    outline: 3px solid var(--bai-focus, #4C8DFF);
    outline-offset: -3px;
  }
  .bai-sitemap__list { padding-bottom: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .bai-sitemap__col > summary::after { transition: none; }
}
