/*
 * marketing-overrides.css
 *
 * The admin app's Tailwind v4 globals.css (loaded app-wide in the root layout)
 * ships a "preflight" base reset. On marketing routes that reset leaks in and
 * fights the ported theme (main.css). Bootstrap's own reboot in main.css wins
 * for most elements (it is unlayered, beating Tailwind's @layer base), but a few
 * preflight rules have no theme counterpart and silently break the design.
 *
 * This file — loaded AFTER main.css on marketing routes only — re-asserts the
 * theme's expected base for those specific cases. Each rule documents the live
 * antstudija.lt computed value it restores. Keep this list minimal and add to it
 * only when a leak is confirmed against the live site.
 */

/* Hero media: the theme lets the hero image/video overflow their masked wrapper
 * (live computed max-width: none → img renders 1024x480, clipped to the diagonal
 * mask). Tailwind preflight forces `img,video { max-width: 100% }`, which shrinks
 * the media to the column width and collapses its height, so the absolutely-
 * positioned mobile headline overflows onto white. Restore the theme behaviour. */
.section-hero .img-wrapper .hero-img,
.section-hero .video-wrapper video {
  max-width: none;
}

/* Swiper slide stretch guard (testimonials / coaches / instagram carousels).
 * The theme's swiper-wrapper is `display:flex; align-items:stretch`. When Swiper
 * works, slides are `position:absolute` so stretch never applies and each card is
 * its own content height (live: 358/238/316px etc.). But if Swiper drops into a
 * half-initialised state on a window resize, the slides revert to in-flow flex
 * items and `align-items:stretch` blows every card up to the (mis-measured, ~732px+)
 * wrapper height — the giant empty testimonial cards. `align-self:flex-start`
 * makes a slide refuse to stretch even as an in-flow flex item, so cards stay
 * content-height in every Swiper state. Visually identical to live in the normal
 * (absolute) case; only prevents the broken-state blow-up. */
.section-testimonials .swiper-slide,
.section-coaches .swiper-slide,
.section-instagram .swiper-slide {
  align-self: flex-start;
}

/* Bootstrap vs Tailwind ".collapse" clash. Tailwind v4 generates every utility
 * whose token appears anywhere in scanned source, and "collapse" qualifies, so
 * globals.css ships `.collapse { visibility: collapse }` (@layer utilities).
 * Bootstrap's navbar markup (`class="collapse navbar-collapse"`) never declares
 * `visibility`, so the Tailwind utility was the only declaration and hid the
 * ENTIRE desktop navbar (nav links + LT/EN switcher) — visibility inherits.
 * Bootstrap handles collapse states purely via `display`, with visibility at
 * its default `visible`; restore that on marketing routes. This rule is
 * unlayered, so it beats the @layer utility regardless of order. */
.collapse {
  visibility: visible;
}

/* ---------------------------------------------------------------------------
 * Homepage "ANT" watermark (live parity).
 * Live: body.home carries a fixed-attachment background of the outlined ANT
 * letterform (main.css:26623-26637). Our <body> has no per-route class, so the
 * homepage wraps its sections in .home-watermark and this block replicates the
 * body.home rules verbatim (asset paths resolved to /site/...). With
 * background-attachment:fixed the positioning area is the viewport, so a
 * wrapper div paints identically to the body background. */
.home-watermark {
  background-image: url("/site/images/bg/ant-watermark-mobile-gray.svg");
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: calc(100% - 0.75rem);
  background-position: 0.375rem 0.375rem;
}
@media (min-width: 992px) {
  .home-watermark {
    background-size: contain;
    background-image: url("/site/images/bg/ant-watermark.svg");
    background-position: top center;
  }
}
@media (min-width: 1600px) {
  .home-watermark {
    background-size: cover;
  }
}

/* ---------------------------------------------------------------------------
 * Coaches carousel (native scroll-snap replacement for the theme Swiper —
 * see src/components/marketing/home/coaches-carousel.tsx for why).
 *
 * Live geometry (theme main.js homeCoachesSwiper + main.css .section-coaches):
 * slide 10rem/<576 and 15rem/≥576 with 12px gaps; 3 per container from 768px
 * (16px gaps), 3 from 992px (20px gaps), 4 from 1400px (24px gaps) — with the
 * next card "peeking" past the .container edge (live: swiper overflow:visible
 * inside a viewport-wide overflow-hidden).
 *
 * --coach-cw = Bootstrap .container INNER width per breakpoint (max-width
 * minus the 2×0.75rem gutters): 516/696/936/1116/1296px. The full-bleed
 * scroller's inline padding centres that width, so card edges align with the
 * .container exactly like live, and overscan shows the peek. */
