/* --- DIGITAL PUBLISHING FRAMEWORK: DESIGN TOKENS --- */
:root {
    --bg-paper: #f9f7f2;
    /* Classic Book Paper */
    --bg-panel: #ffffff;
    /* Clean White */
    --accent-ink: #222222;
    /* Deep Ink Black */
    --text-main: #1a1a1a;
    /* High Contrast Text */
    --text-dim: #555555;
    /* Muted Editorial Text */
    --border-paper: #e0ddd5;
    /* Soft Paper Borders */
    --sidebar-bg: #f1efea;
    /* Slightly darker paper for UI */

    /* Typography: The Core of DPF */
    --font-serif: "Source Serif 4", "Charter", "Georgia", serif;
    --font-sans: "Inter", "SF Pro", "Helvetica Neue", sans-serif;

    /* Layout */
    --max-width-article: 70ch;
    /* Optimal reading width (character-based) */
    --line-height-body: 1.5;
    --spacing-unit: 1rem;
}

/* --- BASE LAYOUT --- */
body.system-command-center {
    background-color: var(--bg-paper);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: var(--line-height-body);
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Editorial Headlines */
h1,
h2,
h3,
.logo-brand {
    font-family: var(--font-serif);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--accent-ink);
}

.system-masthead {
    height: 4.375rem;
    background: var(--bg-panel);
    border-bottom: 0.125rem solid var(--accent-ink);
    display: flex;
    align-items: center;
    padding: 0 2.5rem;
    justify-content: space-between;
}

.logo-brand {
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
}

/* --- THE SIDEBAR (Editorial Style) --- */
.system-sidebar {
    width: 16.25rem;
    background: var(--sidebar-bg);
    border-right: 0.0625rem solid var(--border-paper);
    padding-top: 2.5rem;
}

.system-sidebar a {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.1rem;
    padding: 0.625rem 2.5rem;
    color: var(--text-dim);
    text-decoration: none;
    transition: 0.3s;
    display: block;
}

.system-sidebar a:hover {
    color: var(--accent-ink);
    padding-left: 2.8125rem;
}

/* --- CONTENT AREA --- */
.system-viewport {
    display: flex;
    flex: 1;
    width: 100%;
    overflow: hidden;
}

.editorial-content {
    flex: 1;
    padding: 1.875rem 2.5rem;
    max-width: 75rem;
    margin: 0 auto;
    overflow-y: auto;
}

/* Allow the index page to be wider */
.content:has(.editorial-front-grid) {
    max-width: 75rem;
}

/* --- EDITORIAL DASHBOARD FINE-TUNING --- */
.editorial-dashboard {
    max-width: 68.75rem;
    margin: 0 auto;
    padding: 1.25rem 0;
}

.editorial-masthead {
    text-align: center;
    margin-bottom: 2.5rem;
}

.editorial-masthead-meta {
    font-family: var(--font-sans);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    margin-bottom: 0.625rem;
}

.editorial-masthead h1 {
    font-size: 3.5rem;
    margin: 0;
    line-height: 1;
}

.editorial-masthead-rule {
    height: 0.25rem;
    background: var(--accent-ink);
    margin-top: 0.9375rem;
}

.editorial-masthead-rule.thinner {
    height: 0.0625rem;
    margin: 2.5rem 0;
}

/* --- COLUMN LOGIC --- */
.editorial-lead-story {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3.75rem;
}

.editorial-section-label {
    font-family: var(--font-sans);
    text-transform: uppercase;
    font-size: 0.8rem;
    border-bottom: 0.0625rem solid var(--accent-ink);
    padding-bottom: 0.3125rem;
    margin-bottom: 1.25rem;
    letter-spacing: 0.1em;
}

.editorial-dispatch-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.875rem;
}

.editorial-dispatch-item .editorial-dept {
    font-family: var(--font-sans);
    font-weight: bold;
    color: var(--text-dim);
    font-size: 0.7rem;
    text-transform: uppercase;
}

.editorial-dispatch-item h3 {
    margin: 0.3125rem 0 0.625rem 0;
    font-size: 1.4rem;
}

