/* ============================================
   Institute Website Interface Service — Styles
   ============================================
   Clean, modern public school website design system.

   Architecture:
     Base          — reset, tokens, typography, container, buttons, cards
     Layout        — loading/error/empty states
     Header        — navbar + mobile navigation
     Hero          — hero section + carousel indicators
     Sections      — reusable section heading + content sections
     Cards         — article/event/achievement card grid
     Detail pages  — article/event/achievement detail
     Gallery       — gallery grid + lightbox
     Contact       — contact info + map
     Footer        — footer columns
     404           — not found
     Responsive    — breakpoints (grouped logically)
   ============================================ */

/* ============================================
   Base
   ============================================ */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Theme tokens — overridden at runtime by ThemeApplier. */
    --primary: #1a1a2e;
    --secondary: #16213e;
    --accent: #e94560;
    --page-header-color: var(--secondary);
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    /* Neutral design tokens. */
    --text-color: #2b2f36;
    --text-light: #6b7280;
    --text-muted: #8a919c;
    --bg-light: #f5f7fa;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
    --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
    --shadow-lg: 0 10px 24px rgba(16, 24, 40, 0.10);
    --transition: all 0.2s ease;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Single shared content container. */
.container {
    width: 100%;
    max-width: 90%;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    opacity: 0.85;
}

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

h1,
h2,
h3,
h4 {
    line-height: 1.25;
    color: var(--text-color);
}

/* ============================================
   Buttons
   ============================================ */

.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    opacity: 0.9;
    color: #ffffff;
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    opacity: 1;
    color: var(--primary);
    border-color: var(--primary);
}

/* ============================================
   Layout — loading / error / empty states
   ============================================ */

.loading,
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-page,
.error-container {
    text-align: center;
    padding: 4rem 2rem;
    color: #c0392b;
}

.error-container h2,
.error-page h1 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
    background: var(--bg-white);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius);
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

/* ============================================
   Header
   ============================================ */

.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 68px;
}

.logo-link {
    display: flex;
    align-items: center;
    color: var(--text-color);
    flex-shrink: 0;
    min-width: 0;
}

.logo-link:hover {
    opacity: 1;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.logo-img {
    max-height: 36px;
    width: auto;
    object-fit: contain;
}

.site-brand .site-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    display: inline-block;
    padding: 0.5rem 0.6rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.nav-link.active {
    color: var(--primary);
    font-weight: 600;
    border-bottom-color: var(--primary);
}

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-toggle-bar {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--text-color);
    border-radius: 2px;
}

/* ============================================
   Main content
   ============================================ */

.main-content {
    min-height: 60vh;
}

/* ============================================
   Page header (subpages)
   ============================================ */

.page-header {
    background: var(--page-header-color, var(--primary));
    color: #ffffff;
    padding: 4rem 0;
    text-align: center;
}

.page-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #ffffff;
}

/* ============================================
   Hero section
   ============================================ */

.hero-section {
    background: var(--bg-light);
    padding: 4rem 0;
    /* Anchors the section-level carousel arrows and indicators. */
    position: relative;
}

/* Two-column layout: content left, media right. `.hero-slide` is the keyed
   container re-mounted on every slide change so both columns fade in together. */
.hero-slide {
    display: grid;
    grid-template-columns: 45% 55%;
    align-items: center;
    gap: 3rem;
    animation: hero-slide-fade 0.5s ease;
}

@keyframes hero-slide-fade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Left content */
.hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Right media column for the rotating slide media. */
.hero-media {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-media .homepage-section-media {
    margin-top: 0;
    width: 100%;
}

/* Rich content body inside a rotating slide. */
.hero-content-body {
    max-width: 480px;
    margin-bottom: 1.5rem;
}

.hero-eyebrow {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.hero-title {
    font-size: 2.9rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-light);
    max-width: 480px;
    margin-bottom: 1.75rem;
}

/* Carousel arrows (positioned relative to the whole hero section). */
.hero-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.35);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.hero-carousel-arrow:hover {
    background: var(--primary);
}

.hero-carousel-arrow--prev {
    left: 12px;
}

.hero-carousel-arrow--next {
    right: 12px;
}

/* Carousel indicators (bottom-center of the hero section). */
.hero-carousel-indicators {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: 0.5rem;
}

.hero-carousel-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: var(--transition);
}

.hero-carousel-dot.active {
    background: var(--primary);
}

