/*
 * Base typography + resets — scoped under .redesign so they don't
 * override legacy Bootstrap styles on non-redesigned pages.
 *
 * Only elements inside a .redesign ancestor are affected.
 */

.redesign {
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    color: var(--text-paragraph);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.redesign *,
.redesign *::before,
.redesign *::after {
    box-sizing: border-box;
}

/* ── Global hover-transition net ──────────────────────────────────────
 * Baseline so any color / background / border / icon-fill change on hover
 * eases in *and* out instead of snapping. Transitions must live on the
 * resting state, so this declares them across the interactive surfaces
 * plus the legacy `*_hover` helper classes that ride in from style.css on
 * redesign pages (e.g. the `.tabs_nav` pink-bg hover that had no
 * transition at all).
 *
 * Deliberately low specificity and loaded BEFORE the component files, so
 * any component that declares its own `transition` overrides this — the
 * net only fills the gaps (mostly legacy Bootstrap elements). The property
 * list is explicit (never `all`) and omits `transform`, which components
 * choreograph themselves. Duration / easing live in the --hover-* tokens. */
.redesign a,
.redesign button,
.redesign [role="button"],
.redesign .btn,
.redesign input,
.redesign select,
.redesign textarea,
.redesign [class*="hover"],
.redesign .tabs_nav a,
.redesign i[class*="icon"],
.redesign svg {
    transition: color var(--hover-dur) var(--hover-ease),
                background-color var(--hover-dur) var(--hover-ease),
                border-color var(--hover-dur) var(--hover-ease),
                fill var(--hover-dur) var(--hover-ease),
                stroke var(--hover-dur) var(--hover-ease),
                box-shadow var(--hover-dur) var(--hover-ease),
                text-decoration-color var(--hover-dur) var(--hover-ease),
                opacity var(--hover-dur) var(--hover-ease);
}

/* Headings — IvyJournal-substitute display serif.
 * Light (300) weight is the Figma default across h1–h6. */
.redesign h1,
.redesign h2,
.redesign h3,
.redesign h4,
.redesign h5,
.redesign h6 {
    font-family: var(--font-display);
    font-weight: 300;
    color: var(--text-heading);
    margin: 0;
}

.redesign h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); }
.redesign h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); }
.redesign h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); }
.redesign h4 { font-size: var(--fs-h4); line-height: var(--lh-h4); }
.redesign h5 { font-size: var(--fs-h5); line-height: var(--lh-h5); }
.redesign h6 { font-size: var(--fs-h6); line-height: var(--lh-h6); }

.redesign p {
    margin: 0;
}

/* Superscript / subscript — articles imported from Google Docs ship with
 * inline classes (.c2, .c8, …) that bump sup `vertical-align: super` on
 * top of the browser default's `top: -0.5em`, so footnote refs ride way
 * above the cap height (see /article/breastfeeding-and-jewish-law).
 * Force a single sane geometry across every sup/sub in the redesign,
 * overriding the imported inline class soup. `!important` is necessary
 * because the Google-Docs classes are higher specificity than the
 * `.redesign sup` selector and many use vertical-align: super inline. */
.redesign sup,
.redesign sub {
    font-size: 0.72em !important;
    line-height: 0 !important;
    position: relative !important;
    vertical-align: baseline !important;
}
.redesign sup { top: -0.45em !important; }
.redesign sub { bottom: -0.25em !important; }
/* Footnote-ref anchors inherit the sup's geometry — keep them visually
 * tight against the surrounding word. */
.redesign sup a,
.redesign sub a {
    font-size: inherit;
    line-height: inherit;
    vertical-align: inherit;
}

/* ── Breadcrumb home icon ──
 * Replace the literal "Home" text in the first link of any public-facing
 * breadcrumb with a small house glyph, matching the mikvah show page's
 * style. The text stays in the DOM (off-screen via text-indent) so screen
 * readers still announce "Home". The mikvah show page already renders an
 * inline <svg> instead of text, so its <nav> > <ol> structure doesn't
 * match this `nav > a` selector and isn't affected. Portal admin pages
 * use a different class (`.breadcrumbs`) and are also left alone. */
