/* --- LANDING PAGE: 1. Main Layout --- */

.page-container {
    display: flex;
    height: 85vh;
}

/* --- NEW: Styles for subpages (when $landingpage is false) --- */
.page-container.is-subpage {
    height: 40vh;
    /* Reduced height as requested */
}

/* --- LANDING PAGE: 2. Hero Section --- */

.hero {
    flex: 1;
    height: 100%;
    position: relative;
    overflow: hidden;
    margin-left: -100px;
}

/* --- Hero Carousel --- */
.hero-carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    /* Behind overlays and text */
    overflow: hidden;
}

.carousel-track {
    width: 600%;
    /* 100% for each of the 6 slides */
    height: 100%;
    display: flex;
    position: relative;
    animation: slideanim 30s infinite;
}

/* --- NEW: Stop animation and fix width on subpages --- */
.is-subpage .carousel-track {
    animation: none;
    /* Stop animation */
    width: 100%;
    /* Track is 100% since it only has one slide */
}

.carousel-slide {
    width: 16.6667%;
    /* CHANGED from 20% */
    height: 100%;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

/* --- NEW: Make the single slide fill the container on subpages --- */
.is-subpage .carousel-slide {
    width: 100%;
}

@keyframes slideanim {
    /* Total: 30s (4s pause + 1s transition = 5s per slide)
       Pause: 4s / 30s = 13.33%
       Transition: 1s / 30s = 3.33%
       Total step: 16.67%
    */

    /* Slide 1 */
    0% {
        transform: translateX(0%);
    }

    13.33% {
        transform: translateX(0%);
    }

    /* 4s pause */

    /* Slide 2 */
    16.67% {
        transform: translateX(-16.6667%);
    }

    /* 1s transition */
    30.00% {
        transform: translateX(-16.6667%);
    }

    /* 4s pause */

    /* Slide 3 */
    33.33% {
        transform: translateX(-33.3334%);
    }

    /* 1s transition */
    46.66% {
        transform: translateX(-33.3334%);
    }

    /* 4s pause */

    /* Slide 4 */
    50.00% {
        transform: translateX(-50.0001%);
    }

    /* 1s transition */
    63.33% {
        transform: translateX(-50.0001%);
    }

    /* 4s pause */

    /* Slide 5 */
    66.67% {
        transform: translateX(-66.6668%);
    }

    /* 1s transition */
    80.00% {
        transform: translateX(-66.6668%);
    }

    /* 4s pause */

    /* Slide 6 */
    83.33% {
        transform: translateX(-83.3335%);
    }

    /* 1s transition */
    96.67% {
        transform: translateX(-83.3335%);
    }

    /* 4s pause */

    /* Back to 1 */
    100% {
        transform: translateX(0%);
    }

    /* 1s transition */
}


/* --- Hero Overlays & Text --- */
.overlay-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    z-index: 1;
    width: 120%;
    left: -10%;
}

.overlay-panel {
    flex: 1;
    height: 100%;
    transform: skewX(-8deg);
}

.overlay-panel.green {
    background-color: rgba(var(--rgb-primary), 0.2);
}

.overlay-panel.gold {
    background-color: rgba(var(--rgb-secondary-dark), 0.2);
}

.overlay-panel.small {
    max-width: 40px;
}

.overlay-panel.medium {
    max-width: 100px;
}

.hero-text {
    position: absolute;
    top: 18vh;
    left: 50%;
    transform: translate(-50%, 0);
    color: var(--color-white);
    text-align: right;
    z-index: 2;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    /* width: fit-content; */
    width: 100%;
    animation: fadeHeroText 30s infinite;
}

.hero-text h1 {
    font-size: clamp(2rem, 3.8vw, 4rem);
    font-weight: 700;
    /* letter-spacing: 5px; */
    line-height: 1.1;
    white-space: nowrap;
    border-bottom: 2px solid var(--color-white);
    padding-bottom: 1rem;
    padding-right: 2rem;
    margin-bottom: 0.75rem;
}

