/*
 * satellite-preview.css — visual stylesheet for satellite preview pages.
 *
 * Three layout templates share this file; each scopes its rules to its own
 * body class (.newsroom-grid, .longform-magazine, .minimal-journal) so they
 * look genuinely different even with the same content.
 *
 * CSS custom properties (--color-primary, --color-surface, --font-display,
 * etc.) are injected per satellite via an inline <style> block in the <head>
 * by the renderer's paletteVarsCss helper. This file references those
 * variables with sensible fallbacks.
 *
 * This stylesheet ships statically via Next.js public/. When Phase 3 ships
 * real R2 hosting, a compiled + hashed copy is uploaded alongside each
 * satellite's static site.
 */

/* ─────────────────────────────────────────────────────────────────────── */
/* Base reset + typography                                                  */
/* ─────────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--color-text, #18181b);
  background: var(--color-surface, #ffffff);
  font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary, #2563eb); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.2; font-weight: 700; }
p { margin: 0 0 1em; }
ul { padding-left: 1.25em; }

figure { margin: 0; }

/* ─────────────────────────────────────────────────────────────────────── */
/* NewsroomGrid — dense editorial grid, serif headlines, tight spacing      */
/* ─────────────────────────────────────────────────────────────────────── */

.newsroom-grid {
  font-family: var(--font-body, Georgia, "Times New Roman", serif);
  background: #fafaf7;
  color: #1a1a1a;
}