.editorial-read-more {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--accent-ink);
    text-decoration: none;
    font-size: 0.9rem;
}

/* --- THE SIDEBAR BRIEFS --- */
.editorial-brief-item {
    font-size: 0.9rem;
    padding: 0.9375rem 0;
    border-bottom: 0.0625rem solid var(--border-paper);
    line-height: 1.4;
}

/* --- THE TABLE --- */
.editorial-dispatch-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-sans);
    font-size: 0.9rem;
}

.editorial-dispatch-table th {
    text-align: left;
    padding: 0.625rem;
    border-bottom: 0.125rem solid var(--accent-ink);
}

.editorial-dispatch-table td {
    padding: 0.9375rem 0.625rem;
    border-bottom: 0.0625rem solid var(--border-paper);
}

/* --- MODERN EDITORIAL LEDGER STYLES --- */
.editorial-ledger-wrapper {
    max-width: 75rem;
    margin: 0 auto;
    padding: 1.25rem;
}

.editorial-ledger-header {
    margin-bottom: 2.5rem;
}

.editorial-ledger-meta {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-dim);
}

.editorial-ledger-rule {
    height: 0.125rem;
    background: var(--accent-ink);
    margin: 0.9375rem 0 0 0;
}

/* --- THE GRID ENGINE --- */
.system-spreadsheet-container {
    display: grid;
    grid-template-columns: 3.75rem repeat(10, minmax(7.5rem, 1fr));
    border: 0.0625rem solid var(--accent-ink);
    background: var(--bg-panel);
    gap: 0;
}

.editorial-grid-header {
    background: var(--sidebar-bg);
    border: 0.0625rem solid var(--border-paper);
    font-family: var(--font-serif);
    font-weight: bold;
    font-size: 0.85rem;
    padding: 0.75rem;
    text-align: center;
    color: var(--accent-ink);
}

.column-label {
    border-bottom: 0.125rem solid var(--accent-ink);
    text-transform: uppercase;
}

.column-label.id-col {
    min-width: 2.5rem;
}

.row-label {
    background: var(--sidebar-bg);
    border-right: 0.125rem solid var(--accent-ink);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    color: var(--text-dim);
}

.editorial-grid-cell {
    background: var(--bg-panel);
    border: 0.03125rem solid var(--border-paper);
    padding: 0.625rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    min-height: 1.5625rem;
    outline: none;
    transition: background 0.2s;
}

.editorial-grid-cell:focus {
    background: #fffdf0;
    box-shadow: inset 0 0 0 0.0625rem var(--accent-ink);
    z-index: 5;
}

.editorial-ledger-footer {
    margin-top: 1.25rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    border-top: 0.0625rem solid var(--border-paper);
    padding-top: 0.625rem;
}

/* --- SHEET TABS --- */
.editorial-sheet-tabs {
    display: flex;
    gap: 0.3125rem;
    margin-bottom: -0.125rem;
    padding-left: 3.75rem;
}

.editorial-sheet-tab {
    background: var(--sidebar-bg);
    border: 0.125rem solid var(--accent-ink);
    border-bottom: none;
    padding: 0.3125rem 0.9375rem;
    font-family: var(--font-serif);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    transition: 0.2s;
}

.editorial-sheet-tab.active {
    background: var(--bg-panel);
    border-bottom: 0.125rem solid var(--bg-panel);
    font-weight: bold;
    z-index: 10;
}

.editorial-sheet-tab:hover {
    background: #e9e6df;
}

.editorial-sheet-tab.active:hover {
    background: var(--bg-panel);
}

.editorial-tab-name {
    outline: none;
    min-width: 2.5rem;
}

.editorial-add-tab-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dim);
    padding: 0 0.625rem;
    line-height: 1;
}

.add-tab-btn:hover {
    color: var(--accent);
}

.data-cell.saving {
    background: #f0f7ff;
    /* Syncing color */
}

/* --- EDITORIAL FRONTISPIECE (INDEX) STYLES --- */
.editorial-archive-container {
    max-width: 75rem;
    margin: 2.5rem auto;
    padding: 0 1.25rem;
}

