/* ==========================================================================
   TUNISIAN ARCHITECTURE HISTORY - STYLE SYSTEM
   Modern, Light & Minimalistic Sandstone/Alabaster Theme
   ========================================================================== */

/*  - - Google Fonts  - - */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Montserrat:wght@300;400;500;600;700&display=swap');

/*  - - Design Tokens  - - */
:root {
    --colour-blue: #0077b6;             /* Vibrant Tunisian Cerulean Blue from arches photo */
    /* Color Palette (Light, Modern, Minimalist) */
    --colour-bg-base: #f5f3ee;          /* Vibrant warm plaster sandstone background */
    --colour-bg-card: #ffffff;                   /* High-contrast pure white panels */
    --colour-bg-card-hover: #fafafa;
    --colour-border-subtle: #eae7e0;     /* Soft sandstone border */
    --colour-border-focus: #bfa36f;      /* Muted champagne gold */
    --colour-text-primary: #12100f;     /* Deep stone charcoal for rich legibility */
    --colour-text-secondary: #5a544a;   /* Earthy sandstone grey */
    --colour-text-muted: #8e887e;       /* Muted sandstone sand */
    --colour-gold: #c5a86d;             /* Bright sandstone copper gold */
    --colour-gold-hover: #baa15f;
    --colour-terracotta: #964B36;       /* Warm Infographic Rust Red */
    --colour-terracotta-hover: #7b3d2b;
    --colour-teal: #0f766e;
    
    /* Layout Tokens */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --shadow-subtle: 0 4px 20px rgba(165, 160, 150, 0.08), 0 1px 3px rgba(0, 0, 0, 0.02);
    --shadow-hover: 0 8px 30px rgba(165, 160, 150, 0.15), 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-inset: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    
    /* Typography */
    --font-heading: 'Lora', serif;
    --font-subheading: 'Lora', serif;
    --font-body: 'Montserrat', sans-serif;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/*  - - Reset & Base Styles  - - */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--colour-bg-base);
    color: #12100f;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(168, 139, 72, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(178, 83, 62, 0.02) 0%, transparent 50%);
    background-attachment: fixed;
}

/*  - - Scrollbar Customization (Modern Dark)  - - */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    transition: background var(--transition-fast);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--colour-blue);
}

/* Specific Timeline Sidebar Scrollbar style: ultra thin and elegant */
.timeline-sidebar::-webkit-scrollbar {
    width: 4px;
}
.timeline-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.timeline-sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
}
.timeline-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--colour-blue);
}

/*  - - Container Layout  - - */
.app-container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Slide/Fade entry animations when entering from cover page */
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-container.app-visible {
    opacity: 1;
    transform: translateY(0);
}

/*  - - Header System  - - */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Center-align elements with each other */
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--colour-border-subtle);
    margin-bottom: 2.5rem;
    gap: 2rem;
}

.title-group {
    max-width: 55%; /* Prevent title from squeezing switcher */
    flex: 1;
}

.title-group h1 {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 2.8rem;
    letter-spacing: -0.01em;
    color: var(--colour-text-primary);
}

.title-group p {
    color: #5a544a;
    font-size: 0.95rem;
    margin-top: 0.3rem;
    font-weight: 400;
}

/*  - - Mode Switcher (Implied / Haute Couture)  - - */
.mode-switcher {
    display: flex;
    background: transparent;
    padding: 0;
    border: none;
    gap: 1rem; /* Optimized spacing */
    align-items: center;
    flex-wrap: nowrap; /* Keep always in one line */
    flex-shrink: 0; /* Prevent shrinking */
}

.mode-btn {
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--colour-text-secondary);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.4rem 0;
    border-radius: 0;
    cursor: pointer;
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    border-bottom: 2px solid transparent;
}

.mode-btn:hover {
    color: var(--colour-text-primary);
}

.mode-btn.active {
    background: transparent;
    color: var(--colour-text-primary);
    box-shadow: none;
    border-bottom: 2px solid var(--colour-blue);
}

/*  - - Layout Tab Views  - - */
.tab-content {
    display: none;
    opacity: 0;
    transition: opacity var(--transition-normal);
    flex-grow: 1;
}

.tab-content.active {
    display: flex;
    opacity: 1;
}

/* ==========================================================================
   TAB: CHRONOLOGY / ERAS LAYOUT
   ========================================================================== */
.chronology-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 3rem;
    align-items: start;
    width: 100%;
}

/*  - - Timeline Navigation Sidebar  - - */
.timeline-sidebar {
    background: #ffffff;
    border: 1px solid var(--colour-border-subtle);
    border-radius: 0;
    padding: 1.8rem 1.4rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    max-height: 75vh;
    overflow-y: auto;
    position: sticky;
    top: 2rem;
}

.timeline-sidebar-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--colour-text-secondary);
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--colour-border-subtle);
}

.timeline-list {
    position: relative;
    list-style: none;
    padding-left: 0;
}

/* Timeline themed vertical line with tick marks (ruler) */
.timeline-list::before {
    content: '';
    position: absolute;
    left: 112px; /* Aligns with column 2 spacer of .timeline-item */
    top: 10px;
    bottom: 10px;
    width: 8px;
    border-left: 1.5px solid var(--colour-border-subtle);
    /* Ruler horizontal ticks using repeating linear gradient */
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 5px,
        var(--colour-border-subtle) 5px,
        var(--colour-border-subtle) 6px,
        transparent 6px,
        transparent 10px
    );
    z-index: 1;
}

