/* magazine — dense grid, high contrast, bold typography */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&display=swap');

:root {
  --paper: #f8f8f6;
  --ink: #0a0a0a;
  --muted: #5a5a5a;
  --rule: #0a0a0a;
  --accent: #c8001a;
  --accent-soft: #fff0f0;
  --col-bg: #ffffff;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-display: 'Playfair Display', Georgia, serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
}

a { color: inherit; text-decoration: none; }

/* ── Layout ── */
.site-header,
.site-footer,
.site-main {
  width: min(1200px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

/* ── Header ── */
.site-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 0;
  border-bottom: 4px double var(--rule);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  text-decoration: none;
  padding: 20px 0 16px;
  border-right: 2px solid var(--rule);
  margin-right: 24px;
  padding-right: 24px;
}

.brand-mark {
  display: none;
}

.brand-mark--icon {
  display: block;
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.8rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  max-width: 200px;
  overflow-wrap: break-word;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}

.site-nav .nav-link {
  text-decoration: none;
  padding: 6px 14px;
  border-left: 1px solid var(--rule);
}

.site-nav .nav-link:first-child { border-left: none; }
.site-nav .nav-link:hover { background: var(--ink); color: var(--paper); }

.more-categories { position: relative; border-left: 1px solid var(--rule); }
.more-toggle { cursor: pointer; list-style: none; padding: 6px 14px; font-size: 0.8rem; letter-spacing: 0.12em; font-weight: 600; text-transform: uppercase; }
.more-toggle::-webkit-details-marker { display: none; }

.more-panel {
  position: absolute;
  z-index: 10;
  top: 100%;
  left: 0;
  display: grid;
  gap: 0;
  min-width: 180px;
  border: 2px solid var(--rule);
  background: var(--col-bg);
}

.more-categories:not([open]) .more-panel { display: none; }

.more-panel .nav-link {
  padding: 10px 14px;
  border-left: none;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

.more-panel .nav-link:last-child { border-bottom: none; }

.language-switcher select {
  padding: 6px 10px;
  border: 2px solid var(--rule);
  color: var(--ink);
  background: var(--paper);
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  max-width: 160px;
}

.site-switcher { position: relative; flex-shrink: 0; }

.site-switcher-toggle {
  list-style: none;
  cursor: pointer;
  padding: 5px 10px;
  border: 2px dashed var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-switcher-toggle::-webkit-details-marker { display: none; }
.site-switcher[open] .site-switcher-toggle { color: var(--accent); border-color: var(--accent); }

.site-switcher-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  max-width: 340px;
  border: 2px solid var(--rule);
  background: var(--col-bg);
}
.site-switcher:not([open]) .site-switcher-panel { display: none; }

.site-switcher-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-switcher-item:last-child { border-bottom: none; }
.site-switcher-item:hover { background: var(--ink); color: var(--paper); }
.site-switcher-item--active { font-weight: 700; color: var(--accent); }

/* ── Hamburger button (hidden on desktop) ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  padding: 4px;
  background: none;
  border: 2px solid var(--rule);
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transition: opacity 0.2s;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Main ── */
.site-main { flex: 1; padding-top: 0; }

/* ── Footer ── */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 64px;
  padding: 20px 0 32px;
  border-top: 4px double var(--rule);
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.footer-desc { margin: 0; }

.footer-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.footer-nav a { text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }

/* ── Index page ── */
.lead-story {
  display: block;
  padding: 32px 0;
  border-bottom: 2px solid var(--rule);
}

.lead-card {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 0;
  align-items: stretch;
  text-decoration: none;
  background: var(--col-bg);
  border: 2px solid var(--rule);
}

.lead-card--text { grid-template-columns: 1fr; }

.cover-wrap {
  aspect-ratio: auto;
  min-height: 320px;
  background: var(--ink);
  overflow: hidden;
  order: 2;
}

.cover-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: contrast(1.08);
}

.lead-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 2px solid var(--rule);
  min-width: 0;
}

.post-date {
  display: block;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 12px;
  font-family: var(--font-display);
}

.lead-title {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 3.2rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.lead-excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.post-list-section { padding-top: 32px; }
.post-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.post-item { background: var(--col-bg); border: 2px solid var(--rule); }

.post-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  text-decoration: none;
  height: 100%;
}

.post-row time.post-date { margin-bottom: 4px; }

.post-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.post-excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.post-row:hover .post-title { color: var(--accent); }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 48px 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-prev, .page-next {
  padding: 10px 22px;
  border: 2px solid var(--rule);
  text-decoration: none;
  color: var(--ink);
}

.page-prev { border-right: none; }
.page-current { padding: 10px 22px; border: 2px solid var(--rule); }

.page-prev:not(.page-disabled):hover,
.page-next:not(.page-disabled):hover { background: var(--ink); color: var(--paper); }

.page-disabled { color: var(--muted); opacity: 0.5; }

.empty-state {
  margin: 64px 0;
  padding: 32px;
  border: 2px solid var(--rule);
  color: var(--muted);
  font-size: 1rem;
  text-align: center;
}

