/* ==========================================================================
   Magazine for Collaboration & Dialogue
   Warm Editorial design system – ported 1:1 from school-cd.org
   Tokens mirror src/index.css of the School website (HSL values identical).
   ========================================================================== */

/* --- Self-hosted fonts (same files as school-cd.org, DSGVO-konform) ------- */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url('../fonts/dm-sans-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/dm-sans-italic-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/dm-serif-display-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Serif Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/dm-serif-display-italic-latin.woff2') format('woff2');
}

/* --- Design tokens -------------------------------------------------------- */
:root {
  --background: 36 33% 97%;
  --foreground: 220 20% 14%;
  --card: 36 30% 99%;
  --primary: 12 72% 50%;
  --primary-foreground: 36 33% 97%;
  --secondary: 152 25% 90%;
  --secondary-foreground: 160 25% 25%;
  --muted: 30 15% 92%;
  --muted-foreground: 220 10% 46%;
  --accent: 180 25% 30%;
  --accent-foreground: 36 33% 97%;
  --border: 30 15% 88%;

  --radius: 0.75rem;
  /* Keep the School typography authoritative even when Ghost injects font settings. */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;

  --gradient-warm: linear-gradient(135deg, hsl(12 72% 50%), hsl(30 80% 55%));
  --shadow-soft: 0 4px 24px -4px hsl(220 20% 14% / 0.08);
  --shadow-card: 0 8px 32px -8px hsl(220 20% 14% / 0.1);
  --shadow-elevated: 0 16px 48px -12px hsl(220 20% 14% / 0.15);

  --content-width: 720px;
  --wide-width: 1200px;
}