/* ============================================
   Sections (shared heading)
   ============================================ */

section {
    padding: 4.5rem 0;
}

.section-heading {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-heading h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}

.section-underline {
    display: block;
    width: 56px;
    height: 4px;
    border-radius: 2px;
    background: var(--accent);
    margin: 0 auto 1.25rem;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-light);
    max-width: 640px;
    margin: 0 auto;
}

.section-actions {
    display: flex;
    justify-content: center;
    margin-top: 2.5rem;
}

/* Alternating section backgrounds */
.recent-articles,
.home-gallery,
.upcoming-events,
.about-section {
    background: var(--bg-white);
}

.home-achievements,
.home-contact {
    background: var(--bg-light);
}

/* Rich content */
.content {
    line-height: 1.8;
    color: var(--text-color);
}

.content p {
    margin-bottom: 1rem;
}

/* About section */
.about-section .content {
    max-width: 820px;
    margin: 0 auto;
}

/* ── About "Our School" blocks (flexbox) ──────────────────────────────────
   Each block is one flex row: a white card + optional photo. The photo side
   alternates every image-bearing block; image-less blocks span full width. */
.abt-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.abt-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
}

/* Flipped row: photo left, card right (DOM order unchanged, reversed visually). */
.abt-row.abt-flip {
    flex-direction: row-reverse;
}

.abt-card {
    flex: 1 1 0;
    min-width: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px 28px;
    box-shadow: var(--shadow-md);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.abt-photo {
    flex: 1 1 0;
    min-width: 0;
    position: static;
    height: auto;
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.abt-photo img {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    max-height: 640px;
    object-fit: contain;
    background: #f3f5f9;
}

/* No photo: the card takes the full width. */
.abt-row.abt-full .abt-card {
    flex: 1 1 100%;
}

.abt-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 0.9rem;
}

/* Rich HTML body of a block, inheriting the global `.content` typography. */
.abt-text {
    line-height: 1.8;
    color: var(--text-color);
}

.abt-text p {
    margin-bottom: 1rem;
}

/* Mobile: stack to one column, photo above the card (flip rows included). */
@media (max-width: 768px) {
    .abt-row,
    .abt-row.abt-flip {
        flex-direction: column;
        gap: 16px;
    }
    .abt-card,
    .abt-photo {
        flex: 1 1 auto;
        width: 100%;
    }
    .abt-photo {
        order: -1;
    }
}

/* Homepage section media — single image (centered, natural aspect ratio) and
   multiple images (responsive grid). Full image is always visible; never
   cropped or distorted. */
.homepage-section-media {
    margin-top: 2rem;
}

.homepage-section-media--single {
    display: flex;
    justify-content: center;
}

.homepage-section-media--single .homepage-section-image-wrap {
    width: 100%;
    max-width: 820px;
}

.homepage-section-media--multiple {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.homepage-section-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.homepage-section-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* ============================================
   Detail-page category chips & meta
   ============================================ */

.article-category,
.event-category,
.achievement-category {
    display: inline-block;
    background: rgba(0, 0, 0, 0.05);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
    width: fit-content;
}

.article-date,
.event-date,
.event-location {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

/* ============================================
   Media cards (Events & Achievements)
   ============================================ */

.ec-card-link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.ec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    align-items: stretch;
}

.ec-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.ec-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--primary);
}

.ec-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-light);
}

.ec-media-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.ec-card:hover .ec-media-img {
    transform: scale(1.05);
}

.ec-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.22) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ec-card:hover .ec-media::after {
    opacity: 1;
}

.ec-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 100%);
}

.ec-placeholder-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    color: #818cf8;
    font-size: 1.75rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.ec-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px 18px 18px;
}

.ec-chip {
    display: inline-block;
    width: fit-content;
    background: var(--primary);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
}

.ec-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.4;
    margin-bottom: 0.5rem;
    transition: color 0.2s ease;
}

.ec-card:hover .ec-title {
    color: var(--primary);
}

.ec-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.ec-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ec-meta-item i {
    font-size: 0.8rem;
    color: var(--primary);
    opacity: 0.55;
}

