/* --- THEME VARIABLES --- */
:root {
    --vellum: #F2F0E9;        /* Warm Antique Paper */
    --ink: #1A1A1A;           /* Soft Black */
    --oxblood: #781C1C;       /* Sealing Wax Red */
    --gold-thread: #BFA978;   /* Muted Metallic */
    --line-color: rgba(26, 26, 26, 0.15);

    --font-head: 'Cinzel', serif;
    --font-body: 'EB Garamond', serif;
}

/* --- RESET & BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* Skip to content link for accessibility */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--oxblood);
    color: var(--vellum);
    padding: 8px 16px;
    text-decoration: none;
    z-index: 1000;
    font-family: var(--font-head);
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    transition: top 0.3s;
}

.skip-to-content:focus {
    top: 0;
    outline: 3px solid var(--gold-thread);
    outline-offset: 2px;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--vellum);
    color: var(--ink);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: 0.3s ease; }
ul { list-style: none; }
img { display: block; width: 100%; }

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4, h5 {
    font-family: var(--font-head);
    font-weight: 400;
    text-transform: uppercase;
}

.display-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.2;
    letter-spacing: 0.02em;
    margin-bottom: 30px;
    color: var(--ink);
}

.section-marker {
    font-family: var(--font-head);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: var(--oxblood);
    text-transform: uppercase;
    display: block;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--oxblood);
    padding-bottom: 10px;
    width: fit-content;
}

.lead-paragraph {
    font-size: 1.3rem;
    line-height: 1.6;
    max-width: 95%;
    margin-bottom: 30px;
    color: #222; /* Improved contrast from #333 */
    font-weight: 500;
    text-align: justify;
}

.body-text {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #2a2a2a; /* Improved contrast from #444 */
    text-align: justify;
}

.meta-data {
    font-family: var(--font-head);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: #3a3a3a;
    text-transform: uppercase;
}

/* --- LAYOUT ARCHITECTURE (Split Screen) --- */
.chancery-layout {
    display: grid;
    grid-template-columns: 350px 1fr; /* Fixed Sidebar | Fluid Content */
    min-height: 100vh;
}

/* --- THE FIXED SIDEBAR (Identity) --- */
.sidebar-panel {
    background: var(--ink);
    color: var(--vellum);
    height: 100vh;
    position: sticky;
    top: 0;
    padding: 50px 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 4px double var(--gold-thread);
    z-index: 100;
    overflow-y: auto; /* Allow scrolling if menu is tall */
}

.brand-block {
    border-bottom: 1px solid rgba(242, 240, 233, 0.2);
    padding-bottom: 30px;
}

/* Logo Container */
.brand-logo {
    width: 100%;
    max-width: 280px;
    margin: 0 auto 25px auto;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.brand-logo img {
    width: 100%;
    height: auto;
    display: block;
    filter: brightness(0) invert(1); /* Make logo white on dark sidebar */
    transition: filter 0.3s ease;
}

.brand-logo:hover img {
    filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(191, 169, 120, 0.4));
}

.brand-sub {
    font-family: var(--font-head);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--gold-thread);
    margin-bottom: 15px;
    display: block;
    text-align: center;
}

.brand-main {
    font-size: 2rem;
    line-height: 1.1;
    letter-spacing: 0.05em;
}

