/*
 * news.css - the rebuilt news pages (Chapter Seven, session 87;
 * sitepages/news.py, templates/news/new/). Loaded after cards.css and
 * toyhome.css, whose band, panel, section head and Show more it uses.
 *
 * The list is a traditional vertical list of stories, NOT the catalog's
 * cards (Bill): its own row, nothing of .hb-card. Every rule here is named
 * hb-nw-, a prefix no other page uses. The accent is the old news pages'
 * orange-pink; the R2-D2 theme will change it.
 */
.hb-nw { --nw-accent: #E8896B; }

/* the date over a headline */
.hb-nw-kicker {
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--nw-accent); font-weight: 700;
}

/* the lead: the newest post, large */
.hb-nw-lead {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 24px; align-items: center; margin: 4px 0 26px;
  background: #1d1d1d; border-radius: 10px; overflow: hidden;
  color: var(--t1); text-decoration: none;
}
.hb-nw-lead:hover, .hb-nw-lead:focus { color: var(--t1); text-decoration: none; }
.hb-nw-lead:hover h2 { color: var(--nw-accent); }
.hb-nw-lead img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.hb-nw-lead-text { padding: 18px 24px 18px 0; }
.hb-nw-lead h2 {
  font-size: 30px; line-height: 1.15; margin: 8px 0 12px; font-weight: 800;
  color: var(--t1);
}
.hb-nw-lead p {
  font-size: 17px; line-height: 1.5; color: var(--t2); margin: 0 0 14px;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}

