/* News archive page (loaded on top of theme.css).
   Same bones as the help browser: a rail of everything, the chosen one open in
   full beside it. The mini-card look is shared with the home page widget. */

.pagehead--news { padding-bottom: 30px; }

.newspage {
    display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 26px;
    padding-top: 30px; padding-bottom: 70px; align-items: start;
}

/* ---------- archive rail ---------- */
.newsnav {
    position: sticky; top: 66px; max-height: calc(100vh - 90px);
    display: flex; flex-direction: column; min-height: 0;
}
.newsnav__search { padding: 0 0 12px; flex: none; }
.newsnav__search input {
    width: 100%; padding: 9px 14px;
    background: var(--stone-900); color: var(--text);
    border: 1px solid var(--stone-700); border-radius: 999px;
    font-family: var(--body); font-size: .95rem;
}
.newsnav__search input:focus {
    outline: none; border-color: var(--arcane-deep);
    box-shadow: 0 0 0 3px rgba(187,134,252,.16);
}
.newsnav__list { overflow-y: auto; flex: 1 1 auto; padding-right: 6px; }
.newsnav__none { color: var(--text-faint); font-size: .9rem; }

details.nyear { border-bottom: 1px solid var(--stone-700); }
details.nyear > summary {
    cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px;
    padding: 11px 6px; font-family: var(--body); font-weight: 700; font-size: .8rem;
    letter-spacing: .08em; color: var(--gold-bright);
}
details.nyear > summary::-webkit-details-marker { display: none; }
details.nyear > summary:hover { color: #fff; }
.nyear__n { margin-left: auto; font-family: var(--mono); font-size: .68rem;
    color: var(--text-faint); font-weight: 400; letter-spacing: 0; }
.nyear__items { display: flex; flex-direction: column; gap: 8px; padding: 2px 0 14px; }

/* the home page's card, stacked in a rail instead of a horizontal gallery */
.newsnav .news-mini { width: 100%; padding: 12px 14px; gap: 5px; }
.newsnav .news-mini__subject { font-size: .98rem; }
.newsnav .news-mini:hover, .newsnav .news-mini:focus-visible { transform: translateY(-2px); }
.newsnav .news-mini[aria-current="true"] {
    border-color: var(--gold); background: linear-gradient(180deg, #2a2033, var(--stone-900));
    box-shadow: 0 0 0 1px var(--gold-dim), 0 8px 18px rgba(0,0,0,.45);
}

/* ---------- the entry, open on parchment ---------- */
.newsmain { min-height: 60vh; }
.news-full {
    position: relative; padding: 34px 40px 40px; border-radius: 5px; color: var(--ink);
    background: var(--noise), linear-gradient(172deg, var(--parchment), var(--parchment-2));
    background-blend-mode: multiply, normal;
    border: 1px solid var(--parch-edge);
    box-shadow: 0 14px 34px rgba(0,0,0,.5), inset 0 0 60px rgba(120,95,50,.16);
}
.news-full__meta { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.news-full__date { font-family: var(--mono); font-size: .76rem; letter-spacing: .04em; color: var(--ink-dim); }
.news-full__from { font-family: var(--display); font-size: 1.02rem; color: #7a3b2a; font-weight: 600; }
.news-full__subject {
    font-family: var(--display); font-weight: 700; font-size: clamp(1.6rem, 3.2vw, 2.2rem);
    color: #241809; margin: 0 0 18px; line-height: 1.12;
    padding-bottom: 16px; border-bottom: 1px solid rgba(150,120,70,.3);
}
/* posted as plain text, sometimes hand-aligned — keep the author's line breaks */
.news-full__text {
    white-space: pre-wrap; word-wrap: break-word;
    /* .96rem for the same reason as .hart__body: monospace sets wider */
    font-family: var(--article); font-size: .96rem; line-height: 1.62; color: var(--ink);
    letter-spacing: var(--mono-track);
}
/* same parchment purple the help articles use for cross-references */
.news-full__text a { color: var(--arcane-ink); border-bottom: 1px solid rgba(106,47,166,.38); }
.news-full__text a:hover { color: var(--arcane-ink-hi); border-bottom-color: var(--arcane-ink-hi); }
.news-empty { padding: 30px; text-align: center; color: var(--text-faint); }

@media (max-width: 900px) {
    .newspage { grid-template-columns: 1fr; gap: 18px; }
    /* min-width:0 all the way down to the scroller: a grid/flex item defaults to
       min-width:auto, so without this the gallery's min-content width pushes the
       whole column -- and the page with it -- wider than the screen */
    .newsnav { position: static; max-height: none; min-width: 0; }
    .newsnav__list { overflow: visible; min-width: 0; }
    details.nyear, details.nyear > * { min-width: 0; }
    /* the picker IS the disclosure: one year on show, the rest out of the way */
    details.nyear { display: none; }
    details.nyear.nyear--active { display: block; border-bottom: 0; }
    details.nyear.nyear--active > summary { display: none; }
    /* and that year's notes ride a horizontal rail instead of a vertical mile --
       the same swipeable gallery shape the home page uses for its eight cards */
    .nyear__items {
        display: grid; grid-auto-flow: column; grid-auto-columns: 78%;
        gap: 12px; padding: 2px 0 12px;
        overflow-x: auto; scroll-snap-type: x mandatory;
        overscroll-behavior-x: contain; scrollbar-width: thin;
    }
    .newsnav .news-mini { width: auto; scroll-snap-align: start; }
    .news-full { padding: 24px 20px 30px; }
}
@media (max-width: 560px) { .nyear__items { grid-auto-columns: 86%; } }
