/* ==========================================================================
   /news/ — TAIL_SYSTEM_LOG (V93, Sprint 9 handoff "News"). Light console;
   metrics are the drafts'.
   ========================================================================== */

/* --- .news-body: an entry's body_html ---------------------------------
   Shared by the public entry page, the admin preview AND the TinyMCE
   content area (news.php loads this file as content_css with body_class
   news-body). The editor iframe has no base.css, so this block uses
   LITERALS, never the base.css tokens. Links are #2F7A86 everywhere —
   table cells and headings included (base.css only colours p/li/dd links).
   Scoped darkness (owner draft, Q9): the code block and the YouTube box
   are the terminal/video stage #0d1319 — the dark IS the metaphor. */
.news-body {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #1a1a1a;
    text-align: left;
    overflow-wrap: anywhere;
}

.news-body > :first-child { margin-top: 0; }

.news-body p { margin: 0 0 16px; }

.news-body a,
.news-body a:visited {
    color: #2F7A86;
    text-decoration: underline;
}

.news-body a:hover { color: #254a4b; }

.news-body h2 {
    font-family: 'Source Code Pro', monospace;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.03em;
    color: #254a4b;
    text-align: left;
    text-transform: none;
    border-bottom: 1px solid rgba(53, 134, 145, 0.2);
    padding-bottom: 8px;
    margin: 32px 0 14px;
}

.news-body h3 {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.03em;
    color: #254a4b;
    text-align: left;
    text-transform: none;
    margin: 24px 0 10px;
}

.news-body ul,
.news-body ol {
    margin: 0 0 16px;
    padding-left: 1.3em;
}

.news-body li + li { margin-top: 6px; }

.news-body blockquote {
    margin: 24px 0;
    padding: 14px 18px;
    border-left: 3px solid #a26538;
    background: #fdfdfc;
    border-radius: 0 4px 4px 0;
    font-style: italic;
    color: #254a4b;
}

.news-body blockquote p:last-child { margin-bottom: 0; }

.news-body pre {
    margin: 0 0 16px;
    padding: 14px 16px;
    background: #0d1319;
    color: #e6f6f8;
    border-radius: 4px;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    overflow-x: auto;
    overflow-wrap: normal;
    white-space: pre;
    text-align: left;
}

.news-body pre code {
    font: inherit;
    color: inherit;
    background: none;
    padding: 0;
}

/* inline code stays light (the draft defines only the dark block) */
.news-body :not(pre) > code {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.88em;
    color: #254a4b;
    background: rgba(53, 134, 145, 0.1);
    padding: 0.1em 0.35em;
    border-radius: 3px;
}

/* the renderer wraps every table in .news-table-wrap (320px: the table
   scrolls inside, the page never pans) */
.news-body .news-table-wrap {
    overflow-x: auto;
    margin: 0 0 16px;
}

.news-body table {
    width: 100%;
    border-collapse: collapse;
    background: #fdfdfc;
    border: 1px solid rgba(53, 134, 145, 0.2);
    font-size: 0.95rem;
    overflow-wrap: normal;
}

.news-body th {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: #254a4b;
    text-align: left;
    padding: 8px 12px;
}

.news-body td {
    padding: 8px 12px;
    border-top: 1px solid rgba(53, 134, 145, 0.2);
    vertical-align: top;
    text-align: left;
}

.news-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* --- page frame (list + entry + 404) ---------------------------------
   base.css centres .container text and styles every h1 as the centred
   lowercase brand row; the news pages are plain left-aligned columns. */
.news-main {
    text-align: left;
    padding-bottom: 40px;
}

.news-section,
.news-entry {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
    color: #1a1a1a;
    font-size: 1.05rem;
}

.news-title,
.news-entry-title {
    display: block;
    font-family: 'Source Code Pro', monospace;
    font-weight: 700;
    font-size: clamp(1.3rem, 3.5vw, 1.7rem);
    line-height: 1.3;
    letter-spacing: normal;
    text-transform: none;
    text-align: left;
    text-wrap: balance;
    overflow-wrap: anywhere;
}

.news-title {
    color: #a26538;
    margin: 0 0 24px;
}

.news-title-sub {
    font-weight: 400;
    color: #2F7A86;
}

/* --- the list ---------------------------------------------------------- */
.news-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin: 0 0 18px;
}

.news-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.news-chip {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.6;
    padding: 6px 10px;
    border-radius: 3px;
    border: 1px solid #2F7A86;
    background: #ffffff;
    color: #2F7A86;
    text-decoration: none;
}

