/* Article modal + category + paper page styles */
.article-back {
  position: fixed; inset: 0;
  background: rgba(5,5,7,0.75);
  backdrop-filter: blur(8px);
  z-index: 3000;
  overflow-y: auto;
  padding: 40px 20px;
  animation: articleBackIn 0.25s ease;
}
@keyframes articleBackIn { from { opacity: 0; } to { opacity: 1; } }

.article-page, .category-page, .paper-page {
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 40px 120px rgba(0,0,0,0.5);
  position: relative;
  animation: articleIn 0.3s cubic-bezier(0.2,0.7,0.3,1);
}
.category-page { max-width: 1200px; }
@keyframes articleIn { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }

.article-close {
  position: absolute; top: 24px; right: 24px;
  z-index: 50;
  padding: 8px 14px;
  background: #0d0d0f; color: #fff;
  border-radius: 4px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.15em;
  cursor: pointer;
}
.article-close:hover { background: var(--ember); }

.article-hero {
  position: relative;
  aspect-ratio: 16/7;
  background: var(--cream);
  overflow: hidden;
}
.article-body {
  padding: 28px 60px 60px;
  max-width: 760px;
  margin: 0 auto;
}
.article-title {
  font-family: var(--serif); font-weight: 900;
  font-size: 44px; line-height: 1.1;
  margin: 16px 0 12px;
  letter-spacing: -0.01em;
}
.article-dek {
  font-family: var(--serif); font-style: italic;
  font-size: 19px; line-height: 1.5;
  color: var(--muted); margin: 0 0 20px;
}
.article-meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11px;
  color: var(--muted); letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 16px;
}
.article-share {
  display: flex; gap: 8px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 28px;
}
.article-share button {
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  background: #fff; cursor: pointer;
}
.article-share button:hover { background: var(--ink); color: var(--flame-2); border-color: var(--ink); }
.article-content {
  font-family: var(--serif); font-size: 18px; line-height: 1.75;
  color: var(--text);
}
.article-content p { margin: 0 0 18px; }
.article-content p:first-of-type::first-letter {
  font-size: 64px; float: left; font-weight: 900;
  line-height: 0.85; padding: 6px 10px 0 0; color: var(--ember);
}

.article-related {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 2px solid var(--ink);
}
.article-related h3 {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em;
  text-transform: uppercase; margin: 0 0 20px;
}
.related-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.related-card { cursor: pointer; }
.related-card .rt { font-family: var(--serif); font-weight: 700; font-size: 14px; margin: 8px 0 4px; line-height: 1.3; }
.related-card:hover .rt { color: var(--ember); }
.related-card .rm { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }

/* Category page — Elegant diagonal-line background */
@keyframes papyrusEnter {
  0%   { opacity: 0; transform: translateY(-20px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.category-page {
  max-width: 1300px;
  width: calc(100% - 60px);
  margin: 30px auto;
  padding: 0;
  position: relative;
  animation: papyrusEnter 0.5s cubic-bezier(0.2,0.7,0.3,1);
  background: transparent;
  border: none;
  box-shadow: none;
}
.category-page::before,
.category-page::after { display: none; }
.category-page .roll-left,
.category-page .roll-right { display: none; }

.category-page .paper-inner {
  position: relative;
  /* Dark elegant background — deep navy/charcoal with subtle texture */
  background-color: #0f1419;
  background-image:
    /* fine diagonal pinstripes */
    repeating-linear-gradient(
      135deg,
      rgba(255,255,255,0.025) 0px,
      rgba(255,255,255,0.025) 1px,
      transparent 1px,
      transparent 16px
    ),
    /* subtle dot grid */
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 1.5px),
    /* glow accents */
    radial-gradient(ellipse 800px 500px at top left, rgba(212,108,46,0.12), transparent 70%),
    radial-gradient(ellipse 700px 600px at bottom right, rgba(91,141,162,0.1), transparent 70%),
    /* base gradient */
    linear-gradient(165deg, #1a1f28 0%, #12161c 50%, #0a0d12 100%);
  background-size: auto, 32px 32px, auto, auto, auto;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 60px 70px 80px;
  min-height: 600px;
  box-shadow:
    0 40px 100px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.05),
    inset 0 1px 0 rgba(255,255,255,0.06);
}
.category-page .paper-inner::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 12%);
  border-radius: 6px;
}
.category-page .paper-inner > * { position: relative; z-index: 1; }

