/* ===== REVELATION COMMENTARY SHARED STYLES ===== */

/* ===== BASE TYPOGRAPHY ===== */
* {
    box-sizing: border-box;
}

body {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16px;
    line-height: 1.8;
    color: #222;
    background: #9ca3af;
    margin: 0;
    padding: 0;
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    background: #e5e7eb;
    min-height: 100vh;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
}

.content-inner {
    padding: 2em;
}

h1 {
    font-size: 2.2em;
    color: #1a1a1a;
    border-bottom: 3px solid #2d3748;
    padding-bottom: 0.3em;
    margin-bottom: 0.5em;
}

h2 {
    font-size: 1.6em;
    color: #2d3748;
    margin-top: 2em;
    margin-bottom: 0.5em;
}

h3 {
    font-size: 1.3em;
    color: #4a5568;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

/* ===== SCRIPTURE STYLING ===== */
.scripture-block {
    background: #ffffff;
    border-left: 4px solid #13AEED;
    padding: 1.5em;
    margin: 1.5em 0;
    font-family: 'Charter', Georgia, serif;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-radius: 6px;
}

.verse {
    margin-bottom: 0.8em;
}

.verse-num {
    display: inline-block;
    font-weight: bold;
    color: #13AEED;
    min-width: 2em;
    font-size: 0.95em;
}

.verse-text {
    display: inline;
}

/* ===== EMPHASIS BLOCKS ===== */
.emphasis {
    background: #ffffff;
    border-left: 4px solid #f6ad55;
    padding: 1.5em;
    margin: 1.5em 0;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Legacy class names for backward compatibility */
.pastor-notes {
    background: #ffffff;
    border-left: 4px solid #f6ad55;
    padding: 1.5em;
    margin: 1.5em 0;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.teaching-insight {
    background: #ffffff;
    border-left: 4px solid #f6ad55;
    padding: 1.5em;
    margin: 1.5em 0;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Hide title elements within emphasis blocks */
.pastor-notes-title,
.teaching-insight-title {
    display: none;
}

/* Ensure white backgrounds for attribution highlighting */
body.attribution-mode .emphasis,
body.attribution-mode .pastor-notes,
body.attribution-mode .teaching-insight {
    background: #ffffff !important;
}

/* ===== CROSS REFERENCES WITH TOOLTIPS ===== */
.cross-ref {
    color: #13AEED;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dotted #13AEED;
    cursor: help;
    position: relative;
    white-space: nowrap;
}

.cross-ref:hover {
    color: #0E8FCD;
    border-bottom-color: #0E8FCD;
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: #2d3748;
    color: white;
    padding: 0.8em 1em;
    border-radius: 6px;
    font-size: 0.9em;
    line-height: 1.6;
    max-width: 300px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    font-family: Georgia, serif;
    font-weight: normal;
    font-style: normal;
    white-space: normal;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 20px;
    border: 8px solid transparent;
    border-top-color: #2d3748;
}

.tooltip.show {
    opacity: 1;
}

.tooltip-ref {
    font-weight: bold;
    color: #13AEED;
    display: block;
    margin-bottom: 0.3em;
    font-size: 0.85em;
}

/* ===== KEY TERMS ===== */
.key-term {
    font-weight: 600;
    color: #2d3748;
    background: #edf2f7;
    padding: 0.1em 0.3em;
    border-radius: 3px;
}

/* ===== STICKY HEADER ===== */
.sticky-header {
    position: sticky;
    top: 0;
    background: #13AEED;
    color: white;
    padding: 1em 1.5em;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.sticky-header .content-constrain {
    max-width: 900px;
    margin: 0 auto;
}

.sticky-header .breadcrumb {
    font-size: 0.85em;
    margin-bottom: 0.5em;
    opacity: 0.95;
    text-align: center;
}

.sticky-header .breadcrumb a {
    color: white;
    text-decoration: none;
    border-bottom: 1px dotted rgba(255,255,255,0.6);
}

.sticky-header .breadcrumb a:hover {
    border-bottom-style: solid;
    opacity: 1;
}

.sticky-header .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
}

.sticky-header .nav-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5em 1em;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
}

.sticky-header .nav-button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.sticky-header .nav-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.sticky-header .header-center {
    flex: 1;
    text-align: center;
}

.sticky-header h1 {
    margin: 0;
    border: none;
    color: white;
    font-size: 1.3em;
}

.sticky-header .controls {
    margin-top: 0.5em;
    font-size: 0.85em;
    text-align: center;
}

.sticky-header .controls button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.4em 0.8em;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    margin: 0 0.25em;
    transition: all 0.2s;
}

.sticky-header .controls button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.sticky-header button[style*="background: #4b5563"] {
    background: rgba(75, 85, 99, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.4);
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    .content-wrapper {
        box-shadow: none;
    }

    .content-inner {
        padding: 1em;
    }

    .sticky-header {
        padding: 0.8em 1em;
    }

    .sticky-header .header-content {
        gap: 0.5em;
    }

    .sticky-header .nav-button {
        font-size: 0.8em;
        padding: 0.4em 0.7em;
    }

    .sticky-header h1 {
        font-size: 1em;
    }

    h1 {
        font-size: 1.8em;
    }

    h2 {
        font-size: 1.3em;
    }

    .tooltip {
        max-width: 250px;
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .sticky-header .nav-button {
        font-size: 0.75em;
        padding: 0.3em 0.5em;
    }

    .sticky-header h1 {
        font-size: 0.9em;
    }

    .sticky-header h1 span {
        display: none;
    }
}

/* ===== ATTRIBUTION MODE ===== */
.attribution-toggle {
    background: #6b7280 !important;
    border: 2px solid #9ca3af;
}

.attribution-toggle:hover {
    background: #4b5563 !important;
}

.attribution-toggle.active {
    background: #10b981 !important;
    border-color: #10b981;
}

.attribution-legend {
    display: none;
    background: #1f2937;
    padding: 0.75em 1em;
    margin-top: 0.75em;
    border-radius: 4px;
    font-size: 0.8em;
    line-height: 1.4;
}

.attribution-legend.show {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25em;
    align-items: center;
}

.attribution-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4em;
    white-space: nowrap;
}

.attribution-legend-color {
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Attribution highlight colors (only when active) */

/* Block-level elements (paragraphs, lists, divs) get comfortable padding */
body.attribution-mode p.attr-scripture,
body.attribution-mode ul.attr-scripture,
body.attribution-mode ol.attr-scripture,
body.attribution-mode div.attr-scripture {
    background: rgba(96, 165, 250, 0.12);
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.4);
    padding: 0.8em 1em;
    border-radius: 4px;
    margin: 0.8em 0;
}

body.attribution-mode p.attr-notes,
body.attribution-mode ul.attr-notes,
body.attribution-mode ol.attr-notes,
body.attribution-mode div.attr-notes {
    background: rgba(251, 146, 60, 0.12);
    box-shadow: inset 0 0 0 2px rgba(249, 115, 22, 0.4);
    padding: 0.8em 1em;
    border-radius: 4px;
    margin: 0.8em 0;
}

body.attribution-mode p.attr-transcript,
body.attribution-mode ul.attr-transcript,
body.attribution-mode ol.attr-transcript,
body.attribution-mode div.attr-transcript {
    background: rgba(139, 92, 246, 0.12);
    box-shadow: inset 0 0 0 2px rgba(139, 92, 246, 0.4);
    padding: 0.8em 1em;
    border-radius: 4px;
    margin: 0.8em 0;
}

body.attribution-mode p.attr-synthesis,
body.attribution-mode ul.attr-synthesis,
body.attribution-mode ol.attr-synthesis,
body.attribution-mode div.attr-synthesis {
    background: rgba(16, 185, 129, 0.12);
    box-shadow: inset 0 0 0 2px rgba(16, 185, 129, 0.4);
    padding: 0.8em 1em;
    border-radius: 4px;
    margin: 0.8em 0;
}

/* Headings get subtle background without disrupting their spacing */
body.attribution-mode h1.attr-scripture,
body.attribution-mode h2.attr-scripture,
body.attribution-mode h3.attr-scripture {
    background: rgba(96, 165, 250, 0.12);
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.4);
    padding: 0.3em 0.6em;
    border-radius: 4px;
}

body.attribution-mode h1.attr-notes,
body.attribution-mode h2.attr-notes,
body.attribution-mode h3.attr-notes {
    background: rgba(251, 146, 60, 0.12);
    box-shadow: inset 0 0 0 2px rgba(249, 115, 22, 0.4);
    padding: 0.3em 0.6em;
    border-radius: 4px;
}

body.attribution-mode h1.attr-transcript,
body.attribution-mode h2.attr-transcript,
body.attribution-mode h3.attr-transcript {
    background: rgba(139, 92, 246, 0.12);
    box-shadow: inset 0 0 0 2px rgba(139, 92, 246, 0.4);
    padding: 0.3em 0.6em;
    border-radius: 4px;
}

body.attribution-mode h1.attr-synthesis,
body.attribution-mode h2.attr-synthesis,
body.attribution-mode h3.attr-synthesis {
    background: rgba(16, 185, 129, 0.12);
    box-shadow: inset 0 0 0 2px rgba(16, 185, 129, 0.4);
    padding: 0.3em 0.6em;
    border-radius: 4px;
}

/* List items inside attributed lists need padding */
body.attribution-mode .attr-scripture li,
body.attribution-mode .attr-notes li,
body.attribution-mode .attr-transcript li,
body.attribution-mode .attr-synthesis li {
    padding: 0.3em 0;
}

/* Inline spans get minimal styling */
body.attribution-mode span.attr-scripture,
body.attribution-mode span.attr-notes,
body.attribution-mode span.attr-transcript,
body.attribution-mode span.attr-synthesis {
    padding: 0.1em 0.3em;
    border-radius: 2px;
}

body.attribution-mode span.attr-scripture {
    background: rgba(96, 165, 250, 0.15);
}

body.attribution-mode span.attr-notes {
    background: rgba(251, 146, 60, 0.15);
}

body.attribution-mode span.attr-transcript {
    background: rgba(139, 92, 246, 0.15);
}

body.attribution-mode span.attr-synthesis {
    background: rgba(16, 185, 129, 0.15);
}

/* ===== PRINT OPTIMIZATION ===== */
@media print {
    body {
        font-size: 12pt;
        background: white;
    }

    .content-wrapper {
        max-width: 100%;
        box-shadow: none;
    }

    .content-inner {
        padding: 0.5in;
    }

    .sticky-header {
        position: static;
        background: white;
        color: black;
        box-shadow: none;
        border-bottom: 2px solid #333;
        padding: 0;
        margin: 0 0 1em 0;
    }

    .sticky-header .controls {
        display: none;
    }

    .sticky-header .content-constrain {
        max-width: 100%;
    }

    .sticky-header h1 {
        color: black;
    }

    .scripture-block,
    .emphasis,
    .pastor-notes,
    .teaching-insight {
        page-break-inside: avoid;
        box-shadow: none;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }

    .cross-ref {
        border-bottom: none;
        color: #333;
    }

    .tooltip {
        display: none;
    }

    /* Disable attribution highlighting in print */
    body.attribution-mode .attr-scripture,
    body.attribution-mode .attr-notes,
    body.attribution-mode .attr-transcript,
    body.attribution-mode .attr-synthesis {
        background: transparent !important;
        box-shadow: none !important;
    }

    .attribution-legend {
        display: none !important;
    }
}