/* the list: a row per post, under a head per month */
.hb-nw-list { max-width: 980px; }
.hb-nw-month { margin: 28px 0 2px 0; }
.hb-nw-month:first-child { margin-top: 0; }
.hb-nw-row {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px;
  align-items: start; padding: 18px 0; border-bottom: 1px solid #333;
  color: var(--t1); text-decoration: none;
}
.hb-nw-row:last-child { border-bottom: 0; }
.hb-nw-row:hover, .hb-nw-row:focus { color: var(--t1); text-decoration: none; }
.hb-nw-row:hover h3 { color: var(--nw-accent); }
.hb-nw-row img, .hb-nw-nopic {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block;
  border-radius: 6px; background: #151515;
}
.hb-nw-row h3 {
  font-size: 21px; line-height: 1.25; font-weight: 800; margin: 4px 0 8px;
  color: inherit;
}
.hb-nw-row p {
  font-size: 16.5px; line-height: 1.5; color: var(--t2); margin: 0 0 10px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hb-nw-meta { font-size: 12px; color: var(--t3); letter-spacing: .03em; }
.hb-nw-meta b { color: var(--t1); font-weight: 600; }
.hb-nw-none { color: var(--t3); margin: 12px 0; }

@media (max-width: 860px) {
  .hb-nw-lead { grid-template-columns: 1fr; }
  .hb-nw-lead-text { padding: 0 18px 18px; }
}
@media (max-width: 640px) {
  .hb-nw-row { grid-template-columns: 120px minmax(0, 1fr); gap: 14px; }
  .hb-nw-row h3 { font-size: 17px; }
  .hb-nw-row p { -webkit-line-clamp: 2; }
}

/* ---------------------------------------------------------------- a post */

/* the top: date, headline, preview text, tags - and the picture beside */
.hb-nw-top {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px; align-items: center; margin: 6px 0 26px;
}
.hb-nw-title {
  font-size: 40px; line-height: 1.1; font-weight: 800; margin: 6px 0 12px;
  color: var(--t1); background: none; padding: 0; text-transform: none;
}
.hb-nw-stand { font-size: 18px; line-height: 1.5; color: var(--t2); margin: 0 0 14px; }
.hb-nw-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px; }
.hb-nw-tags .hb-pill { text-decoration: none; }
.hb-nw-hero { background: #151515; border-radius: 10px; overflow: hidden; text-align: center; }
.hb-nw-hero img { max-width: 100%; max-height: 560px; display: inline-block; }

/* the text: one reading column; staff's HTML, drawn as stored but for the
   display rules in sitepages/news.py */
.hb-nw-text { font-size: 19px; line-height: 1.65; color: #eee; }
.hb-nw-text p { margin: 0 0 1em; }
.hb-nw-text h2, .hb-nw-text h3 { color: var(--t1); font-weight: 800; margin: 1.2em 0 .5em; }
.hb-nw-text hr { border: 0; border-top: 1px solid var(--line); margin: 1.6em 0; clear: both; }
.hb-nw-text a { color: var(--nw-accent); }
.hb-nw-text img { max-width: 100%; height: auto; }
.hb-nw-text::after { content: ''; display: block; clear: both; }
/* an item placed by its marker: its card, beside the text that follows */
.hb-nw-placed {
  float: right; clear: right; width: 210px; margin: 4px 0 14px 22px;
  padding: 0; background: none;
}

/* the items the text does not place, and the comments */
.hb-nw-items { margin-top: 34px; }
.hb-nw-comments { margin: 40px 0 0; }
.hb-nw-comment { padding: 12px 0; border-bottom: 1px solid #333; }
.hb-nw-comment-who { font-size: 12px; color: var(--t3); }
.hb-nw-comment-who b { color: var(--t1); font-weight: 600; }
.hb-nw-comment p { margin: 6px 0 0; color: var(--t2); font-size: 17px; line-height: 1.5; }
.hb-nw-thanks { color: var(--t1); margin: 14px 0 0; }
.hb-nw-say { margin-top: 16px; }
.hb-nw-say label { display: block; font-size: 12px; color: var(--t3); letter-spacing: .05em; text-transform: uppercase; }
.hb-nw-say textarea {
  width: 100%; margin-top: 6px; padding: 10px; border-radius: 6px;
  border: 1px solid var(--line); background: #1b1b1b; color: var(--t1); font-size: 15px;
}
.hb-nw-say-row { display: flex; align-items: center; gap: 12px; justify-content: flex-end; margin-top: 8px; }
.hb-nw-say-row [data-form-said] { color: var(--nw-accent); font-size: 13px; margin-right: auto; }
.hb-nw-none a { color: var(--nw-accent); }

@media (max-width: 860px) {
  .hb-nw-top { grid-template-columns: 1fr; }
  .hb-nw-title { font-size: 30px; }
  .hb-nw-placed { float: none; width: auto; max-width: 260px; margin: 0 0 14px; }
}

/* a draft, seen by staff only (session 89): the bar over the post */
.hb-nw-draftbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center;
  gap: 12px; flex-wrap: wrap; padding: 10px 16px; margin-bottom: 12px;
  background: #1b1b1b; border: 1px solid #333; border-radius: 8px;
  /* a grid item: without this a long one-line note sets the column's width
     and pushes the bar and the post past the page's edge (Bill, session 90) */
  min-width: 0;
}
.hb-nw-draftpill {
  background: #FFD452; color: #111; border-radius: 12px; padding: 2px 10px;
  font-size: 12px; font-weight: 800; letter-spacing: .04em;
}
.hb-nw-draftsaid { color: var(--t2); font-size: 13px; }
/* the note a draft was written from (session 90) - one line, whole on hover */
.hb-nw-draftnote { min-width: 0; max-width: 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-nw-draftlink { color: var(--t1); font-size: 13px; text-decoration: underline; }

/* editing a post on its page, staff only (session 89; js/news_edit.js) -
   the look of Bill's edit mock (session 87-88) */
.hb-nw-livepill { background: #24313b; color: #98BEE3; }
.hb-nw-edsaid { color: #FFD452; font-size: 12px; }
.hb-nw-edacts { display: inline-flex; gap: 8px; }
.hb-nw-edacts[hidden] { display: none; }
.hb-nw-edbtn {
  border-radius: 6px; padding: 6px 12px; font-size: 13px; font-weight: 700; cursor: pointer;
  background: none; color: var(--t1); border: 1px solid #9FAA9D;
}
.hb-nw-edbtn:disabled { opacity: .45; cursor: default; }
.hb-nw-edbtn.hb-nw-edgo { background: #FFD452; color: #111; border-color: #FFD452; }
.hb-nw-edbtn:focus { outline: none; }
.hb-nw-edbtn:focus-visible { outline: 2px solid #FFD452; outline-offset: 2px; }
.hb-nw-editing [contenteditable="true"] { outline: 1px dashed transparent; outline-offset: 4px; border-radius: 2px; }
.hb-nw-editing [contenteditable="true"]:hover { outline-color: #555; }
.hb-nw-editing [contenteditable="true"]:focus { outline: 1px dashed #FFD452; }
.hb-nw-editing [data-placeholder]:empty::before { content: attr(data-placeholder); color: #666; }
.hb-nw-ed-tools {
  position: sticky; top: 60px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  background: #1b1b1b; border: 1px solid #333; border-radius: 6px; padding: 4px; margin: 0 0 12px;
}
.hb-nw-ed-tools[hidden] { display: none; }
.hb-nw-ed-tools button { background: none; border: 0; color: #ddd; width: 32px; height: 28px; border-radius: 4px; cursor: pointer; }
.hb-nw-ed-tools button:hover { background: #2a2a2a; }
.hb-nw-ed-hint { font-size: 12px; color: #9FAA9D; margin-left: 8px; }
.hb-nw-ed-tag { position: relative; padding-right: 22px; cursor: default; }
.hb-nw-ed-tag button {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: #999; font-size: 13px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.hb-nw-ed-addtag {
  background: none; border: 1px dashed #666; color: var(--t1); border-radius: 12px;
  font-size: 12px; padding: 2px 10px; width: 140px;
}
.hb-nw-hero { position: relative; }
.hb-nw-ed-pic {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 120px; margin: 8px; padding: 12px; border: 2px dashed #FFD452; border-radius: 10px;
  color: #ddd; font-size: 13px; cursor: pointer;
}
.hb-nw-ed-pic[hidden] { display: none; }
.hb-nw-ed-pic input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.hb-nw-ed-pic img { max-width: 100%; max-height: 260px; }
.hb-nw-ed-pic small { color: #9FAA9D; }
.hb-nw-editing [data-ref] { position: relative; cursor: grab; outline: 1px dashed #555; outline-offset: 4px; }
.hb-nw-editing [data-ref] a { cursor: grab; }
.hb-nw-ed-n {
  position: absolute; top: -10px; right: -10px; z-index: 3; min-width: 22px; height: 22px;
  border-radius: 11px; background: #FFD452; color: #111; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; padding: 0 6px;
}
.hb-nw-ed-x {
  position: absolute; top: -10px; left: -10px; z-index: 3; width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: #E8896B; color: #111; font-size: 11px; cursor: pointer;
}
.hb-nw-ed-dragging { opacity: .4; }
.hb-nw-text > .hb-nw-ed-before { box-shadow: 0 -3px 0 #FFD452; }
.hb-nw-text > .hb-nw-ed-after { box-shadow: 0 3px 0 #FFD452; }
.hb-nw-ed-cards > .hb-nw-ed-before { box-shadow: -3px 0 0 #FFD452; }
.hb-nw-ed-cards > .hb-nw-ed-after { box-shadow: 3px 0 0 #FFD452; }
.hb-nw-ed-tray { margin-top: 24px; }
.hb-nw-ed-tray[hidden] { display: none; }
.hb-nw-ed-cards { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; min-height: 80px; padding: 12px 4px; }
.hb-nw-ed-cards > .hb-nw-placed { float: none; margin: 0; }
/* while a card is dragged, the tray shows itself as a target - and says so
   when it is empty (session 90; a drop anywhere under the text lands here) */
.hb-nw-ed-carrying .hb-nw-ed-cards { outline: 2px dashed #FFD452; outline-offset: -2px; border-radius: 6px; }
.hb-nw-ed-carrying .hb-nw-ed-cards:empty::after {
  content: "Drop a card here to take it out of the text";
  align-self: center; margin: 0 auto; color: #FFD452; font-size: 14px;
}
.hb-nw-editing [data-ed-dim] { opacity: .45; pointer-events: none; }
.hb-nw-ed-linkbox { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; }
.hb-nw-ed-linkbox[hidden] { display: none; }
.hb-nw-ed-linkbox input {
  width: 300px; max-width: 50vw; background: #111; border: 1px solid #FFD452; border-radius: 4px;
  color: var(--t1); font-size: 13px; padding: 3px 8px;
}
