/* simple-meridian/static/style.css */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; /* Common system font stack */
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #212529; /* Slightly darker text */
}

.container {
    max-width: 800px;
    margin: 20px auto;
    padding: 25px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

/* Wider container for the brief page (room for the on-this-page rail). */
.container.container-wide { max-width: 1080px; }

/* --- Header Styling (top bar) --- */
.main-header {
    background-color: #ffffff;
    border-bottom: 1px solid #dee2e6;
    padding: 10px 0;
    margin-bottom: 25px;
}

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

.logo {
    font-size: 1.5em;
    font-weight: 600;
    color: #495057;
    text-decoration: none;
}
.logo:hover { color: #0056b3; }

.main-nav {
    display: flex;
    gap: 25px;
    flex-grow: 1;
    margin-left: 40px;
}

.main-nav a {
    text-decoration: none;
    color: #495057;
    font-size: 1.0em;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: #0056b3;
    border-bottom-color: #007bff;
}
.main-nav a.active { font-weight: 600; }
/* --- End Header Styling --- */

/* --- Brief page: "On this page" table-of-contents rail --- */
.brief-layout { display: flex; align-items: flex-start; gap: 36px; }
.brief-main { flex: 1; min-width: 0; max-width: 760px; }
.brief-toc {
    order: -1;                 /* rail sits on the left */
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
.brief-toc-title {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75em;
    font-weight: 600;
    color: #868e96;
    margin-bottom: 10px;
}
.brief-toc ul { list-style: none; margin: 0; padding: 0; }
.brief-toc ul ul { margin-left: 12px; }   /* indent subsections */
/* Collapse each section's story list; show only the section currently being read.
   The Markdown `toc` extension wraps the list in <div class="toc">, so target through it. */
.brief-toc > .toc > ul > li > ul { display: none; }
.brief-toc > .toc > ul > li.expanded > ul { display: block; }
.brief-toc a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #495057;
    font-size: 0.92em;
    line-height: 1.3;
    padding: 8px 10px;
    border-left: 2px solid transparent;
    border-radius: 4px;
}
/* Chevron only on section (top-level) rows; rotates down when that section is expanded. */
.brief-toc > .toc > ul > li > a::after { content: "\203A"; color: #adb5bd; transition: transform 0.15s ease; }
.brief-toc > .toc > ul > li.expanded > a::after { transform: rotate(90deg); }
.brief-toc a:hover { background-color: #f1f3f5; color: #212529; }
.brief-toc a.active {
    background-color: #f1f3f5;
    color: #0056b3;
    font-weight: 600;
    border-left-color: #007bff;
}

@media (max-width: 900px) {
    .brief-toc { display: none; }       /* hide the rail on narrow screens */
    .brief-main { max-width: none; }
}
/* --- End brief TOC --- */


h1 {
    color: #343a40; /* Darker heading */
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 0;
    font-size: 1.8em;
}

h2 {
    color: #495057;
    margin-top: 1.5em;
}

h3 {
    color: #495057;
    margin-top: 1.2em;
}

.timestamp {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 15px;
}

hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

/* Standfirst: one-line summary under the brief title. */
.brief-standfirst {
    font-size: 1.18em;
    line-height: 1.5;
    color: #495057;
    margin: 0.1em 0 0.6em;
}
/* Standfirst snippet on the briefs list. */
.brief-standfirst-list {
    margin: 3px 0 4px;
    font-size: 0.92em;
    line-height: 1.45;
    color: #495057;
}

.brief-content {
    margin-top: 20px;
}
.brief-content p {
    margin-bottom: 1.3em;
}
/* Each story leads with a bold headline inside its paragraph; promote that
   leading bold to its own line so it reads as a sub-heading (improves scanning). */
.brief-content p > strong:first-child {
    display: block;
    margin-bottom: 0.3em;
    font-size: 1.08em;
    line-height: 1.35;
}
/* Section headers (## ...) get a light rule so the brief's structure stands out. */
.brief-content h2 {
    margin-top: 1.9em;
    padding-bottom: 0.25em;
    border-bottom: 1px solid #e9ecef;
}
/* "Tell me more" ↗ link beside each story headline — discreet, appears on hover. */
.brief-content h3 .tell-more {
    opacity: 0;
    margin-left: 0.45em;
    font-size: 0.62em;
    font-weight: 400;
    text-decoration: none;
    color: #adb5bd;
    vertical-align: middle;
    transition: opacity 0.15s ease, color 0.15s ease;
}
.brief-content h3:hover .tell-more { opacity: 1; }
.brief-content h3 .tell-more:hover { color: #007bff; }
/* Touch devices have no hover — keep it faintly visible so it's still tappable. */
@media (hover: none) {
    .brief-content h3 .tell-more { opacity: 0.45; }
}

/* Contested / single-source caveats are emitted as blockquotes — render as callouts. */
.brief-content blockquote {
    margin: -0.4em 0 1.4em;
    padding: 0.6em 0.9em;
    background-color: #fff8ec;
    border-left: 3px solid #f59e0b;
    border-radius: 0 6px 6px 0;
    font-size: 0.94em;
    color: #5c4a1f;
}
.brief-content blockquote p { margin: 0; }
.brief-content blockquote strong { color: #b4790a; }

/* --- Brief sources (transparency) --- */
.brief-sources {
    margin-top: 2.5em;
    border-top: 1px solid #e9ecef;
    padding-top: 1em;
    font-size: 0.92em;
}
.brief-sources summary {
    cursor: pointer;
    font-weight: 600;
    color: #495057;
    list-style: revert;
}
.brief-sources summary:hover { color: #007bff; }
.brief-sources-count { font-weight: 400; color: #868e96; margin-left: 6px; }
.brief-sources-note { color: #868e96; margin: 0.8em 0 1.2em; }
.source-group { margin-bottom: 1.1em; }
.source-outlet { font-weight: 600; color: #343a40; margin-bottom: 0.3em; }
.source-outlet-count { font-weight: 400; color: #adb5bd; }
.brief-sources ul { margin: 0; padding-left: 1.2em; }
.brief-sources li { margin-bottom: 0.25em; line-height: 1.4; }
.brief-sources a { color: #495057; text-decoration: none; }
.brief-sources a:hover { color: #007bff; text-decoration: underline; }

/* --- Article List Styling --- */
.article-list {
    list-style-type: none; /* Remove default bullets */
    padding-left: 0;
    margin-top: 20px;
}

.article-item {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f1f1; /* Light separator */
}
.article-item:last-child {
    border-bottom: none;
}

.article-link-wrapper {
  display: block;
  margin-bottom: 4px;
}

.article-link, .article-link-original {
    display: inline;
    text-decoration: none;
    color: #0056b3; /* Slightly darker blue for links */
    font-weight: 500; /* Slightly bolder titles */
}
.article-link:hover, .article-link-original:hover {
    text-decoration: underline;
    color: #003d80;
}

.article-meta {
    font-size: 0.85em;
    color: #6c757d; /* Gray for metadata */
    display: block; /* Put metadata on new line */
}
/* --- End Article List Styling --- */

/* --- Article List Image Styling --- */
.article-item {
    display: flex; /* Use flexbox for layout */
    align-items: flex-start; /* Align items to the top */
    gap: 15px; /* Space between image and text */
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f1f1;
}
.article-item:last-child { border-bottom: none; }

.article-image-container {
    flex-shrink: 0; /* Prevent image container from shrinking */
    width: 100px; /* Fixed width for image/placeholder */
    height: 75px; /* Fixed height */
    overflow: hidden; /* Hide parts of image that don't fit */
    border-radius: 4px;
    background-color: #f0f0f0; /* BG for container while image loads */
}

.article-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the area, cropping if needed */
    border-radius: 4px;
}

.article-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: #e9ecef; /* Grey background */
    color: #6c757d; /* Muted text color */
    font-size: 0.8em;
    text-align: center;
    border-radius: 4px;
    box-sizing: border-box; /* Include padding/border in element's total width/height */
    border: 1px dashed #ced4da; /* Optional dashed border */
}

.placeholder-icon {
    width: 24px; /* Adjust icon size */
    height: 24px;
    margin-bottom: 4px;
    opacity: 0.6;
}

.article-text-content {
    flex-grow: 1; /* Allow text content to take remaining space */
    /* No specific styles needed unless required */
}
/* --- End Article List Image Styling --- */


/* --- Article Detail Image Styling --- */
.article-detail-image-container {
    margin-bottom: 25px; /* Space below image */
    max-width: 400px; /* Limit max width on detail page */
    margin-left: auto; /* Center the container */
    margin-right: auto;
}
.article-detail-image {
    display: block;
    width: 100%;
    height: auto; /* Maintain aspect ratio */
    border-radius: 6px;
    border: 1px solid #dee2e6;
}
.article-detail-placeholder {
    height: 200px; /* Give placeholder a decent height */
    font-size: 1em;
}
.article-detail-placeholder .placeholder-icon {
    width: 40px;
    height: 40px;
}


/* Basic styling for Markdown elements */
p {
    margin-bottom: 1em;
}

ul:not(.article-list), ol { /* Only apply margin to non-article lists */
    margin-left: 20px;
    margin-bottom: 1em;
}

li:not(.article-item) { /* Only apply margin to non-article list items */
    margin-bottom: 0.5em;
}

strong, b {
    font-weight: bold;
    color: #495057;
}

em, i {
    font-style: italic;
}

code {
    background-color: #e9ecef;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9em;
}

pre {
    background-color: #e9ecef;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    font-size: 0.9em;
}

pre code {
    background-color: transparent;
    padding: 0;
}

blockquote {
    border-left: 4px solid #ccc;
    padding-left: 15px;
    margin-left: 0;
    color: #555;
    font-style: italic;
}

/* --- Pagination Styling --- */
.pagination {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 0.95em;
}

.page-link {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 5px;
    text-decoration: none;
    color: #007bff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.page-link:hover {
    background-color: #e9ecef;
    color: #0056b3;
    border-color: #ced4da;
}

.page-link.disabled {
    color: #6c757d;
    pointer-events: none; /* Make it non-clickable */
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.page-info {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 10px;
    color: #495057;
    font-weight: 500;
}

/* article page */
.article-details dt {
    font-weight: bold;
    margin-top: 1em;
    color: #343a40;
}

/* Style for the collapsible header (dt) */
.collapsible-header {
    display: flex;
    justify-content: space-between; /* Puts text left, icon right */
    align-items: center;
}

/* Style for the icon container */
.toggle-icon-container {
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    color: #6c757d; /* Muted icon color */
    display: inline-flex;
    align-items: center;
}
.toggle-icon-container:hover {
    background-color: #e9ecef;
    color: #007bff; /* Highlight on hover */
}

/* Style for the SVG icons themselves */
.toggle-icon-container svg {
    width: 16px;
    height: 16px;
}

.article-details dd {
    margin-left: 0; /* Reset browser default indent */
    margin-bottom: 0.8em;
    color: #495057;
    padding-left: 1em; /* Add our own indent */
    border-left: 3px solid #e9ecef; /* Subtle left border */
}

.article-details dd a { /* Style link within details */
    color: #0056b3;
    text-decoration: none;
}
.article-details dd a:hover {
    text-decoration: underline;
}

.content-block { /* Common style for summary/raw */
    background-color: #f8f9fa;
    padding: 10px 15px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    font-size: 0.95em;
    line-height: 1.5;
    margin-top: 5px; /* Space from the <dt> */
}

.content-block.raw-content pre {
    white-space: pre-wrap;       /* CSS3 */
    white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
    white-space: -pre-wrap;      /* Opera 4-6 */
    white-space: -o-pre-wrap;    /* Opera 7 */
    word-wrap: break-word;       /* Internet Explorer 5.5+ */
    max-height: 400px; /* Limit height */
    overflow-y: auto; /* Add scrollbar if needed */
    margin: 0; /* Reset default pre margin */
    background-color: transparent; /* Inherit from parent */
    padding: 0; /* Reset default pre padding */
    border: none; /* Reset default pre border */
    font-size: 0.9em; /* Slightly smaller for dense text */
}

/* --- Impact Score Styling --- */
.impact-score {
    display: inline-block; /* Changed from inline to inline-block for padding/margin */
    padding: 3px 8px;
    font-size: 0.8em;
    font-weight: bold;
    border-radius: 10px; /* Rounded corners */
    color: #fff; /* Default white text */
    margin-right: 8px; /* Space between badge and title */
    min-width: 1.5em; /* Ensure single digits have decent width */
    text-align: center;
    vertical-align: middle; /* Align better with text */
    line-height: 1.2; /* Adjust line height for padding */
}

/* Default / Unknown */
.impact-score.score-unknown { background-color: #adb5bd; color: #fff;} /* Grey */

/* Color Scale (Example - adjust colors as desired) */
.impact-score.score-1, .impact-score.score-2 { background-color: #28a745; } /* Green */
.impact-score.score-3, .impact-score.score-4 { background-color: #198754; } /* Darker Green */
.impact-score.score-5, .impact-score.score-6 { background-color: #ffc107; color: #333; } /* Yellow (darker text) */
.impact-score.score-7, .impact-score.score-8 { background-color: #fd7e14; } /* Orange */
.impact-score.score-9, .impact-score.score-10 { background-color: #dc3545; } /* Red */

/* Adjust positioning slightly on the article list item */
.article-item .impact-score {
    /* Optional: Tweak alignment if needed */
    position: relative;
    top: -1px;
}

.filter-sort-form {
    display: flex;
    flex-direction: column; /* Stack sections vertically */
    gap: 10px; /* Space between sections */
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

.form-section {
    /* Base styles for sections within the form if needed */
}

.form-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.form-row {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping */
    gap: 15px; /* Space between profile and search */
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* --- Search Filter Styling --- */
.search-filter {
    display: flex;
    align-items: center;
    flex-grow: 1; /* Allow search to take more space */
    background-color: #fff; /* White background */
    border: 1px solid #ced4da;
    border-radius: 20px; /* Rounded corners */
    padding: 0px 5px 0px 12px; /* Padding left for text, less right for button */
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.search-filter input[type="search"] {
    border: none;
    outline: none;
    padding: 8px 5px;
    font-size: 0.95em;
    flex-grow: 1; /* Input takes available space */
    background: transparent;
    min-width: 150px; /* Minimum width */
}
/* Hide browser's default cancel button */
.search-filter input[type="search"]::-webkit-search-cancel-button,
.search-filter input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}


.btn-search {
    background: none;
    border: none;
    padding: 5px 8px;
    cursor: pointer;
    color: #6c757d;
}
.btn-search:hover {
    color: #007bff;
}
.btn-search svg { /* Style embedded SVG */
    display: block; /* Remove extra space below SVG */
    width: 18px;
    height: 18px;
}

.btn-clear-search {
    background: none;
    border: none;
    color: #adb5bd;
    font-size: 1.4em;
    line-height: 1;
    padding: 0 8px;
    cursor: pointer;
    text-decoration: none;
    margin-left: 4px; /* Space from search button */
}
.btn-clear-search:hover {
    color: #dc3545; /* Red on hover */
}

/* --- Collapsible Date Filter Styling --- */
.date-filter-toggle {
    background-color: transparent;
    border: none;
    color: #007bff;
    cursor: pointer;
    font-size: 0.9em;
    padding: 5px 0;
    width: 100%;
    text-align: left;
    margin-bottom: 10px;
}
.date-filter-toggle:hover {
    text-decoration: underline;
}
.toggle-icon {
    display: inline-block;
    margin-left: 5px;
    font-weight: bold;
    width: 1em; /* Fixed width */
    text-align: center;
}

.date-filter-content {
    /* display: none; */ /* Set inline style initially */
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    background-color: #fff; /* White background inside */
    margin-top: -10px; /* Pull up slightly */
    display: flex; /* Use flex for layout inside */
    flex-direction: column;
    gap: 15px; /* Space between date inputs and presets */
}

/* Ensure date inputs and presets display nicely within collapsible */
.date-filter-content .date-inputs,
.date-filter-content .preset-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.filter-controls {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 15px; /* Space between sections */
    align-items: center;
}

.date-inputs {
    display: flex;
    align-items: center;
    gap: 8px; /* Space between label, input, button */
    flex-grow: 1; /* Allow date inputs to take available space */
}

.date-inputs label {
    font-size: 0.9em;
    color: #495057;
}

.date-inputs input[type="date"] {
    padding: 5px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9em;
}

.preset-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap; /* Allow buttons to wrap */
}

/* General Button Styling */
.btn {
    display: inline-block;
    padding: 6px 12px;
    font-size: 0.9em;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
    margin: 0.5em 0 0.5em 0;
}

.btn-filter {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}
.btn-filter:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-clear {
    color: #6c757d;
    background-color: transparent;
    border: 1px solid #6c757d;
}
.btn-clear:hover {
    color: #fff;
    background-color: #6c757d;
}

.btn-preset {
    color: #007bff;
    background-color: #e7f1ff; /* Light blue background */
    border: 1px solid #b8d6ff;
}
.btn-preset:hover {
    background-color: #cde2ff;
    border-color: #99c3ff;
}
.btn-preset.active {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
    font-weight: bold;
}

/* --- End Filter Controls Styling --- */

/* --- Sorting Controls Styling (adjust if needed) --- */
.sort-controls {
    margin-bottom: 20px;
    padding-bottom: 10px;
    font-size: 0.9em;
    color: #6c757d;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

/* --- Sorting Controls Styling --- */

.sort-link {
    text-decoration: none;
    color: #007bff; /* Link blue */
    margin-left: 15px;
    padding: 3px 5px;
    border-radius: 3px;
}

.sort-link:hover {
    background-color: #e9ecef;
    text-decoration: none;
}

.sort-link.active {
    font-weight: bold;
    color: #0056b3; /* Darker blue for active */
    background-color: #d6eaff; /* Light blue background for active */
}

.sort-indicator {
    display: inline-block;
    margin-left: 4px;
    font-size: 0.8em; /* Make indicator slightly smaller */
    color: #343a40; /* Dark color for indicator */
}

/* --- Feed Profile Filter & Badge Styling --- */
.profile-filter {
    margin-bottom: 15px;
    padding-bottom: 0;
    font-size: 0.9em;
    color: #6c757d;
}

.profile-filter.form-section select { /* Style the select dropdown */
    padding: 5px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9em;
    margin-left: 5px;
}
.profile-filter.form-section label {
     font-size: 0.9em;
    color: #495057;
}

.profile-link {
    text-decoration: none;
    color: #007bff;
    margin-left: 10px;
    padding: 3px 6px;
    border-radius: 3px;
}
.profile-link:hover {
    background-color: #e9ecef;
    text-decoration: none;
}
.profile-link.active {
    font-weight: bold;
    color: #fff;
    background-color: #6c757d; /* Grey background for active profile */
}

.profile-badge {
    display: inline-block;
    padding: 2px 7px;
    font-size: 0.8em;
    font-weight: 500;
    border-radius: 4px;
    background-color: #6c757d; /* Default grey */
    color: #fff;
    margin-left: 8px;
    vertical-align: middle;
}
.profile-badge.list-badge { /* Smaller badge on list items */
    font-size: 0.7em;
    padding: 1px 5px;
    margin-right: 5px; /* Space before impact score */
    margin-left: 0;
}

.relevance-notice {
    font-weight: bold;
    color: #17a2b8; /* Teal color or similar */
    font-size: 0.9em;
}

.sort-link-disabled {
    color: #adb5bd; /* Lighter grey for disabled */
    text-decoration: none;
    margin-left: 5px;
    cursor: default;
}

/* --- Flash Message Styling --- */
.flash-messages {
    margin-bottom: 15px;
}
.flash {
    padding: 10px 15px;
    margin-bottom: 10px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 0.9em;
}
.flash-success { color: #0f5132; background-color: #d1e7dd; border-color: #badbcc; }
.flash-error   { color: #842029; background-color: #f8d7da; border-color: #f5c2c7; }
.flash-warning { color: #664d03; background-color: #fff3cd; border-color: #ffecb5; }
.flash-info    { color: #055160; background-color: #cff4fc; border-color: #b6effb; } /* For general info */

/* --- Add Article Form Styling --- */
.add-article-form {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: .5rem;
    font-weight: 500;
    font-size: 0.9em;
}
.form-control {
    display: block;
    width: 100%;
    padding: .375rem .75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    appearance: none; /* For select */
    border-radius: .25rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}
.form-control:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 .25rem rgba(13,110,253,.25);
}
.form-text {
    display: block;
    margin-top: .25rem;
    font-size: .8em;
    color: #6c757d;
}
.btn-primary { /* For the submit button */
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}
.btn-primary:hover {
    color: #fff;
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-delete {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 1.1rem;
    color: #6c757d; /* Muted color */
    transition: color 0.15s ease-in-out;
    vertical-align: middle; /* Better alignment with text */
}

.btn-delete:hover {
    color: #dc3545; /* Red on hover */
}

/* --- Header Action Button Styling --- */
.btn-add-article {
    color: #198754; /* Green text */
    background-color: #e8f3ed; /* Light green background */
    border: 1px solid #a3d0b9;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px; /* Space between icon and text */
    margin: 0; /* Override any margin from .btn */
}

.btn-add-article:visited {
    color: #198754;
}

.btn-add-article:hover {
    color: #fff;
    background-color: #198754; /* Solid green on hover */
    border-color: #198754;
}

/* --- Collections Dropdown Menu --- */
.collections-menu {
    border-radius: 6px;
}

.collections-menu-content {
    font-size: 0.9em; /* Smaller font */
}

.collection-entry {
    display: flex;
    justify-content: space-between; /* Aligns name left, button right */
    align-items: center;
    padding: 4px 0;
}

.collections-list-container {
    max-height: 150px; /* Limit height */
    overflow-y: auto; /* Add scrollbar if content overflows */
    margin-bottom: 8px; /* Space above footer */
}

.collections-menu-footer {
    border-top: 1px solid #eee; /* Separator line */
    padding-top: 8px;
    text-align: right; /* Align link to the right */
}
.collections-menu-footer a {
    text-decoration: none;
    color: #0056b3;
    display: inline-flex;
    align-items: center;
    gap: 5px; /* Space between icon and text */
}
.collections-menu-footer a:hover {
    text-decoration: underline;
}

.collection-action-button .btn {
    margin: 0; /* Override default button margin */
    padding: 2px 6px; /* Smaller padding for icon buttons */
    line-height: 1; /* Tighter line height */
}

.collections-button {
    color: #6c757d;
    cursor: pointer;
}

.collections-button :hover {
    color: #0056b3;
}

.collection-article-count {
    font-weight: 400; /* Normal weight */
    font-size: 0.9em;
    color: #6c757d; /* Muted text color */
    margin-left: 5px;
}

/* --- Theme toggle button --- */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    font-size: 1.05em;
    padding: 6px 9px;
    margin-right: 6px;
    border-radius: 6px;
    line-height: 1;
    vertical-align: middle;
}
.theme-toggle:hover { color: #007bff; background-color: #e9ecef; }

/* --- Language toggle --- */
.lang-toggle {
    display: inline-flex;
    align-items: center;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    margin-left: 4px;
    vertical-align: middle;
}
.lang-toggle a {
    padding: 4px 9px;
    font-size: 0.78em;
    font-weight: 600;
    color: #6c757d;
    text-decoration: none;
    line-height: 1.4;
}
.lang-toggle a:hover { background-color: #e9ecef; color: #007bff; }
.lang-toggle a.active { background-color: #007bff; color: #fff; }

/* --- Header nav link ("What is this?") --- */
.header-actions { display: inline-flex; align-items: center; gap: 4px; }
.nav-link {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
}
.nav-link:hover { color: #007bff; background-color: #e9ecef; }

/* --- About / "What is this?" page --- */
.about-page { max-width: 720px; }
.about-page h3 { margin-top: 1.8em; }
.about-lead { font-size: 1.12em; line-height: 1.6; color: #343a40; }
.about-steps { padding-left: 1.2em; }
.about-steps li { margin-bottom: 0.7em; line-height: 1.55; }
.about-foot { color: #6c757d; font-size: 0.95em; margin-top: 1.6em; }

/* --- Briefing list items --- */
.brief-list {
    list-style: none;   /* drop the default bullet next to each date rail */
    margin: 0;
    padding: 0;
}
.brief-item {
    padding: 14px 0;
    border-bottom: 0.5px solid #e9ecef;
}
.brief-item:last-child { border-bottom: none; }
/* Each item: a minimal date "rail" on the left + the brief body on the right. */
.brief-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.brief-datecol {
    flex: 0 0 auto;
    width: 46px;
    text-align: center;
    border-left: 2px solid #f59e0b;   /* sunrise amber, matches the logo */
    padding-left: 11px;
    padding-top: 2px;
    line-height: 1.1;
}
.bd-day {
    display: block;
    font-size: 1.7em;
    font-weight: 600;
    color: #212529;
    font-variant-numeric: tabular-nums;
}
.bd-month { display: block; font-size: 0.8em; color: #495057; }
.bd-dow { display: block; font-size: 0.72em; color: #adb5bd; margin-top: 1px; }
.brief-body { flex: 1 1 auto; min-width: 0; }

.brief-link {
    font-size: 1.12em;
    font-weight: 600;
    text-decoration: none;
}
.brief-link:hover { text-decoration: underline; }
.brief-meta-line {
    margin-top: 3px;
    font-size: 0.82em;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 4px;
}
.brief-date { font-variant-numeric: tabular-nums; }

/* ===================== Dark mode ===================== */
html[data-theme="dark"] body { background-color: #0f1115; color: #e4e6eb; }
html[data-theme="dark"] .container { background-color: #1a1d23; box-shadow: 0 2px 5px rgba(0,0,0,0.4); }

html[data-theme="dark"] .main-header { background-color: transparent; border-bottom-color: #2c313a; }
html[data-theme="dark"] .logo { color: #e4e6eb; }
html[data-theme="dark"] .logo:hover { color: #4dabf7; }
html[data-theme="dark"] .main-nav a { color: #b8bdc4; }
html[data-theme="dark"] .main-nav a:hover,
html[data-theme="dark"] .main-nav a.active { color: #4dabf7; border-bottom-color: #4dabf7; }
html[data-theme="dark"] .nav-link { color: #b8bdc4; }
html[data-theme="dark"] .nav-link:hover { color: #4dabf7; background-color: #23272f; }
html[data-theme="dark"] .about-lead { color: #d3d7dd; }
html[data-theme="dark"] .about-foot { color: #9aa0a8; }

html[data-theme="dark"] h1 { color: #f0f2f5; border-bottom-color: #2c313a; }
html[data-theme="dark"] h2,
html[data-theme="dark"] h3 { color: #e9ebee; }
html[data-theme="dark"] .brief-content h2 { border-bottom-color: #2c313a; }
html[data-theme="dark"] .brief-content blockquote {
    background-color: #2a2415;
    border-left-color: #f59e0b;
    color: #e0cfa0;
}
html[data-theme="dark"] .brief-content blockquote strong { color: #f5b942; }
html[data-theme="dark"] .brief-content h3 .tell-more { color: #6c757d; }
html[data-theme="dark"] .brief-content h3 .tell-more:hover { color: #4dabf7; }
html[data-theme="dark"] .brief-sources { border-top-color: #2c313a; }
html[data-theme="dark"] .brief-sources summary { color: #c7ccd3; }
html[data-theme="dark"] .brief-sources-count,
html[data-theme="dark"] .brief-sources-note { color: #8a909a; }
html[data-theme="dark"] .source-outlet { color: #dfe2e6; }
html[data-theme="dark"] .brief-sources a { color: #b8bdc4; }
html[data-theme="dark"] .brief-sources a:hover { color: #4dabf7; }
html[data-theme="dark"] strong,
html[data-theme="dark"] b { color: #f0f2f5; }
html[data-theme="dark"] hr { border-top-color: #2c313a; }
html[data-theme="dark"] .timestamp,
html[data-theme="dark"] .article-meta,
html[data-theme="dark"] .form-text,
html[data-theme="dark"] .sort-controls,
html[data-theme="dark"] .profile-filter,
html[data-theme="dark"] .date-inputs label,
html[data-theme="dark"] .profile-filter.form-section label { color: #9aa0a8; }

/* brief TOC */
html[data-theme="dark"] .brief-toc a { color: #b8bdc4; }
html[data-theme="dark"] .brief-toc a::after { color: #5c636b; }
html[data-theme="dark"] .brief-toc a:hover { background-color: #23272f; color: #ffffff; }
html[data-theme="dark"] .brief-toc a.active { background-color: #23272f; color: #4dabf7; border-left-color: #4dabf7; }

/* links */
html[data-theme="dark"] a,
html[data-theme="dark"] .article-link,
html[data-theme="dark"] .article-link-original,
html[data-theme="dark"] .sort-link,
html[data-theme="dark"] .profile-link,
html[data-theme="dark"] .page-link,
html[data-theme="dark"] .collections-menu-footer a,
html[data-theme="dark"] .article-details dd a { color: #4dabf7; }
html[data-theme="dark"] .article-link:hover,
html[data-theme="dark"] .article-link-original:hover { color: #74c0fc; }

/* code / pre / blockquote */
html[data-theme="dark"] code,
html[data-theme="dark"] pre { background-color: #23272f; color: #e4e6eb; }
html[data-theme="dark"] blockquote { border-left-color: #3a3f48; color: #adb5bd; }

/* article list + surfaces */
html[data-theme="dark"] .article-item { border-bottom-color: #2c313a; }
html[data-theme="dark"] .article-image-container,
html[data-theme="dark"] .article-image-placeholder { background-color: #23272f; color: #9aa0a8; border-color: #3a3f48; }
html[data-theme="dark"] .content-block,
html[data-theme="dark"] .filter-sort-form,
html[data-theme="dark"] .add-article-form,
html[data-theme="dark"] .date-filter-content,
html[data-theme="dark"] .search-filter { background-color: #23272f; border-color: #2c313a; color: #e4e6eb; }
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .date-inputs input[type="date"],
html[data-theme="dark"] .profile-filter.form-section select { background-color: #23272f; border-color: #3a3f48; color: #e4e6eb; }
html[data-theme="dark"] .search-filter input[type="search"] { color: #e4e6eb; }
html[data-theme="dark"] .form-row { border-bottom-color: #2c313a; }
html[data-theme="dark"] .article-details dt { color: #e9ebee; }
html[data-theme="dark"] .article-details dd { color: #cdd0d5; border-left-color: #2c313a; }

/* pagination / sort / profile states */
html[data-theme="dark"] .page-link { border-color: #2c313a; }
html[data-theme="dark"] .page-link:hover,
html[data-theme="dark"] .sort-link:hover,
html[data-theme="dark"] .profile-link:hover { background-color: #23272f; }
html[data-theme="dark"] .page-link.disabled { background-color: #1a1d23; color: #6c757d; border-color: #2c313a; }
html[data-theme="dark"] .sort-link.active { background-color: #20364d; color: #74c0fc; }
html[data-theme="dark"] .collections-menu-footer { border-top-color: #2c313a; }

/* theme toggle */
html[data-theme="dark"] .theme-toggle { color: #9aa0a8; }
html[data-theme="dark"] .theme-toggle:hover { color: #4dabf7; background-color: #23272f; }

/* language toggle */
html[data-theme="dark"] .lang-toggle { border-color: #3a3f48; }
html[data-theme="dark"] .lang-toggle a { color: #9aa0a8; }
html[data-theme="dark"] .lang-toggle a:hover { background-color: #23272f; color: #4dabf7; }
html[data-theme="dark"] .lang-toggle a.active { background-color: #20364d; color: #74c0fc; }

/* briefing list */
html[data-theme="dark"] .brief-item { border-bottom-color: #2c313a; }
html[data-theme="dark"] .brief-meta-line { color: #9aa0a8; }
html[data-theme="dark"] .bd-day { color: #f0f2f5; }
html[data-theme="dark"] .bd-month { color: #b8bdc4; }
html[data-theme="dark"] .bd-dow { color: #6c757d; }
html[data-theme="dark"] .brief-standfirst,
html[data-theme="dark"] .brief-standfirst-list { color: #b8bdc4; }
/* ===================== End dark mode ===================== */
