/**
 * About Us Page Styles
 * File: assets/css/about.css
 *
 * Selector contract — must match template-parts/about/*.php output:
 *
 *   Hero:
 *     .about-hero  .about-hero__overlay  .about-hero-inner
 *     .about-hero-image  .headshot-img
 *     .about-hero-content  .about-hero-intro
 *
 *   Story:
 *     .about-story  .about-story-inner  .about-story-inner--{boxed|wide}
 *     .about-story-inner--has-image  .about-story-inner--image-{left|right|top}
 *     .about-story__title  .about-story__body
 *     .about-story__image--{left|right|top}  .story-content
 *
 *   Timeline:
 *     .about-timeline  .about-timeline__overlay  .about-timeline__inner
 *     .about-timeline__title
 *     .timeline  (= #gallery, the horizontal scroll container)
 *     .timeline-card  .timeline-pin
 *     .timeline-card__img  .timeline-card__body
 *     .timeline-card__year  .timeline-card__caption
 *     .timeline.active .timeline-card  → sway animation
 *     .timeline-card.visible           → fade-in visible state
 *
 *   CTA:
 *     .about-cta  .about-cta__inner  .about-cta__title
 *     .about-cta__text  .about-cta-btn
 */

@import url('https://fonts.googleapis.com/css2?family=Kalam:wght@400;700&display=swap');

/* ================================================================
   PAGE WRAPPER
   ================================================================ */

.about-layout-contained .about-hero-inner,
.about-layout-contained .about-story-inner,
.about-layout-contained .about-timeline__inner,
.about-layout-contained .about-cta__inner {
    max-width: 1200px;
    margin-left:  auto;
    margin-right: auto;
}

/* ================================================================
   HERO SECTION
   ================================================================ */
.about-hero {
    position: relative;
    min-height: 80vh;                          /* overridden by dynamic CSS */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 175px 20px 100px;
    margin-top: -140px;                        /* slide under header */
    background: linear-gradient(135deg, #000e4f 0%, #27054b 100%);
    overflow: hidden;
}

/* Overlay (opacity set via dynamic CSS) */
.about-hero__overlay {
    position: absolute;
    inset: 0;
    background-color: #000;
    opacity: 0.3;
    z-index: 1;
    pointer-events: none;
}

/* Inner content row */
.about-hero-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: row-reverse;   /* headshot right, text left */
    gap: 60px;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Headshot column */
.about-hero-image {
    flex: 0 0 400px;
    max-width: 400px;
}

.about-hero-image img,
.headshot-img {
    width: 100%;
    height: auto;
    border-radius: 20px;           /* overridden by dynamic CSS */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    display: block;
}

/* Text column */
.about-hero-content {
    flex: 1;
    color: #fff;
}

.about-hero-content h1 {
    font-size: 48px;               /* overridden by dynamic CSS */
    line-height: 1.15;
    margin: 0 0 20px;
    font-weight: 700;
    color: #aeb9f7;
}

.about-hero-content h2 {
    font-size: 24px;               /* overridden */
    margin: 0 0 20px;
    font-weight: 400;
    color: #fff;
    opacity: 0.95;
}

.about-hero-intro {
    font-size: 18px;               /* overridden */
    line-height: 1.8;
    color: #fff;
}

/* ================================================================
   STORY SECTION
   ================================================================ */
.about-story {
    padding: 100px 20px;
    background-color: #fff;        /* overridden by dynamic CSS */
}

/* Width modifiers */
.about-story-inner          { margin: 0 auto; }
.about-story-inner--boxed   { max-width:  800px; }
.about-story-inner--wide    { max-width: 1200px; }

/* Section title */
.about-story__title {
    font-size: 40px;               /* overridden */
    font-weight: 700;
    color: #27054b;
    text-align: center;
    margin: 0 0 40px;
    line-height: 1.2;
}

/* Body: single column by default */
.about-story__body {
    display: block;
}

/* Body: two-column when image is left or right */
.about-story-inner--has-image.about-story-inner--image-left .about-story__body,
.about-story-inner--has-image.about-story-inner--image-right .about-story__body {
    display: flex;
    align-items: flex-start;
    gap: 48px;
}

/* Image wrapper — left / right */
.about-story__image--left,
.about-story__image--right {
    flex: 0 0 360px;
    max-width: 360px;
}

/* Image wrapper — top */
.about-story__image--top {
    margin-bottom: 40px;
}
.about-story__image--top img {
    max-height: 480px;
    object-fit: cover;
    width: 100%;
}

/* All story images */
.about-story__image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
}

/* Order within flex row */
.about-story-inner--image-left  .about-story__image--left  { order: -1; }
.about-story-inner--image-right .about-story__image--right { order:  1; }

/* Body text */
.story-content {
    flex: 1;
    font-size: 18px;               /* overridden */
    line-height: 1.9;
    color: #555;
}

.story-content p             { margin-bottom: 24px; }
.story-content p:last-child  { margin-bottom: 0; }

/* ================================================================
   TIMELINE SECTION
   ================================================================ */
.about-timeline {
    position: relative;
    padding: 100px 20px;
    background-color: #1a1a2e;    /* overridden + bg image via dynamic CSS */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    overflow: hidden;
}