.nav-vertical {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.nav-item {
    font-family: var(--font-head);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    color: rgba(242, 240, 233, 0.6);
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-item::before {
    content: '';
    width: 0px; height: 1px;
    background: var(--gold-thread);
    transition: 0.3s;
}

.nav-item:hover,
.nav-item:focus {
    color: var(--vellum);
    outline: 2px solid var(--gold-thread);
    outline-offset: 4px;
}

.nav-item:hover::before,
.nav-item:focus::before {
    width: 15px;
}

.nav-item.active {
    color: var(--gold-thread);
}

.nav-item.active::before {
    width: 15px;
}

.sidebar-footer {
    font-family: var(--font-head);
    font-size: 0.7rem;
    opacity: 0.4;
    letter-spacing: 0.1em;
    margin-top: 40px;
}

/* --- THE SCROLLING CONTENT --- */
.content-panel {
    background: var(--vellum);
    width: 100%;
}

/* --- HERO HEADER --- */
.hero-header {
    min-height: 90vh;
    display: flex;
    align-items: center;
    padding: 80px;
    border-bottom: 1px solid var(--line-color);
    position: relative;
    background-image: radial-gradient(var(--line-color) 1px, transparent 0);
    background-size: 40px 40px; /* Dot grid pattern */
}

.hero-overlay {
    background: rgba(242, 240, 233, 0.9);
    padding: 40px;
    border: 1px solid var(--line-color);
    max-width: 900px;
}

.scroll-hint {
    position: absolute;
    bottom: 40px; right: 80px;
    font-family: var(--font-head);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--oxblood);
    writing-mode: vertical-rl;
}

/* --- CONTENT SECTIONS --- */
.section-wrapper {
    display: grid;
    grid-template-columns: 60px 1fr; /* Vertical Label | Content */
    border-bottom: 1px solid var(--line-color);
}

.vertical-label {
    border-right: 1px solid var(--line-color);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    padding: 40px 0;
    text-align: center;
    font-family: var(--font-head);
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    background: rgba(0,0,0,0.02);
    color: var(--oxblood);
    height: auto;
}

.section-inner {
    padding: 80px 60px;
}

/* --- THE DOCKET (Grid) --- */
.docket-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.docket-card {
    border: 1px solid var(--line-color);
    background: #fff;
    padding: 30px;
    box-shadow: 10px 10px 0px rgba(0,0,0,0.05); /* Architectural shadow */
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.docket-card:hover {
    transform: translateY(-5px);
    box-shadow: 15px 15px 0px var(--oxblood);
    border-color: var(--ink);
}

.card-type {
    font-family: var(--font-head);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--oxblood);
    margin-bottom: 15px;
    display: block;
}

.card-title {
    font-size: 1.4rem;
    line-height: 1.2;
    margin-bottom: 15px;
    font-weight: 500;
}

.card-excerpt {
    font-size: 1rem;
    color: #3a3a3a; /* Improved contrast from #555 */
    margin-bottom: 30px;
    text-align: justify;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    font-family: var(--font-head);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 6px 12px;
    border: 1px solid var(--ink);
    color: var(--ink);
    background: transparent;
    margin-bottom: 12px;
}

.status-badge.ongoing {
    border-color: var(--gold-thread);
    color: var(--gold-thread);
}

.status-badge.completed {
    border-color: var(--oxblood);
    color: var(--oxblood);
}

.btn-link {
    font-family: var(--font-head);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--ink);
    padding-bottom: 3px;
    text-transform: uppercase;
    width: fit-content;
}

/* --- PUBLICATION LIST --- */
.pub-list {
    list-style: none;
    margin-top: 30px;
}
.pub-item {
    padding: 22px 0;
    border-bottom: 1px solid var(--line-color);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 15px;
    line-height: 1.5;
}
.pub-date {
    font-family: var(--font-head);
    font-size: 0.8rem;
    color: var(--oxblood);
    min-width: 100px;
}
.pub-title {
    font-weight: 600;
    font-size: 1.1rem;
    flex-grow: 1;
}

.pub-link {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.pub-link:hover {
    color: var(--oxblood);
    border-bottom-color: var(--oxblood);
}

.pub-source {
    font-style: italic;
    color: #3a3a3a;
}

/* --- EDITORIAL TEAM BOX --- */
.editorial-box {
    background: #fff;
    border: 1px solid var(--line-color);
    padding: 40px;
    margin-top: 40px;
}
.team-grid-text {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 20px;
}
.team-list-group h5 {
    font-size: 0.9rem;
    color: var(--oxblood);
    margin-bottom: 10px;
    letter-spacing: 0.1em;
}
.team-list-group ul {
    list-style: none;
    font-size: 0.95rem;
    color: #2a2a2a; /* Improved contrast from #444 */
}
.team-list-group li { margin-bottom: 5px; }

/* --- PORTRAITS --- */
.portrait-layout {
    display: flex;
    gap: 40px;
}

.portrait-box {
    width: 50%;
}

.img-frame {
    width: 100%;
    height: 400px;
    border: 1px solid var(--ink);
    padding: 10px;
    margin-bottom: 25px;
}

.img-frame img {
    width: 100%; height: 100%;
    object-fit: contain; /* Changed from cover to contain - shows full image without cropping */
    filter: grayscale(100%) sepia(10%);
    transition: 0.5s;
}

.portrait-box:hover img { filter: grayscale(0%); }

.person-name {
    font-size: 1.8rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.person-role {
    font-family: var(--font-head);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--gold-thread);
    text-transform: uppercase;
}

.person-bio {
    margin-top: 15px;
    color: #3a3a3a; /* Improved contrast from #555 */
    font-size: 0.95rem;
    text-align: justify;
}

/* --- TEAM MEMBERS --- */
.team-members-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-top: 40px;
}

