/*
 * Exit Five — /newsletter (CPT archive) page styles.
 *
 * Two-section layout:
 *   1. .ex5-archive-hero      — Webflow-quality landing hero (two-column,
 *                                avatars, hero image, HubSpot form).
 *   2. .ex5-archive-section   — "Latest editions" grid of newsletter
 *                                CPT cards (.ex5-newsletter-card).
 *
 * Hero ports the Webflow source at exitfive.com/newsletter — same brand
 * font (Onsite Standard), same headline/body sizes, same proportions.
 * Issue grid below the fold uses theme.json tokens (Manrope).
 *
 * Loaded only on the newsletter CPT archive
 * (`is_post_type_archive('newsletter')` in theme functions.php).
 */

/* -----------------------------------------------------------------
 * Brand font — Onsite Standard
 * (matches the live Webflow site; same WOFF URLs Webflow serves)
 * ----------------------------------------------------------------- */

@font-face {
    font-family: "Onsite Standard";
    src: url("https://cdn.prod.website-files.com/662f071987728937d4adcba6/6740d7106f71dcd3d0755fd5_OnsiteStandard-Light.woff")
        format("woff");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Onsite Standard";
    src: url("https://cdn.prod.website-files.com/662f071987728937d4adcba6/6740d710744b16e3070a5338_OnsiteStandard-Regular.woff")
        format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Onsite Standard";
    src: url("https://cdn.prod.website-files.com/662f071987728937d4adcba6/6740d7107ec1b7a124e1c544_OnsiteStandard-Medium.woff")
        format("woff");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* -----------------------------------------------------------------
 * Hero — section
 * ----------------------------------------------------------------- */

.ex5-archive-hero {
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--primary-foreground);
    font-family: "Onsite Standard", var(--wp--preset--font-family--manrope), sans-serif;
    overflow: hidden;
    /* Kill the block theme's `:where(.wp-site-blocks) > * { margin-block-start: 24px }`
       gap so the hero touches the very top of the content area. */
    margin-top: 0 !important;
    margin-block-start: 0 !important;
    /* Section itself is a flex column at full viewport height, so the
       inner container (and the image inside it) always fill top-to-bottom. */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.ex5-archive-hero__container {
    display: flex;
    align-items: stretch;       /* both columns fill full height */
    flex: 1 1 auto;             /* container fills the section's height */
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    /* IMPORTANT: main.css styles this same class for the OLD archive hero
       with `max-width: 87.5rem; margin-inline: auto; padding: 6rem 3rem`.
       That 6rem (96px) top padding was pushing the whole hero — image
       included — down from the top. Override all three here so the hero
       is true full-bleed; the left column provides its own text padding. */
    max-width: none;
    margin: 0;
    padding: 0;
}

/* Left column — dark, text + form. Width matches Webflow exactly:
   640px capped at 50% of viewport (so on narrow screens it shrinks).
   Stacks from the TOP (not centered) so the whole CTA fits above the
   fold and the hero image runs full-bleed top-to-bottom on the right. */
.ex5-archive-hero__content {
    flex: 0 0 auto;
    width: 640px;
    max-width: 50%;
    padding: clamp(2.5rem, 5vh, 5rem) clamp(1.5rem, 3vw, 3rem) clamp(2rem, 4vh, 3.5rem);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1.25rem;
    box-sizing: border-box;
}

/* Right column — full-bleed background image. Explicitly stretches to
   fill the container top-to-bottom (belt-and-suspenders over align-items). */
.ex5-archive-hero__image {
    flex: 1 1 auto;
    align-self: stretch;
    margin: 0;
    background-color: #f7f7f5;
    background-position: 50% 50%;
    background-size: cover;
    background-repeat: no-repeat;
    min-height: 100%;
}

/* -----------------------------------------------------------------
 * Logo (top of left column)
 * ----------------------------------------------------------------- */

.ex5-archive-hero__logo {
    display: block;
    width: 200px;
    height: auto;
    margin-bottom: 0.5rem;
    background-color: var(--wp--preset--color--primary);
    border-radius: 10px;
    padding: 17px 15px 15px;
    box-sizing: border-box;
}

/* -----------------------------------------------------------------
 * Headline + body copy
 * ----------------------------------------------------------------- */

/* Headline — matches Webflow's stepped sizing exactly.
   Desktop: 51px, Tablet (≤991px): 38px, Mobile (≤479px): 30px.
   See media queries below for tablet/mobile overrides. */
.ex5-archive-hero__title {
    font-family: "Onsite Standard", var(--wp--preset--font-family--manrope), sans-serif;
    font-weight: 500;
    font-size: 51px;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--wp--preset--color--primary-foreground);
    text-wrap: balance;
}

