/* Web Style inspired by NYT T-Magazine */

:root {
    --font-headline: 'Sixtyfour', serif;
    --font-body: 'Inter', sans-serif;
    --color-text: #000;
    --color-caption: #666;
    --max-width-body: 680px;
    --max-width-lead-image: 1100px; 
}

body {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: #FFF;
    margin: 0;
    padding: 0;
}

.article-content {
    width: 100%;
}

.article-header {
    text-align: center;
    padding: 40px 20px;
    max-width: var(--max-width-body);
    margin: 0 auto;
}

.kicker {
    font-size: 0.8em;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text);
    margin-bottom: 1em;
}

.headline {
    font-family: var(--font-headline);
    font-size: 3.2rem;
    line-height: 1.3;
    margin: 0.2em 0;
}

.byline {
    font-size: 0.7em;
    color: var(--color-text);
    margin-top: 1.7em;
}

.highlight {
    font-family: var(--font-headline);
    font-size: 1.2em;
    font-weight: 500;
    text-align: center;
    color: var(--color-text);
    margin: 1em 1em;    
}

/* Image styling */
figure {
    margin: 0;
    padding: 0;
    width: 100%;
}

.lead-image {
    max-width: var(--max-width-lead-image);
    margin: 20px auto 40px auto;
}

.inline-image {
    max-width: var(--max-width-body);
    margin: 40px auto;
    padding: 0 20px;
}

img {
    width: 100%;
    height: auto;
    display: block;
}

figcaption {
    font-size: 0.6em;
    color: var(--color-caption);
    text-align: center;
    padding: 8px 0;
}

/* Article Body */
.article-body {
    max-width: var(--max-width-body);
    margin: 0 auto;
    padding: 0 20px;
}

.article-body p {
    margin-bottom: 1em;
}

.article-body h2 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1em;
    letter-spacing: 0.1em;
    margin-top: 5em;
    margin-bottom: 1em;
    text-transform: uppercase;
    text-align: center;
    color: var(--color-text);
}

/* Video Container */
.video-container {
    max-width: var(--max-width-body);
    position: relative;
    margin: 40px auto;
    padding: 0 20px;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }
    .headline {
        font-size: 1.8rem;
        margin-top: .7em;
    }
    .article-header {
        padding: 20px;
    }
    .article-body, .video-container {
        padding: 0 20px;
    }
    .inline-image {
        padding: 0;
    }
    .highlight {
        margin: 0;
    }
    figcaption {
        text-align: center;
    }
}

.site-footer {
    background-color: #000;
    color: #fff;
    /* This padding is the source of the layout issue we are fixing below */
    padding: 50px 20px; 
    text-align: center;
    margin-top: 40px; 
}

/* --- CORRECTED VERTICAL VIDEO STYLES --- */
.vertical-video-container {
    max-width: var(--max-width-body); /* Constrains width to match the article text */
    margin: 40px auto; /* Centers the container */
    padding: 0 20px; /* Aligns the video with the text's horizontal gutters */
    box-sizing: border-box;
}

.vertical-video-container video {
    max-width: 100%; /* Use max-width to allow the video to shrink */
    max-height: calc(90vh - 100px); 
    aspect-ratio: 9 / 16; /* Maintain the vertical aspect ratio */
    object-fit: cover;
    display: block; /* Ensures proper block-level rendering */
    margin: 0 auto; /* Centers the video horizontally if it shrinks */
    background-color: #111;
}

.footer-video-container {
    /* This container holds and centers the video */
    width: 100%;
    margin: 0 auto 30px auto; /* Centers the container and adds space below it */
}

.footer-video-container video {
    display: block;
    margin: 0 auto; /* Centers the video itself if it scales down */
    aspect-ratio: 9 / 16; /* Maintain the vertical shape */
    object-fit: cover; /* Ensures video fills the frame without distortion */
    max-width: 100%; /* Prevents the video from overflowing horizontally */
    
    /* 
     *  THE SOLUTION:
     *  Calculate the max height by taking 90% of the viewport height (90vh)
     *  and subtracting the footer's top and bottom padding (50px + 50px = 100px).
    */
    max-height: calc(90vh - 100px); 
    
    background-color: #111; /* Dark background for while the video loads */
}

.footer-credits {
    font-size: 0.7em;
    color: #333;
}

.footer-credits p {
    margin: 0.5em 0;
    line-height: 1.2;
}