/* ===== LCV Blotter – Unified Styles ===== */
@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=Source+Serif+4:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --color-background: #FFFFFF;
  --color-foreground: #141414;
  --color-surface: #F7F7F5;
  --color-primary: #1A86C4;
  --color-primary-foreground: #FFFFFF;
  --color-accent: #7C3AED;
  --color-marker: #ED8A30;
  --color-muted: #6B6B6B;
  --color-border: #E5E5E5;
  --font-heading: 'Archivo', Arial, sans-serif;
  --font-sans: 'Archivo', Arial, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { height: 100%; }
body {
    font-family: var(--font-sans);
    color: var(--color-foreground);
    background: var(--color-background);
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* American flag watermark */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/images/flag.gif') center / cover no-repeat;
    opacity: 0.70;
    pointer-events: none;
    z-index: -1;
}

/* Underlay containers – 95% of viewport width */
.container, main, .drill-content, .modal-content, .filter-bar, .breadcrumb-bar {
    background: rgba(255, 255, 255, 0.30);
    position: relative;
    z-index: 1;
    width: 95%;
    max-width: 95%;
    margin: 2rem auto;
    border-radius: 16px;
    padding: 1rem;
}
.modal-content { background: rgba(255, 255, 255, 0.30); }

/* Main content – 95% of viewport */
main {
    width: 95%;
    max-width: 95%;
    margin: 2rem auto;
    padding: 0 1rem;
    background: rgba(255, 255, 255, 0.30);
    border-radius: 16px;
    flex: 1;
}
@media (max-width: 768px) {
    body::before { opacity: 0.70; background-size: cover; background-position: center top; }
    main, .container { padding: 0.5rem; }
}

/* ========== HAMBURGER MENU OVERLAY ========== */
.menu-toggle-checkbox { display: none; }
.menu-overlay {
    position: fixed; top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.95);
    color: white;
    z-index: 1000;
    display: none;
    flex-direction: column;
    padding: 2rem;
    overflow-y: auto;
}
.menu-toggle-checkbox:checked ~ .menu-overlay { display: flex; }
.menu-close {
    align-self: flex-end;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    color: white;
}
.menu-group {
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
}
.menu-group summary {
    font-size: 1.4rem;
    font-weight: 700;
    padding: 0.5rem 0;
    cursor: pointer;
    list-style: none;
    color: white;
}
.menu-group summary::-webkit-details-marker { display: none; }
.menu-group summary::after { content: " ▾"; font-size: 1rem; opacity: 0.7; }
.menu-group[open] summary::after { content: " ▴"; }
.menu-group a, .menu-group-link {
    display: block;
    color: #ccc;
    text-decoration: none;
    padding: 0.4rem 1rem;
    font-size: 1.1rem;
    transition: background 0.2s;
}
.menu-group a:hover, .menu-group-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.menu-group-link {
    font-size: 1.4rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
    display: block;
}

/* ---------- HEADER ---------- */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #1a1a1a;
    padding: 1rem 2rem 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    z-index: 2;
}
.logo { width: 100%; }
.logo img { width: 100%; height: auto; display: block; }
.header-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 0.8rem;
    gap: 1rem;
}
.header-search {
    display: flex;
    flex-grow: 1;
    max-width: 500px;
    position: relative;
}
.header-search input[type="text"] {
    flex-grow: 1;
    padding: 0.4rem 0.6rem;
    font-size: 0.95rem;
    border: 1px solid #555;
    border-right: none;
    border-radius: 4px 0 0 4px;
    background: #fff;
    color: #141414;
}
.header-search button {
    padding: 0.4rem 0.8rem;
    border: none;
    background: var(--color-marker);
    color: white;
    font-size: 1.2rem;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}
.menu-icon {
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    user-select: none;
    white-space: nowrap;
}