.redesign .article__breadcrumb > a[href="/"]:first-of-type,
.redesign .region-page__breadcrumb > a[href="/"]:first-of-type,
.redesign .directory-intro__breadcrumb > a[href="/"]:first-of-type {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 16px;
    overflow: hidden;
    text-indent: 100%;
    white-space: nowrap;
    vertical-align: middle;
    color: currentColor;
}
.redesign .article__breadcrumb > a[href="/"]:first-of-type::before,
.redesign .region-page__breadcrumb > a[href="/"]:first-of-type::before,
.redesign .directory-intro__breadcrumb > a[href="/"]:first-of-type::before {
    content: "";
    position: absolute;
    inset: 0;
    text-indent: 0;
    /* Mask + currentColor so the icon inherits the breadcrumb link's color
     * — article breadcrumbs use the dark heading color, region/directory
     * intros use sea-green-darker. Background-color fills the mask shape. */
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 8L8 3l6 5'/%3E%3Cpath d='M3.5 7.5V13h9V7.5'/%3E%3C/svg%3E") center/16px 16px no-repeat;
    mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 8L8 3l6 5'/%3E%3Cpath d='M3.5 7.5V13h9V7.5'/%3E%3C/svg%3E") center/16px 16px no-repeat;
}

.redesign a {
    color: var(--brand-sea-green);
    text-decoration: none;
    /* color + underline hover fade handled by the global hover net above */
}

.redesign a:hover,
.redesign a:focus-visible {
    color: var(--brand-sea-green-darker);
    text-decoration: underline;
}

.redesign img,
.redesign picture,
.redesign video,
.redesign svg {
    max-width: 100%;
    display: block;
}

/* Override the legacy .boxed_layout width (1250px) and body background
 * (#E4EFF2) on redesign pages. Redesigned pages are full-bleed — sections
 * manage their own container widths via `.container` (max 1312px). */
html:has(body.redesign) {
    background: var(--neutral-white);
    margin: 0 !important;
    padding: 0 !important;
}