.news-chip:hover,
.news-chip:focus-visible { border-color: #254a4b; color: #254a4b; }

.news-chip[aria-current="true"],
.news-chip[aria-current="true"]:hover {
    background: #2F7A86;
    border-color: #2F7A86;
    color: #ffffff;
}

.news-rss,
.news-pager a,
.news-more-link {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    color: #2F7A86;
    text-decoration: none;
}

.news-rss:hover,
.news-pager a:hover,
.news-more-link:hover { color: #254a4b; }

.news-list {
    background: #fdfdfc;
    border: 1px solid rgba(53, 134, 145, 0.2);
    border-radius: 6px;
    padding: 4px 22px;
}

.news-item {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 14px 20px;
    align-items: start;
    padding: 20px 0;
}

.news-item + .news-item { border-top: 1px dashed rgba(53, 134, 145, 0.3); }

.news-thumb {
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 4px;
    overflow: hidden;
    background: #e9eef0;
    border: 1px solid rgba(53, 134, 145, 0.2);
    color: #254a4b;
    text-decoration: none;
}

.news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Q7: no cover = the grey 4:3 tile with the prompt */
.news-thumb-none {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-family: 'Source Code Pro', monospace;
    font-weight: 700;
    font-size: 1.1rem;
    color: #254a4b;
}

.news-item-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.news-meta {
    margin: 0;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #666666;
}

.news-meta-cat { color: #a26538; }

.news-item-title {
    margin: 0;
    font-family: 'Source Code Pro', monospace;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
    text-align: left;
    text-transform: none;
    text-wrap: pretty;
    overflow-wrap: anywhere;
}

.news-item-title a {
    color: #254a4b;
    text-decoration: none;
}

.news-item-title a:hover,
.news-item-title a:focus-visible { color: #2F7A86; }

.news-item-teaser {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #1a1a1a;
    text-wrap: pretty;
    overflow-wrap: anywhere;
}

.news-empty {
    margin: 0;
    padding: 22px 0;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.85rem;
    color: #666666;
}

.news-pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 18px 0 0;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.8rem;
    font-weight: 700;
}

.news-pager span[aria-disabled="true"] {
    color: #666666;
    opacity: 0.55;
}

.news-pager-pos {
    color: #666666;
    font-weight: 400;
}

@media (max-width: 560px) {
    .news-item { grid-template-columns: 88px minmax(0, 1fr); }
}

/* --- one entry --------------------------------------------------------- */
.news-crumbs {
    margin: 0 0 14px;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.news-crumb-home { color: #2F7A86; text-decoration: none; }
.news-crumb-cat { color: #a26538; text-decoration: none; }
.news-crumb-home:hover, .news-crumb-cat:hover { color: #254a4b; }

.news-crumb-sep {
    color: #666666;
    font-weight: 400;
}

.news-entry-title {
    color: #254a4b;
    margin: 0 0 10px;
}

.news-entry > .news-meta { margin: 0 0 24px; }

.news-cover { margin: 0 0 28px; }

.news-cover img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(53, 134, 145, 0.2);
}

/* Q5: the teaser opens the entry as its lead */
.news-lead {
    font-size: 1.15rem;
    margin: 0 0 16px;
    color: #254a4b;
    text-wrap: pretty;
    overflow-wrap: anywhere;
}

.news-more {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 20px;
    margin: 32px 0 0;
    padding-top: 16px;
    border-top: 1px dashed rgba(53, 134, 145, 0.3);
}

.news-more-older { overflow-wrap: anywhere; }

/* the click-to-load YouTube box (news.js): scoped darkness, the video
   stage IS the metaphor (Q9) */
.news-body .news-video {
    aspect-ratio: 16 / 9;
    background: #0d1319;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 12px;
    padding: 22px;
    margin: 0 0 16px;
}

/* no overflow:hidden on the box: aspect-ratio is a MINIMUM then, so at
   320px the button + note grow the box instead of being cut */
.news-body .news-video.is-loaded { padding: 0; }

.news-video-load {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #ffffff;
    background: #a26538;
    border: none;
    border-radius: 4px;
    padding: 10px 16px;
    cursor: pointer;
}

.news-video-load:hover,
.news-video-load:focus-visible { background: #254a4b; }

.news-video-load:focus-visible { outline: 2px solid #a5f3fc; outline-offset: 2px; }

.news-body .news-video-note {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.55;
    color: #e6f6f8;
    max-width: 52ch;
}

.news-body a.news-video-link,
.news-body a.news-video-link:visited { color: #a5f3fc; }

.news-video-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 6px;
}

/* --- preview bar (admin) + 404 ------------------------------------------ */
.news-preview-bar {
    max-width: 800px;
    margin: 0 auto 24px;
    padding: 10px 14px;
    border: 1px dashed #a26538;
    border-radius: 4px;
    background: rgba(162, 101, 56, 0.06);
    font-family: 'Source Code Pro', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    color: #a26538;
    overflow-wrap: anywhere;
}

.news-404-copy { margin: 0 0 16px; }

/* house rule: every element given a CSS display above keeps [hidden] working */
.news-title[hidden], .news-entry-title[hidden], .news-bar[hidden], .news-filters[hidden], .news-item[hidden],
.news-thumb[hidden], .news-thumb img[hidden], .news-thumb-none[hidden], .news-item-text[hidden], .news-pager[hidden],
.news-cover img[hidden], .news-more[hidden], .news-body .news-video[hidden], .news-video-frame[hidden] { display: none; }