/* ── Category page ── */
.category-hero {
  padding: 48px 0 32px;
  border-bottom: 4px double var(--rule);
  margin-bottom: 32px;
}

.category-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5vw, 5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.category-desc {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.55;
}

.subcategory-list-section { padding-bottom: 64px; }

.subcategory-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.subcategory-item { border-bottom: 2px solid var(--rule); background: var(--col-bg); }
.subcategory-item:first-child { border-top: 2px solid var(--rule); }

.subcategory-card {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  align-items: center;
  gap: 20px;
  padding: 22px 20px;
  text-decoration: none;
  transition: background 0.1s;
}

.subcategory-card:hover { background: var(--accent-soft); }
.subcategory-card:hover .subcategory-name { color: var(--accent); }

.subcategory-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent);
  opacity: 0.4;
  flex-shrink: 0;
  text-align: right;
  line-height: 1;
}

.subcategory-body { min-width: 0; }

.subcategory-name {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.subcategory-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.subcategory-post-count {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.subcategory-arrow {
  font-size: 1.2rem;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.1s;
}

.subcategory-card:hover .subcategory-arrow { transform: translateX(4px); color: var(--accent); }

/* ── Article page ── */
.article-shell {
  max-width: 800px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.breadcrumb-link { color: var(--accent); text-decoration: none; }
.breadcrumb-link:hover { text-decoration: underline; }
.breadcrumb-current { color: var(--muted); }
.breadcrumb-sep { color: var(--rule); }

.article-meta { margin-bottom: 12px; }

.article-date {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.article-title {
  margin: 8px 0 20px;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.article-summary {
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1.5;
  margin: 0 0 32px;
  border-left: 4px solid var(--accent);
  padding-left: 16px;
}

.article-cover {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  display: block;
  margin-bottom: 40px;
  border: 2px solid var(--rule);
}

.prose {
  font-size: 1.075rem;
  line-height: 1.78;
  padding-top: 32px;
  border-top: 2px solid var(--rule);
}

.prose h2, .prose h3 {
  margin: 2em 0 0.5em;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
}

.prose h2 { font-size: 2.2rem; border-bottom: 2px solid var(--rule); padding-bottom: 8px; }
.prose h3 { font-size: 1.6rem; }
.prose p, .prose ul, .prose ol { margin: 1em 0; }

.prose blockquote {
  margin: 2em 0;
  padding: 20px 24px;
  border-left: 5px solid var(--accent);
  background: var(--accent-soft);
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.4;
  color: var(--ink);
}

.prose pre {
  overflow-x: auto;
  padding: 20px;
  border: 2px solid var(--rule);
  background: var(--ink);
  color: #f0f0f0;
  font-size: 0.9rem;
}

.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.prose a { color: var(--accent); font-weight: 600; }
.prose img { max-width: 100%; border: 2px solid var(--rule); display: block; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .lead-card { grid-template-columns: 1fr; }
  .cover-wrap { order: 0; min-height: 220px; }
  .lead-body { border-right: none; border-top: 2px solid var(--rule); }
  .post-list { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .site-header {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 12px 0;
  }
  .brand { border-right: none; padding-right: 0; margin-right: 0; padding: 12px 0 10px; }
  .brand-name { font-size: 1.1rem; max-width: 160px; }

  .nav-toggle { display: flex; }

  .site-nav {
    display: none;
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    border-top: 2px solid var(--rule);
    padding-top: 8px;
  }
  .site-nav.nav-open { display: flex; }
  .site-nav .nav-link {
    border-left: none;
    border-bottom: 1px solid var(--rule);
    padding: 10px 0;
    width: 100%;
  }
  .more-categories { width: 100%; border-left: none; }
  .more-toggle { padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .more-panel {
    position: static;
    border: none;
    border-left: 3px solid var(--accent);
    padding: 4px 0 4px 12px;
    margin-bottom: 4px;
  }
  .more-panel .nav-link { border-bottom: none; padding: 7px 0; white-space: normal; }

  .language-switcher { width: 100%; padding: 8px 0; }
  .language-switcher select { width: 100%; }
  .site-switcher { width: 100%; padding: 8px 0; }
  .site-switcher-toggle { max-width: 100%; width: 100%; }
  .site-switcher-panel { position: static; box-shadow: none; border: none; border-left: 3px solid var(--accent); padding: 4px 0 4px 12px; margin-top: 4px; }
  .site-switcher-item { white-space: normal; border-bottom: none; padding: 7px 0; }

  .post-list { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; gap: 12px; }

  .category-hero { padding: 28px 0 20px; margin-bottom: 16px; }
  .category-title { font-size: clamp(2rem, 8vw, 3rem); }
  .subcategory-card { grid-template-columns: 40px 1fr auto auto; gap: 12px; padding: 18px 12px; }
  .subcategory-num { font-size: 1.2rem; }

  .article-shell { max-width: none; }
  .breadcrumb { margin-top: 20px; }
  .article-title { font-size: clamp(1.8rem, 7vw, 3rem); }
}