.timeline-item {
    display: grid;
    grid-template-columns: 100px 25px 1fr;
    align-items: center;
    gap: 0;
    padding: 0.6rem 0.5rem;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-radius: var(--radius-sm);
    margin-bottom: 0.3rem;
}

.timeline-item:hover {
    background: #f5f3ef;
}

.timeline-item.active {
    background: #fbfbf9;
    border-left: 3px solid var(--colour-blue);
    box-shadow: inset 2px 0 0 var(--colour-blue);
}

.timeline-item.active .timeline-era-date {
    color: var(--colour-blue);
}

.timeline-item.active .timeline-era-name {
    color: var(--colour-text-primary);
}

.timeline-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

.timeline-era-date {
    font-family: var(--font-subheading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--colour-text-secondary);
    text-align: right;
    padding-right: 12px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-ruler-spacer {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Timeline dot indicators situated exactly on the ruler line */
.timeline-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid var(--colour-bg-card);
    z-index: 3;
    transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.timeline-item:hover .timeline-dot {
    background: var(--colour-gold);
    transform: scale(1.3);
}

.timeline-item.active .timeline-dot {
    background: var(--colour-blue);
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 119, 182, 0.25);
    transform: scale(1.6);
}

.timeline-era-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 10px;
}

.timeline-era-number {
    font-family: var(--font-subheading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--colour-terracotta);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.1;
}

.timeline-era-name {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--colour-text-primary);
    line-height: 1.25;
}

/*  - - Main Viewer Content Area  - - */
.viewer-content {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2.5rem;
}

/* Info Panel (Left) */
.info-panel {
    background: #ffffff;
    border: 1px solid var(--colour-border-subtle);
    border-radius: 0;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.era-header {
    margin-bottom: 2rem;
}

.era-badge {
    display: inline-block;
    background: rgba(178, 83, 62, 0.06);
    border: 1px solid rgba(178, 83, 62, 0.15);
    color: var(--colour-terracotta);
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.7rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.8rem;
}

.era-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--colour-text-primary);
    line-height: 1.25;
}

.era-dates {
    font-family: var(--font-subheading);
    font-size: 1.15rem;
    color: var(--colour-gold);
    font-weight: 700;
    margin-top: 0.2rem;
}

/* Tabs inside Info Panel (Implied / Haute Couture) */
.info-tabs {
    display: inline-flex;
    background: transparent;
    padding: 0;
    border: none;
    margin-bottom: 2rem;
    gap: 2rem;
    border-bottom: 1px solid var(--colour-border-subtle);
    width: 100%;
}

.info-tab-btn {
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--colour-text-secondary);
    font-family: var(--font-subheading);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 0.8rem 0;
    border-radius: 0;
    cursor: pointer;
    transition: color var(--transition-fast);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.info-tab-btn:hover {
    color: var(--colour-text-primary);
    background: transparent;
}

.info-tab-btn.active {
    background: transparent;
    color: var(--colour-text-primary);
    box-shadow: none;
    border-bottom: 2px solid var(--colour-blue);
}

.info-pane {
    display: none;
    animation: fadeIn var(--transition-normal) forwards;
}

.info-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.context-text {
    font-size: 1rem;
    color: var(--colour-text-primary);
    line-height: 1.7;
    margin-bottom: 1.2rem;
}

.info-pane h3 {
    font-family: var(--font-heading);
    font-size: 1.65rem;
    color: var(--colour-terracotta);
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid var(--colour-border-subtle);
    padding-bottom: 0.4rem;
}

.info-pane h4 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--colour-gold-hover);
    margin-top: 1.4rem;
    margin-bottom: 0.5rem;
}

.info-pane ul {
    margin-left: 1.5rem;
    margin-bottom: 1.2rem;
    list-style-type: square;
}

.info-pane li {
    font-size: 0.95rem;
    color: var(--colour-text-secondary);
    line-height: 1.6;
    margin-bottom: 0.6rem;
}

.info-pane cite {
    font-size: 0.75rem;
    color: var(--colour-text-muted);
    font-style: normal;
    background: #f1ede6;
    border: 1px solid var(--colour-border-subtle);
    padding: 0.05rem 0.25rem;
    border-radius: 3px;
    margin-left: 0.2rem;
    vertical-align: super;
}

/* Residential Focus Specifications Grid */
.residential-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.res-card {
    border-left: 2px solid var(--colour-border-subtle);
    padding-left: 1.2rem;
}

.res-card:hover {
    border-left-color: var(--colour-gold);
}

.res-card h4 {
    font-family: var(--font-subheading);
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--colour-gold-hover);
    margin-bottom: 0.3rem;
}

.res-card p {
    color: var(--colour-text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/*  - - Media/Monument Panel (Right)  - - */
.media-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.monument-card {
    background: #ffffff;
    border: 1px solid var(--colour-border-subtle);
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.monument-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    cursor: zoom-in;
    background: #f0ede8;
}

.monument-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.monument-img-wrapper:hover .monument-img {
    transform: scale(1.02);
}

.monument-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.2) 0%, transparent 40%);
    pointer-events: none;
}

.monument-zoom-badge {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--colour-border-subtle);
    color: var(--colour-text-primary);
    padding: 0.3rem;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.monument-img-wrapper:hover .monument-zoom-badge {
    opacity: 1;
}

.monument-body {
    padding: 1.2rem;
}

.monument-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--colour-text-primary);
    margin-bottom: 0.3rem;
}

