/* WIJDR REV23 — editorial cards and comment presentation ONLY.
   No selectors here change visibility or behavior of forms, search, pagination,
   moderation, reactions, comments, attachments, or floating UI.
   Page-scoped where possible; public comment styling uses .comments-shell.
*/
:root {
  --rev23-ink:#151410;
  --rev23-cream:#f8f4eb;
  --rev23-paper:#fffefa;
  --rev23-gold:#c49a45;
  --rev23-red:#bd2528;
  --rev23-line:#dfd5c3;
  --rev23-muted:#665e54;
  --rev23-shadow:0 14px 32px rgba(33,23,15,.085);
}

/* DISCUSSION INDEX — restrict to grids whose links are discussion topics. */
.container:has(> .grid.cards > a[href^="/discuss/"]) > .section-kicker,
.container:has(> .grid.cards > a[href^="/discuss/"]) > h1.high-intensity {
  position:relative;
}
.container:has(> .grid.cards > a[href^="/discuss/"]) > .section-kicker {
  color:var(--rev23-red);font-size:.78rem;letter-spacing:.14em;font-weight:900;
}
.container:has(> .grid.cards > a[href^="/discuss/"]) > h1.high-intensity {
  color:var(--rev23-ink);letter-spacing:-.055em;margin-bottom:25px;
}
.container:has(> .grid.cards > a[href^="/discuss/"]) > .grid.cards {
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch;
  gap:18px;margin-top:20px;margin-bottom:24px;
}
.container > .grid.cards > a.card.card-link[href^="/discuss/"] {
  --rev23-topic-border:var(--rev23-line);
  display:flex;flex-direction:column;gap:11px;min-width:0;
  position:relative;isolation:isolate;overflow:hidden;
  padding:24px 25px 23px;border:1px solid var(--rev23-topic-border);
  border-radius:17px;background:linear-gradient(130deg,#fffefa 0%,#f9f5ec 100%);
  box-shadow:0 4px 13px rgba(25,19,10,.045);color:var(--rev23-ink);
  text-decoration:none;transition:border-color .2s,box-shadow .2s,transform .2s;
}
.container > .grid.cards > a.card.card-link[href^="/discuss/"]::before {
  content:"PUBLIC DISCUSSION";display:inline-flex;align-self:flex-start;
  background:#231e1a;color:#f7e9c8;letter-spacing:.12em;
  font-size:.66rem;font-weight:900;padding:6px 10px;border-radius:5px;
}
.container > .grid.cards > a.card.card-link[href^="/discuss/"]::after {
  content:"";position:absolute;left:0;top:0;bottom:0;width:5px;
  background:linear-gradient(180deg,var(--rev23-red),var(--rev23-gold));
}
.container > .grid.cards > a.card.card-link[href^="/discuss/"] h2,
.container > .grid.cards > a.card.card-link[href^="/discuss/"] h3 {
  margin:0;line-height:1.2;letter-spacing:-.03em;
  font-size:clamp(1.22rem,1.65vw,1.65rem);font-weight:850;
  color:#1d1a16;overflow-wrap:anywhere;
}
.container > .grid.cards > a.card.card-link[href^="/discuss/"] p {
  margin:0;color:var(--rev23-muted);line-height:1.62;font-size:.94rem;
  overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;
  -webkit-line-clamp:4;line-clamp:4;overflow:hidden;
}
.container > .grid.cards > a.card.card-link[href^="/discuss/"]:hover,
.container > .grid.cards > a.card.card-link[href^="/discuss/"]:focus-visible {
  border-color:#bd9951;box-shadow:0 18px 35px rgba(53,31,15,.12);transform:translateY(-3px);
}
.container > .grid.cards > a.card.card-link[href^="/discuss/"]:focus-visible {
  outline:3px solid #c99a36;outline-offset:3px;
}

/* LIBRARY INDEX — do not disturb backend filtering, ordering or paging. */
.container:has(> .library-toolbar) > .section-kicker {color:var(--rev23-red);font-weight:850;letter-spacing:.13em}
.container:has(> .library-toolbar) > .library-toolbar {
  padding:15px;display:flex;flex-wrap:wrap;gap:11px;align-items:center;
  border:1px solid var(--rev23-line);border-radius:15px;
  background:var(--rev23-paper);box-shadow:0 4px 12px rgba(38,24,8,.045);
}
.container:has(> .library-toolbar) > .library-toolbar input,
.container:has(> .library-toolbar) > .library-toolbar select {
  min-width:0;min-height:42px;border:1px solid #d8cbb7;border-radius:9px;background:white;
}
.container:has(> .library-toolbar) > .library-toolbar input:focus-visible,
.container:has(> .library-toolbar) > .library-toolbar select:focus-visible {
  outline:3px solid rgba(196,154,69,.32);outline-offset:1px;
}
.container:has(> .library-toolbar) > .library-toolbar .button,
.container:has(> .library-toolbar) > .library-toolbar button {
  border-radius:9px;min-height:42px;font-weight:800;
}
.grid.cards:has(> a.wijdr-library-card) {
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:17px;
  margin-top:18px;align-items:stretch;
}
.grid.cards > a.wijdr-library-card {
  display:flex;gap:0;align-items:stretch;min-width:0;min-height:170px;
  padding:0;overflow:hidden;border-radius:16px;border:1px solid var(--rev23-line);
  background:var(--rev23-paper);box-shadow:0 4px 12px rgba(38,24,8,.045);
  text-decoration:none;transition:transform .2s,box-shadow .2s,border-color .2s;
}
.grid.cards > a.wijdr-library-card:is(:hover,:focus-visible) {
  border-color:var(--rev23-gold);box-shadow:var(--rev23-shadow);transform:translateY(-3px);
}
.grid.cards > a.wijdr-library-card:focus-visible {outline:3px solid #c99a36;outline-offset:2px}
.grid.cards > a.wijdr-library-card .wijdr-library-preview {
  flex:0 0 38%;width:38%;min-height:170px;border:0;border-right:1px solid #ddd0b9;
  border-radius:0;margin:0;background:#e9e0cc;overflow:hidden;
}
.grid.cards > a.wijdr-library-card .wijdr-library-thumb {
  width:100%;height:100%;min-height:170px;max-height:none;object-fit:cover;
  display:block;transition:transform .3s ease;background:#e9e0cc;
}
.grid.cards > a.wijdr-library-card:hover .wijdr-library-thumb {transform:scale(1.035)}
.grid.cards > a.wijdr-library-card .wijdr-library-card-info {
  flex:1;display:flex;flex-direction:column;gap:8px;min-width:0;padding:17px 18px 16px;
}
.grid.cards > a.wijdr-library-card .section-kicker {
  align-self:flex-start;margin:0;padding:4px 9px;border-radius:4px;
  background:#251d17;color:#f6e9c7;font-size:.7rem;letter-spacing:.12em;
  line-height:1.4;text-transform:uppercase;font-weight:900;
}
.grid.cards > a.wijdr-library-card h3 {
  margin:0;font-size:1.08rem;line-height:1.25;font-weight:850;
  letter-spacing:-.025em;color:var(--rev23-ink);overflow-wrap:anywhere;
}
.grid.cards > a.wijdr-library-card p {
  margin:0;color:var(--rev23-muted);font-size:.83rem;line-height:1.5;
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3;
  overflow:hidden;overflow-wrap:anywhere;
}
.grid.cards > a.wijdr-library-card small {
  display:block;margin-top:auto;padding-top:10px;border-top:1px solid #eadfcd;
  font-size:.72rem;line-height:1.5;color:#736b5f;overflow-wrap:anywhere;
}
/* Style existing category/filter and page navigation links; do not change their URLs. */
.container:has(> .library-toolbar) :is(.library-filters,.media-filters,.filter-chips,.library-types) a,
.container:has(> .library-toolbar) :is(.wijdr-pages,.pagination,.library-pagination) a {
  border-radius:9px;border-color:#dacdb9;background:#fffefa;text-decoration:none;
}
.container:has(> .library-toolbar) :is(.library-filters,.media-filters,.filter-chips,.library-types) a:is(:hover,:focus-visible),
.container:has(> .library-toolbar) :is(.wijdr-pages,.pagination,.library-pagination) a:is(:hover,:focus-visible) {
  background:#f4eada;border-color:var(--rev23-gold);
}

/* COMMENTS ON ALL PUBLIC PAGES — visual only; no hidden controls or overlay. */
.comments-shell {
  --rev23-comment-bg:#fffefa;
  border-top:4px solid #231e1a;
  padding:29px clamp(12px,3vw,28px) 38px;
  background:linear-gradient(180deg,#faf4e9 0%,#f8f6f1 170px,#f8f6f1 100%);
  border-radius:18px;min-width:0;
}
.comments-shell > .section-kicker {color:var(--rev23-red);font-weight:900;letter-spacing:.14em;font-size:.76rem}
.comments-shell > h2 {font-size:clamp(1.7rem,3.2vw,2.6rem);letter-spacing:-.045em;margin:6px 0 10px;color:#201b15;line-height:1.1}
.comments-shell > .muted {max-width:90ch;color:#60574b}
.comments-shell :is(.privacy-note,.comment-privacy-note) {
  border-left:4px solid var(--rev23-gold);background:#fff8e9;color:#594a35;
  border-radius:9px;padding:13px 16px;
}
.comments-shell :is(.comment-form,.anonymous-first-form) {
  background:var(--rev23-comment-bg);padding:18px;
  border:1px solid #dfcfb5;border-top:4px solid var(--rev23-red);
  border-radius:14px;box-shadow:0 6px 20px rgba(26,16,8,.05);
}
.comments-shell :is(.comment-mode-banner,.wijdr-reply-context) {color:#66584b;font-weight:700}
.comments-shell :is(textarea,input[type="text"],input[type="search"]) {
  max-width:100%;min-width:0;border:1px solid #d7cbb8;border-radius:9px;
  background:#fff;color:#211c16;line-height:1.55;
}
.comments-shell textarea {min-height:110px;padding:13px 14px}
.comments-shell :is(textarea,input[type="text"],input[type="search"]):focus-visible {
  outline:3px solid rgba(189,37,40,.20);outline-offset:1px;border-color:var(--rev23-red);
}
.comments-shell .file-chip {
  border:1px dashed #baa17c;background:#fcf7eb;border-radius:10px;color:#534331;
}
.comments-shell :is(.comment-list,.wijdr-comment-list) {min-width:0}
.comments-shell article.comment,
.comments-shell .wijdr-thread-comment {
  min-width:0;max-width:100%;border:1px solid #e0d2bc;
  border-left:4px solid var(--rev23-red);border-radius:13px;
  background:var(--rev23-comment-bg);padding:17px 19px;
  box-shadow:0 3px 10px rgba(37,20,7,.04);
  overflow-wrap:anywhere;
}
.comments-shell article.comment.reply,
.comments-shell .wijdr-thread-comment.reply {
  border-left:4px solid var(--rev23-gold);
  background:linear-gradient(120deg,#fffdf7,#fbf6e9);
}
.comments-shell .comment-head {
  display:flex;flex-wrap:wrap;align-items:center;gap:8px;
  padding-bottom:11px;border-bottom:1px solid #eee2d1;
}
.comments-shell .comment-head strong {font-weight:900;color:#1e1b16;font-size:.9rem}
.comments-shell .comment-head time {font-size:.74rem;color:#776d5d;margin-left:auto;font-weight:600}
.comments-shell .avatar.placeholder {background:#2a2018;color:#fff3ce;font-weight:900;border:2px solid #dbc493}
.comments-shell .avatar {border:2px solid #e0cba3;width:37px;height:37px}
.comments-shell .comment-body {color:#25201a;line-height:1.75;font-size:.95rem;max-width:100%;overflow-wrap:anywhere;white-space:pre-wrap}
.comments-shell .comment-body :is(img,video,iframe,pre,table) {max-width:100%}
.comments-shell .comment-actions {
  display:flex;flex-wrap:wrap;align-items:center;gap:12px;
  margin-top:10px;padding-top:10px;border-top:1px solid #f0e6d5;
}
.comments-shell .comment-actions :is(a,button.link-button) {
  color:#922126;font-size:.82rem;font-weight:850;text-decoration:none;
}
.comments-shell .comment-actions :is(a,button.link-button):is(:hover,:focus-visible) {text-decoration:underline;text-underline-offset:3px}
.comments-shell .reply-form:not([hidden]) {
  margin-top:16px;padding:13px;border-radius:11px;background:#fff9ee;border:1px solid #e3cfad;
}
.comments-shell .reply-form[hidden] {display:none!important}
.comments-shell .comment-attachments {gap:10px;max-width:100%;}
.comments-shell .comment-attachments .comment-media-item {max-width:100%;min-width:0}
.comments-shell .comment-attachments a {border-radius:9px}
.comments-shell .comment-submit-row {display:flex;flex-wrap:wrap;gap:13px;align-items:center}
.comments-shell :is(.wijdr-pages,.pagination) a {background:#fff8eb;border:1px solid #dac3a0;border-radius:8px;text-decoration:none}
.comments-shell :is(.wijdr-pages,.pagination) a:is(:hover,:focus-visible) {border-color:var(--rev23-red);color:var(--rev23-red)}

/* Narrow screens: comfortable tap targets and absolutely no horizontal scrolling. */
@media(max-width:900px) {
  .container:has(> .grid.cards > a[href^="/discuss/"]) > .grid.cards,
  .grid.cards:has(> a.wijdr-library-card) {grid-template-columns:1fr;gap:13px}
  .container > .grid.cards > a.card.card-link[href^="/discuss/"] {padding:20px}
}
@media(max-width:520px) {
  .grid.cards > a.wijdr-library-card {min-height:133px}
  .grid.cards > a.wijdr-library-card .wijdr-library-preview {flex-basis:34%;width:34%;min-height:133px}
  .grid.cards > a.wijdr-library-card .wijdr-library-thumb {min-height:133px}
  .grid.cards > a.wijdr-library-card .wijdr-library-card-info {padding:11px 12px;gap:5px}
  .grid.cards > a.wijdr-library-card h3 {font-size:.95rem}
  .grid.cards > a.wijdr-library-card small {font-size:.68rem}
  .comments-shell {padding:21px 10px 30px;border-radius:12px}
  .comments-shell article.comment,.comments-shell .wijdr-thread-comment {padding:13px 12px}
  .comments-shell .comment-head time {margin-left:0}
  .comments-shell :is(.comment-form,.anonymous-first-form) {padding:13px}
  .comments-shell .comment-actions {gap:10px}
}
@media(prefers-reduced-motion:reduce) {
  .container > .grid.cards > a.card.card-link[href^="/discuss/"],
  .grid.cards > a.wijdr-library-card,
  .grid.cards > a.wijdr-library-card .wijdr-library-thumb {transition:none!important;transform:none!important}
}