.hero-text p {
    font-size: clamp(1.2rem, 1.5vw, 1.8rem);
    font-weight: 400;
    letter-spacing: 3px;
    padding-right: 2rem;
}

/* --- NEW: Animation for Fading Hero Text --- */

/* --- NEW: Stop hero text from fading on subpages --- */
.is-subpage .hero-text {
    animation: none;
    opacity: 1;
    /* Ensure it's visible */
}

@keyframes fadeHeroText {
    /* Total: 30s (matches carousel)
       Slide 1 (Visible): 0s to 4s (0% to 13.33%)
       Fade Out: 4s to 5s (13.33% to 16.67%)
       Hidden (Slides 2-6): 5s to 29s (16.67% to 96.67%)
       Fade In: 29s to 30s (96.67% to 100%)
    */

    /* Start (On Slide 1) */
    0% {
        opacity: 1;
    }

    /* End of Slide 1 (start fading out) */
    13.33% {
        opacity: 1;
    }

    /* End of transition to Slide 2 (fully faded out) */
    16.67% {
        opacity: 0;
    }

    /* Stay hidden for all other slides */
    96.67% {
        opacity: 0;
    }

    /* End of transition back to Slide 1 (fully faded in) */
    100% {
        opacity: 1;
    }
}

/* --- LANDING PAGE: 3. News & Events Section --- */

.news-events-section {
    /* padding: var(--padding-section-y) 0; */
    background-color: var(--color-white);
    overflow-x: hidden;
}

.desktop-headings {
    display: flex;
    justify-content: start;
    margin-bottom: 1rem;
}

.heading-col {
    flex: 1;
    position: relative;
    padding-top: 10px;
    background-color: var(--color-primary);
    display: flex;
    align-items: center;
    padding-left: 2rem;
}

.heading-col::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--color-secondary-dark);
}

.heading-col h2 {
    color: var(--color-text-white);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1.25rem;
    letter-spacing: 1px;
    padding-left: 1rem;
}

#latest-news-heading {
    text-align: left;
}

#upcoming-events-heading {
    text-align: left;
}

.heading-divider {
    width: var(--size-heading-divider);
    height: 60px;
    position: relative;
    background-color: var(--color-secondary-dark);
    transform: skewX(-10deg) translateX(0.5rem) translateY(0.2rem) scaleY(1.2);
    flex-shrink: 0;
    z-index: 999;
}


.heading-divider::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -50%;
    width: 2rem;
    height: 100%;
    background-color: var(--color-green);
    transform: scaleY(0.9);
}

.section-content {
    display: flex;
    gap: 3rem;
    padding: 1.5rem;
    justify-content: space-between;
}

.content-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-inline: 1rem;
}

.article-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.card-image {
    width: 120px;
    height: 90px;
    object-fit: cover;
    flex-shrink: 0;
}