.monument-desc {
    font-size: 0.85rem;
    color: var(--colour-text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.monument-citation {
    font-size: 0.75rem;
    color: var(--colour-text-muted);
    border-top: 1px solid var(--colour-border-subtle);
    padding-top: 0.8rem;
}

.monument-citation a {
    color: var(--colour-gold);
    text-decoration: none;
    font-weight: 500;
}

.monument-citation a:hover {
    text-decoration: underline;
}

/* Quick Spec Cards */
.spec-mini-card {
    background: #ffffff;
    border: 1px solid var(--colour-border-subtle);
    border-radius: 0;
    padding: 1.2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.spec-mini-card h4 {
    font-family: var(--font-subheading);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--colour-text-secondary);
    margin-bottom: 0.6rem;
}

.spec-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.spec-tag {
    background: rgba(0, 119, 182, 0.06);
    border: 1px solid rgba(0, 119, 182, 0.12);
    color: var(--colour-blue);
    font-size: 0.85rem;
    padding: 0.3rem 0.7rem;
    border-radius: 0;
    font-weight: 500;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.spec-tag:hover {
    background: rgba(0, 119, 182, 0.12);
    border-color: var(--colour-blue);
}

/* Navigation Controls (Implied / Haute Couture style: PREVIOUS ————— NEXT) */
.nav-arrows {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.nav-arrow-btn {
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--colour-text-secondary);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: color var(--transition-fast);
    padding: 0;
    flex: none;
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-arrow-btn#prev-btn::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 1px;
    background-color: var(--colour-text-secondary);
    opacity: 0.4;
    margin-left: 1.5rem;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.nav-arrow-btn:hover:not(:disabled) {
    color: var(--colour-text-primary);
    background: transparent;
}

.nav-arrow-btn#prev-btn:hover:not(:disabled)::after {
    opacity: 0.8;
}

.nav-arrow-btn:disabled {
    color: var(--colour-text-muted);
    opacity: 0.3;
    cursor: not-allowed;
    box-shadow: none;
}


/* ==========================================================================
   TAB: SIDE-BY-SIDE COMPARISON
   ========================================================================== */
.comparison-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
}

/* Comparison Selector Header */
.comparison-selectors {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    gap: 1.5rem;
    align-items: center;
    background: var(--colour-bg-card);
    border: 1px solid var(--colour-border-subtle);
    padding: 1.2rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-subtle);
}

.comp-select-col {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.comp-select-col label {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--colour-text-secondary);
}

.comp-dropdown {
    background: var(--colour-bg-base);
    border: 1px solid var(--colour-border-subtle);
    color: var(--colour-text-primary);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    width: 100%;
}

.comp-dropdown:focus {
    outline: none;
    border-color: var(--colour-text-primary);
}

.comp-vs-badge {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--colour-terracotta);
    text-align: center;
}

/* Comparison Table / Matrix Grid */
.comparison-matrix {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.comp-pane {
    background: var(--colour-bg-card);
    border: 1px solid var(--colour-border-subtle);
    border-radius: var(--radius-md);
    padding: 2.2rem;
    box-shadow: var(--shadow-subtle);
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.comp-pane-header {
    border-bottom: 1px solid var(--colour-border-subtle);
    padding-bottom: 1rem;
}

.comp-pane-header .era-badge {
    margin-bottom: 0.4rem;
}

.comp-pane-header h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--colour-text-primary);
}

.comp-pane-dates {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--colour-gold);
    margin-top: 0.1rem;
}

.comp-monument-strip {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 1rem;
    background: #fcfbfa;
    border: 1px solid var(--colour-border-subtle);
    border-radius: var(--radius-md);
    padding: 0.6rem;
    align-items: center;
}

.comp-monument-img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.comp-monument-body h5 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--colour-text-primary);
}

.comp-monument-body p {
    font-size: 0.78rem;
    color: var(--colour-text-secondary);
    line-height: 1.3;
}

.comp-section {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.comp-section h4 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--colour-gold-hover);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.comp-section p {
    font-size: 0.92rem;
    color: var(--colour-text-secondary);
    line-height: 1.6;
}


/* ==========================================================================
   TAB: BIBLIOGRAPHY VIEW
   ========================================================================== */
.bibliography-layout {
    background: var(--colour-bg-card);
    border: 1px solid var(--colour-border-subtle);
    border-radius: var(--radius-md);
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-subtle);
    width: 100%;
}

.bib-header {
    border-bottom: 1px solid var(--colour-border-subtle);
    padding-bottom: 1.2rem;
    margin-bottom: 2rem;
}

.bib-header h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--colour-text-primary);
}

.bib-header p {
    color: var(--colour-text-secondary);
    font-size: 0.92rem;
    margin-top: 0.2rem;
}

.bib-section {
    margin-bottom: 2.2rem;
}

.bib-section h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--colour-text-primary);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--colour-border-subtle);
    padding-bottom: 0.3rem;
}

.bib-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bib-entry {
    padding-left: 2rem;
    text-indent: -2rem; /* Hanging indent */
    color: var(--colour-text-secondary);
    font-size: 0.92rem;
    line-height: 1.6;
}

.bib-entry a {
    color: var(--colour-gold);
    text-decoration: none;
    word-break: break-all;
}

.bib-entry a:hover {
    text-decoration: underline;
}

.bib-era-tag {
    font-weight: 700;
    color: var(--colour-terracotta);
    margin-right: 0.4rem;
    text-indent: 0;
}


/* ==========================================================================
   LIGHTBOX MODAL SYSTEM
   ========================================================================== */
.lightbox-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30, 37, 48, 0.95); /* Deep translucent slate to display photos best */
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.lightbox-modal.active {
    display: flex;
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 2.2rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-fast);
    z-index: 1010;
}