.section-coaches .coaches-scroller {
  --coach-cw: 100%;
  --coach-gap: 0.75rem; /* 12px, live spaceBetween <768 */
  display: flex;
  gap: var(--coach-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; /* live carousel shows no scrollbar */
  padding-inline: max(0.75rem, calc((100% - var(--coach-cw)) / 2));
  scroll-padding-inline: max(0.75rem, calc((100% - var(--coach-cw)) / 2));
  cursor: grab; /* live coaches Swiper runs grabCursor: true */
}
.section-coaches .coaches-scroller::-webkit-scrollbar {
  display: none;
}
/* Active mouse drag (coaches-carousel.tsx pointer handlers): relax snap so
 * direct scrollLeft writes track the pointer 1:1, show the grabbing cursor,
 * and stop text/image selection. Snap re-engages when the class drops after
 * the release settle. */
.section-coaches .coaches-scroller.is-dragging {
  scroll-snap-type: none;
  cursor: grabbing;
  user-select: none;
}
.section-coaches .coaches-scroller .coach-slide {
  flex: 0 0 auto;
  width: 10rem; /* live .swiper-slide <576 */
  scroll-snap-align: start;
}
@media (min-width: 576px) {
  .section-coaches .coaches-scroller {
    --coach-cw: 516px;
  }
  .section-coaches .coaches-scroller .coach-slide {
    width: 15rem; /* live .swiper-slide 576-767 */
  }
}
@media (min-width: 768px) {
  .section-coaches .coaches-scroller {
    --coach-cw: 696px;
    --coach-gap: 1rem; /* live spaceBetween 768+ */
  }
  .section-coaches .coaches-scroller .coach-slide {
    /* live slidesPerView: 3 */
    width: calc((var(--coach-cw) - 2 * var(--coach-gap)) / 3);
  }
}
@media (min-width: 992px) {
  .section-coaches .coaches-scroller {
    --coach-cw: 936px;
    --coach-gap: 1.25rem; /* live spaceBetween 992+ */
  }
}
@media (min-width: 1200px) {
  .section-coaches .coaches-scroller {
    --coach-cw: 1116px;
  }
}
@media (min-width: 1400px) {
  .section-coaches .coaches-scroller {
    --coach-cw: 1296px;
    --coach-gap: 1.5rem; /* live spaceBetween 1400+ */
  }
  .section-coaches .coaches-scroller .coach-slide {
    /* live slidesPerView: 4 */
    width: calc((var(--coach-cw) - 3 * var(--coach-gap)) / 4);
  }
}

/* The carousel prev/next are real <button>s (a11y) instead of live's <div>s;
 * the theme's .swiper-navigation-prev/-next border/padding/rotate styles apply
 * directly — just neutralise the UA/Bootstrap button chrome. */
.section-coaches .swiper-navigation button {
  background: transparent;
  color: inherit;
}

/* The scroll-progress track: the theme styles .swiper-pagination (relative,
 * 6px/#EBEBEB mobile → 4px/rgba(4,4,5,.12) desktop, margin-top 3rem) and the
 * fill colors (#878787 → #1B1B22). Swiper's own base CSS normally supplies the
 * fill's box (absolute, full-size, scaleX origin left) via
 * .swiper-pagination-progressbar — restated here because our track lives
 * outside a .swiper element and the fill is a <span>. */
.section-coaches .swiper-pagination {
  display: block;
  overflow: hidden;
}
.section-coaches .swiper-pagination .swiper-pagination-progressbar-fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  transform: scale(0);
  transform-origin: left top;
}

/* -----------------------------------------------------------------------------
 * .legal-content — long-form legal documents (privacy policy, 0295).
 *
 * The theme's .simple-content only styles <p> and <h5>; a privacy policy is a
 * structured document with section headings, nested lists and links, and none
 * of those have a theme counterpart here (Tailwind preflight strips list
 * markers and heading sizes, Bootstrap's reboot does not restore them inside
 * this block). These rules give the policy readable document typography that
 * matches the theme's scale, without touching any other marketing surface.
 * -------------------------------------------------------------------------- */
