/* ==========================================================================
   COMPONENT: .ui-brochure — Brochure Hero Layout
   A premium 2-column brochure grid used on the Initiatives page.
   Driven by the `image_on_right` toggle in Flask-Admin.
   ========================================================================== */

.ui-brochure {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
    padding: 100px 0;
    max-width: var(--container-width, 1240px);
    margin: 0 auto;
}

/* Alternate background for visual rhythm */
.ui-brochure:nth-child(even) {
    background: rgba(35, 87, 216, 0.02);
}

/* --------------------------------------------------------------------------
   TEXT BLOCK
   -------------------------------------------------------------------------- */
.ui-brochure__text {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ui-brochure__tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    padding: 8px 18px;
    border-radius: 999px;
    background: rgba(35, 87, 216, 0.08);
    border: 1px solid rgba(35, 87, 216, 0.12);
    color: var(--primary, #2357D8);
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.ui-brochure__title {
    font-family: var(--font-head, 'Playfair Display', serif);
    font-size: clamp(2rem, 3.5vw, 3.2rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--dark, #13294B);
}

.ui-brochure__body {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-muted, #6F6F6F);
}

.ui-brochure__body p {
    margin-bottom: 12px;
}

.ui-brochure__body p:last-child {
    margin-bottom: 0;
}

.ui-brochure__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: fit-content;
    min-height: 56px;
    padding: 14px 36px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent, #E07A3F) 0%, #ef9c69 100%);
    color: #ffffff;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-decoration: none;
    box-shadow:
        0 8px 24px rgba(224, 122, 63, 0.25),
        0 2px 8px rgba(224, 122, 63, 0.15);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.ui-brochure__cta:hover {
    transform: translateY(-3px);
    box-shadow:
        0 14px 36px rgba(224, 122, 63, 0.32),
        0 4px 12px rgba(224, 122, 63, 0.2);
}

.ui-brochure__cta:active {
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   IMAGE BLOCK
   -------------------------------------------------------------------------- */
.ui-brochure__image {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 28px 60px rgba(26, 47, 36, 0.12),
        0 8px 20px rgba(26, 47, 36, 0.06);
}

.ui-brochure__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.ui-brochure:hover .ui-brochure__image img {
    transform: scale(1.04);
}

/* Decorative soft inner glow */
.ui-brochure__image::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 24px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   SCROLL REVEAL ANIMATION
   -------------------------------------------------------------------------- */
.ui-brochure {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.ui-brochure.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   RESPONSIVE: MOBILE (max-width: 900px)
   Stack to 1 column. Image ALWAYS on top via order: -1.
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .ui-brochure {
        grid-template-columns: 1fr;
        gap: 36px;
        padding: 64px 24px;
    }

    /* Force image on top regardless of HTML source order */
    .ui-brochure__image {
        order: -1;
    }

    .ui-brochure__text {
        order: 1;
    }

    .ui-brochure__title {
        font-size: clamp(1.8rem, 6vw, 2.6rem);
    }

    .ui-brochure__cta {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 560px) {
    .ui-brochure {
        gap: 28px;
        padding: 48px 16px;
    }

    .ui-brochure__image {
        border-radius: 18px;
    }

    .ui-brochure__image::after {
        border-radius: 18px;
    }
}


/* ==========================================================================
   COMPONENT: .ui-member-story — 50/50 Split-Screen Member Narrative
   A premium fixed-height section with a scrollable text column
   and a full-bleed portrait photograph. Fully generalised — no individual
   profile elements. Driven by the member_story() Jinja macro.
   ========================================================================== */

.ui-member-story {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 80vh;
    min-height: 580px;
    max-height: 880px;
    overflow: hidden;
    margin-bottom: 2px; /* Small space between cards */
}

/* Image on left modifier */
.ui-member-story--image-left .ui-member-story__content {
    order: 2;
}

.ui-member-story--image-left .ui-member-story__media {
    order: 1;
}


/* --------------------------------------------------------------------------
   TEXT COLUMN (Left — Scrollable on Desktop)
   -------------------------------------------------------------------------- */
.ui-member-story__content {
    position: relative;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    background: var(--primary, #2357D8);
    color: rgba(255, 255, 255, 0.92);
    scroll-behavior: smooth;
}

/* Custom thin white scrollbar — Webkit */
.ui-member-story__content::-webkit-scrollbar {
    width: 5px;
}

.ui-member-story__content::-webkit-scrollbar-track {
    background: transparent;
}

.ui-member-story__content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.24);
    border-radius: 999px;
}

.ui-member-story__content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.42);
}

/* Custom scrollbar — Firefox */
.ui-member-story__content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}

.ui-member-story__content-inner {
    padding: 80px 10%;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 100%;
}

/* Eyebrow tag */
.ui-member-story__tag {
    display: inline-block;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.48);
    margin-bottom: 16px;
}