.lightbox-close:hover {
    color: #fff;
    transform: scale(1.05);
}

.lightbox-content {
    max-width: 85%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    position: relative;
}

.lightbox-img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.lightbox-caption {
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    font-size: 0.88rem;
    max-width: 550px;
    line-height: 1.4;
}

.lightbox-caption strong {
    color: #fff;
}


/* ==========================================================================
   RESPONSIVE STYLING (MEDIA QUERIES)
   ========================================================================== */

/*  - - Tablet Mode  - - */
@media (max-width: 1024px) {
    .chronology-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .timeline-sidebar {
        max-height: none;
        position: relative;
        top: 0;
        margin-bottom: 1rem;
        width: 100%;
    }
    
    .timeline-list {
        display: block;
        overflow-x: visible;
        padding-left: 0;
        padding-bottom: 0;
    }
    
    .timeline-list::before {
        display: block !important;
        content: '';
        position: absolute;
        left: 112px;
        top: 10px;
        bottom: 10px;
        width: 8px;
        border-left: 1.5px solid var(--colour-border-subtle);
        background: repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 5px,
            var(--colour-border-subtle) 5px,
            var(--colour-border-subtle) 6px,
            transparent 6px,
            transparent 10px
        );
        z-index: 1;
    }
    
    .timeline-item {
        display: grid !important;
        grid-template-columns: 100px 25px 1fr;
        align-items: center;
        gap: 0;
        padding: 0.8rem 0.5rem;
        margin-bottom: 0.3rem;
        border: 1px solid transparent;
        border-radius: var(--radius-sm);
        transition: background var(--transition-fast);
        background: transparent;
    }
    
    .timeline-item:hover {
        background: rgba(0, 0, 0, 0.02);
    }
    
    .timeline-item.active {
        background: #fbfbf9;
        border-left: 3px solid var(--colour-blue);
        box-shadow: inset 2px 0 0 var(--colour-blue);
    }

    .timeline-item.active-expanded {
        background: #fbfbf9;
        border: 1px solid var(--colour-border-subtle);
        border-left: 3px solid var(--colour-blue);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    }
    
    .viewer-content {
        display: none !important; /* Hide separate details section on mobile */
    }
    
    .comparison-matrix {
        grid-template-columns: 1fr;
    }

    /* Mobile details container styling */
    .mobile-era-details-container {
        display: grid; /* Grid container for 0fr to 1fr height animation */
        grid-template-rows: 0fr;
        grid-column: 1 / -1; /* Spans all columns of the timeline-item grid */
        padding: 0 0.5rem; /* No padding when collapsed */
        margin-top: 0;
        border-top: 1.5px solid transparent;
        background: #fbfbf9;
        text-align: left;
        cursor: default; /* Disable click cursor pointer inside content */
        position: relative;
        z-index: 10; /* Stack on top of absolute parent timeline ruler line */
        overflow: hidden;
        transition: grid-template-rows 0.4s cubic-bezier(0.25, 1, 0.5, 1), 
                    padding 0.4s cubic-bezier(0.25, 1, 0.5, 1), 
                    margin-top 0.4s cubic-bezier(0.25, 1, 0.5, 1), 
                    border-top-color 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    }

    .timeline-item.active-expanded .mobile-era-details-container {
        grid-template-rows: 1fr;
        padding: 1.5rem 0.5rem;
        margin-top: 1rem;
        border-top-color: var(--colour-border-subtle);
    }

    .mobile-era-details-container * {
        cursor: auto; /* Restore normal cursors inside content */
    }

    .mobile-details-content {
        display: flex;
        flex-direction: column;
        gap: 1.8rem;
        min-height: 0; /* Required for CSS grid 0fr -> 1fr animation */
        overflow: hidden; /* Required for animation to render clean */
    }

    .mobile-dates-badge {
        display: inline-block;
        background: var(--colour-gold);
        color: var(--colour-text-primary);
        padding: 0.3rem 0.8rem;
        font-size: 0.85rem;
        font-family: var(--font-heading);
        font-weight: 600;
        width: fit-content;
    }

    .mobile-narrative-section h4,
    .mobile-residential-section h4,
    .mobile-materials-section h4,
    .mobile-monument-card h4 {
        font-family: var(--font-heading);
        color: var(--colour-text-primary);
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
        border-left: 3px solid var(--colour-gold);
        padding-left: 0.6rem;
    }

    .mobile-context-text {
        font-size: 0.95rem;
        color: var(--colour-text-secondary);
        line-height: 1.6;
    }

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

    .mobile-residential-list {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .mobile-res-item {
        background: #ffffff;
        border: 1px solid var(--colour-border-subtle);
        padding: 1rem;
    }

    .mobile-res-item strong {
        display: block;
        color: var(--colour-terracotta);
        font-family: var(--font-heading);
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }

    .mobile-res-item span {
        font-size: 0.9rem;
        color: var(--colour-text-secondary);
        line-height: 1.5;
    }

    /* Mobile Monument Showcase */
    .mobile-monument-card {
        background: #ffffff;
        border: 1px solid var(--colour-border-subtle);
        padding: 1.2rem;
    }

    .mobile-monument-img-wrapper {
        position: relative;
        width: 100%;
        margin: 1rem 0;
        cursor: zoom-in;
        overflow: hidden;
    }

    .mobile-monument-img {
        width: 100%;
        height: auto;
        object-fit: cover;
        display: block;
    }

    .mobile-monument-body {
        margin-top: 0.8rem;
    }

    .mobile-monument-title {
        font-family: var(--font-heading);
        font-size: 1rem;
        color: var(--colour-text-primary);
        margin-bottom: 0.4rem;
    }

    .mobile-monument-desc {
        font-size: 0.88rem;
        color: var(--colour-text-secondary);
        line-height: 1.5;
    }

    .mobile-materials-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/*  - - Mobile Mode  - - */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .title-group {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .title-group h1 {
        font-size: 1.7rem !important; /* Fits completely on a single line on mobile */
    }
    
    .title-group p {
        max-width: 100% !important;
        margin-right: 0 !important;
    }
    
    .mode-switcher {
        width: 100%;
        flex-wrap: wrap; /* Wrap buttons on mobile */
        justify-content: center;
        gap: 0.5rem;
    }
    
    .mode-btn {
        flex: none;
        font-size: 0.72rem;
        letter-spacing: 0.08em;
        padding: 0.4rem 0.8rem;
        border: 1px solid var(--colour-border-subtle);
        border-radius: 4px;
        background: rgba(0, 0, 0, 0.02);
    }

    .mode-btn.active {
        border-color: var(--colour-gold);
        background: rgba(197, 168, 109, 0.05);
    }

    /* Reorder tabs on mobile: Gallery after Site */
    #btn-mode-chronology { order: 1; }
    #btn-mode-site { order: 2; }
    #btn-mode-gallery { order: 3; }
    #btn-mode-design { order: 4; }
    #btn-mode-bibliography { order: 5; }
    
    .app-container {
        padding: 1.5rem 1rem;
    }
    
    .viewer-content {
        grid-template-columns: 1fr;
    }
    
    .media-panel {
        grid-template-columns: 1fr;
    }
    
    .info-panel {
        padding: 1.5rem;
    }
    
    .era-title {
        font-size: 1.4rem;
    }
    
    .comparison-selectors {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        text-align: center;
    }
    
    .comp-vs-badge {
        order: -1;
        margin: 0.3rem 0;
    }
    
    .lightbox-close {
        top: 1rem;
        right: 1rem;
    }

    /* Layout padding adjustments for mobile screens */
    .site-layout,
    .bibliography-layout {
        padding: 1.5rem 1rem;
    }

    .design-layout {
        padding: 1.5rem 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .intro-scope-card,
    .design-notes-box,
    .design-thesis-box {
        padding: 1.2rem 1rem !important;
        margin-left: -1rem !important;
        margin-right: -1rem !important;
        width: calc(100% + 2rem) !important;
        border-left: none !important;
        border-right: none !important;
        border-radius: 0 !important;
        box-sizing: border-box !important;
    }

    .intro-scope-card {
        margin-bottom: 2.2rem !important;
    }

    .design-notes-box {
        margin-top: 1.5rem !important;
    }

    .design-thesis-box {
        margin-bottom: 2.2rem !important;
    }

    /* Checklist columns wrapper for mobile screens */
    .checklist-items {
        grid-template-columns: 1fr;
    }

    /* Gallery grid responsiveness */
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1.2rem;
    }
}

/* ==========================================================================
   COVER PAGE / SPLASH SCREEN (SPLIT DESIGN)
   ========================================================================== */
.cover-page {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background-image: url('assets/cream_paper_texture.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: stretch;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 1.2s;
    overflow: hidden;
}

.cover-left-panel {
    flex: 1;
    height: 100vh;
    overflow: hidden;
    position: relative;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0; /* Remove padding to let the image fit full screen height */
}

.cover-arches-img {
    width: auto; /* Scale width proportionally */
    height: 100%; /* Stretch from top to bottom of screen */
    object-fit: contain; /* Fit fully without any cropping */
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 1.8s cubic-bezier(0.16, 1, 0.3, 1), transform 2.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.cover-page.text-visible .cover-arches-img {
    opacity: 1;
    transform: scale(1);
}

.cover-right-panel {
    flex: 1;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Align content to the left (closer to the image) */
    position: relative;
    padding: 3rem 2rem 3rem 1.5rem; /* Reduced left padding to shift text leftward */
}

.cover-content {
    position: relative;
    z-index: 4;
    text-align: left;
    max-width: 700px; /* Increased to allow 'Reclaiming the Sun' to fit on one line */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
}

.cover-title {
    font-family: var(--font-heading);
    font-size: 3.8rem;
    font-weight: 300;
    color: var(--colour-text-primary);
    letter-spacing: -0.01em;
    line-height: 1.1;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cover-subtitle {
    font-size: 1.35rem;
    color: var(--colour-text-secondary);
    font-family: var(--font-subheading);
    font-style: italic;
    font-weight: 400;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-explore {
    background: transparent;
    border: none;
    border-bottom: 1.5px solid #12100f;
    color: var(--colour-text-primary);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    padding: 0.6rem 0.2rem;
    border-radius: 0;
    cursor: pointer;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), border-color var(--transition-fast), color var(--transition-fast);
    box-shadow: none;
}

.btn-explore:hover {
    background: transparent;
    color: var(--colour-blue);
    border-color: var(--colour-blue);
}

/* Animations active states triggered sequentially by JS */
.cover-page.text-visible .cover-title {
    opacity: 1;
    transform: translateY(0);
}

.cover-page.text-visible .cover-subtitle {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

.cover-page.btn-visible .btn-explore {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive adjustment for cover page */
@media (max-width: 768px) {
    .cover-page {
        flex-direction: column;
        overflow: hidden;
    }
    .cover-left-panel {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
        flex: none;
        padding: 0;
    }
    .cover-arches-img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* Fill the full screen */
        filter: brightness(0.65); /* Make it exactly 35% darker for better text contrast */
    }
    .cover-right-panel {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        z-index: 2;
        flex: none;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2rem 1.2rem; /* Reduced horizontal padding to allow more text width */
        background: transparent;
    }
    .cover-content {
        align-items: center;
        text-align: center;
        max-width: 100%;
        gap: 2rem;
    }
    .cover-title {
        font-size: 1.85rem !important; /* Guarantee title fits on exactly one line on mobile screen */
        color: #ffffff !important;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    }
    .cover-subtitle {
        font-size: 0.88rem !important; /* Guarantee subtitle fits on exactly two lines on mobile screen */
        line-height: 1.45;
        color: rgba(255, 255, 255, 0.9) !important;
        text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
    }
    .btn-explore {
        align-self: center;
        color: #ffffff !important;
        border-bottom-color: #ffffff !important;
        text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
    }
    .btn-explore:hover {
        color: var(--colour-gold) !important;
        border-bottom-color: var(--colour-gold) !important;
    }
}

/* ==========================================================================
   LIGHTBOX NAVIGATION & DOTS
   ========================================================================== */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition-fast);
    z-index: 1010;
    user-select: none;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: #ffffff;
    transform: translateY(-50%) scale(1.05);
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

.lightbox-index {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    font-family: var(--font-heading);
    letter-spacing: 0.1em;
    margin-top: 0.5rem;
}

/* Main page card: multiple image badge indicator */
.monument-img-wrapper {
    position: relative;
}

.monument-img-count-badge {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(30, 37, 48, 0.75);
    backdrop-filter: blur(4px);
    color: #ffffff;
    padding: 0.35rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: 0.05em;
    z-index: 5;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .lightbox-nav {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    
    .lightbox-prev {
        left: 0.5rem;
    }
    
    .lightbox-next {
        right: 0.5rem;
    }
}

/* Collapsable Accordion System (Modern Maximalist) */
.site-details {
    border: 1px solid var(--colour-border-subtle);
    border-radius: 0;
    background: #ffffff;
    margin-bottom: 1.2rem;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.site-details:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
}

.site-details[open] {
    border-color: var(--colour-blue);
    background: #ffffff;
}

.site-summary {
    font-family: var(--font-subheading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--colour-terracotta);
    padding: 1.1rem 1.4rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    user-select: none;
    border-bottom: 1px solid transparent;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.site-summary::-webkit-details-marker,
.sub-summary::-webkit-details-marker {
    display: none;
}

.site-details[open] > .site-summary {
    border-bottom-color: var(--colour-border-subtle);
    background: #fafafa;
}

.site-summary::after {
    content: "\25BC\FE0E"; /* Forces text style instead of colored emoji on mobile */
    font-size: 0.8rem;
    color: var(--colour-gold-hover);
    transition: transform var(--transition-fast);
}

.site-details[open] > .site-summary::after {
    transform: rotate(-180deg);
}

.site-content {
    padding: 1.2rem 1.2rem 0.2rem 1.2rem;
}

/* Sub-sections collapsable details */
.sub-details {
    margin-bottom: 1rem;
    border-left: 2px solid var(--colour-border-subtle);
    padding-left: 1rem;
    transition: border-color var(--transition-fast);
}

.sub-details[open] {
    border-left-color: var(--colour-gold);
}

.sub-summary {
    font-family: var(--font-subheading);
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--colour-text-primary);
    padding: 0.4rem 0;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    user-select: none;
}

.sub-summary::before {
    content: "\25B6\FE0E"; /* Forces text style instead of colored emoji on mobile */
    font-size: 0.7rem;
    color: var(--colour-gold-hover);
    transition: transform var(--transition-fast);
    display: inline-block;
}

.sub-details[open] > .sub-summary::before {
    transform: rotate(90deg);
}



/* ==========================================================================
   VERTICAL TIMELINE TAB
   ========================================================================== */
.timeline-view-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2.5rem 1rem;
}

.timeline-header {
    text-align: center;
    margin-bottom: 4rem;
}

.timeline-header h2 {
    font-family: var(--font-heading);
    color: var(--colour-terracotta);
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.6rem;
}

.timeline-header p {
    color: var(--colour-text-secondary);
    font-size: 1.05rem;
}



/* ==========================================================================
   TAB: GALLERY STYLES
   ========================================================================== */
.gallery-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 0;
}

.gallery-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--colour-border-subtle);
    padding-bottom: 1.2rem;
}

.gallery-header h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--colour-text-primary);
    margin-bottom: 0.5rem;
}