.legal-content {
  text-align: left;
}
.legal-content h2,
.legal-content h3,
.legal-content h4 {
  font-family: "ClashGrotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #0000AD;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.legal-content h2 {
  font-size: 1.375rem;
  line-height: 1.2;
  margin-top: 3rem;
  margin-bottom: 1rem;
}
.legal-content h3 {
  font-size: 1.125rem;
  line-height: 1.25;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.legal-content h4 {
  font-size: 1rem;
  line-height: 1.3;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.legal-content h2:first-child,
.legal-content h3:first-child {
  margin-top: 0;
}
@media (min-width: 992px) {
  .legal-content h2 {
    font-size: 1.75rem;
  }
  .legal-content h3 {
    font-size: 1.25rem;
  }
}
/* Body copy one step down from .simple-content's 1.125/1.25rem — a policy is
 * read as a document, not as a marketing paragraph. */
.legal-content p,
.legal-content li {
  font-size: 1rem;
  line-height: 1.55;
  letter-spacing: 0.01em;
}
.legal-content p {
  margin-bottom: 1rem;
}
.legal-content ul,
.legal-content ol {
  margin: 0 0 1.5rem 0;
  padding-left: 1.5rem;
}
.legal-content ul {
  list-style: disc outside;
}
.legal-content ol {
  list-style: decimal outside;
}
.legal-content li {
  margin-bottom: 0.5rem;
}
.legal-content a {
  color: #0000AD;
  text-decoration: underline;
  line-break: anywhere;
}

/* -----------------------------------------------------------------------------
 * Footer legal links — flush with the studio's own text (2026-08-09).
 *
 * The theme styles these as menu items: `.navbar-nav-footer-bottom .nav-item
 * .nav-link { padding: .5rem }`, which indents „Privatumo politika" 8px past
 * „© ANT Studija" and „Namai, kuriuose visada skamba muzika!" directly above it.
 * Since the links moved into the brand column they read as part of that block,
 * and a stray 8px is visible against a left edge three other lines share.
 *
 * Three classes deep on purpose: the theme's own rule is that specific, so a
 * shorter selector loses to it and the fix silently does nothing (verified in
 * the browser — a two-class selector was still computing 8px). Spacing between
 * the two links comes from the list's column-gap, not from link padding.
 * -------------------------------------------------------------------------- */
.navbar-nav-footer-bottom .nav-item .nav-link {
  padding-left: 0;
  padding-right: 0;
}

/* -----------------------------------------------------------------------------
 * Fullscreen menu: clip sub-menu overflow while the collapse animates.
 *
 * The theme hides an inactive drill-down sub-menu with `height: 0` during the
 * collapse animation (`.navbar-collapse.collapsing .sub-menu`) and relies on
 * `.is-hidden` (added by main.js) for the actual clipping — height alone does
 * not stop the items' text from painting over the list. On WordPress that pair
 * can never separate (every navigation reloads the page); here a client-side
 * route change lets React recompute the parent item's className mid-animation,
 * so a sub-menu could sit at height 0 WITHOUT `is-hidden` and its links
 * flashed over the menu until the animation ended (owner report 2026-08-31).
 * main.js now resets the drill-down state when the overlay finishes closing;
 * this rule is the belt-and-braces guarantee that no in-between state can
 * paint overflowing text. The drilled-open case is untouched: there the
 * sub-menu has `height: auto`, so nothing overflows and nothing is clipped.
 * -------------------------------------------------------------------------- */
@media (max-width: 1399.98px) {
  .navbar-main .navbar-collapse.collapsing .sub-menu,
  .navbar-main .navbar-collapse.show .sub-menu {
    overflow: hidden;
  }
}

/* -----------------------------------------------------------------------------
 * The contract signing portal — /sutartis/{token} and its staff preview at
 * /admin/sutartis-perziura/{id} (owner review, 2026-09-07).
 *
 * These rules live HERE, after `.legal-content p`, and not in a Tailwind
 * utility, for one cascade reason: the portal renders inside
 * `.simple-content.legal-content`, whose `.legal-content p { font-size: 1rem }`
 * is a 0-2-0 selector sitting in the unlayered bucket. It outranks any 0-1-0
 * class (that is exactly how the theme's `.h4` lost) AND any Tailwind
 * utility, which lives in an @layer and therefore always loses to unlayered
 * rules. A 0-2-0 selector declared after it is the way to win cleanly.
 * -------------------------------------------------------------------------- */

/* The month total — the number a parent opened the page to find. Explicitly
 * the largest thing in its card, in the page's own face rather than the
 * theme's condensed uppercase display face, and with tabular figures so the
 * September and October cards (and the two commitment columns) line up digit
 * for digit. */
.legal-content .portal-month-total {
  font-family: "ClashGrotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.875rem;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: #0000AD;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
@media (min-width: 992px) {
  .legal-content .portal-month-total {
    font-size: 2.125rem;
  }
}
/* „Padengia užstatas“ occupies the total's slot but is a sentence, not a
 * figure — it takes the emphasis without the display size that would wrap it. */
.legal-content .portal-month-covered {
  font-family: "ClashGrotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.125rem;
  line-height: 1.3;
  font-weight: 600;
  color: #0000AD;
}
/* The breakdown reads as the total's detail: a hairline separates them, and
 * its amounts get the same tabular figures so the column stays straight. */
.legal-content .portal-month-lines {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(4, 4, 5, 0.12);
}
.legal-content .portal-month-line-amount {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  white-space: nowrap;
}

/* The two commitment quotes. DOM order is column-major — „Su įsipareigojimu“
 * and its months, then „Be įsipareigojimo“ and its months — so the phone's
 * single column reads correctly top to bottom. */
.portal-quotes {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr;
}
.portal-quote {
  display: grid;
  gap: 0.5rem;
  align-content: start;
}
.portal-quote-head {
  align-self: center;
}
@media (min-width: 768px) {
  .portal-quotes {
    grid-template-columns: 1fr 1fr;
  }
  /* Side by side, the two columns share ROW tracks: one for the heading and
   * one per month. Each track sizes to its tallest card, so September always
   * sits beside September even though „Su įsipareigojimu“ carries an extra
   * „Užstatas“ line in the first month. No fixed heights anywhere — an extra
   * line grows the row for both columns at once.
   *
   * Browsers without `subgrid` skip this block entirely and keep the previous
   * two-independent-stacks layout, which is a cosmetic regression to the old
   * behaviour rather than a break. */
  @supports (grid-template-rows: subgrid) {
    .portal-quotes {
      grid-template-rows: repeat(var(--portal-quote-rows, 3), auto);
    }
    .portal-quote {
      grid-row: 1 / -1;
      grid-template-rows: subgrid;
    }
  }
}

/* Why a disabled control is disabled. Distinct from the cards' `text-muted`
 * small print — a reader must not have to work out which of three grey
 * sentences belongs to the greyed-out button. */
.legal-content .portal-blocked-note {
  margin: 0 0 1rem 0;
  padding: 0.625rem 0.875rem;
  border-left: 3px solid #0000AD;
  background: rgba(0, 0, 173, 0.05);
  color: rgba(4, 4, 5, 0.85);
  border-radius: 0 0.25rem 0.25rem 0;
}
/* Bootstrap's `disabled` only dims to 0.65 here and the theme restores
 * `cursor: pointer`, so a held button still invited a press. */
.portal-disabled-wrap {
  display: inline-block;
  cursor: not-allowed;
  /* The note explaining WHY the button is held must sit beneath THAT button.
   * Measured on the annex card before this rule: the held button ended line 1
   * at x=786 while its explanation landed at (285, 500) — 116px below and
   * 500px to the left, directly under a different, ENABLED button. A reader
   * who does not read the whole card reads the note as belonging to the
   * control above it, which is the opposite of what it says.
   *
   * Taking the whole line puts the held button and its callout in one column,
   * flush left, as a single unit. It also fixes the phone, where the note
   * otherwise stacks under the upload button. */
  flex: 0 0 100%;
}
.portal-disabled-wrap > .btn:disabled {
  pointer-events: none;
}

/* -----------------------------------------------------------------------------
 * The signing portal, second owner pass (2026-09-07). Same cascade reasoning as
 * the block above: `.legal-content p { font-size: 1rem }` is a 0-2-0 unlayered
 * selector, so anything that has to beat it is declared here, after it, at the
 * same specificity.
 * -------------------------------------------------------------------------- */

/* The greeting is the page's own heading and belongs with „Sutarties
 * pasirašymas“ — centred, and ABOVE the rule that
 * `.section-generic .simple-content { border-top }` draws. It therefore lives
 * in its own `.legal-content` block outside `.simple-content`, which is what
 * lifts it over the rule; these rules give it the centring and the spacing the
 * separated block no longer inherits. */
.legal-content.portal-greeting {
  text-align: center;
  margin-bottom: 1.5rem;
}
.legal-content.portal-greeting h2 {
  margin-top: 0;
  margin-bottom: 0;
}

/* „Šokėjas: …“, „Studija: …“, and the group lines under „Jūsų planas“ — one
 * fact per line, label plain, value bold, a step up from the body copy. The
 * owner's note was that these were „one line, small“; they are the first thing
 * a parent with three children checks. */
.legal-content .portal-identity {
  font-size: 1.125rem;
  line-height: 1.4;
}
@media (min-width: 992px) {
  .legal-content .portal-identity {
    font-size: 1.25rem;
  }
}
.legal-content .portal-identity strong {
  font-weight: 600;
}
/* The per-group lines are children of the „Grupės šį sezoną:“ label. */
.legal-content .portal-identity-item {
  padding-left: 1rem;
}

/* A plan card that does not cover the dancer's groups: still readable — the
 * family should see the whole ladder and where they sit on it — but plainly
 * out of reach, and never inviting a press. */
.legal-content .portal-plan-blocked,
.portal-plan-blocked {
  opacity: 0.6;
  background: rgba(4, 4, 5, 0.03);
}
.portal-plan-blocked input[type="radio"] {
  pointer-events: none;
}
.legal-content .portal-plan-blocked-why {
  color: rgba(4, 4, 5, 0.75);
}