/* Body — matches Webflow's stepped sizing exactly.
   Desktop: 22px, Tablet (≤991px): 24px, Mobile (≤479px): 18px. */
.ex5-archive-hero__lede {
    font-family: "Onsite Standard", var(--wp--preset--font-family--manrope), sans-serif;
    font-weight: 400;
    font-size: 22px;
    line-height: 1.45;
    color: var(--wp--preset--color--primary-foreground);
    opacity: 0.92;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin: 0;
}

.ex5-archive-hero__lede p {
    margin: 0;
}

/* -----------------------------------------------------------------
 * HubSpot subscribe form (inline custom form — posts via ex5-subscribe JS)
 * ----------------------------------------------------------------- */

.ex5-archive-hero__form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: stretch;
    margin: 0;
}

.ex5-archive-hero__input {
    flex: 1 1 200px;
    min-width: 0;
    height: 40px;
    padding: 0 0.875rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: var(--wp--preset--color--primary-foreground);
    font-family: var(--wp--preset--font-family--manrope);
    font-size: 0.875rem;
    box-sizing: border-box;
}

.ex5-archive-hero__input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.ex5-archive-hero__input:focus-visible {
    outline: 2px solid var(--wp--preset--color--accent);
    outline-offset: 2px;
    border-color: var(--wp--preset--color--accent);
}

.ex5-archive-hero__submit {
    height: 40px;
    padding: 0 1.125rem;
    border-radius: 999px;
    border: 0;
    background: var(--wp--preset--color--accent);
    color: var(--wp--preset--color--accent-foreground);
    font-family: "Onsite Standard", var(--wp--preset--font-family--manrope), sans-serif;
    font-weight: 500;
    font-size: 0.9375rem;
    letter-spacing: 0; /* override main.css's .ex5-archive-hero__submit letter-spacing */
    text-transform: none; /* override main.css's .ex5-archive-hero__submit uppercase */
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.15s ease;
    box-sizing: border-box;
}

.ex5-archive-hero__submit:hover {
    filter: brightness(0.95);
}

.ex5-subscribe-msg {
    flex: 1 1 100%;
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: var(--wp--preset--color--accent);
}

/* -----------------------------------------------------------------
 * Avatars + social proof line
 * ----------------------------------------------------------------- */

.ex5-archive-hero__proof {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.ex5-archive-hero__avatars {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.ex5-archive-hero__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--wp--preset--color--primary);
    background: var(--wp--preset--color--muted);
}

.ex5-archive-hero__avatar + .ex5-archive-hero__avatar {
    margin-left: -10px;
}

.ex5-archive-hero__proof-text {
    margin: 0;
    font-family: "Onsite Standard", var(--wp--preset--font-family--manrope), sans-serif;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--wp--preset--color--primary-foreground);
    opacity: 0.85;
    /* Let it flow naturally — matches Webflow which keeps it on one line. */
}

.ex5-archive-hero__proof-count {
    font-weight: 700;
    opacity: 1;
}

/* -----------------------------------------------------------------
 * Hero — responsive (stack columns on tablet/mobile)
 * ----------------------------------------------------------------- */

@media (max-width: 991px) {
    .ex5-archive-hero__container {
        flex-direction: column;
        min-height: auto;
    }

    /* Content first on narrow viewports — conversion-priority.
       (Matches Webflow's stack order on exitfive.com/newsletter.) */
    .ex5-archive-hero__content {
        flex: 1 1 auto;
        max-width: 100%;
        width: 100%;
        order: 1;
        min-height: auto;
        padding: 2.5rem clamp(1.5rem, 5vw, 2.5rem);
    }

    .ex5-archive-hero__image {
        order: 2;
        flex: 0 0 auto;
        width: 100%;
        aspect-ratio: 16 / 10;
        min-height: 0;
    }

    /* Tablet typography — matches Webflow's ≤991px breakpoint. */
    .ex5-archive-hero__title {
        font-size: 38px;
    }

    .ex5-archive-hero__lede {
        font-size: 24px;
    }
}

