/* TRUE GOLD Synthesis - Citation Styles */
/* Enhanced 2026-02-04: Improved quote-link visibility per Guardian feedback */

:root {
    --primary-color: #1a365d;
    --accent-color: #2b6cb0;
    --background: #fafafa;
    --text-color: #2d3748;
    --border-color: #e2e8f0;
    --highlight: #fffbeb;
    --quote-link-color: #2563eb;  /* NEW: Distinct blue for quote links */
    --quote-link-hover-bg: #dbeafe;  /* NEW: Light blue hover background */
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.8;
    max-width: 850px;
    margin: 0 auto;
    padding: 2rem;
    color: var(--text-color);
    background: var(--background);
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 3px solid var(--primary-color);
}

h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.meta {
    font-size: 0.9rem;
    color: #718096;
    font-style: italic;
}

.meta-badge {
    display: inline-block;
    background: #e6fffa;
    color: #234e52;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin: 0.5rem 0.25rem;
}

/* Headings */
h2 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-top: 2.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border-color);
}

h3 {
    font-size: 1.15rem;
    color: #4a5568;
    margin-top: 1.5rem;
}

h4 {
    font-size: 1rem;
    color: #4a5568;
    font-style: italic;
}

/* Paragraphs */
p {
    margin: 1rem 0;
    text-align: justify;
}

/* Citation Superscripts */
sup.citation {
    font-size: 0.7em;
    line-height: 0;
    vertical-align: super;
}

sup.citation a {
    color: var(--accent-color);
    text-decoration: none;
    padding: 0 2px;
}

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

/* ============================================
   QUOTE LINKS - Enhanced Visibility (2026-02-04)
   ============================================ */

/* Base quote-link styling - MUCH more visible */
a.quote-link {
    color: var(--quote-link-color);  /* Distinct blue instead of inherit */
    text-decoration: underline;
    text-decoration-style: solid;  /* Solid instead of dotted */
    text-decoration-color: var(--quote-link-color);
    text-decoration-thickness: 1.5px;  /* Slightly thicker underline */
    text-underline-offset: 2px;  /* Small gap for readability */
    padding: 0 2px;
    border-radius: 2px;
    transition: background-color 0.15s ease, color 0.15s ease;
    cursor: pointer;
}

a.quote-link:hover {
    background-color: var(--quote-link-hover-bg);
    color: #1d4ed8;  /* Darker blue on hover */
    text-decoration-color: #1d4ed8;
}

/* Small PDF indicator after quote links */
a.quote-link::after {
    content: " 📄";
    font-size: 0.7em;
    opacity: 0.6;
    margin-left: 2px;
}

a.quote-link:hover::after {
    opacity: 1;
}

/* ============================================
   BLOCKQUOTES - Enhanced with clickable text
   ============================================ */

blockquote {
    border-left: 4px solid var(--accent-color);
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: #f7fafc;
    position: relative;
    font-style: italic;
}

/* Verify link icon in corner */
blockquote .verify-link {
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
    font-size: 1rem;
    text-decoration: none;
    opacity: 0.5;
    transition: opacity 0.2s;
}

blockquote .verify-link:hover {
    opacity: 1;
}

blockquote .verify-link:after {
    content: " View PDF";
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.2s;
}

blockquote .verify-link:hover:after {
    opacity: 0.7;
}

/* NEW: Clickable blockquote text styling */
blockquote a.blockquote-text-link {
    color: inherit;  /* Keep italic text color */
    text-decoration: none;
    display: block;
    padding: 0.25rem 0;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

blockquote a.blockquote-text-link:hover {
    background-color: var(--quote-link-hover-bg);
}

/* Clickable indicator for blockquote text */
blockquote a.blockquote-text-link::before {
    content: "🔗 ";
    font-size: 0.8em;
    opacity: 0;
    transition: opacity 0.15s ease;
    font-style: normal;
}

blockquote a.blockquote-text-link:hover::before {
    opacity: 0.7;
}

/* ============================================
   KEY FINDING BOX - Enhanced quote links
   ============================================ */

.key-finding {
    background: linear-gradient(135deg, #ebf8ff 0%, #e6fffa 100%);
    border-left: 4px solid var(--accent-color);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

.key-finding strong {
    color: var(--primary-color);
}

/* Quote links inside key-finding boxes */
.key-finding a.quote-link {
    background-color: rgba(255, 255, 255, 0.5);
    padding: 1px 4px;
    border-radius: 3px;
}

.key-finding a.quote-link:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

th, td {
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.8rem;
    text-align: left;
}

th {
    background: #edf2f7;
    font-weight: 600;
    color: var(--primary-color);
}

tr:nth-child(even) {
    background: #f7fafc;
}

/* Lists */
ul, ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

li {
    margin: 0.5rem 0;
}

/* Footnotes */
.footnotes {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.footnotes h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.footnote {
    font-size: 0.9rem;
    margin: 0.75rem 0;
    padding-left: 2rem;
    text-indent: -2rem;
    line-height: 1.6;
}

.footnote-num {
    font-weight: bold;
    color: var(--accent-color);
}

.footnote em {
    font-style: italic;
}

.footnote a {
    color: var(--accent-color);
}

.footnote .back-link {
    font-size: 0.8em;
    margin-left: 0.5rem;
    text-decoration: none;
    opacity: 0.6;
}

.footnote .back-link:hover {
    opacity: 1;
}

.pdf-link {
    display: inline-block;
    background: #edf2f7;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

/* Horizontal Rule */
hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

/* Source Badge */
.source-badge {
    display: inline-block;
    background: #edf2f7;
    color: #4a5568;
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 3px;
    margin-top: 0.5rem;
}

/* Navigation */
.toc {
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.toc h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.toc ul {
    list-style: none;
    padding-left: 0;
}

.toc li {
    margin: 0.4rem 0;
}

.toc a {
    color: var(--accent-color);
    text-decoration: none;
}

.toc a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: #718096;
    text-align: center;
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.4rem;
    }
    
    blockquote {
        padding: 0.75rem 1rem;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    /* Simplify quote link indicator on mobile */
    a.quote-link::after {
        content: "";
    }
}

/* Print Styles */
@media print {
    body {
        max-width: none;
        padding: 0;
    }
    
    .toc, .verify-link {
        display: none;
    }
    
    a {
        color: inherit;
        text-decoration: none;
    }
    
    a.quote-link {
        color: inherit;
        text-decoration: underline;
    }
    
    a.quote-link::after {
        content: "";
    }
    
    sup.citation a:after {
        content: "";
    }
}