.gallery-header p {
    font-size: 0.95rem;
    color: var(--colour-text-secondary);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.8rem;
}

.gallery-card {
    background: var(--colour-bg-card);
    border: 1px solid var(--colour-border-subtle);
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    transition: background var(--transition-normal), border-color var(--transition-normal), transform var(--transition-normal), box-shadow var(--transition-normal);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    background: #ffffff;
    border-color: var(--colour-blue);
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 119, 182, 0.12);
}

.gallery-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #eae7e0;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(80%); /* Soft color style by default */
    transition: filter var(--transition-normal), transform var(--transition-normal);
}

.gallery-card:hover .gallery-img {
    filter: grayscale(0%);
    transform: scale(1.03);
}

.gallery-card-badge {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    background: rgba(18, 18, 18, 0.85);
    color: #ffffff;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 0;
    font-weight: 500;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: background var(--transition-normal), color var(--transition-normal), border-color var(--transition-normal);
}

.gallery-card:hover .gallery-card-badge {
    background: var(--colour-blue);
    color: #ffffff;
    border-color: var(--colour-blue);
}

.gallery-card-zoom {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--colour-border-subtle);
    color: var(--colour-text-primary);
    padding: 0.3rem;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.gallery-card:hover .gallery-card-zoom {
    opacity: 1;
    transform: scale(1);
}