@media (max-width: 479px) {
    .ex5-archive-hero__content {
        padding: 2rem 1.25rem 2.5rem;
        gap: 1.125rem;
    }

    /* Mobile typography — matches Webflow's ≤479px breakpoint. */
    .ex5-archive-hero__title {
        font-size: 30px;
    }

    .ex5-archive-hero__lede {
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ex5-archive-hero__submit {
        transition: none;
    }
}

/* -----------------------------------------------------------------
 * Archive section — "Latest editions" header + grid
 * ----------------------------------------------------------------- */

.ex5-archive-section {
    background: var(--wp--preset--color--background);
    color: var(--wp--preset--color--foreground);
    padding: clamp(3rem, 6vw, 6rem) 0;
}

.ex5-archive-section__container {
    width: min(100%, 1280px);
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 3vw, 2rem);
    box-sizing: border-box;
}

.ex5-archive-section__header {
    margin-bottom: clamp(2rem, 4vw, 3rem);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ex5-archive-section__eyebrow {
    font-family: var(--wp--preset--font-family--rajdhani);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--wp--preset--color--muted-foreground);
}

.ex5-archive-section__title {
    font-family: var(--wp--preset--font-family--manrope);
    font-weight: 800;
    font-size: clamp(1.75rem, 1.3rem + 2vw, 2.75rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--wp--preset--color--foreground);
}

/* -----------------------------------------------------------------
 * Newsletter card grid
 * ----------------------------------------------------------------- */

.ex5-newsletter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: clamp(1.25rem, 2vw, 2rem);
}

.ex5-newsletter-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: var(--wp--preset--color--muted);
    border: 1px solid var(--wp--preset--color--border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ex5-newsletter-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px -16px rgba(0, 18, 14, 0.18);
}

.ex5-newsletter-card__media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--wp--preset--color--muted);
}

.ex5-newsletter-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ex5-newsletter-card__brand {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--wp--preset--color--accent);
    color: var(--wp--preset--color--accent-foreground);
    font-family: var(--wp--preset--font-family--rajdhani);
    font-weight: 700;
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    padding: 4px 8px;
    border-radius: 4px;
}

.ex5-newsletter-card__body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1 1 auto;
}

.ex5-newsletter-card__badge {
    align-self: flex-start;
    background: var(--wp--preset--color--background);
    color: var(--wp--preset--color--muted-foreground);
    border: 1px solid var(--wp--preset--color--border);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 2px 8px;
    border-radius: 999px;
}

.ex5-newsletter-card__title {
    font-family: var(--wp--preset--font-family--manrope);
    font-weight: 700;
    font-size: 1.125rem;
    line-height: 1.3;
    margin: 0;
    color: var(--wp--preset--color--foreground);
    /* Clamp to 3 lines so cards stay even */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ex5-newsletter-card__excerpt {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--wp--preset--color--muted-foreground);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ex5-newsletter-card__meta {
    margin-top: auto;
    padding-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--wp--preset--color--muted-foreground);
}

/* -----------------------------------------------------------------
 * Archive pagination — prev/next bar, matching the /content + /podcast
 * archives (.ex5-content-pagination / .ex5-podcast-pagination).
 * ----------------------------------------------------------------- */

.ex5-archive-pagination {
    margin-top: 3rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}

.ex5-archive-pagination__link {
    display: inline-block;
    padding: 0.75rem 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--wp--preset--color--foreground);
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.ex5-archive-pagination__link:hover {
    border-color: rgba(0, 0, 0, 0.25);
    background: #fafafa;
}

.ex5-archive-pagination__link--prev { justify-self: start; }
.ex5-archive-pagination__link--next { justify-self: end; }

.ex5-archive-pagination__status {
    font-size: 0.875rem;
    color: rgba(0, 0, 0, 0.6);
    font-weight: 500;
    text-align: center;
}