.card-text h3 {
    color: var(--color-primary);
    font-size: 1rem;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-text h3 a {
    color: var(--color-primary);
    font-size: 1rem;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-decoration: none;
}

.card-text p {
    font-size: 0.9rem;
    color: var(--color-text-dark);
    line-height: 1.6;
}

.mobile-heading {
    display: none;
    color: var(--color-text-white);
}

.no-records-message {
    font-style: italic;
    color: #666;
    /* A slightly muted text color */
    text-align: center;
    padding: 2rem 1rem;
    border: 1px dashed #ddd;
    border-radius: 5px;
    margin: 1rem;
}

/* --- Link to More News/Events --- */

.more-link-wrapper {
    margin-top: 1rem;
    text-align: right;
    padding-right: 1rem;
    /* Matches your content-col padding */
}

.btn-more {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.btn-more i {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.btn-more:hover {
    color: var(--color-secondary-dark);
}

.btn-more:hover i {
    transform: translateX(4px);
    /* Adds a little "push" on hover */
}

/* --- LANDING PAGE: 4. Vision Section (Revised) --- */
.vision-contact-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
    background-color: var(--color-secondary-dark);
    padding: 0;
}

.side-horse-image {
    width: 350px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    clip-path: polygon(0 0, 100% 0%, 80% 100%, 0% 100%);
    position: relative;
    overflow: hidden;
}

.side-horse-image .overlay-container {
    width: 100%;
    left: 0;
    transform: translateX(-10%);
}

.side-horse-image .overlay-panel {
    transform: skewX(-15deg);
}

/* --- REVISED: Video and Text are now side-by-side --- */
.vision-main-content {
    flex: 1;
    min-width: 500px;
    padding: 2rem;
    position: relative;
    display: flex;
    /* <-- NEW */
    gap: 2rem;
    /* <-- NEW */
    align-items: flex-start;
    /* <-- NEW */
}

.video-wrapper {
    flex: 1;
    /* <-- NEW: Takes half the space */
    position: relative;
    height: 380px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    background-color: var(--color-black);
    box-sizing: border-box;
    margin-block: 1rem;
}

.video-wrapper video {
    width: 100%;
    height: 100%;

    /* --- ADD THESE TWO LINES --- */
    position: relative;
    z-index: 1;
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;

    /* --- ADD THESE TWO LINES --- */
    position: relative;
    z-index: 1;
    min-width: 400px;
    min-height: 400px;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    /* REMOVE the background color from here */
    /* background: rgba(0, 0, 0, 0.3); */

    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    cursor: pointer;

    /* We add position: relative so we can center the icon */
    overflow: hidden;
    /* Good practice */

    opacity: 1;
    transition: opacity 0.3s ease;
}

/* --- ADD THIS NEW RULE for the thumbnail --- */
.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Fills the container */
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    /* Sits at the bottom of the overlay */

    /* This darkens the image so the white play icon is visible */
    filter: brightness(0.8);
    transition: filter 0.3s ease;
}

/* --- UPDATE THIS RULE for the icon --- */
.video-overlay i {
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);

    /* Layer the icon on top of the image */
    position: relative;
    z-index: 99;

    /* Add a nice hover effect */
    transform: scale(1);
    transition: transform 0.3s ease;
}

/* --- OPTIONAL: Add hover effects --- */
.video-overlay:hover .video-thumbnail {
    filter: brightness(1);
    /* Brighten image on hover */
}

.video-overlay:hover i {
    transform: scale(1.1);
    /* Enlarge icon on hover */
}

/* This class (toggled by your JS) still hides the *entire* overlay */
.video-wrapper.is-playing .video-overlay {
    opacity: 0;
    pointer-events: none;
}

.vision-text {
    flex: 1;
    /* <-- NEW: Takes the other half */
    padding-top: 1rem;
    /* Match video's margin-block */
}

.vision-text h3 {
    color: var(--color-primary);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.vision-text p {
    color: var(--color-text-dark);
    font-size: 0.95rem;
    line-height: 1.7;
    padding-bottom: 1rem;
    /* <-- CHANGED: Reduced padding */
}

/* --- REMOVED: All .contact-card styles --- */


/* --- 4. Footer (Revised) --- */
.site-footer {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    padding: 2.5rem 0;
    /* Increased padding */
    font-size: 0.85rem;
    position: relative;
    z-index: 10;
}

/* --- NEW: Footer Container --- */
.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* <-- CHANGED FROM flex-start */
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-logo {
    width: 150px;
    /* Adjust size as needed */
    height: auto;
    margin-bottom: 1rem;
}

.footer-copyright {
    flex-basis: 50%;
    /* Takes left half */
    min-width: 280px;
    line-height: 1.6;
}

.footer-copyright p {
    margin: 0;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    margin: 0 0.3rem;
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: var(--color-white);
}

/* --- NEW: Footer Contact Area --- */
.footer-contact {
    flex-basis: 350px;
    color: var(--color-white);
}

.footer-contact h3 {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-white);
    margin-bottom: 1rem;
    text-align: left;
    /* <-- ADD THIS LINE */
}

.footer-contact .contact-info {
    list-style: none;
    margin: 0 0 1.5rem 0;
    padding: 0;
}