.category-head {
  padding: 0 0 26px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  background: transparent;
  position: relative;
}
.category-head h1 {
  font-family: var(--serif); font-weight: 900;
  font-size: 64px; margin: 0 0 10px;
  letter-spacing: -0.02em;
  color: #f4ebd9;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.category-head p {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em;
  text-transform: uppercase; color: rgba(244,235,217,0.55); margin: 0; font-weight: 500;
}

.category-body {
  padding: 32px 0 0;
  display: flex; flex-direction: column; gap: 36px;
  color: #e8dfc9;
}
.category-page .cat-hero h2 { color: #f4ebd9; font-weight: 900; }
.category-page .cat-hero .dek { color: rgba(244,235,217,0.78); font-weight: 400; }
.category-page .cat-hero .meta,
.category-page .cat-card .meta,
.category-page .cat-row .meta { color: rgba(232,165,116,0.85); font-weight: 600; letter-spacing: 0.14em; }
.category-page .cat-card h3,
.category-page .cat-row h3 { color: #f4ebd9; font-weight: 600; }

.cat-hero {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px;
  cursor: pointer;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.2s ease;
}
.cat-hero:hover { transform: translateY(-2px); }
.cat-hero .hero-media {
  aspect-ratio: 16/10;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  overflow: hidden;
}
.cat-hero h2 {
  font-family: var(--serif); font-weight: 900; font-size: 38px;
  line-height: 1.15; margin: 8px 0 12px; color: #f4ebd9;
}
.cat-hero:hover h2 { color: #e8a574; }
.cat-hero .dek {
  font-family: var(--serif); font-style: italic; font-size: 17px;
  color: rgba(244,235,217,0.78); line-height: 1.5;
}
.cat-hero .meta {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(232,165,116,0.7); margin-top: 18px;
}

.cat-secondary {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 26px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.cat-card {
  cursor: pointer;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.2s ease;
}
.cat-card:hover {
  background: rgba(255,255,255,0.06);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.4);
}
.cat-card .hero-media {
  aspect-ratio: 4/3; margin-bottom: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
}
.cat-card h3 {
  font-family: var(--serif); font-weight: 700; font-size: 19px;
  margin: 0 0 8px; line-height: 1.3; color: #f4ebd9;
}
.cat-card:hover h3 { color: #e8a574; }
.cat-card .meta {
  font-family: var(--mono); font-size: 10px;
  color: rgba(232,165,116,0.7); letter-spacing: 0.12em; text-transform: uppercase;
}

.cat-list { display: flex; flex-direction: column; gap: 4px; }
.cat-row {
  display: grid; grid-template-columns: 140px 1fr; gap: 22px;
  padding: 18px 4px; border-bottom: 1px solid rgba(255,255,255,0.08);
  cursor: pointer; align-items: center;
  transition: background 0.15s ease, padding 0.15s ease;
}
.cat-row:hover {
  background: rgba(255,255,255,0.04);
  padding-left: 12px;
}
.cat-row:last-child { border-bottom: none; }
.cat-row .thumb {
  aspect-ratio: 4/3;
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
}
.cat-row h3 {
  font-family: var(--serif); font-weight: 600; font-size: 19px;
  margin: 0 0 5px; line-height: 1.3; color: #f4ebd9;
}
.cat-row:hover h3 { color: #e8a574; }
.cat-row .meta {
  font-family: var(--mono); font-size: 10px;
  color: rgba(232,165,116,0.7); letter-spacing: 0.12em; text-transform: uppercase;
}

/* Category page takes its own padding, no extra space needed */
.article-back:has(.category-page) {
  padding: 30px 20px !important;
}
.category-page .article-close {
  position: absolute;
  top: 28px; right: 28px;
  z-index: 60;
  background: rgba(255,255,255,0.08);
  color: #f4ebd9;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
}
.category-page .article-close:hover {
  background: rgba(212,108,46,0.4);
  border-color: rgba(232,165,116,0.5);
}

/* Badge on papyrus */
.category-head .badge-cat {
  background: rgba(42,26,8,0.92);
  color: #f4e9cf;
  border: 1px solid rgba(80,50,20,0.4);
}

/* Paper page */
.paper-page { max-width: 720px; background: #fdfaf0; }
.paper-big { padding: 40px 48px; }
.pb-masthead { font-family: var(--serif); font-weight: 900; font-size: 56px; padding-bottom: 12px; border-bottom: 4px double var(--ink); margin-bottom: 10px; letter-spacing: -0.01em; text-align: center; }
.pb-date { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); text-align: center; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.pb-headline { font-family: var(--serif); font-weight: 900; font-size: 32px; line-height: 1.1; text-align: center; margin-bottom: 16px; }
.pb-photo { aspect-ratio: 16/9; background: var(--rule); margin-bottom: 20px; position: relative; }
.pb-photo .ph { position: absolute; inset: 0; }
.pb-cols { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; column-gap: 20px; }
.pb-col h4 { font-family: var(--serif); font-weight: 800; font-size: 14px; margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--ink); padding-bottom: 4px; }
.pb-col p { font-family: var(--serif); font-size: 12px; line-height: 1.5; margin: 0 0 10px; text-align: justify; }
.pb-line { height: 3px; background: var(--rule); margin: 4px 0; }
.pb-line.short { width: 70%; }

body.theme-dark .article-page,
body.theme-dark .category-page { background: #141417; color: #eee; }
body.theme-dark .article-title,
body.theme-dark .category-head h1,
body.theme-dark .cat-hero h2,
body.theme-dark .cat-card h3,
body.theme-dark .cat-row h3 { color: #fff; }
body.theme-dark .category-head { background: linear-gradient(180deg, #1a1a1d, #141417); }
body.theme-dark .article-content { color: #ddd; }
body.theme-dark .article-share button { background: #1a1a1d; border-color: #2a2a2f; color: #eee; }

/* Edited articles get the elegant dark navy treatment */
.article-page.is-edited {
  background: #0f1419;
  background-image:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.025) 0px, rgba(255,255,255,0.025) 1px, transparent 1px, transparent 16px),
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 1.5px),
    radial-gradient(ellipse 800px 500px at top left, rgba(212,108,46,0.12), transparent 70%),
    radial-gradient(ellipse 700px 600px at bottom right, rgba(91,141,162,0.1), transparent 70%),
    linear-gradient(165deg, #1a1f28 0%, #12161c 50%, #0a0d12 100%);
  background-size: auto, 32px 32px, auto, auto, auto;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 40px 100px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05), inset 0 1px 0 rgba(255,255,255,0.06);
  color: #e8dfc9;
}
.article-page.is-edited .article-title { color: #f4ebd9; text-shadow: 0 2px 12px rgba(0,0,0,0.5); }
.article-page.is-edited .article-dek { color: rgba(244,235,217,0.78); }
.article-page.is-edited .article-meta { color: rgba(232,165,116,0.85); }
.article-page.is-edited .article-meta strong { color: #f4ebd9; }
.article-page.is-edited .article-content { color: #d8cfba; }
.article-page.is-edited .article-content p:first-of-type::first-letter { color: #e8a574; }
.article-page.is-edited .article-content h2,
.article-page.is-edited .article-content h3 { color: #f4ebd9; }
.article-page.is-edited .article-content blockquote {
  border-left: 3px solid #e8a574; color: rgba(244,235,217,0.85);
  background: rgba(255,255,255,0.03); padding: 16px 22px; margin: 24px 0;
}
.article-page.is-edited .article-content a { color: #e8a574; }
.article-page.is-edited .article-content strong { color: #f4ebd9; }
.article-page.is-edited .article-share button {
  background: rgba(255,255,255,0.06); color: #e8dfc9;
  border: 1px solid rgba(255,255,255,0.12);
}
.article-page.is-edited .article-share button:hover {
  background: rgba(212,108,46,0.3); border-color: rgba(232,165,116,0.5);
}
.article-page.is-edited .article-close {
  background: rgba(255,255,255,0.08); color: #f4ebd9;
  border: 1px solid rgba(255,255,255,0.18); backdrop-filter: blur(8px);
}
.article-page.is-edited .article-close:hover {
  background: rgba(212,108,46,0.4); border-color: rgba(232,165,116,0.5);
}
.article-page.is-edited .article-related h3 { color: #f4ebd9; border-bottom: 1px solid rgba(255,255,255,0.12); }
.article-page.is-edited .related-card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); }
.article-page.is-edited .related-card:hover { background: rgba(255,255,255,0.07); border-color: rgba(232,165,116,0.4); }
.article-page.is-edited .related-card .rt { color: #f4ebd9; }
.article-page.is-edited .related-card .rm { color: rgba(232,165,116,0.7); }