/* ---- FOOTER ---- */
footer {
    background: #1a1a1a;
    color: #ccc;
    padding: 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4rem;
    width: 100%;
    margin: 0;
    position: relative;
    z-index: 2;
}
.footer-col { flex: 0 0 auto; }
.footer-col h3 { color: white; font-family: var(--font-heading); margin-bottom: 0.5rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.3rem; }
.footer-col a { color: #ccc; text-decoration: none; }
.footer-col a:hover { text-decoration: underline; color: #fff; }
.support-btn {
    background: #cc3333;
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 3px;
    font-weight: bold;
    display: inline-block;
    text-decoration: none;
}
.support-btn:hover { background: #a82a2a; }
.copyright {
    text-align: center;
    background: #111;
    color: #777;
    padding: 0.5rem;
    margin: 0;
}

/* ---- CONTENT CARDS (95% of parent container) ---- */
.article-body-card, .profile-card, .card, .dashboard-container, .editor-card, .comments-thread,
.social-post, .user-card, .comment, .media-card, .document-card, .article-card,
.rating-card, .contributor-card-wrapper, .anonymous-group, .contributor-group {
    width: 95%;
    max-width: 95%;
    margin: 0 auto 1rem auto;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}
.article-body-card:hover, .profile-card:hover, .card:hover, .social-post:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Data tables and wide content */
.data-table-wrapper {
    overflow-x: auto;
    width: 100%;
}
.data-table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
    background: #fff;
}
.data-table th, .data-table td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    text-align: left;
}
.data-table th {
    background: #f0f0f0;
}

/* ---- ARTICLE & COMMON ---- */
.resource-toc, nav.resource-toc {
    background: #f0f4ff !important;
    border: 2px solid #1A86C4 !important;
    border-radius: 8px;
    padding: 1.2em !important;
    margin-bottom: 2em !important;
}
.resource-toc h2 { color: #141414 !important; }
.resource-toc a { color: #1A86C4 !important; font-weight: 600; }
.article-list article {
    background: var(--color-surface);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
}
.article-list h2 a {
    color: var(--color-foreground);
    font-weight: 700;
}
.article-list h2 a:hover { color: var(--color-primary); text-decoration: none; }
.meta { color: var(--color-muted); font-size: 0.85rem; }
.retraction-banner {
    background: #ffe0e0;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid red;
}
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 1rem 0;
}
.video-container iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}
.article-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}
.article-gallery a { flex: 1 1 200px; max-width: 300px; }
.article-gallery img { width: 100%; height: auto; border-radius: 4px; }
.citations {
    border-top: 2px solid var(--color-border);
    margin-top: 2rem;
    padding-top: 1rem;
    font-size: 0.9rem;
}
.citations ol { padding-left: 1.5rem; }
.citations li { margin-bottom: 0.5rem; }
sup a { text-decoration: none; color: var(--color-marker); }

/* ========== BUTTONS & PULSING ========== */
.pulse-button {
    display: inline-block;
    background: #cc3333;
    color: white !important;
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 0.5rem;
    border: 2px solid #1A86C4;
    animation: pulseRedBlue 1.5s infinite ease-in-out;
    transition: transform 0.2s;
}
.pulse-button:hover { transform: scale(1.02); }
@keyframes pulseRedBlue {
    0% { background-color: #cc3333; border-color: #1A86C4; }
    50% { background-color: #1A86C4; border-color: #cc3333; }
    100% { background-color: #cc3333; border-color: #1A86C4; }
}

.share-print-btn {
    background: #1A86C4;
    border: none;
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
}
.share-print-btn:hover { background: #0e5a8a; }

/* ---- COMMENTS SECTION ---- */
.comments-section {
    position: relative;
    background: #f5f5f0;
    padding: 1rem;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 2rem;
    z-index: 1;
}
.comments-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 300%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(204, 51, 51, 0.3) 10%,
        transparent 20%,
        rgba(255, 255, 255, 0.3) 35%,
        transparent 50%,
        rgba(26, 134, 196, 0.3) 65%,
        transparent 80%,
        rgba(204, 51, 51, 0.3) 95%,
        transparent 100%);
    background-size: 300% 100%;
    animation: slideRedWhiteBlue 16s infinite linear;
    z-index: -2;
}
.comments-section::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245, 245, 240, 0.2);
    z-index: -1;
    border-radius: 12px;
}
.comments-section * { position: relative; z-index: 1; }
@keyframes slideRedWhiteBlue {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-100%); }
}
.comment {
    background: white;
    color: black;
    margin-bottom: 1rem;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #ddd;
}
.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}
.comment-timestamp { font-size: 0.8rem; color: #666; }
.delete-comment {
    background: #cc3333;
    color: white;
    border: none;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
}
.comment-content { margin-top: 0.3rem; }
.form-field { margin-bottom: 1rem; }
.form-field label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.2rem;
}
.form-field input, .form-field textarea {
    width: 100%;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: white;
    color: black;
}
.field-hint {
    font-size: 0.8rem;
    color: #555;
    margin-top: 0.2rem;
}
.comments-disclaimer {
    font-size: 0.85rem;
    background: #fef9e3;
    border-left: 4px solid #1A86C4;
    padding: 0.3rem 0.5rem;
    margin: 0.5rem 0;
    border-radius: 4px;
    color: #333;
}
.hashtag {
    color: #1A86C4;
    text-decoration: none;
    font-weight: 500;
}
.hashtag:hover { text-decoration: underline; }
.mention {
    color: #2ecc71;
    text-decoration: none;
    font-weight: 500;
}
.mention:hover { text-decoration: underline; }