.footer-contact .contact-info li {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.footer-contact .contact-info li i {
    color: var(--color-secondary-dark);
    /* Gold icons */
    margin-right: 0.8rem;
    width: 20px;
    text-align: center;
}

.footer-contact .contact-info li span {
    white-space: nowrap;
}

.footer-contact .social-links {
    display: flex;
    justify-content: flex-start;
    /* Align to left */
    gap: 1.2rem;
    margin: 0;
}

.footer-contact .social-links a {
    color: var(--color-white);
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.footer-contact .social-links a:hover {
    color: var(--color-secondary-dark);
}

@media (width<900px) {
    .side-horse-image {
        display: none;
    }
}

/* --- LANDING PAGE: 5. Mobile Overrides --- */

@media (max-width: 768px) {

    .page-container {
        flex-direction: column;
        height: auto;
    }

    /* --- Mobile override for subpage header --- */
    .page-container.is-subpage {
        height: auto;
        /* WAS: 30vh. This fixes the overflow. */
    }

    /* --- Mobile Hero Section --- */
    .hero {
        flex: none;
        height: 50vh;
        margin-left: 0;
    }

    /* --- Mobile override for subpage hero --- */
    .is-subpage .hero {
        height: 30vh;
        /* WAS: 100%. This sets a fixed height for the subpage hero image. */
    }

    .hero-text {
        top: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
        width: 90%;
    }

    .hero-text h1 {
        font-size: clamp(2.2rem, 10vw, 2.5rem);
        white-space: normal;
        border-bottom-width: 1px;
    }

    .hero-text p {
        font-size: 1.2rem;
        letter-spacing: 2px;
    }

    .hero .overlay-container {
        width: 140%;
        left: -20%;
    }

    .hero .overlay-panel {
        transform: skewX(-12deg);
    }

    /* --- Mobile News & Events Section --- */

    .news-events-section {
        padding: 1.5rem 0;
    }

    .desktop-headings {
        display: none;
    }

    .mobile-heading {
        display: block;
        color: var(--color-white);
        background-color: var(--color-primary);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 1.25rem;
        letter-spacing: 1px;
        text-align: center;
        margin-bottom: 1.5rem;
        position: relative;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .mobile-heading::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        height: 4px;
        background-color: var(--color-secondary-dark);
    }

    .section-content {
        flex-direction: column;
        gap: 2.5rem;
    }

    #events-col {
        order: 2;
    }

    #news-col {
        order: 1;
    }

    .article-card {
        max-width: 400px;
        margin: 0 auto;
    }

    /* --- Mobile Vision & Contact Section --- */

    /* --- Mobile Vision Section --- */
    .vision-contact-section {
        flex-direction: column;
    }

    .side-horse-image {
        display: none;
    }

    .vision-main-content {
        width: 100%;
        padding: 2rem 1rem;
        min-width: 100%;
        flex-direction: column;
        /* <-- NEW: Stack video and text */
        gap: 1.5rem;
    }

    .video-wrapper {
        min-width: 280px;
        max-width: 100%;
        margin: 1rem auto;
    }

    .vision-content-wrapper {
        max-width: 100%;
        margin: 0;
    }

    .vision-text {
        padding-top: 0;
    }

    .vision-text h3 {
        font-size: 1.2rem;
        text-align: center;
    }

    .vision-text p {
        font-size: 0.9rem;
        text-align: left;
        padding-bottom: 1rem;
    }

    /* --- Mobile Footer --- */
    .site-footer {
        padding: 2rem 0;
    }

    .site-footer .container {
        flex-direction: column;
        /* Stack columns */
        align-items: center;
        /* Center-align all content */
        text-align: center;
        gap: 2rem;
    }

    .footer-copyright {
        flex-basis: auto;
        /* Reset basis */
        order: 2;
    }

    .footer-contact {
        flex-basis: auto;
        /* Reset basis */
        align-items: center;
        order: 1;
    }

    .footer-contact h3 {
        text-align: center;
    }

    .footer-contact .social-links {
        justify-content: center;
        /* Center social links */
    }

    .footer-contact .contact-info {
        align-items: center;
    }

    .footer-contact .contact-info li {
        justify-content: center;
        /* Center list items */
    }
}