body.redesign {
    background: var(--neutral-white);
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

body.redesign > *:first-child,
body.redesign .boxed_layout > *:first-child {
    margin-top: 0;
}

body.redesign main {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
}

/* Legacy `style.css` adds `.content { padding: 0 10px }` below 992 px
 * viewports (used by the old mikvah.org layout). On redesign pages the
 * sections are full-bleed (hero water photo, peach "What is a Mikvah"
 * section, etc.) so this 10 px strip paints a white gutter on each side.
 * Zero it out inside the redesigned <section class="content"> wrapper. */
body.redesign > .boxed_layout > main > .content,
body.redesign main > .content,
body.redesign .content {
    padding-left: 0;
    padding-right: 0;
}

/* nav-overlay pulls main up under the transparent nav so the hero
 * video bleeds the full way to the viewport top edge. Nav is 88px
 * (16 + 56 logo + 16, symmetric padding). */
body.nav-overlay main {
    margin-top: -88px;
}

body.redesign .boxed_layout,
body.redesign .boxed_layout.bg_light {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    background: transparent;   /* kill legacy .bg_light { background: #fff } */
    border: 0;
}

/* Eliminate the top-edge gap from body's default 8px margin on browsers
 * that miss :has() — plus kill the legacy gradient_line + hr strips that
 * the old header used to emit above itself. */
body.redesign header .gradient_line,
body.redesign header hr { display: none; }

/* Used by partials/redesign/_logo.blade.php when only the legacy PNG logo
 * is available and it needs to show on a dark background — inverts
 * black→white until the light-variant SVG is exported from Figma. */
.redesign .logo--invert {
    filter: brightness(0) invert(1);
}

.redesign button {
    font: inherit;
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
}

/* Tagline utility — 12px uppercase SemiBold Manrope, 2px letter-spacing.
 * Used above section titles throughout the Figma. */
.redesign .tagline {
    font-family: var(--font-body);
    font-size: var(--fs-tagline);
    line-height: var(--lh-tagline);
    font-weight: 600;
    letter-spacing: var(--ls-tagline);
    text-transform: uppercase;
    color: var(--text-heading);
}

/* Italic display accent — used in hero headlines like the Figma
 * "every stage" phrase set in IvyJournal Light Italic. */
.redesign .display-italic {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
}

/* Heading accent — used inside section H2s for words like "Mikvah" in
 * "What is a Mikvah?" and "Find a Mikvah". Matches Figma: same serif,
 * same size, same weight as the host heading — just with the color
 * dialed down to 60% of the heading tone (rgba(85,75,75,0.6) against
 * the brown --text-heading). Subtle editorial de-emphasis, not italic. */
.redesign .heading-accent {
    color: rgba(85, 75, 75, 0.6);
    font-weight: inherit;
    font-style: inherit;
}

/* Legacy banner override — `.page_title` is the old theme's hero strip
 * used on detail pages (`/directory`, gallery, photo gallery, etc.) with
 * a fixed background image and a `.color_light` heading on top.
 *
 * Earlier this used `--brand-offwhite-slate` (#c2d2d8 — a soft green-grey)
 * but that washed out badly against the sea-green overlay + busy
 * background photos (especially the dotted world-map on `/directory`).
 * Switch to warm peach-cream (`--brand-offwhite-peach`) which has much
 * stronger contrast against the deep-green overlay, and add a soft
 * text-shadow so the title cuts through any high-contrast areas of the
 * underlying image. The overlay itself goes from .78 → .85 alpha
 * (see translucent_bg rule below) for the same reason.
 *
 * Specificity beats `.color_light` from style.css (0,2,1 vs 0,1,0). */
.redesign .page_title h1,
.redesign .page_title h2,
.redesign .page_title h3,
.redesign .page_title h4,
.redesign .page_title h5,
.redesign .page_title h6,
.redesign .page_title .color_light {
    color: var(--brand-offwhite-peach);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
/* Body copy / breadcrumb-like ancillary text on the banner uses a
 * slightly muted variant so the H1 stays the focal point. */
.redesign .page_title p,
.redesign .page_title .fs_medium {
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Breadcrumbs inside legacy `.page_title` heroes — used by the audio /
 * media / directory / kallah-teachers / etc. pages. Legacy markup paints
 * each anchor with `color_grey_light_3` which the redesign maps to
 * --text-paragraph (#776f6f); that vanishes against the dark hero
 * overlay. Override to a soft white at rest, full white on hover, and
 * give non-link items (rendered as <span>) a default cursor so they
 * don't look interactive. The legacy `.color_grey_light_3` rule on
 * the breadcrumb anchors loses to this selector via specificity
 * (.redesign .page_title .breadcrumbs a → 0,3,1 vs the global
 * .redesign .color_grey_light_3 → 0,2,0). */
.redesign .page_title .breadcrumbs,
.redesign .page_title .breadcrumbs li,
.redesign .page_title .breadcrumbs a,
.redesign .page_title .breadcrumbs span {
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.redesign .page_title .breadcrumbs i {
    color: rgba(255, 255, 255, 0.55);
}
.redesign .page_title .breadcrumbs a {
    text-decoration: none;
    transition: color var(--hover-dur) var(--hover-ease);
}
.redesign .page_title .breadcrumbs a:hover,
.redesign .page_title .breadcrumbs a:focus-visible {
    color: var(--neutral-white);
    text-decoration: none;
}
.redesign .page_title .breadcrumbs span {
    cursor: default;
}

/* ───────────────────────────────────────────────────────────────────────
 * Legacy color-helper override — the old `style.css` defines a palette of
 * Bootstrap-3 / Material flavoured single-purpose classes:
 *   .color_blue   #55c0db   (info-blue)
 *   .color_purple #4e4ca0   (deep purple)
 *   .color_pink   #a255c4   (magenta)
 *   .color_green  #2ecc71   (emerald)
 *   .color_dark   #34383d   (near-black)
 *   .color_grey   #899096   (cool grey)
 * Many legacy blade templates apply these directly to text (`color_dark
 * tr_all`, `color_purple color_pink_hover` etc.) which paints the
 * redesign surface with off-brand accents on Gallery, Directory, News,
 * Search, etc. Re-route them to the redesign palette without rewriting
 * markup. Semantic warning/error colors (`.color_red`, `.color_yellow`)
 * are left intact since they convey meaning.
 *
 * Specificity: tied with the legacy single-class selectors but redesign
 * loads after style.css so cascade order wins. ─────────────────────── */
.redesign .color_blue,
.redesign .color_purple,
.redesign .color_pink,
.redesign .color_green {
    color: var(--brand-sea-green);
}

.redesign .color_blue_hover:hover,
.redesign .color_purple_hover:hover,
.redesign .color_pink_hover:hover,
.redesign .color_green_hover:hover {
    color: var(--brand-sea-green-darker);
}

.redesign .color_dark {
    color: var(--text-heading);
}

.redesign .color_grey,
.redesign .color_grey_light_2,
.redesign .color_grey_light_3 {
    color: var(--text-paragraph);
}

/* Background helpers — avoid recoloring entire sections, but the most
 * common legacy bg helpers should follow the palette too. */
.redesign .bg_color_blue,
.redesign .bg_color_purple,
.redesign .bg_color_pink,
.redesign .bg_color_green {
    background: var(--brand-sea-green);
}

.redesign .bg_color_purple_hover:hover,
.redesign .bg_color_blue_hover:hover,
.redesign .bg_color_pink_hover:hover,
.redesign .bg_color_green_hover:hover {
    background: var(--brand-sea-green-darker);
}

/* Icon-wrap circles use border-color matching the helper — same routing. */
.redesign [class*="icon_wrap_"].color_blue,
.redesign [class*="icon_wrap_"].color_purple,
.redesign [class*="icon_wrap_"].color_pink,
.redesign [class*="icon_wrap_"].color_green {
    border-color: var(--brand-sea-green);
    color: var(--brand-sea-green);
}

/* ── Compound legacy selectors that ride the .color_purple/_pink/_blue
 *    cascade (lines 583-624 of public_html/css/style.css) ──
 * The legacy palette grouping baked the deep purple `#4e4ca0` (and its
 * pink/blue siblings) into selectors that have NO color helper class on
 * the matched element — e.g. `blockquote.type_3:before`,
 * `.step:hover h3`, `.category_link:hover .category_title`,
 * `.checkout_video:hover .video_button i[class|="icon"]`,
 * `.title_counter_type:before`, `.paginations .active a`.
 * My `.redesign .color_purple` override above can't reach those, so
 * mirror the same destinations here. Specificity prefix `.redesign`
 * keeps the rule out of the legacy admin/portal area. */

/* Color cascade — anywhere the legacy palette routed to deep purple */
.redesign .checkout_video:hover .video_button i[class|="icon"],
.redesign .step:hover h3,
.redesign blockquote.type_3:before,
.redesign blockquote.type_3 > p:last-of-type:after,
.redesign .category_link:hover .category_title {
    color: var(--brand-sea-green);
}

/* Border + bg cascades for paginations, step counters, transparent
 * button hovers, p_table active rows — all legacy `.color_purple` heirs. */
.redesign .paginations .active a,
.redesign .paginations .active:last-child a,
.redesign .paginations li a:hover,
.redesign .paginations li:last-child a:hover,
.redesign .step:hover .step_counter,
.redesign .p_table.bg_color_purple_hover:hover,
.redesign .p_table.bg_color_purple_hover.active {
    border-color: var(--brand-sea-green);
    background: var(--brand-sea-green);
    color: var(--neutral-white);
}

.redesign .paginations .active + li a,
.redesign .paginations li:hover + li a {
    border-left-color: var(--brand-sea-green);
}

.redesign .title_counter_type:before,
.redesign .animation_fill.color_purple:before,
.redesign .animation_fill.color_pink:before,
.redesign .animation_fill.color_blue:before,
.redesign .animation_fill.color_green:before {
    background: var(--brand-sea-green);
}

/* Translucent overlay variants used on legacy `.page_title` heroes.
 * Bumped from .78 → .85 alpha so banner titles stay legible over busy
 * background images (e.g. the dotted world-map on `/directory` was
 * making the H1 fight a high-contrast pattern). The legacy
 * `.translucent_bg_color_scheme` (sea-green @ .5) is also captured
 * here so the same fix applies to `/directory`, `/contact`, etc. */
.redesign .translucent_bg_color_scheme,
.redesign .translucent_bg_color_scheme.image_fixed:before,
.redesign .translucent_bg_purple,
.redesign .translucent_bg_purple.image_fixed:before,
.redesign .translucent_bg_pink,
.redesign .translucent_bg_pink.image_fixed:before,
.redesign .translucent_bg_blue,
.redesign .translucent_bg_blue.image_fixed:before {
    background: rgba(40, 65, 75, 0.85);   /* sea-green @ 85% */
}

/* ── Legacy `.tabs_nav` active-state hover lock ──
 * Pages using the legacy easytabs system (`/overview`, `/halachos-text`,
 * etc.) ship `<a class="color_dark n_sc_hover">` inside the tabs nav.
 * The default `a:hover` underline still kicks in even though the
 * scheme-color hover is suppressed by `n_sc_hover`, which makes the
 * active tab text look like it's being struck-through on hover.
 * Lock the active state to white text on solid sea-green at three
 * pseudo levels so neither hover, focus, nor any cascading rule can
 * override it. The `/directory` page has its own scoped pill toggle —
 * this rule only fires when the legacy `.tabs_nav` is in play. */
.redesign .tabs_nav li.active a,
.redesign .tabs_nav li.active a:hover,
.redesign .tabs_nav li.active a:focus,
.redesign .tabs_nav .active a,
.redesign .tabs_nav .active a:hover,
.redesign .tabs_nav .active a:focus {
    background: var(--brand-sea-green) !important;
    color: var(--neutral-white) !important;
    text-decoration: none !important;
    border-color: var(--brand-sea-green) !important;
}

/* ── Legacy `color_dark fw_light` heading polish ──
 * The legacy theme ships dozens of section H3/H4s like
 * `<h4 class="color_dark fw_light m_bottom_15">Disclaimer</h4>`
 * (referrals, audio index, mentors, search results, location pages,
 * cheshbon calendar, copyright, …). On the redesign these read as
 * undersized and crowd the content immediately below them.
 *
 * Promote them site-wide to Cormorant display type with a peach
 * underline rule and breathing room below — same rhythm used by the
 * scoped section headers on `/about`, `/overview`, `/kallah-teachers`,
 * etc. Pages that have already opted into a tighter scoped treatment
 * (e.g. `.overview-page h3.color_dark.fw_light`, `.ktt-media h3…`,
 * `.referrals-index h3/h4.color_dark.fw_light`) override this via
 * higher specificity and stay unchanged. */
.redesign h3.color_dark.fw_light,
.redesign h4.color_dark.fw_light {
    font-family: var(--font-display);
    font-weight: 300;
    line-height: 1.25;
    color: var(--text-heading);
    padding-bottom: 12px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--brand-border-peach);
}
.redesign h3.color_dark.fw_light { font-size: 26px; }
.redesign h4.color_dark.fw_light { font-size: 22px; }

/* Accessibility: visually hidden but screen-reader available */
.redesign .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Reserve space for the scrollbar at all times so opening the mikvah
 * modal (which sets `body { overflow: hidden }`) doesn't pop the
 * scrollbar away and shift the entire page horizontally by ~17px.
 * Falls back gracefully on browsers without `scrollbar-gutter`
 * support — they just behave as before. */
html {
    scrollbar-gutter: stable;
}

/* Respect reduced-motion — but narrowly.
 *
 * Kill decorative *keyframe* animations (carousels, loops, infinite
 * tickers) and force instant scroll-jumps, since those are what
 * actually cause motion-sickness for reduced-motion users.
 *
 * Do NOT kill `transition-duration` globally. Short functional
 * transitions (sticky-bar fade/slide, button hover/focus, drawer
 * open/close) are considered an acceptable and expected part of a
 * modern UI even for reduced-motion users — they convey *state*, not
 * decoration. Killing them with a blanket !important broke the
 * sticky-bar animation on Windows users who have "Show animations in
 * Windows" disabled (Chrome then reports reduced-motion = reduce). */
@media (prefers-reduced-motion: reduce) {
    .redesign *,
    .redesign *::before,
    .redesign *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}
