/* ============================================================
   THE HIDEOUT — news.html
   Page-specific styles. Loaded AFTER styles.css.
   Announcement + changelog timeline (grew out of updates.css).
   ============================================================ */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- filter bar ---------- */
.news-bar {
  position: sticky; top: var(--nav-h); z-index: 20;
  background: rgba(4, 7, 10, 0.86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.news-bar .wrap { padding-block: 14px; }
.news-bar__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 920px; margin-inline: auto; }
.news-bar .tab { min-height: 40px; }
.news-bar .tab:focus-visible { outline: 2px solid var(--aqua); outline-offset: 3px; border-radius: 999px; }
.news-follow { font-family: var(--mono); font-size: 12px; color: var(--fg-dim); letter-spacing: .06em; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; }
.news-follow:hover { color: var(--aqua); }
.news-follow svg { width: 16px; height: 16px; }

.news-section { padding-block: clamp(24px, 4vw, 48px) clamp(56px, 8vw, 96px); }

/* ---------- timeline ---------- */
.timeline { max-width: 920px; margin-inline: auto; }

.post {
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: clamp(20px, 4vw, 40px);
  scroll-margin-top: calc(var(--nav-h) + 80px);
}
.post:last-of-type { border-bottom: none; }

.news-post.is-pinned .post-body { position: relative; }
.news-post.is-pinned {
  border: 1px solid var(--aqua-line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.06), rgba(34, 211, 238, 0.015));
  padding: 28px clamp(18px, 3vw, 28px);
  margin-bottom: 16px;
}