.gallery-card-body {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.gallery-card-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--colour-text-primary);
    margin-bottom: 0.3rem;
    line-height: 1.4;
    transition: color var(--transition-normal);
}

.gallery-card:hover .gallery-card-title {
    color: var(--colour-blue);
}

.gallery-card-era {
    font-family: var(--font-subheading);
    font-size: 0.75rem;
    color: var(--colour-terracotta);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color var(--transition-normal);
}

.gallery-card:hover .gallery-card-era {
    color: var(--colour-terracotta);
}

.gallery-card-desc {
    font-size: 0.82rem;
    color: var(--colour-text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
    flex-grow: 1;
    transition: color var(--transition-normal);
}

.gallery-card:hover .gallery-card-desc {
    color: var(--colour-text-secondary);
}

.gallery-card-footer {
    font-size: 0.72rem;
    color: var(--colour-text-muted);
    border-top: 1px solid var(--colour-border-subtle);
    padding-top: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==========================================================================
   TAB: SITE ANALYSIS
   ========================================================================== */
.site-layout {
    background: var(--colour-bg-card);
    border: 1px solid var(--colour-border-subtle);
    border-radius: var(--radius-md);
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-subtle);
    width: 100%;
}

.site-header {
    border-bottom: 1px solid var(--colour-border-subtle);
    padding-bottom: 1.2rem;
    margin-bottom: 2rem;
}

.site-header h2 {
    font-family: var(--font-heading);
    color: var(--colour-text-primary);
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.site-header p {
    color: var(--colour-text-secondary);
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.6;
}

/* ==========================================================================
   TAB: DESIGN CONSIDERATIONS
   ========================================================================== */
.design-layout {
    background: var(--colour-bg-card);
    border: 1px solid var(--colour-border-subtle);
    border-radius: var(--radius-md);
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-subtle);
    width: 100%;
}

.design-header {
    border-bottom: 1px solid var(--colour-border-subtle);
    padding-bottom: 1.2rem;
    margin-bottom: 2.5rem;
}

.design-header h2 {
    font-family: var(--font-heading);
    color: var(--colour-text-primary);
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.design-header p {
    color: var(--colour-text-secondary);
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.6;
}

.design-main-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--colour-text-primary);
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.design-subtitle {
    font-size: 1rem;
    font-style: italic;
    color: var(--colour-text-secondary);
    line-height: 1.5;
    margin-top: 0.5rem;
}

/* Intro & Scope Card styling */
.intro-scope-card {
    background: rgba(0, 0, 0, 0.012);
    border: 1px solid var(--colour-border-subtle);
    border-radius: var(--radius-md);
    padding: 2.2rem;
    margin-bottom: 3.5rem;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.01);
}