/* Heading */
.ui-member-story__title {
    font-family: var(--font-head, 'Playfair Display', serif);
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #ffffff;
    margin: 0 0 8px;
}

/* Qualification / Designation line */
.ui-member-story__qualification {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.52);
    margin: 0 0 32px;
    line-height: 1.4;
}

/* Body paragraphs */
.ui-member-story__body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ui-member-story__body p {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 1.02rem;
    line-height: 1.85;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.ui-member-story__body p:first-child {
    font-size: 1.08rem;
    color: rgba(255, 255, 255, 0.9);
}


/* --------------------------------------------------------------------------
   MEDIA COLUMN (Right — Full-Bleed Portrait)
   -------------------------------------------------------------------------- */
.ui-member-story__media {
    position: relative;
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: #e8e2d8;
}

.ui-member-story__portrait {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    transition: transform 8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ui-member-story:hover .ui-member-story__portrait {
    transform: scale(1.04);
}

/* Subtle overlay for depth & vignette */
.ui-member-story__media-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.10) 100%),
        linear-gradient(270deg, rgba(0, 0, 0, 0) 80%, rgba(35, 87, 216, 0.06) 100%);
    pointer-events: none;
}


/* --------------------------------------------------------------------------
   RESPONSIVE: Tablet (max-width: 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .ui-member-story__content-inner {
        padding: 64px 8%;
    }

    .ui-member-story__title {
        font-size: clamp(1.75rem, 3.2vw, 2.5rem);
        margin-bottom: 24px;
    }

    .ui-member-story__body p {
        font-size: 0.96rem;
    }
}


/* --------------------------------------------------------------------------
   RESPONSIVE: Mobile (max-width: 900px)
   Stack single column. Image on top, text below — NO scroll trapping.
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .ui-member-story {
        grid-template-columns: 1fr;
        height: auto;
        min-height: auto;
        max-height: none;
    }

    /* Portrait image floats to top */
    .ui-member-story__media {
        order: -1;
        height: 50vh;
        min-height: 280px;
        max-height: 420px;
    }

    /* Text flows naturally — no internal scroll box */
    .ui-member-story__content {
        order: 2;
        overflow-y: visible;
        height: auto;
    }

    .ui-member-story__content-inner {
        padding: 48px 6%;
        min-height: auto;
    }

    .ui-member-story__tag {
        margin-bottom: 12px;
    }

    .ui-member-story__title {
        font-size: clamp(1.6rem, 6vw, 2.2rem);
        margin-bottom: 20px;
    }

    .ui-member-story__body {
        gap: 16px;
    }

    .ui-member-story__body p {
        font-size: 0.94rem;
        line-height: 1.75;
    }
}


/* --------------------------------------------------------------------------
   RESPONSIVE: Small Mobile (max-width: 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .ui-member-story__media {
        height: 44vh;
        min-height: 240px;
    }

    .ui-member-story__content-inner {
        padding: 36px 5% 48px;
    }

    .ui-member-story__title {
        font-size: clamp(1.4rem, 7vw, 1.9rem);
    }

    .ui-member-story__body p {
        font-size: 0.88rem;
    }
}


/* --------------------------------------------------------------------------
   ACCESSIBILITY: Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .ui-member-story__portrait {
        transition: none !important;
    }

    .ui-member-story:hover .ui-member-story__portrait {
        transform: none;
    }
}