/* Dark overlay */
.about-timeline__overlay {
    position: absolute;
    inset: 0;
    background-color: #000;
    opacity: 0.5;                  /* overridden by dynamic CSS */
    z-index: 1;
    pointer-events: none;
}

/* Inner wrapper */
.about-timeline__inner {
    position: relative;
    z-index: 2;
}

/* Heading */
.about-timeline__title {
    text-align: center;
    font-size: 40px;               /* overridden */
    margin: 0 0 60px;
    color: #ffd700;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6);
}

/* ---- Horizontal scroll container (id="gallery") ---- */
.timeline {
    display: flex;
    gap: 40px;
    padding: 50px 40px 40px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;

    /* Hide scrollbar, keep drag functionality */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.timeline::-webkit-scrollbar {
    display: none;
}

/* ---- Polaroid Cards ---- */
.timeline-card {
    position: relative;
    flex-shrink: 0;
    width: 220px;
    background-color: #fff;        /* overridden by dynamic CSS */
    padding: 15px 15px 40px;
    border-radius: 5px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transform-origin: top center;

    /* Hidden until JS adds .visible */
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Visible state (added by JS) */
.timeline-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Sway animation — active state on #gallery triggers child keyframes */
.timeline.active .timeline-card.visible {
    animation: ktv-swing var(--swing-duration, 2s) ease-in-out infinite alternate;
}

/* Stagger sway offsets per card */
.timeline-card:nth-child(even).visible {
    animation-delay: -0.75s;
}

@keyframes ktv-swing {
    0%   { transform: rotate(-3deg) translateY(0); }
    100% { transform: rotate( 3deg) translateY(0); }
}

/* Disable sway if customizer says so */
.timeline[data-sway="0"] .timeline-card,
.timeline[data-sway="0"] .timeline-card.visible {
    animation: none !important;
}

/* ---- Pin ---- */
.timeline-pin {
    position: absolute;
    top: 0.3rem;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    background-color: #ff6b6b;     /* overridden by dynamic CSS */
    border-radius: 50%;
    box-shadow: inset -1px -1px 3px rgba(0, 0, 0, 0.4);
    z-index: 5;
}

/* ---- Card Image ---- */
.timeline-card__img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 3px;
    margin-bottom: 12px;
}

/* ---- Card Text ---- */
.timeline-card__body {
    text-align: center;
}

.timeline-card__year {
    font-family: 'Kalam', cursive;
    font-size: 20px;               /* overridden */
    font-weight: 700;
    color: #ffd700;
    margin: 0 0 6px;
}

.timeline-card__caption {
    font-family: 'Kalam', cursive;
    font-size: 14px;               /* overridden */
    line-height: 1.5;
    color: #333;
    display: block;
    margin: 0;
}

/* Empty state */
.about-timeline__empty {
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 40px 0;
}

/* ================================================================
   CTA SECTION
   ================================================================ */
.about-cta {
    padding: 120px 20px;
    background-color: #27054b;     /* overridden by dynamic CSS */
    text-align: center;
    color: #fff;
}

.about-cta__inner {
    max-width: 800px;
    margin: 0 auto;
}

.about-cta__title {
    font-size: 40px;
    margin: 0 0 20px;
    color: #fff;
}

.about-cta__text {
    font-size: 20px;
    margin: 0 0 40px;
    line-height: 1.6;
    color: #eee;
}

.about-cta-btn {
    display: inline-block;
    padding: 16px 48px;
    background-color: #ffd700;     /* overridden by dynamic CSS */
    color: #27054b;
    text-decoration: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.about-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    color: inherit;
    text-decoration: none;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 992px) {
    .about-hero {
        margin-top: -135px;
        padding: 100px 20px 80px;
    }

    .about-hero-inner {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }

    .about-hero-image {
        flex: 0 0 auto;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .about-hero-content h1 { font-size: 36px; }
    .about-hero-content h2 { font-size: 20px; }

    .timeline { gap: 24px; padding: 40px 20px; }
    .timeline-card { width: 190px; }
}

@media (max-width: 768px) {
    .about-hero         { padding: 80px 16px 60px; }
    .about-hero-content h1 { font-size: 30px; }
    .about-hero-content h2 { font-size: 18px; }

    .about-story        { padding: 60px 16px; }
    .about-story__title { font-size: 28px; margin-bottom: 24px; }

    /* Stack image on top on mobile regardless of desktop position */
    .about-story-inner--has-image.about-story-inner--image-left .about-story__body,
    .about-story-inner--has-image.about-story-inner--image-right .about-story__body {
        flex-direction: column;
    }

    .about-story__image--left,
    .about-story__image--right {
        flex: none;
        max-width: 100%;
        order: -1;
    }

    .about-story-inner--boxed,
    .about-story-inner--wide { max-width: 100%; }

    .story-content { font-size: 16px; }

    .about-timeline         { padding: 60px 16px; }
    .about-timeline__title  { font-size: 28px; margin-bottom: 40px; }

    .about-cta              { padding: 80px 16px; }
    .about-cta__title       { font-size: 28px; }
    .about-cta__text        { font-size: 18px; }
}