.editorial-archive-masthead {
    text-align: center;
    margin-bottom: 3.125rem;
}

.editorial-edition-mark {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.editorial-hero-title {
    font-size: 4rem;
    line-height: 1.1;
    margin-top: 1.25rem;
    letter-spacing: -0.04em;
    font-family: var(--font-serif);
}

.editorial-hero-rule {
    height: 0.1875rem;
    background: var(--accent-ink);
    margin: 2.5rem 0;
}

.editorial-hero-rule.thinner {
    height: 0.0625rem;
    margin: 3.75rem 0 1.875rem 0;
}

/* --- THE MANIFESTO --- */
.editorial-manifesto-section {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 5rem;
    align-items: start;
}

.editorial-manifesto-text {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    line-height: 1.8;
}

/* Classic Drop Cap */
.editorial-drop-cap {
    float: left;
    font-size: 5.5rem;
    line-height: 0.8;
    padding-top: 0.25rem;
    padding-right: 0.75rem;
    padding-left: 0.1875rem;
    font-family: var(--font-serif);
    font-weight: bold;
    color: var(--accent-ink);
}

/* --- THE EDITORIAL ACCESS PORTAL (LOGIN) --- */
.system-entry-portal {
    background: var(--sidebar-bg);
    padding: 2.5rem;
    border: 0.0625rem solid var(--border-paper);
    box-shadow: 0.9375rem 0.9375rem 0 var(--border-paper);
}

.system-login-form .system-input-group {
    margin-bottom: 1.5625rem;
}

.system-login-form label {
    display: block;
    font-family: var(--font-sans);
    font-weight: bold;
    font-size: 0.7rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
}

.system-login-form input {
    width: 100%;
    padding: 0.75rem 0;
    background: transparent;
    border: none;
    border-bottom: 0.125rem solid var(--accent-ink);
    font-family: var(--font-serif);
    font-size: 1.1rem;
    outline: none;
}

.btn-system-editorial {
    width: 100%;
    background: var(--accent-ink);
    color: var(--bg-panel);
    border: none;
    padding: 0.9375rem;
    font-family: var(--font-sans);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: 0.2s;
}

.btn-system-editorial:hover {
    background: #444;
}

.login-meta {
    font-size: 0.65rem;
    text-align: center;
    margin-top: 0.9375rem;
    color: var(--text-dim);
    font-family: var(--font-sans);
}

/* --- FOOTER --- */
.front-footer {
    display: flex;
    justify-content: space-between;
}

.footer-col h4 {
    font-family: var(--font-sans);
    text-transform: uppercase;
    font-size: 0.75rem;
    margin-bottom: 0.9375rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    font-size: 0.9rem;
    color: var(--text-dim);
}

/* --- EDITORIAL FRONT PAGE FOOTER --- */
.editorial-front-footer {
    grid-column: 1 / -1;
    margin-top: 5rem;
    padding-bottom: 2.5rem;
}

.editorial-footer-rule {
    height: 0.0625rem;
    background: var(--border-paper);
    margin-bottom: 1.5625rem;
}

.editorial-footer-columns {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.system-tech-summary p {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-ink);
}

.editorial-scripture-citation p {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text-main);
    text-align: right;
}

/* Scripture Style */
.scripture-cite {
    text-align: right;
    max-width: none;
    white-space: nowrap;
}

.scripture-cite p {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text-main);
}

.scripture-cite em {
    font-style: italic;
    margin-right: 0.3125rem;
}

/* --- EDITORIAL FRONT GRID --- */
.editorial-archive-grid {
    display: grid;
    grid-template-columns: 20rem 1fr;
    gap: 1.875rem;
    align-items: start;
    max-width: 75rem;
}

.editorial-access-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.editorial-main-archive {
    padding-left: 1.25rem;
    border-left: 0.0625rem solid var(--border-paper);
}

.editorial-entry-list {
    list-style: none;
    padding: 0;
    margin-top: 1.25rem;
}

.editorial-entry-list li {
    margin-bottom: 1.875rem;
}

.entry-date {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 0.3125rem;
}