.ec-desc {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ec-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.ec-cta-arrow {
    transition: transform 0.2s ease;
}

.ec-card:hover .ec-cta {
    color: var(--accent);
}

.ec-card:hover .ec-cta-arrow {
    transform: translateX(4px);
}

@media (max-width: 576px) {
    .ec-grid {
        grid-template-columns: 1fr;
    }
}

/* Achievement date (detail page) */
.achievement-date {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
}

/* ============================================
   Detail pages (articles / events / achievements)
   ============================================ */

.content-detail-header {
    padding: 2.5rem 0 1.5rem;
}

.content-detail-header h2 {
    font-size: 2.25rem;
    color: var(--text-color);
    margin: 0.75rem 0;
}

.content-detail-header .article-date,
.event-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.content-detail-media--single {
    display: flex;
    justify-content: center;
}

.content-detail-media--single .content-detail-image-wrap {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
}

.content-detail-media--multiple {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.content-detail-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.content-detail-image {
    width: 100%;
    max-height: 420px;
    height: auto;
    object-fit: contain;
    display: block;
}

.content-detail-body {
    padding: 1.5rem 0 4rem;
    line-height: 1.8;
    font-size: 1.05rem;
    color: var(--text-color);
}

.content-detail-body p {
    margin-bottom: 1.25rem;
}

/* ============================================
   Detail column wrapper (centers title/category/image/paragraph)
   ============================================ */

.dt-column {
    width: 100%;
    max-width: 820px;
    margin: 0 auto !important;
    padding: 0 16px;
    box-sizing: border-box;
}

.dt-column > *,
.dt-column div:not(.vp-frame),
.dt-column p {
    max-width: 100% !important;
    float: none !important;
    box-sizing: border-box;
}

.dt-column > * {
    width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
}

.dt-column img:not(.vp-img) {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 24px;
}

.dt-column p {
    margin: 0 0 16px;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

@media (max-width: 576px) {
    .dt-column {
        padding: 0 14px;
    }
}

/* ============================================
   Gallery
   ============================================ */

.gallery-section {
    margin-bottom: 3rem;
}

.gallery-section h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.gallery-description {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.gallery-type-badge {
    display: inline-block;
    margin: 0.25rem 0 0.75rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary);
    background: rgba(0, 0, 0, 0.05);
    border-radius: 999px;
}

/* ============================================
   Media-only gallery tiles (homepage + listing)
   ============================================ */

.gallery-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.gallery-tile-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.gallery-tile {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.gallery-tile:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.gallery-tile-image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--bg-light);
}

.gallery-tile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-tile-empty {
    width: 100%;
    height: 100%;
    background: var(--bg-light);
}

.gallery-tile-count {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
}

.gallery-tile-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gallery-tile:hover .gallery-tile-overlay,
.gallery-tile:focus-within .gallery-tile-overlay {
    opacity: 1;
}

.gallery-tile-view {
    padding: 6px 18px;
    border: 1px solid #fff;
    border-radius: 999px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.gallery-tile-title {
    padding: 12px 14px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    background: var(--bg-white);
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Under 576px: two columns, tiles shrink to fit. */
@media (max-width: 575.98px) {
    .gallery-tile-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.gallery-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: var(--bg-light);
    display: block;
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: #ffffff;
    padding: 2rem 1rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.gallery-empty {
    color: var(--text-light);
    font-style: italic;
    margin: 0.5rem 0;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    cursor: zoom-out;
    outline: none;
}

.lightbox-img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: var(--radius);
    cursor: default;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 1.6rem;
    line-height: 1;
    color: #ffffff;
    background: transparent;
    border: none;
    cursor: pointer;
}

/* ============================================
   Contact
   ============================================ */

.contact-content {
    padding-top: 0;
}

.contact-info-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 720px;
}

.contact-info-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

/* Two-column contact layout: details card + map side by side. */
.ct-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: stretch;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Direct children fill their grid column; min-width: 0 prevents overflow and
   max-width: none overrides the details card's narrow cap. */
.ct-wrap > * {
    width: 100%;
    max-width: none !important;
    min-width: 0;
}

/* When no map is saved the details card is the only element child; let it fill
   the full width instead of half of the two-column grid. */
.ct-wrap > :only-child {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .ct-wrap {
        grid-template-columns: 1fr;
    }
}

/* Make the map block match the details card (white card, same height). */
.map-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px 28px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.map-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 18px;
    color: var(--text-color);
}

.map-card-frame {
    flex: 1 1 auto;
    width: 100%;
    height: 100% !important;
    min-height: 320px;
    border-radius: 10px !important;
    border: none;
}

.map-card-directions {
    align-self: flex-start;
    margin-top: 18px;
}

@media (max-width: 768px) {
    .map-card {
        height: auto;
    }
}

.info-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.info-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.info-item h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.info-item p,
.info-item a {
    color: var(--text-color);
    font-size: 0.95rem;
}

.info-item a {
    color: var(--primary);
}

/* Multi-value contact entries rendered one per line. */
.info-value-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-value {
    display: block;
    word-break: break-word;
}

.no-contact {
    color: var(--text-light);
    font-style: italic;
}

/* ============================================
   Footer
   ============================================ */

.site-footer {
    background: var(--primary);
    color: rgba(255, 255, 255, 0.85);
    padding: 3.5rem 0 2rem;
    margin-top: 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.4fr;
    gap: 2.5rem;
}

.footer-brand h3 {
    font-size: 1.35rem;
    color: #ffffff;
    margin-bottom: 0.75rem;
}

.footer-brand p {
    font-size: 0.9rem;
    opacity: 0.75;
    margin-bottom: 1rem;
}

.footer-contact h4,
.footer-links h4 {
    font-size: 1rem;
    color: #ffffff;
    margin-bottom: 1rem;
}

.contact-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    align-items: flex-start;
}

.contact-icon {
    flex-shrink: 0;
    font-size: 1rem;
}

.contact-row a {
    color: rgba(255, 255, 255, 0.85);
}

.contact-row a:hover {
    color: #ffffff;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.social-link {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    font-size: 0.82rem;
    color: #ffffff;
    transition: var(--transition);
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    opacity: 1;
}

.footer-bottom {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
}

.footer-bottom p {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Social links inside contact info (light context) */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.social-links .social-link {
    color: var(--primary);
    border-color: var(--border-color);
}

.social-links .social-link:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--primary);
}

