/*
 * ssr-content.css — styling for the server-rendered content blocks.
 *
 * The Worker injects real HTML (topic listings, article bodies, Q&A, card
 * grids, the site directory) into <!-- CONTENT_SLOT --> so crawlers and no-JS
 * visitors get the library without executing JavaScript. Until now those
 * blocks shipped with NO stylesheet at all, which meant:
 *   - a visible flash of unstyled text before the JS render replaced it, and
 *   - a genuinely ugly page for anyone whose JS never ran.
 *
 * Progressive enhancement only works if the un-enhanced state is presentable.
 * These rules deliberately reuse the site's parchment/ink palette rather than
 * introducing tokens, matching how the rest of the CSS in this project is
 * written.
 */

.ssr-content {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.ssr-heading {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: #33302b;
  margin: 0 0 0.6rem;
}

.ssr-subheading {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #3b3630;
  margin: 2rem 0 0.35rem;
}

.ssr-intro {
  font-size: 1.08rem;
  line-height: 1.6;
  color: #4a4335;
  max-width: 62ch;
  margin: 0 0 0.75rem;
}

.ssr-count,
.ssr-section-count {
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  color: #7d7358;
  margin: 0 0 1.25rem;
}

.ssr-section-count { margin: 0 0 0.85rem; }

/* --- card grids (topic hubs, article/infographic/paper/video indexes) --- */

.ssr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1rem;
  margin: 0 0 2rem;
}

.ssr-card {
  border: 1px solid #cdb987;
  border-radius: 12px;
  background: #fbf6ea;
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ssr-card-link { text-decoration: none; }

.ssr-card-title {
  font-family: 'Cinzel', serif;
  font-size: 1.02rem;
  line-height: 1.35;
  font-weight: 700;
  color: #3b3630;
  margin: 0;
}

.ssr-card-link:hover .ssr-card-title { color: #7a5e26; }

.ssr-card-type {
  align-self: flex-start;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #8a7a52;
}

.ssr-card-summary {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #565043;
  margin: 0;
}

/* --- simple link lists (subtopic sections, related reading, directory) --- */

.ssr-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 0.35rem 1.25rem;
}

.ssr-list li { line-height: 1.5; }

.ssr-list a {
  color: #7a5e26;
  text-decoration: none;
  border-bottom: 1px solid rgba(122, 94, 38, 0.28);
}

.ssr-list a:hover { border-bottom-color: #7a5e26; }

/* --- article detail --- */

.ssr-article {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.ssr-article-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  line-height: 1.2;
  font-weight: 700;
  color: #33302b;
  margin: 0 0 0.75rem;
}

.ssr-article-deck {
  font-size: 1.15rem;
  line-height: 1.6;
  color: #565043;
  font-style: italic;
  margin: 0 0 1.5rem;
}

.ssr-article-meta {
  font-size: 0.88rem;
  color: #7d7358;
  margin: 0 0 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #ddd0ad;
}

.ssr-article-meta a { color: #7a5e26; }

.ssr-article-body {
  font-size: 1.08rem;
  line-height: 1.7;
  color: #3f3a31;
}

.ssr-article-body h2,
.ssr-article-body h3 {
  font-family: 'Cinzel', serif;
  color: #33302b;
  margin: 2rem 0 0.6rem;
}

.ssr-article-body h2 { font-size: 1.4rem; }
.ssr-article-body h3 { font-size: 1.15rem; }
.ssr-article-body p { margin: 0 0 1.1rem; }
.ssr-article-body a { color: #7a5e26; }
.ssr-article-body ul,
.ssr-article-body ol { margin: 0 0 1.1rem 1.25rem; }
.ssr-article-body li { margin: 0 0 0.4rem; }
.ssr-article-body img { max-width: 100%; height: auto; }
.ssr-article-body blockquote {
  margin: 0 0 1.1rem;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 3px solid #cdb987;
  color: #565043;
}

/* --- breadcrumbs --- */

.ssr-breadcrumb {
  font-size: 0.88rem;
  color: #7d7358;
  margin: 0 0 1rem;
}

.ssr-breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0;
  margin: 0;
}

.ssr-breadcrumb li::after {
  content: "›";
  margin-left: 0.35rem;
  color: #b3a373;
}

.ssr-breadcrumb li:last-child::after { content: ""; }
.ssr-breadcrumb a { color: #7a5e26; text-decoration: none; }
.ssr-breadcrumb a:hover { text-decoration: underline; }

/* --- parent / related blocks on a detail page --- */

.ssr-parent { font-size: 0.95rem; color: #565043; margin: 1.75rem 0 0.5rem; }
.ssr-parent a { color: #7a5e26; }

.ssr-related {
  margin: 1.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid #ddd0ad;
}

.ssr-related h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: #33302b;
  margin: 0 0 0.7rem;
}

.ssr-related ul { list-style: none; padding: 0; margin: 0; }
.ssr-related li { margin: 0 0 0.45rem; line-height: 1.5; }
.ssr-related a { color: #7a5e26; text-decoration: none; border-bottom: 1px solid rgba(122, 94, 38, 0.28); }
.ssr-related a:hover { border-bottom-color: #7a5e26; }

/* --- Q&A --- */

.ssr-qa-item {
  border-bottom: 1px solid #e2d7ba;
  padding: 0 0 1rem;
  margin: 0 0 1rem;
}

.ssr-qa-item h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.ssr-qa-item h3 a { color: #3b3630; text-decoration: none; }
.ssr-qa-item h3 a:hover { color: #7a5e26; }
.ssr-qa-item p { font-size: 0.98rem; line-height: 1.55; color: #565043; margin: 0; }

/* --- site directory (the crawlable link block above the footer) ---
   Also a genuinely useful HTML sitemap for readers, which is why it is
   visible rather than hidden. Hiding it would be cloaking. */

.ssr-sitenav {
  border-top: 1px solid #ddd0ad;
  margin: 3rem 0 0;
  padding: 2rem 1.25rem 2.5rem;
  background: rgba(251, 246, 234, 0.55);
}

.ssr-sitenav-inner {
  max-width: 72rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.5rem 2rem;
}

.ssr-sitenav h2 {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a7a52;
  margin: 0 0 0.6rem;
  font-weight: 700;
}

.ssr-sitenav ul { list-style: none; padding: 0; margin: 0; }
.ssr-sitenav li { margin: 0 0 0.3rem; line-height: 1.45; }

.ssr-sitenav a {
  color: #6b6252;
  text-decoration: none;
  font-size: 0.94rem;
}

.ssr-sitenav a:hover { color: #7a5e26; text-decoration: underline; }

/* --- homepage discovery block --- */

.ssr-home-paths {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 2rem;
}

.ssr-home-path h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #33302b;
  margin: 0 0 0.3rem;
}

.ssr-home-path > p {
  font-size: 0.98rem;
  line-height: 1.55;
  color: #6b6252;
  margin: 0 0 0.9rem;
  max-width: 46ch;
}

.ssr-home-path ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.3rem 1rem;
}

.ssr-home-path li { line-height: 1.5; }

.ssr-home-path a {
  color: #7a5e26;
  text-decoration: none;
  border-bottom: 1px solid rgba(122, 94, 38, 0.25);
  font-size: 0.98rem;
}

.ssr-home-path a:hover { border-bottom-color: #7a5e26; }

.ssr-home-path .ssr-count-inline {
  color: #9c9078;
  font-size: 0.82rem;
  border: 0;
}
