/*
 * Editorial Page — Styles
 * Font sizes intentionally omitted — inherits from theme.
 * Enqueue in functions.php when is_page_template( 'template-editorial.php' ).
 */

/* ── Tokens ──────────────────────────────────────── */
:root {
    --ep-green:      #495037;
    --ep-gold:       #c9b97a;
    --ep-cream:      #f5f3f0;
    --ep-white:      #ffffff;
    --ep-text:       #3a3228;
    --ep-text-mid:   #6b5f50;
    --ep-text-muted: #9a8c6e;
    --ep-border:     #e0d8cc;
    --ep-gap:        3px;
    --ep-section-px: 80px;
}

/* ── Wrapper breakout ────────────────────────────── */
.ep-page-template .entry-content {
    max-width: none !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    float: none !important;
}

/* ── Base ────────────────────────────────────────── */
.ep-page {
    background: var(--ep-cream);
    color: var(--ep-text);
    width: 100%;
    max-width: none;
}

.ep-eyebrow {
    display: block;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ep-text-muted);
    margin-bottom: 14px;
}

.ep-text-link {
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ep-green);
    border-bottom: 0.5px solid var(--ep-green);
    padding-bottom: 2px;
    text-decoration: none;
    display: inline-block;
    margin-top: 12px;
}

.ep-section-gap {
    height: 80px;
    background: var(--ep-cream);
}

/* ── Hero ────────────────────────────────────────── */
.ep-hero {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    min-height: 600px;
    width: 100%;
}

.ep-hero__text {
    background: var(--ep-white);
    padding: 96px var(--ep-section-px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.ep-hero__heading {
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 24px;
}

.ep-hero__body p {
    color: var(--ep-text-mid);
    line-height: 1.85;
    margin-bottom: 14px;
}

.ep-hero__media {
    overflow: hidden;
    min-width: 0;
    aspect-ratio: 16 / 9;
}

.ep-hero__media--image img,
.ep-hero__media--video video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    display: block;
}

/* ── Click-to-play video ─────────────────────────── */
.ep-video-wrap {
    position: relative;
}

.ep-video-poster {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1;
    transition: opacity 0.4s ease;
}

.ep-video-poster.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.ep-video-play {
    background: none;
    border: none;
    color: rgba(240, 232, 216, 0.9);
    width: 72px;
    height: 72px;
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
}

.ep-video-play:hover {
    transform: scale(1.1);
    color: #fff;
}

.ep-video-play svg {
    width: 100%;
    height: 100%;
}

.ep-video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ep-hero__media--youtube {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ── YouTube poster (fills hero media area) ──────── */
.ep-hero__media--youtube {
    position: relative;
}

.ep-hero__media--youtube .ep-video-poster {
    position: absolute;
    inset: 0;
    cursor: pointer;
}

/* ── YouTube modal ───────────────────────────────── */
.ep-yt-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.ep-yt-modal[hidden] { display: none; }

.ep-yt-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 8, 5, 0.88);
    cursor: pointer;
}

.ep-yt-modal__box {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 960px;
    animation: ep-yt-in 0.25s ease;
}

@keyframes ep-yt-in {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: scale(1); }
}

.ep-yt-modal__close {
    position: absolute;
    top: -20px;
    right: -20px;
    background: #495037;
    border: none;
    color: #c9b97a;
    font-size: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s ease;
}