.team-category {
    border-left: 2px solid var(--gold-thread);
    padding-left: 30px;
}

.team-member-list {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
}

.team-member-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--line-color);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.team-member-item:last-child {
    border-bottom: none;
}

.member-name {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--ink);
}

.member-role {
    font-family: var(--font-head);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--oxblood);
    text-transform: uppercase;
}

/* --- FOOTER --- */
.footer-simple {
    padding: 80px 40px;
    background: var(--ink);
    color: var(--vellum);
    text-align: center;
}

.footer-seal {
    font-family: var(--font-head);
    font-size: 3rem;
    margin-bottom: 30px;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-family: var(--font-head);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    flex-wrap: wrap;
}

.footer-nav a:hover { color: var(--gold-thread); }

.footer-address {
    opacity: 0.5;
    font-size: 0.9rem;
    margin-top: 30px;
}

.map-container {
    margin: 40px auto;
    max-width: 800px;
    border: 1px solid var(--gold-thread);
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
}

.map-container iframe {
    display: block;
    width: 100%;
}

.footer-copyright {
    opacity: 0.3;
    font-size: 0.7rem;
    margin-top: 20px;
}

/* --- UTILITY CLASSES --- */
.text-oxblood { color: var(--oxblood); }
.text-gold { color: var(--gold-thread); }

.hero-intro {
    font-size: 1.1rem;
    max-width: 600px;
    text-align: left; /* Short hero text should not be justified */
}

.meta-data-row {
    display: flex;
    gap: 40px;
    margin-top: 50px;
    border-top: 1px solid var(--line-color);
    padding-top: 30px;
    flex-wrap: wrap;
}

.focus-area-title {
    font-size: 1.3rem;
    margin-top: 5px;
}

.journal-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.journal-intro {
    font-size: 1.2rem;
}

.guidelines-box {
    background: white;
    border: 1px solid var(--line-color);
    padding: 40px;
    margin-top: 40px;
}

.guidelines-title {
    color: var(--oxblood);
    margin-bottom: 20px;
}

.guidelines-list {
    list-style-type: none;
    padding-left: 0;
    color: #2a2a2a;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.8;
}

.submit-section {
    margin-top: 30px;
}

.editor-subtitle {
    margin-top: 20px;
}

.research-intro {
    margin-bottom: 40px;
}

.section-heading {
    margin-bottom: 20px;
}

.section-heading-spaced {
    margin-bottom: 20px;
    margin-top: 40px;
}

.project-box {
    background: white;
    border: 1px solid var(--line-color);
    padding: 30px;
    margin-bottom: 50px;
}

.program-box {
    background: var(--ink);
    color: var(--vellum);
    padding: 50px;
}

.program-title {
    font-size: 2rem;
    color: var(--gold-thread);
    margin-bottom: 20px;
}