.entry-title-link {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--accent-ink);
    text-decoration: none;
}

.file-link:hover {
    text-decoration: underline;
}

.file-desc {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.5;
    margin-top: 0.3125rem;
}

.entry-actions {
    margin-top: 0.9375rem;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    text-align: center;
}

.entry-actions a,
.editorial-inbox-link {
    color: var(--text-main);
    text-decoration: none;
}

.entry-meta-actions a {
    text-decoration: none;
    color: var(--text-dim);
    font-family: var(--font-sans);
    font-size: 0.8rem;
}

/* --- COMING SOON --- */
.coming-soon-container {
    text-align: center;
    padding: 6.25rem 1.25rem;
}

.coming-soon-container h1 {
    font-family: var(--font-sans);
    font-size: 3rem;
    margin-bottom: 1.25rem;
    font-weight: 300;
}

.coming-soon-muted {
    font-style: italic;
    color: var(--text-dim);
}

.coming-soon-rule {
    margin: 2.5rem auto;
    border-bottom: 0.0625rem solid var(--accent-ink);
    width: 6.25rem;
}

/* --- SUCCESS MESSAGES --- */
.editorial-success-message {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--accent-ink);
    margin-bottom: 1.25rem;
}

.contact-masthead .name {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.3125rem;
}

.contact-masthead .email a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
}

/* Fix for footer spanning columns */
.front-page-footer {
    grid-column: 1 / -1;
}

/* --- EMAIL CLIENT (CORRESPONDENCE) STYLES --- */
.email-client-container {
    max-width: 75rem;
    margin: 0 auto;
    padding: 1.25rem;
}

.email-layout {
    display: grid;
    grid-template-columns: 21.875rem 1fr;
    gap: 0;
    border: 0.125rem solid var(--accent);
    background: var(--bg-panel);
    height: 43.75rem;
}

/* Inbox Sidebar */
.inbox-sidebar {
    border-right: 0.0625rem solid var(--accent);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--sidebar-bg);
}

.inbox-actions {
    padding: 1.25rem;
    border-bottom: 0.125rem solid var(--accent);
}

.btn-brief {
    width: 100%;
    background: var(--accent);
    color: var(--bg-panel);
    border: none;
    padding: 0.75rem;
    font-family: var(--font-sans);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    cursor: pointer;
}

.inbox-list {
    flex: 1;
    overflow-y: auto;
}

.inbox-item {
    padding: 1.25rem;
    border-bottom: 0.0625rem solid var(--border);
    cursor: pointer;
    transition: 0.2s;
    position: relative;
}

.inbox-item:hover {
    background: #e9e6df;
}

.inbox-item.active {
    background: var(--bg-panel);
    border-left: 0.3125rem solid var(--accent);
    padding-left: 0.9375rem;
}

.inbox-item .sender {
    font-family: var(--font-sans);
    font-weight: bold;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-dim);
}

.inbox-item .time {
    float: right;
    font-size: 0.7rem;
    color: var(--text-dim);
}

.inbox-item h3 {
    margin: 0.5rem 0 0.3125rem 0;
    font-size: 1.1rem;
    line-height: 1.2;
}

.inbox-item .snippet {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Reader Pane */
.message-reader {
    background: var(--bg-panel);
    padding: 2.5rem;
    overflow-y: auto;
}

.message-meta {
    margin-bottom: 2.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 0.0625rem solid var(--border);
}

.meta-row {
    display: flex;
    margin-bottom: 0.625rem;
    font-size: 0.9rem;
}

.meta-row .label {
    width: 5rem;
    font-family: var(--font-sans);
    font-weight: bold;
    color: var(--text-dim);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
}

.meta-row .value.emphasis {
    font-family: var(--font-serif);
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--accent);
}

.message-body {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    line-height: 1.8;
}

/* Reusing the Drop Cap logic */
.message-body .drop-cap {
    float: left;
    font-size: 4rem;
    line-height: 0.8;
    padding-top: 0.25rem;
    padding-right: 0.75rem;
    font-family: var(--font-serif);
    font-weight: bold;
    color: var(--accent);
}