/* ============================================
   404
   ============================================ */

/* ============================================
   Suspension page (hosting suspended/inactive)
   ============================================ */
.suspension-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    background: var(--bg-light);
}

.suspension-card {
    max-width: 520px;
    width: 100%;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 3rem 2rem;
    text-align: center;
}

.suspension-icon {
    font-size: 3.5rem;
    color: var(--accent);
    margin-bottom: 1.25rem;
}

.suspension-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.suspension-subtitle {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 0;
}

/* ============================================
   404 / Not found
   ============================================ */
.not-found {
    text-align: center;
    padding: 5rem 2rem;
}

.not-found h1 {
    font-size: 6rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.not-found h2 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.not-found p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.not-found a {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    background: var(--primary);
    color: #ffffff;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.not-found a:hover {
    opacity: 0.9;
    color: #ffffff;
}

/* ============================================
   Responsive
   ============================================ */

/* Tablet */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .hero-slide {
        gap: 2rem;
    }

    .hero-title {
        font-size: 2.4rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    section {
        padding: 3rem 0;
    }

    .section-heading h2 {
        font-size: 1.6rem;
    }

    .site-header .container {
        height: 60px;
        flex-wrap: nowrap;
    }

    .logo-link {
        flex: 1;
    }

    .nav-toggle {
        display: flex;
        flex-shrink: 0;
        margin-left: auto;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0;
        padding: 0.5rem 20px 1rem;
        background: var(--bg-white);
        border-bottom: 1px solid var(--border-color);
        box-sizing: border-box;
    }

    .main-nav.open {
        display: flex;
    }

    .main-nav .nav-link {
        padding: 0.75rem 0.5rem;
        width: fit-content;
        align-self: flex-start;
    }

    .main-nav .nav-link.active {
        border-bottom-color: var(--primary);
    }

    .hero-section {
        padding: 3rem 0;
    }

    .hero-slide {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-content {
        align-items: flex-start;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-carousel-arrow {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }

    .hero-carousel-arrow--prev {
        left: 8px;
    }

    .hero-carousel-arrow--next {
        right: 8px;
    }

    .page-header {
        padding: 3rem 0;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

    .homepage-section-media--multiple {
        grid-template-columns: 1fr;
    }

    .content-detail-media--multiple {
        grid-template-columns: 1fr;
    }

    .content-detail-header h2 {
        font-size: 1.5rem;
    }

    .content-detail-image {
        max-height: 320px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.6rem;
    }

    .content-detail-image {
        max-height: 260px;
    }

    .not-found h1 {
        font-size: 4rem;
    }

    .contact-info-card {
        padding: 1.25rem;
    }

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

    .gallery-item img {
        height: 180px;
    }
}

/* ============================================
   Organization homepage
   ============================================ */

.organization-homepage {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.organization-homepage .main-content {
    flex: 1;
}

/* Alternate content section background for visual rhythm. */
.org-section--alt {
    background: var(--bg-light);
}

/* Contact content (from a `footer` content_type section). */
.org-contact-content {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

/* Rich-text paragraphs (admin-entered description content). Blank lines are
   rendered as separate <p> blocks, so keep consistent spacing and reset the
   last paragraph's bottom margin. */
.content p,
.abt-text p,
.content-detail-body p,
.hero-content-body p,
.org-contact-content p {
    margin: 0 0 14px;
    line-height: 1.7;
}

.content p:last-child,
.abt-text p:last-child,
.content-detail-body p:last-child,
.hero-content-body p:last-child,
.org-contact-content p:last-child {
    margin-bottom: 0;
}

/* Institutions grid and cards. */
.org-institutions {
    background: var(--bg-light);
}

.org-institution-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

.org-institution-card {
    flex: 0 1 340px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    height: 100%;
    padding: 1.75rem 1.25rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.org-institution-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.org-institution-logo-wrap {
    width: 100%;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.org-institution-logo {
    max-width: 100%;
    max-height: 96px;
    object-fit: contain;
}

.org-institution-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
}

.org-institution-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    line-height: 1.4;
}

.org-institution-domain {
    font-size: 0.85rem;
    color: var(--text-muted);
    word-break: break-all;
}

.org-institution-link {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.45rem 1.1rem;
    background: var(--primary);
    color: #ffffff;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}

.org-institution-link:hover {
    background: var(--accent);
    color: #ffffff;
    opacity: 1;
}

/* Vision: centered content pages (dt-column, 820px). */
.org-centered-section {
    background: var(--bg-white);
}

/* A single content block (photo + title + rich text). */
.section-block {
    margin: 0 0 40px;
}

.section-block:last-child {
    margin-bottom: 0;
}

.vp-frame {
    max-width: 640px;
    margin: 0 auto 24px;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f5f9;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.vp-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 380px;
    object-fit: contain;
    margin: 0 auto;
}

@media (max-width: 576px) {
    .vp-img {
        max-height: 260px;
    }
}

.section-block-title {
    margin: 0 0 12px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
}

.section-block-text p {
    margin: 0 0 16px;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.section-block-text p:last-child {
    margin-bottom: 0;
}

/* Trustees grid and cards. */
.org-trustees {
    background: var(--bg-light);
}

.org-trustee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 300px));
    gap: 48px 40px;
    justify-content: center;
}

.org-trustee-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.85rem;
}

.org-trustee-portrait {
    position: relative;
    width: 260px;
    height: 260px;
    padding: 12px;
    background: var(--primary);
    border-radius: 58% 42% 52% 48% / 50% 56% 44% 50%;
    box-sizing: border-box;
}

.org-trustee-portrait::after {
    content: "";
    position: absolute;
    inset: -14px;
    border: 2px solid var(--accent);
    border-radius: inherit;
    pointer-events: none;
}

.org-trustee-portrait img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    border-radius: 58% 42% 52% 48% / 50% 56% 44% 50%;
}

.org-trustee-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 6rem;
    font-weight: 700;
    color: #ffffff;
    background: var(--accent);
    border-radius: 58% 42% 52% 48% / 50% 56% 44% 50%;
}

.org-trustee-name {
    margin: 0.35rem 0 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.35;
}

.org-trustee-designation {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
}

@media (max-width: 576px) {
    .org-trustee-portrait {
        width: 200px;
        height: 200px;
    }

    .org-trustee-initial {
        font-size: 4.5rem;
    }
}

/* ─── Organization homepage: layout refinements (CSS-only, .org-scoped) ────
 * The org header has no hamburger toggle (that lives in the institution
 * header's Rust), so its `.main-nav` would be hidden by the shared mobile
 * rule. Keep the org nav links visible as a wrapped row instead. */
@media (max-width: 768px) {
    .organization-homepage .site-header .container {
        flex-wrap: wrap;
        height: auto;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        row-gap: 0.5rem;
    }

    .organization-homepage .main-nav {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        width: auto;
        gap: 0.25rem;
        padding: 0;
        background: transparent;
    }
}

/* The org footer renders only the brand column, so collapse the 3-column
   grid into a single centered column. */
.organization-homepage .footer-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
}

.organization-homepage .footer-brand p {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}