.program-intro {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.program-section-title {
    color: var(--gold-thread);
    margin-bottom: 15px;
}

.program-list {
    list-style: none;
    margin-bottom: 30px;
    opacity: 0.8;
    font-family: var(--font-head);
    font-size: 0.9rem;
}

.program-list li {
    margin-bottom: 10px;
}

.btn-link-light {
    border-color: var(--vellum);
}

/* --- MOBILE OPTIMIZATION (BREAKPOINT: 1024px) --- */
@media (max-width: 1024px) {

    /* Reset Grid to Stack */
    .chancery-layout {
        display: block; /* No grid on mobile */
    }

    /* Sidebar becomes Top Header */
    .sidebar-panel {
        height: auto;
        position: relative;
        width: 100%;
        border-right: none;
        border-bottom: 4px double var(--gold-thread);
        padding: 40px 20px;
        text-align: center;
        overflow: visible;
    }

    .brand-block {
        border-bottom: none;
        padding-bottom: 10px;
    }

    /* Logo responsive sizing */
    .brand-logo {
        max-width: 240px;
        margin: 0 auto 20px auto;
    }

    .brand-main { font-size: 1.8rem; }

    /* Nav becomes Horizontal Row */
    .nav-vertical {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        margin-top: 20px;
    }

    .nav-item {
        font-size: 0.8rem;
        padding: 12px 16px; /* Increase touch target to 44px+ */
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        border-radius: 4px;
        transition: background 0.2s;
    }

    .nav-item:hover,
    .nav-item:focus {
        background: rgba(242, 240, 233, 0.1);
        outline: 2px solid var(--gold-thread);
        outline-offset: 2px;
    }

    .sidebar-footer { display: none; } /* Hide footer metadata to save space */

    /* Hero Adjustments */
    .hero-header {
        height: auto;
        min-height: 60vh;
        padding: 60px 20px;
        text-align: center;
    }
    .hero-overlay { padding: 20px; }

    .display-title { font-size: 1.8rem; }
    .section-marker { margin: 0 auto 20px auto; }
    .scroll-hint { display: none; }

    /* Content Sections */
    .section-wrapper {
        display: block; /* Stack label on top of content */
        border-bottom: 1px solid var(--line-color);
    }

    /* Convert Vertical Label to Horizontal Banner */
    .vertical-label {
        writing-mode: horizontal-tb;
        transform: none;
        border-right: none;
        border-bottom: 1px solid var(--line-color);
        width: 100%;
        padding: 15px 0;
        height: auto;
        display: block;
    }

    .section-inner {
        padding: 50px 20px; /* Reduced side padding */
    }

    /* Grid Fixes */
    .docket-grid {
        grid-template-columns: 1fr; /* Stack cards */
        gap: 40px;
    }

    .portrait-layout {
        flex-direction: column;
        gap: 50px;
    }

    .team-grid-text { grid-template-columns: 1fr; }

    .portrait-box { width: 100%; }
    .img-frame {
        height: auto;
        min-height: 300px;
    }

    /* Footer */
    .footer-simple { padding: 60px 20px; }
    .footer-nav { flex-direction: column; gap: 20px; }

    /* Text Sizing */
    .lead-paragraph {
        font-size: 1.2rem;
        max-width: 100%;
        text-align: left;
    }

    .body-text {
        text-align: left; /* Remove justification on mobile for better readability */
    }

    .meta-data-row {
        flex-direction: column;
        gap: 20px !important;
        margin-top: 40px !important;
    }

    /* Team Members Mobile */
    .team-members-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* =========================================
   PRINT STYLES
   ========================================= */
@media print {
    /* Reset colors for print */
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Page setup */
    @page {
        margin: 2cm;
        size: A4;
    }

    /* Hide navigation and non-essential elements */
    .sidebar-panel,
    .skip-to-content,
    .hero-header,
    .scroll-hint,
    .footer-nav,
    .vertical-label {
        display: none !important;
    }

    /* Full width for content */
    .chancery-layout {
        display: block;
    }

    .content-panel {
        width: 100%;
    }

    /* Section formatting */
    .section-wrapper {
        display: block;
        page-break-inside: avoid;
        border-bottom: 1px solid #ccc;
        padding-bottom: 20px;
        margin-bottom: 30px;
    }

    .section-inner {
        padding: 0;
    }

    /* Typography for print */
    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
    }

    .display-title {
        font-size: 18pt;
        margin-bottom: 10pt;
    }

    .section-marker {
        font-size: 10pt;
        border-bottom: 2px solid #000;
        margin-bottom: 10pt;
    }

    /* Publication lists */
    .pub-list {
        margin-top: 15pt;
    }

    .pub-item {
        page-break-inside: avoid;
        padding: 8pt 0;
        border-bottom: 1px solid #ddd;
    }

    .pub-date {
        font-weight: bold;
    }

    /* Images */
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    .portrait-layout {
        display: block;
    }

    .portrait-box {
        width: 100%;
        page-break-inside: avoid;
        margin-bottom: 20pt;
    }

    .img-frame {
        border: 1px solid #000;
        padding: 5pt;
        height: auto;
    }

    .img-frame img {
        filter: grayscale(100%);
    }

    /* Links - show URLs */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666;
    }

    a[href^="#"]:after,
    a[href^="mailto:"]:after {
        content: "";
    }

    /* Cards and boxes */
    .docket-card,
    .editorial-box {
        border: 1px solid #000;
        padding: 15pt;
        margin-bottom: 15pt;
        page-break-inside: avoid;
    }

    /* Footer */
    .footer-simple {
        padding: 20pt 0;
        border-top: 2px solid #000;
        margin-top: 30pt;
    }

    .footer-seal {
        font-size: 24pt;
    }

    /* Page breaks */
    section {
        page-break-before: auto;
    }

    .person-bio {
        text-align: left;
    }
}

