/* =========================================
   ABOUT PAGE V2 STYLES
   ========================================= */

/* --- Title Bar Adjustments --- */
/* Inherits base structure from race-card.css */
.race-title-bar {
    margin-bottom: 2rem;
}

.header-tagline {
    font-family: 'Montserrat', serif;
    /* Optional: Use your site's serif font */
    font-style: italic;
    font-size: 1.1rem;
    color: var(--color-primary);
    opacity: 0.9;
    letter-spacing: 0.5px;
    border-left: 3px solid var(--color-secondary);
    padding-left: 1rem;
}

/* --- Main Card Container --- */
.about-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 3rem;
    border: 1px solid #eee;
    position: relative;
    overflow: hidden;
}

/* Decorative top border gradient */
.about-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}

/* --- Header Section (Inside Card) --- */
.about-header {
    text-align: center;
    margin-bottom: 3rem;
}

.about-header h2 {
    font-size: 1.75rem;
    color: var(--color-primary);
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.divider-line {
    width: 80px;
    height: 4px;
    background-color: var(--color-secondary);
    margin: 0 auto;
    border-radius: 2px;
}

/* --- Body Typography --- */
.about-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #444;
}

.lead-text {
    font-size: 1.2rem;
    font-weight: 500;
    color: #222;
    margin-bottom: 2.5rem;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.content-block {
    margin-bottom: 3rem;
}

.content-block h3 {
    font-size: 1.4rem;
    color: var(--color-primary);
    font-weight: 700;
    margin-bottom: 1rem;
    border-left: 4px solid var(--color-secondary);
    padding-left: 1rem;
}

.content-block p {
    margin-bottom: 1.5rem;
}

strong {
    color: var(--color-primary);
    font-weight: 700;
}

/* --- Image Layouts (CAPPED & ZOOMABLE) --- */
.with-image-right,
.with-image-left {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

/* Standard Flex flow (Text -> Image) is handled by HTML order in .with-image-left */
/* No special reversing needed for .with-image-left if HTML is structured correctly */

.text-content {
    flex: 1;
}

.image-wrapper {
    flex: 0 0 400px;
    /* Fixed width for image column */
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* CAP THE IMAGES */
.content-img {
    width: 100%;
    /* Limit height so it doesn't take full screen height */
    max-height: 300px;
    object-fit: cover;
    /* Ensures image fills the box neatly */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #eee;
    transition: transform 0.3s ease, filter 0.3s ease;
    cursor: zoom-in;
    /* Indicates it can be opened */
}

.content-img:hover {
    transform: scale(1.02);
    filter: brightness(0.95);
}

.img-caption {
    font-size: 0.85rem;
    color: #888;
    text-align: center;
    font-style: italic;
}

/* --- Highlight Box --- */
.highlight-box {
    background-color: #f8fcf9;
    /* Very light green tint */
    border-left: 5px solid var(--color-primary);
    padding: 1.5rem 2rem;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #333;
    font-weight: 500;
    margin: 2rem 0;
}

.highlight-box p {
    margin: 0;
}

/* --- Facilities Grid (Bottom Images) --- */
.facilities-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px dashed #ddd;
}

.facility-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

/* CAP BOTTOM IMAGES TOO */
.facility-item img {
    width: 100%;
    height: 300px;
    /* Fixed height cap */
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.facility-item img:hover {
    transform: scale(1.02);
}

.facility-item span {
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

/* =========================================
   PHOTO DIALOG (MODAL) STYLES
   ========================================= */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    /* Black w/ opacity */
    backdrop-filter: blur(5px);
}

/* Modal Content (The Image) */
.image-modal-content {
    margin: auto;
    display: block;
    width: auto;
    max-width: 90%;
    max-height: 90vh;
    /* Keep it within viewport */
    margin-top: 2%;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    animation: zoomStart 0.3s;
}

/* Caption of Modal Image */
#modal-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
    font-size: 1.2rem;
    font-weight: 500;
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10000;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--color-secondary);
    text-decoration: none;
    cursor: pointer;
}

/* Zoom Animation */
@keyframes zoomStart {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}

/* =========================================
   MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 992px) {

    .with-image-right,
    .with-image-left {
        flex-direction: column;
        /* Stack vertically */
        gap: 2rem;
    }

    /* Optional: If you want consistent ordering on mobile (Text Top, Image Bottom),
       uncomment these lines. Otherwise, it follows HTML order.
    */
    /* .with-image-right .text-content { order: 1; }
    .with-image-right .image-wrapper { order: 2; }
    
    .with-image-left .text-content { order: 1; }
    .with-image-left .image-wrapper { order: 2; }
    */

    .image-wrapper {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .race-title-bar {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .header-tagline {
        border-left: none;
        border-top: 2px solid var(--color-secondary);
        padding-left: 0;
        padding-top: 0.5rem;
    }

    .about-card {
        padding: 1.5rem;
    }

    .about-header h2 {
        font-size: 1.4rem;
    }

    .facilities-grid {
        grid-template-columns: 1fr;
    }

    .facility-item img {
        height: auto;
        max-height: 250px;
    }
}