.newsroom-grid a { color: var(--color-primary, #b91c1c); }

.newsroom-grid__topbar {
  background: var(--color-primary, #b91c1c);
  height: 4px;
}

.newsroom-grid__header {
  background: #fff;
  border-bottom: 1px solid #d4d4d4;
}

.newsroom-grid__masthead {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.newsroom-grid__wordmark {
  font-family: var(--font-display, "Playfair Display", "Times New Roman", serif);
  font-size: 2.25rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #1a1a1a;
  text-transform: uppercase;
}

.newsroom-grid__nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.newsroom-grid__main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.newsroom-grid__footer {
  background: #1a1a1a;
  color: #fff;
  margin-top: 4rem;
}

.newsroom-grid__footer a { color: #fff; }

.newsroom-grid__footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
}

.newsroom-grid__footer-nav {
  display: flex;
  gap: 1rem;
}

/* Homepage content inside newsroom grid */
.newsroom-grid .satellite-home h1 {
  font-family: var(--font-display, "Playfair Display", serif);
  font-size: 2.5rem;
  border-bottom: 3px double #1a1a1a;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.newsroom-grid .featured-post {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid #d4d4d4;
  margin-bottom: 2rem;
}

.newsroom-grid .featured-post img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.newsroom-grid .featured-post h3 {
  font-family: var(--font-display, "Playfair Display", serif);
  font-size: 1.75rem;
}

.newsroom-grid .post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem 2rem;
}

.newsroom-grid .post-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin-bottom: 0.75rem;
}

.newsroom-grid .post-card h3 {
  font-family: var(--font-display, "Playfair Display", serif);
  font-size: 1.125rem;
}

.newsroom-grid .post-card p {
  font-size: 0.875rem;
  color: #52525b;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* LongformMagazine — centered wide column, giant hero, serif body          */
/* ─────────────────────────────────────────────────────────────────────── */

.longform-magazine {
  font-family: var(--font-body, Georgia, "Iowan Old Style", "Apple Garamond", serif);
  background: #fbfaf6;
  color: #1f1f1f;
  font-size: 18px;
  line-height: 1.7;
}

.longform-magazine__header {
  padding: 3rem 2rem 2rem;
  text-align: center;
  border-bottom: 1px solid #e5e5e5;
}

.longform-magazine__wordmark-wrap { margin-bottom: 0.5rem; }

.longform-magazine__wordmark {
  font-family: var(--font-display, "Cormorant Garamond", "Playfair Display", serif);
  font-size: 3rem;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.02em;
  color: #1f1f1f;
}

.longform-magazine__tagline {
  font-size: 0.875rem;
  font-style: italic;
  color: #6b6b6b;
  margin: 0;
  letter-spacing: 0.05em;
}

.longform-magazine__nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.longform-magazine__main {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.longform-magazine__footer {
  background: #1f1f1f;
  color: #e5e5e5;
  margin-top: 5rem;
}

.longform-magazine__footer a { color: #e5e5e5; }

.longform-magazine__footer-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
  text-align: center;
}

.longform-magazine__editor-note {
  font-style: italic;
  font-size: 0.9375rem;
  opacity: 0.85;
  max-width: 520px;
  margin: 0 auto 1.5rem;
}

.longform-magazine__footer-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  font-size: 0.8125rem;
}

.longform-magazine .satellite-home h1 {
  font-family: var(--font-display, "Cormorant Garamond", serif);
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.longform-magazine .featured-post {
  text-align: center;
  padding-bottom: 3rem;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 3rem;
}

.longform-magazine .featured-post img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  margin-bottom: 1.5rem;
}

.longform-magazine .featured-post h3 {
  font-family: var(--font-display, "Cormorant Garamond", serif);
  font-size: 2rem;
  font-weight: 400;
}

.longform-magazine .post-grid {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.longform-magazine .post-card {
  padding-bottom: 2rem;
  border-bottom: 1px solid #e5e5e5;
}

.longform-magazine .post-card:last-child { border-bottom: none; }

.longform-magazine .post-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 1rem;
}

.longform-magazine .post-card h3 {
  font-family: var(--font-display, "Cormorant Garamond", serif);
  font-size: 1.5rem;
  font-weight: 400;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* MinimalJournal — narrow single column, monospace accents, stark          */
/* ─────────────────────────────────────────────────────────────────────── */

.minimal-journal {
  font-family: var(--font-body, "Iowan Old Style", Georgia, serif);
  background: #ffffff;
  color: #111;
  max-width: 100vw;
}

.minimal-journal__header {
  max-width: 640px;
  margin: 0 auto;
  padding: 4rem 1.5rem 2rem;
  border-bottom: 1px solid #000;
}

.minimal-journal__site-name {
  font-family: var(--font-display, "JetBrains Mono", "SF Mono", "IBM Plex Mono", monospace);
  font-size: 1rem;
  font-weight: 500;
  color: #111;
  letter-spacing: -0.02em;
  text-transform: lowercase;
}

.minimal-journal__nav {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  font-family: var(--font-display, "JetBrains Mono", monospace);
}

.minimal-journal__main {
  max-width: 640px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.minimal-journal__footer {
  max-width: 640px;
  margin: 4rem auto 2rem;
  padding: 1.5rem;
  border-top: 1px solid #000;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-family: var(--font-display, "JetBrains Mono", monospace);
  color: #666;
}

.minimal-journal__footer-nav {
  display: flex;
  gap: 1rem;
}

.minimal-journal__copyright {
  color: #666;
}

.minimal-journal .satellite-home h1 {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.minimal-journal .satellite-home > p:first-of-type {
  font-size: 0.9375rem;
  color: #666;
  margin-bottom: 2.5rem;
}

.minimal-journal .featured-post {
  padding: 1rem 0;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 1.5rem;
}

.minimal-journal .featured-post img {
  display: none;
}

.minimal-journal .featured-post h3 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.minimal-journal .featured-post p {
  font-size: 0.9375rem;
  color: #444;
}

.minimal-journal .post-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.minimal-journal .post-card {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.minimal-journal .post-card img { display: none; }

.minimal-journal .post-card h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.125rem;
}

.minimal-journal .post-card p {
  font-size: 0.875rem;
  color: #666;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* Shared content patterns (about, post, contact, etc.)                     */
/* ─────────────────────────────────────────────────────────────────────── */

.post-article,
.about-page,
.contact-page,
.privacy-page,
.terms-page,
.category-page {
  padding: 2rem 0;
}

.post-article h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.post-article__byline {
  font-size: 0.875rem;
  color: #6b6b6b;
  margin-bottom: 1.5rem;
}

.post-article img.post-article__hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 2rem;
}

.post-article__body h2 {
  margin-top: 2em;
  font-size: 1.5rem;
}

.post-article__related {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e5e5;
}

.masthead-member {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid #e5e5e5;
}

.masthead-member:last-child { border-bottom: none; }

.masthead-member img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.masthead-member__role--smallcaps {
  font-variant: small-caps;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: #6b6b6b;
}

.masthead-member h3 { font-size: 1rem; margin-bottom: 0.125rem; }
.masthead-member p { font-size: 0.875rem; margin-bottom: 0.5rem; line-height: 1.5; }

/* ─────────────────────────────────────────────────────────────────────── */
/* Launching-soon placeholder (shown when a satellite has no               */
/* published posts yet — keeps the home page from looking blank).          */
/* ─────────────────────────────────────────────────────────────────────── */

.satellite-home__launching {
  margin: 2rem 0 3rem;
  padding: 2.25rem 1.75rem;
  text-align: center;
  border-radius: 14px;
  border: 1px dashed var(--color-primary, #2563eb);
  background: color-mix(in srgb, var(--color-primary, #2563eb) 6%, transparent);
}

.satellite-home__launching h2 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
  color: var(--color-primary, #2563eb);
}

.satellite-home__launching p {
  font-size: 0.95rem;
  max-width: 44ch;
  margin: 0 auto;
  color: var(--color-text, #4b5563);
  opacity: 0.85;
  line-height: 1.55;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* Responsive tweaks                                                        */
/* ─────────────────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .newsroom-grid__masthead { padding: 1rem; }
  .newsroom-grid__wordmark { font-size: 1.5rem; }
  .newsroom-grid__main { padding: 1rem; }
  .newsroom-grid .featured-post { grid-template-columns: 1fr; }

  .longform-magazine__wordmark { font-size: 2rem; }
  .longform-magazine__main { padding: 2rem 1rem; }

  .minimal-journal__header { padding: 2rem 1rem; }
  .minimal-journal__main { padding: 2rem 1rem; }
}