/* ---------- date rail ---------- */
.post-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.08em;
  line-height: 1.6;
}
.post-date time { display: block; }
.post-date .day {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 34px;
  line-height: 1;
  margin-bottom: 4px;
  color: var(--aqua);
  text-shadow: 0 0 30px rgba(34, 211, 238, 0.35);
  letter-spacing: -0.03em;
}
.post-date .month { display: block; letter-spacing: 0.2em; text-transform: uppercase; color: var(--fg-muted); }
.post-date .year { display: block; color: var(--fg-dim); }
.post-date .ver {
  margin-top: 14px;
  padding: 4px 10px;
  border: 1px solid var(--aqua-line);
  color: var(--aqua);
  background: var(--aqua-ghost);
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.12em;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- badges ---------- */
.news-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.news-type, .news-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--fg-muted);
}
.news-type--ann { color: var(--aqua); border-color: var(--aqua-line); background: var(--aqua-ghost); }
.news-type--log { color: #c4b5fd; border-color: rgba(196, 181, 253, .32); background: rgba(196, 181, 253, .08); }
.news-badge--pin { color: #fcd34d; border-color: rgba(252, 211, 77, .35); background: rgba(252, 211, 77, .08); }
.news-badge--pin svg { width: 12px; height: 12px; }
.news-badge--tag { letter-spacing: .1em; }

/* ---------- post body ---------- */
.post-body { min-width: 0; }
.post-body h2 {
  font-family: var(--display);
  font-size: clamp(21px, 2.6vw, 26px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.post-author { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.post-author img, .news-author__mono { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); flex: none; }
.news-author__mono { display: inline-grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--aqua); }
.post-author .name { font-family: var(--display); font-size: 14.5px; font-weight: 600; color: var(--fg); }
.news-src { font-family: var(--mono); font-size: 11px; color: var(--fg-dim); letter-spacing: .04em; }
.news-src::before { content: "·"; margin-right: 10px; color: var(--fg-dim); }
a.news-src:hover { color: var(--aqua); }

.post-content { font-size: 15px; color: var(--fg-muted); line-height: 1.75; font-family: var(--body); }

/* rendered markdown (server-side from Discord markdown) */
.ann-text { word-break: break-word; overflow-wrap: anywhere; }
.ann-text h3 { font-family: var(--display); font-size: 17px; margin: 18px 0 6px; text-transform: uppercase; color: var(--fg); letter-spacing: 0.01em; }
.ann-text h4 { font-family: var(--display); font-size: 15px; margin: 14px 0 4px; color: var(--fg); }
.ann-text ul, .ann-text ol { margin: 8px 0; padding-left: 22px; }
.ann-text li { padding: 2px 0; }
.ann-text li::marker { color: var(--aqua); }
.ann-text a { color: var(--aqua); text-decoration: underline; text-underline-offset: 2px; }
.ann-text a:hover { color: var(--aqua-bright); }
.ann-text strong { color: var(--fg); }
.ann-text u { text-underline-offset: 3px; }
.ann-text blockquote { border-left: 3px solid var(--line-strong); padding-left: 12px; margin: 8px 0; color: var(--fg-muted); }
.ann-text code { background: rgba(255,255,255,0.06); padding: 1px 5px; border-radius: 4px; font-family: var(--mono); font-size: 12.5px; }
.ann-text pre { background: rgba(255,255,255,0.04); padding: 12px; border-radius: 8px; overflow-x: auto; margin: 8px 0; border: 1px solid var(--line); }
.ann-text pre code { background: none; padding: 0; }

/* embeds + images */
.post-embed {
  border-left: 3px solid var(--aqua);
  background: var(--surface);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 14px 0;
}
.post-embed .embed-title { font-family: var(--display); font-size: 15px; font-weight: 600; margin: 0 0 6px; }
.post-embed .embed-title a { color: var(--aqua); }
.post-embed .embed-title a:hover { text-decoration: underline; }
.post-embed .embed-desc { font-size: 13.5px; color: var(--fg-muted); white-space: pre-wrap; word-break: break-word; }
.post-embed img { max-width: 100%; height: auto; border-radius: 8px; margin-top: 10px; border: 1px solid var(--line); }

.news-images { margin-top: 16px; display: grid; gap: 10px; }
.news-images--grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.news-img { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.news-img img { width: 100%; height: auto; max-height: 520px; object-fit: cover; transition: transform .4s var(--ease); }
.news-images--grid .news-img img { aspect-ratio: 16 / 10; }
.news-img:hover img { transform: scale(1.015); }

/* long posts fold */
.news-clamp.is-clamped { max-height: 520px; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent); mask-image: linear-gradient(180deg, #000 72%, transparent); }
.news-readmore {
  margin-top: 10px; padding: 8px 16px; min-height: 40px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  font-family: var(--display); font-weight: 600; font-size: 13.5px; color: var(--fg);
  transition: border-color .2s, color .2s;
}
.news-readmore:hover { border-color: var(--aqua-line); color: var(--aqua); }

/* ---------- commit day cards ---------- */
.log-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.log-item + .log-item { border-top: 1px solid var(--line); }
.log-row, .log-item summary {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap;
  padding: 11px 14px; font-size: 14px; line-height: 1.5;
}
.log-item summary { cursor: pointer; list-style: none; }
.log-item summary::-webkit-details-marker { display: none; }
.log-item summary:hover { background: rgba(255,255,255,.02); }
.log-item summary:focus-visible { outline: 2px solid var(--aqua); outline-offset: -2px; border-radius: 0; }
.log-title { color: var(--fg); font-weight: 600; position: relative; padding-left: 18px; flex: 1 1 280px; min-width: 0; overflow-wrap: anywhere; }
.log-title::before { content: "+"; position: absolute; left: 0; color: var(--aqua); font-family: var(--mono); font-weight: 700; }
.log-item details .log-title::after { content: "›"; display: inline-block; margin-left: 8px; color: var(--fg-dim); transition: transform .2s var(--ease); }
.log-item details[open] .log-title::after { transform: rotate(90deg); }
.log-meta { display: inline-flex; gap: 10px; font-family: var(--mono); font-size: 11px; color: var(--fg-dim); letter-spacing: .04em; white-space: nowrap; }
.log-repo { color: #c4b5fd; }
.log-detail { padding: 0 14px 14px 32px; font-size: 14px; color: var(--fg-muted); line-height: 1.7; }

/* ---------- states ---------- */
.news-note { color: var(--fg-dim); font-family: var(--mono); font-size: 13px; padding: 28px 0; }
.news-note--warn { padding: 12px 14px; margin-top: 16px; border: 1px solid rgba(251, 191, 36, .3); background: rgba(251, 191, 36, .06); color: #fcd34d; border-radius: 10px; font-size: 12px; }
.news-note--error { color: var(--fg-muted); }
.news-retry { margin-left: 8px; color: var(--aqua); text-decoration: underline; text-underline-offset: 3px; font-family: var(--mono); font-size: 13px; min-height: 32px; }

.news-more { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 28px; max-width: 920px; margin-inline: auto; }
.news-status { font-family: var(--mono); font-size: 12px; color: var(--fg-dim); letter-spacing: .04em; min-height: 1.4em; }

.news-skel .sk { display: block; height: 12px; border-radius: 6px; margin-bottom: 12px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-3) 50%, var(--surface) 100%); background-size: 200% 100%; animation: newsShimmer 1.4s linear infinite; }
.news-skel .sk--day { width: 52px; height: 34px; }
.news-skel .sk--chip { width: 110px; height: 20px; border-radius: 999px; }
.news-skel .sk--title { width: 64%; height: 22px; margin-bottom: 18px; }
.news-skel .sk--short { width: 40%; }
@keyframes newsShimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .news-skel .sk { animation: none; }
  .news-img img { transition: none; }
}

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .news-bar .wrap { padding-block: 10px; }
  .news-bar .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .news-bar .tab { white-space: nowrap; padding: 8px 14px; font-size: 13.5px; }
  .news-follow { display: none; }
  .post { grid-template-columns: 1fr; gap: 10px; padding: 26px 0; }
  .post-date time { display: flex; align-items: baseline; gap: 8px; }
  .post-date { display: flex; align-items: baseline; gap: 10px; }
  .post-date .day { font-size: 22px; margin-bottom: 0; }
  .post-date .ver { margin-top: 0; margin-left: auto; }
  .news-post.is-pinned { padding: 20px 16px; }
  .log-detail { padding-left: 14px; }
  .news-images--grid { grid-template-columns: 1fr; }
}

/* the current page in the mobile menu */
.mobile-menu a[aria-current="page"] { color: var(--aqua); }

/* hero lines up with the feed column */
.news-hero .wrap { max-width: calc(920px + 2 * var(--gutter)); }

/* "and N more" row for a big push */
.log-more { font-family: var(--mono); font-size: 12px; color: var(--fg-dim); padding-left: 18px; }