.ep-yt-modal__close:hover { background: #3a3c2a; }

.ep-yt-modal__player {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

.ep-yt-modal__player iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ── Text + image split ──────────────────────────── */
.ep-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 540px;
}

.ep-split--img-left  .ep-split__text  { order: 2; }
.ep-split--img-left  .ep-split__image { order: 1; }
.ep-split--img-right .ep-split__text  { order: 1; }
.ep-split--img-right .ep-split__image { order: 2; }

.ep-split__text {
    background: var(--ep-white);
    padding: 96px var(--ep-section-px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.ep-split__heading {
    font-weight: 400;
    line-height: 1.4;
    margin-bottom: 22px;
    color: var(--ep-text);
}

.ep-split__body p {
    color: var(--ep-text-mid);
    line-height: 1.85;
    margin-bottom: 14px;
}

.ep-split__image {
    overflow: hidden;
    min-width: 0;
}

.ep-split__image img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    display: block;
}

/* ── Full-width image ────────────────────────────── */
.ep-full-image {
    position: relative;
    height: 560px;
    overflow: hidden;
}

.ep-full-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ep-full-image__caption {
    position: absolute;
    bottom: 24px;
    left: var(--ep-section-px);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(240, 232, 216, 0.75);
}

/* ── Pull quote ──────────────────────────────────── */
.ep-quote {
    padding: 112px 180px;
    text-align: center;
    background: var(--ep-white);
    border-top: 0.5px solid var(--ep-border);
    border-bottom: 0.5px solid var(--ep-border);
}

.ep-quote blockquote {
    font-weight: 400;
    font-style: italic;
    line-height: 1.6;
    color: var(--ep-text);
    margin: 0 0 18px;
    quotes: none;
}

.ep-quote cite {
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ep-text-muted);
    font-style: normal;
}

/* ── Video ───────────────────────────────────────── */
.ep-video {
    background: #1a120a;
    position: relative;
}

.ep-video__player {
    width: 100%;
    max-height: 600px;
    display: block;
    object-fit: cover;
}

.ep-video__label {
    position: absolute;
    bottom: 20px;
    left: var(--ep-section-px);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(240, 232, 216, 0.55);
    pointer-events: none;
}

/* ── CTA strip ───────────────────────────────────── */
.ep-cta {
    background: var(--ep-green);
    padding: 96px var(--ep-section-px);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: center;
}

.ep-cta__heading {
    font-weight: 400;
    color: #e8dfc8;
    margin-bottom: 10px;
}

.ep-cta__body {
    color: rgba(232, 223, 200, 0.6);
    line-height: 1.7;
    margin: 0;
}

.ep-cta__btn {
    background: var(--ep-gold);
    color: #2a2018;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 14px 28px;
    border-radius: 2px;
    text-decoration: none;
    white-space: nowrap;
    font-weight: 500;
    display: inline-block;
    transition: opacity 0.2s ease;
}

.ep-cta__btn:hover { opacity: 0.88; }

/* ── Responsive ──────────────────────────────────── */
@media ( max-width: 900px ) {
    :root { --ep-section-px: 40px; }
    .ep-quote { padding: 60px 80px; }
}

@media ( max-width: 768px ) {
    :root { --ep-section-px: 24px; }

    .ep-hero,
    .ep-split { grid-template-columns: 1fr; }

    .ep-hero__media { aspect-ratio: 4 / 3; }
    .ep-hero__text  { padding: 48px 24px; }

    .ep-split--img-left .ep-split__text,
    .ep-split--img-left .ep-split__image,
    .ep-split--img-right .ep-split__text,
    .ep-split--img-right .ep-split__image { order: unset; }

    .ep-split__text  { padding: 56px 24px; }
    .ep-split__image { min-height: 300px; }

    .ep-full-image { height: 320px; }

    .ep-quote { padding: 56px 24px; }

    .ep-cta {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 56px 24px;
    }

    .ep-section-gap { height: 40px; }
}

/* ── Background colour overrides ─────────────────── */
/*
 * When a dark background colour is chosen via the colour picker,
 * add class ep-dark-bg to the section in the editor and text
 * will automatically switch to light. The inline background-color
 * from ACF handles the colour itself.
 */
.ep-split__text[style*="background"] p,
.ep-split__text[style*="background"] h2,
.ep-split__text[style*="background"] .ep-eyebrow,
.ep-split__text[style*="background"] .ep-text-link {
    /* Colour inherits unless overridden — intentional */
}

/* Dark background helper — add ep-dark-bg to section via custom class field if needed */
.ep-dark-bg .ep-split__text,
.ep-dark-bg.ep-quote,
.ep-dark-bg.ep-cta {
    color: #f0e8d8;
}

.ep-dark-bg .ep-split__heading,
.ep-dark-bg .ep-quote blockquote {
    color: #f0e8d8;
}

.ep-dark-bg .ep-split__body p,
.ep-dark-bg .ep-quote cite,
.ep-dark-bg .ep-cta__body {
    color: rgba(240, 232, 216, 0.7);
}

.ep-dark-bg .ep-eyebrow {
    color: rgba(240, 232, 216, 0.5);
}

.ep-dark-bg .ep-text-link {
    color: #c9b97a;
    border-bottom-color: #c9b97a;
}