.intro-scope-card .theme-title {
    font-family: var(--font-heading);
    color: var(--colour-text-primary);
    font-size: 1.6rem;
    margin-bottom: 1.2rem;
    border-bottom: 2px solid var(--colour-gold);
    display: inline-block;
    padding-bottom: 0.3rem;
}

.intro-scope-card p {
    font-family: var(--font-body);
    color: var(--colour-text-secondary);
    font-size: 0.98rem;
    line-height: 1.75;
    margin-bottom: 1.2rem;
}

.intro-scope-card p:last-child {
    margin-bottom: 0;
}

.intro-highlight {
    font-style: italic;
    border-left: 3.5px solid var(--colour-gold);
    padding-left: 1.2rem;
    color: var(--colour-text-primary) !important;
}

/* Thesis Callout Box */
.design-thesis-box {
    background: rgba(197, 168, 109, 0.05); /* very light gold tint */
    border-left: 4px solid var(--colour-gold);
    border-radius: var(--radius-sm);
    padding: 1.5rem 1.8rem;
    margin-bottom: 3rem;
}

.design-thesis-box h3 {
    font-family: var(--font-heading);
    color: var(--colour-text-primary);
    font-size: 1.25rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.design-thesis-box p {
    font-family: var(--font-body);
    color: var(--colour-text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.8rem;
}
.design-thesis-box p:last-child {
    margin-bottom: 0;
}

/* Sections & Grid */
.design-grid {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
}

.design-theme-card {
    border-bottom: 1px solid var(--colour-border-subtle);
    padding-bottom: 3rem;
}
.design-theme-card:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.design-theme-card h3.theme-title {
    font-family: var(--font-heading);
    color: var(--colour-text-primary);
    font-size: 1.6rem;
    margin-bottom: 1.2rem;
    border-bottom: 2px solid var(--colour-blue);
    display: inline-block;
    padding-bottom: 0.3rem;
}

.design-theme-card h4.theme-subtitle {
    font-family: var(--font-heading);
    color: var(--colour-text-primary);
    font-size: 1.2rem;
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
}

.design-theme-card p {
    font-family: var(--font-body);
    color: var(--colour-text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.2rem;
}

/* Design Notes Box */
.design-notes-box {
    background: rgba(0, 119, 182, 0.03); /* very light blue tint */
    border-left: 4px solid var(--colour-blue);
    border-radius: var(--radius-sm);
    padding: 1.5rem 1.8rem;
    margin-top: 2rem;
}

.design-notes-box h4 {
    font-family: var(--font-heading);
    color: var(--colour-blue);
    font-size: 1.15rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.design-notes-list {
    margin: 0;
    padding-left: 1.2rem;
    list-style-type: decimal;
}

.design-notes-list li {
    font-family: var(--font-body);
    color: var(--colour-text-secondary);
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 0.6rem;
}
.design-notes-list li:last-child {
    margin-bottom: 0;
}

/* Checklist Section */
.checklist-container {
    background: #fafafa;
    border: 1px solid var(--colour-border-subtle);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    margin-top: 2rem;
}

.checklist-container h3 {
    font-family: var(--font-heading);
    color: var(--colour-text-primary);
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
}

.checklist-group {
    margin-bottom: 2rem;
}
.checklist-group:last-child {
    margin-bottom: 0;
}

.checklist-group h4 {
    font-family: var(--font-heading);
    color: var(--colour-text-primary);
    font-size: 1.15rem;
    margin-bottom: 1rem;
    border-left: 3px solid var(--colour-gold);
    padding-left: 0.6rem;
}

.checklist-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1rem;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    background: var(--colour-bg-card);
    border: 1px solid var(--colour-border-subtle);
    padding: 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.checklist-item:hover {
    border-color: var(--colour-gold);
    transform: translateY(-1px);
}

.checklist-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--colour-border-subtle);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: transparent;
    flex-shrink: 0;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.checklist-checkbox svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: white;
    stroke-width: 3px;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.checklist-item.checked .checklist-checkbox {
    background: var(--colour-blue);
    border-color: var(--colour-blue);
}

.checklist-item.checked .checklist-checkbox svg {
    opacity: 1;
}

.checklist-text {
    font-family: var(--font-body);
    color: var(--colour-text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Source Register & Notes */
.sources-section {
    margin-top: 4rem;
}

.sources-section h3 {
    font-family: var(--font-heading);
    color: var(--colour-text-primary);
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
}

.source-tier-group {
    margin-bottom: 2rem;
}

.source-tier-group h4 {
    font-family: var(--font-heading);
    color: var(--colour-text-primary);
    font-size: 1.15rem;
    margin-bottom: 0.8rem;
}

.source-list {
    margin: 0;
    padding-left: 1.5rem;
}

.source-list li {
    font-family: var(--font-body);
    color: var(--colour-text-secondary);
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

/* Footnotes Section */
.footnotes-section {
    border-top: 1px solid var(--colour-border-subtle);
    padding-top: 2rem;
    margin-top: 4rem;
}

.footnotes-title {
    font-family: var(--font-heading);
    color: var(--colour-text-primary);
    font-size: 1.25rem;
    margin-bottom: 1.2rem;
    font-weight: 600;
}

.footnotes-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footnotes-list li {
    font-family: var(--font-body);
    color: var(--colour-text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 0.8rem;
    display: flex;
    gap: 0.5rem;
}

.footnotes-num {
    font-weight: 600;
    color: var(--colour-text-secondary);
    flex-shrink: 0;
    width: 20px;
}

/* Lightbox Slider Track & Swipe Styles */
.lightbox-slider-wrapper {
    overflow: hidden;
    width: 100%;
    max-width: 900px;
    position: relative;
    border-radius: var(--radius-sm);
    margin: 0 auto;
}

.lightbox-track {
    display: flex;
    width: 300%;
    flex-shrink: 0;
    transform: translateX(-33.3333%);
}

.lightbox-slide-img {
    width: 33.3333%;
    flex-shrink: 0;
    height: 70vh;
    max-height: 70vh;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}



/* Table of Contents Styles */
.toc-card {
    background: rgba(197, 168, 109, 0.04); /* very subtle gold/cream tint */
    border: 1px solid var(--colour-border-subtle);
    border-radius: var(--radius-md);
    padding: 1.8rem 2rem;
    margin-bottom: 3rem;
}

.toc-title {
    font-family: var(--font-heading);
    color: var(--colour-text-primary);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    letter-spacing: -0.01em;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem 1.5rem;
}

.toc-link {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--colour-blue);
    text-decoration: none;
    transition: color var(--transition-fast), border-bottom-color var(--transition-fast);
    border-bottom: 1px solid transparent;
}

.toc-link:hover {
    color: var(--colour-terracotta);
    border-bottom-color: var(--colour-terracotta);
}

@media (max-width: 768px) {
    .toc-card {
        padding: 1.2rem 1rem !important;
        margin-left: -1rem !important;
        margin-right: -1rem !important;
        width: calc(100% + 2rem) !important;
        border-left: none !important;
        border-right: none !important;
        border-radius: 0 !important;
        box-sizing: border-box !important;
        margin-bottom: 2.2rem !important;
    }
    
    .toc-list {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
}

/* Gallery mobile overrides at end of file to prevent base style cascade override */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.4rem !important;
    }

    .gallery-card {
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .gallery-img-wrapper {
        aspect-ratio: 1 / 1 !important;
        border-radius: 3px !important;
        overflow: hidden !important;
    }

    .gallery-img {
        filter: grayscale(0%) !important;
    }

    .gallery-card-body,
    .gallery-card-badge,
    .gallery-card-zoom {
        display: none !important;
    }

    /* Hide lightbox navigation arrows on mobile screen sizes so they do not block the image content */
    #lightbox-prev,
    #lightbox-next {
        display: none !important;
    }
}