/* --- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: hsl(var(--primary)); text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: 0; border-top: 1px solid hsl(var(--border)); margin: 3rem 0; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: hsl(var(--foreground));
}

/* --- Layout --------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--wide-width); margin: 0 auto; padding: 0 1.5rem; }
.wrap--narrow { max-width: var(--content-width); }
.section { padding: 4rem 0; }
@media (min-width: 768px) { .section { padding: 5.5rem 0; } }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: hsl(var(--foreground)); color: hsl(var(--background));
  padding: 0.75rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

/* --- Header --------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: hsl(var(--background) / 0.9);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid hsl(var(--border));
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 72px;
}
.site-brand { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.site-brand img { max-height: 36px; width: auto; }
.site-brand__text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: hsl(var(--foreground));
  line-height: 1.2;
}
.site-brand:hover { text-decoration: none; }

.nav { display: flex; align-items: center; gap: 1.25rem; }
.nav ul,
.nav ol {
  display: flex; align-items: center; gap: 1.25rem;
  list-style: none; margin: 0; padding: 0;
}
.nav li { list-style: none; margin: 0; }
.nav li::marker { content: none; }
.nav a {
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  color: hsl(var(--foreground) / 0.75);
}
.nav a:hover { color: hsl(var(--primary)); text-decoration: none; }

.nav--mobile { display: none; flex: 0 0 auto; }
@media (max-width: 800px) {
  .nav--desktop { display: none; }
  .nav--mobile { display: block; }
  .site-brand__text { font-size: 1rem; }
  .nav--mobile summary {
    list-style: none; cursor: pointer;
    font-size: 0.9375rem; color: hsl(var(--foreground) / 0.75);
  }
  .nav--mobile summary::-webkit-details-marker { display: none; }
  .nav--mobile[open] .nav__panel {
    position: absolute; left: 0; right: 0; top: 72px;
    background: hsl(var(--card)); border-bottom: 1px solid hsl(var(--border));
    padding: 1rem 1.5rem; display: flex; flex-direction: column; gap: 0.75rem;
    box-shadow: var(--shadow-card);
  }
  .nav__panel ul, .nav__panel ol {
    display: flex; flex-direction: column; gap: 0.75rem;
    list-style: none; margin: 0; padding: 0;
  }
  .nav__panel li { list-style: none; margin: 0; }
  .nav__panel a { font-size: 0.875rem; color: hsl(var(--foreground) / 0.75); }
}


/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--font-body); font-size: 0.9375rem; font-weight: 500;
  padding: 0.7rem 1.35rem; border-radius: calc(var(--radius) - 2px);
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary {
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  box-shadow: var(--shadow-soft);
}
.btn--primary:hover { box-shadow: var(--shadow-card); }
.btn--outline {
  background: transparent; color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}
.btn--outline:hover { background: hsl(var(--muted)); }

/* --- Hero / masthead ------------------------------------------------------ */
.masthead { padding: 4rem 0 2.5rem; text-align: center; }
.masthead__eyebrow {
  font-size: 0.8125rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: hsl(var(--accent)); margin: 0 0 1rem;
}
.masthead h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin: 0 0 1.25rem; }
.masthead p {
  max-width: 46ch; margin: 0 auto;
  font-size: 1.125rem; color: hsl(var(--foreground) / 0.7);
}
.masthead__actions { margin-top: 2rem; display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* --- Post cards ----------------------------------------------------------- */
.post-feed {
  display: grid; gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .post-feed { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .post-feed { grid-template-columns: repeat(3, 1fr); } }

.post-card {
  display: flex; flex-direction: column;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform .2s ease, box-shadow .2s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.post-card__image { aspect-ratio: 16 / 10; overflow: hidden; background: hsl(var(--muted)); }
.post-card__image img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; flex: 1; }
.post-card__tag {
  font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: hsl(var(--accent));
}
.post-card__title { font-size: 1.5rem; margin: 0; }
.post-card__title a { color: inherit; }
.post-card__title a:hover { color: hsl(var(--primary)); text-decoration: none; }
.post-card__excerpt { margin: 0; color: hsl(var(--muted-foreground)); font-size: 0.9375rem; }
.post-card__meta {
  margin-top: auto; padding-top: 0.5rem;
  font-size: 0.8125rem; color: hsl(var(--muted-foreground));
  display: flex; gap: 0.5rem; align-items: center;
}

/* Featured first card on the home feed */
.post-feed--home .post-card--featured { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .post-feed--home .post-card--featured { flex-direction: row; }
  .post-feed--home .post-card--featured .post-card__image { flex: 0 0 55%; aspect-ratio: auto; }
  .post-feed--home .post-card--featured .post-card__body { padding: 2.5rem; justify-content: center; }
  .post-feed--home .post-card--featured .post-card__title { font-size: 2.25rem; }
  .post-feed--home .post-card--featured .post-card__excerpt { font-size: 1.0625rem; }
}

/* --- Single post ---------------------------------------------------------- */
.article { padding: 3.5rem 0 4rem; }
.article__header { text-align: center; margin-bottom: 2.5rem; }
.article__tag {
  font-size: 0.8125rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: hsl(var(--accent));
}
.article__title { font-size: clamp(2.1rem, 5vw, 3.25rem); margin: 0.75rem 0 1rem; }
.article__excerpt { font-size: 1.15rem; color: hsl(var(--foreground) / 0.7); margin: 0 auto; max-width: 54ch; }
.article__meta {
  margin-top: 1.5rem; font-size: 0.875rem; color: hsl(var(--muted-foreground));
  display: flex; gap: 0.75rem; justify-content: center; align-items: center; flex-wrap: wrap;
}
.article__avatar { width: 32px; height: 32px; border-radius: 999px; object-fit: cover; }
.article__cover {
  margin: 0 0 3rem; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-card);
}

.content { font-size: 1.125rem; }
.content > * + * { margin-top: 1.5rem; }
.content h2 { font-size: 1.9rem; margin-top: 3rem; }
.content h3 { font-size: 1.45rem; margin-top: 2.25rem; }
.content a { text-decoration: underline; text-underline-offset: 2px; }
.content blockquote {
  margin: 2.5rem 0; padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 3px solid hsl(var(--primary));
  font-family: var(--font-display); font-size: 1.35rem; line-height: 1.4;
  color: hsl(var(--foreground) / 0.85);
}
.content ul, .content ol { padding-left: 1.35rem; }
.content li + li { margin-top: 0.5rem; }
.content figure { margin: 2.5rem 0; }
.content figure img { border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.content figcaption {
  margin-top: 0.75rem; text-align: center;
  font-size: 0.875rem; color: hsl(var(--muted-foreground));
}
.content code {
  background: hsl(var(--muted)); border-radius: 4px;
  padding: 0.15em 0.4em; font-size: 0.9em;
}
.content pre {
  background: hsl(var(--foreground)); color: hsl(var(--background));
  padding: 1.25rem; border-radius: var(--radius); overflow-x: auto;
}
.content pre code { background: none; color: inherit; padding: 0; }
.kg-width-wide { max-width: 1000px; margin-left: 50%; transform: translateX(-50%); }
.kg-width-full { max-width: 100vw; margin-left: 50%; transform: translateX(-50%); }

/* --- Subscribe / CTA ------------------------------------------------------ */
.cta {
  background: hsl(var(--secondary));
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  margin: 4rem auto 0;
}
.cta h2 { font-size: 1.9rem; margin: 0 0 0.75rem; }
.cta p { margin: 0 auto 1.75rem; max-width: 48ch; color: hsl(var(--secondary-foreground)); }
.subscribe-form { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.subscribe-form input[type="email"] {
  font-family: var(--font-body); font-size: 0.9375rem;
  padding: 0.7rem 1rem; min-width: 260px;
  border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--card)); color: hsl(var(--foreground));
}
.subscribe-form input[type="email"]:focus {
  outline: 2px solid hsl(var(--primary) / 0.4); outline-offset: 1px;
}
.subscribe-note { margin-top: 1rem; font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }

/* --- Pagination ----------------------------------------------------------- */
.pagination {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; margin-top: 3.5rem;
}
.pagination__page { font-size: 0.875rem; color: hsl(var(--muted-foreground)); }

/* --- Footer --------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid hsl(var(--border));
  padding: 3rem 0;
  margin-top: 4rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.site-footer__inner {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem;
  justify-content: space-between; align-items: center;
}
.site-footer a { color: hsl(var(--muted-foreground)); }
.site-footer a:hover { color: hsl(var(--primary)); }
.site-footer__links { display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* --- Utilities ------------------------------------------------------------ */
.text-gradient-warm {
  background: var(--gradient-warm);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.center { text-align: center; }
.muted { color: hsl(var(--muted-foreground)); }
.section-title {
  font-size: 1.05rem; letter-spacing: 0.14em; text-transform: uppercase;
  font-family: var(--font-body); color: hsl(var(--accent));
  margin: 0 0 2rem;
}