/* ---- AUTOCOMPLETE DROPDOWN ---- */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 0 0 6px 6px;
    z-index: 1001;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
}
.autocomplete-item {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--color-foreground);
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
    transition: background 0.15s;
}
.autocomplete-item:hover { background: var(--color-surface); }
.autocomplete-item.no-results {
    color: var(--color-muted);
    font-style: italic;
    cursor: default;
    background: none;
}
.autocomplete-kind {
    font-size: 0.75rem;
    background: var(--color-surface);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    margin-right: 0.5rem;
}

/* ---- MODAL FOR DOCUMENT VIEWER (kept) ---- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    position: relative;
}
.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.8rem;
    cursor: pointer;
}

/* ---- MOBILE RESPONSIVENESS ---- */
@media (max-width: 768px) {
    header { flex-direction: column; }
    .header-actions { flex-wrap: wrap; justify-content: center; }
    main { padding: 0 0.5rem; }
    footer { flex-direction: column; gap: 2rem; text-align: center; }
    .article-body-card, .profile-card, .card, .dashboard-container, .editor-card {
        padding: 0.5rem;
    }
}
@media (max-width: 480px) {
    .article-list article { padding: 1rem; }
    .comment-meta { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
}

/* ---- PRINT STYLES ---- */
@media print {
    header, footer, .mgmt-quick-nav, .footer-col, .article-toolbar, .share-print-btn,
    .header-search, .mgmt-header, .copyright, .pagination, .comments-section, .modal {
        display: none !important;
    }
    body { background: white; color: black; }
    .article-container { margin: 0; padding: 0; }
    a { text-decoration: none; color: black; }
    .featured-image { max-width: 100%; }
    .video-container iframe { display: none; }
    .video-container::after { content: "YouTube video (available online)"; font-style: italic; }
}

/* ========== RESPONSIVE IMAGES & MODAL FIXES ========== */
/* Ensure all images in articles and comments are responsive */
.article-content img,
.comment-content img,
.post-media img,
.featured-image,
.media-embed {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 1rem auto;
    cursor: pointer;
    border-radius: 8px;
}

/* Prevent overflow in article containers */
.article-body-card,
.article-body-inner,
.article-content {
    max-width: 100%;
    overflow-x: hidden;
}

/* Image preview modal - full screen with proper scaling */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.image-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.image-modal-img {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.image-modal-caption {
    color: white;
    margin-top: 1rem;
    text-align: center;
    font-size: 1rem;
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
}

.image-modal-close:hover {
    color: #ccc;
}

/* PDF viewer modal (keep existing, ensure proper z-index) */
.pdf-viewer-modal {
    display: none;
    position: fixed;
    z-index: 20000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    align-items: center;
    justify-content: center;
}
.pdf-viewer-content {
    background: white;
    width: 90vw;
    height: 90vh;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}
.pdf-viewer-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 20001;
    color: #333;
    background: white;
    padding: 0 8px;
    border-radius: 50%;
}
.pdf-viewer-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Ensure header logo link is fully clickable */
.logo a {
    display: block;
    width: 100%;
    height: auto;
}
.logo img {
    display: block;
    width: 100%;
    height: auto;
}
