:root {
  --bg: #fdfcf9;
  --ink: #1a1a1a;
  --ink-soft: #6b6b6b;
  --accent: #b3271d;
  --rule: #1a1a1a;
  --border: #e4e1d9;
  --warm: #f4ede0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Source Sans 3', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color .2s; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 32px; }

/* Masthead */
.masthead { border-bottom: 2px solid var(--rule); padding-top: 12px; }
.masthead-grid {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 16px 32px;
  gap: 16px;
}
.date {
  font-size: 12px;
  font-style: italic;
  color: var(--ink-soft);
}
.logo {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -2px;
  color: var(--ink);
  text-align: center;
}
.logo span { color: var(--accent); }
.masthead-nav {
  display: flex; justify-content: flex-end; gap: 24px;
  font-size: 13px;
}
.masthead-nav a:hover { color: var(--accent); }

.cats { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cats-inner {
  display: flex; justify-content: center; gap: 36px;
  padding: 14px 32px;
}
.cats a {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.cats a.active, .cats a:hover { color: var(--accent); }

/* Kicker */
.kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

/* Featured */
.featured {
  display: grid; grid-template-columns: 1.2fr 1fr;
  gap: 56px; align-items: center;
  padding: 60px 0;
  border-bottom: 1px solid var(--border);
}
.featured-img {
  aspect-ratio: 4/3;
  background:
    linear-gradient(rgba(0,0,0,.08), rgba(0,0,0,.08)),
    url('https://images.unsplash.com/photo-1568471173242-461f0a730452?w=1200&q=80') center/cover;
}
.featured h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 24px;
}
.lede {
  font-size: 19px;
  color: var(--ink-soft);
  font-family: 'Playfair Display', serif;
  font-style: italic;
  margin-bottom: 28px;
  line-height: 1.5;
}
.byline {
  display: flex; align-items: center; gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background-size: cover; background-position: center;
  flex-shrink: 0;
}
.a1 { background-image: url('https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=200&q=80'); }
.a2 { background-image: url('https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=200&q=80'); }
.byline strong { display: block; font-size: 14px; }
.byline span { font-size: 12px; color: var(--ink-soft); }

/* Grid Section */
.grid-section { padding: 60px 0; border-bottom: 1px solid var(--border); }
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 36px; font-weight: 700;
  margin-bottom: 36px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--rule);
  letter-spacing: -0.5px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 32px;
}
.card { cursor: pointer; }
.card-img {
  aspect-ratio: 5/3;
  background-size: cover; background-position: center;
  margin-bottom: 16px;
  transition: opacity .3s;
}
.card:hover .card-img { opacity: 0.85; }
.i1 { background-image: url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?w=800&q=80'); }
.i2 { background-image: url('https://images.unsplash.com/photo-1611273426858-450d8e3c9fce?w=800&q=80'); }
.i3 { background-image: url('https://images.unsplash.com/photo-1544025162-d76694265947?w=800&q=80'); }
.i4 { background-image: url('https://images.unsplash.com/photo-1414235077428-338989a2e8c0?w=800&q=80'); }
.i5 { background-image: url('https://images.unsplash.com/photo-1601001815853-3835274403b3?w=800&q=80'); }
.i6 { background-image: url('https://images.unsplash.com/photo-1517686469429-8bdb88b9f907?w=800&q=80'); }

.card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 10px;
}
.card p {
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.card-meta {
  font-size: 12px;
  color: var(--ink-soft);
  font-style: italic;
}

/* Article + sidebar */
.article-wrap {
  display: grid; grid-template-columns: 1fr 320px;
  gap: 80px;
  padding: 80px 0;
}
.article {
  max-width: 720px;
}
.article-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 24px;
}
.article .lede { margin-bottom: 32px; }
.article-meta {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}
.article-body p {
  font-size: 18px;
  line-height: 1.7;
  margin-bottom: 24px;
  color: #2a2a2a;
}
.article-body h3 {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  margin: 40px 0 16px;
  letter-spacing: -0.3px;
}
.article-body em { font-style: italic; }
.dropcap::first-letter {
  font-family: 'Playfair Display', serif;
  float: left;
  font-size: 72px;
  line-height: 0.85;
  padding: 6px 10px 0 0;
  font-weight: 900;
  color: var(--accent);
}
blockquote {
  border-left: 3px solid var(--accent);
  padding: 16px 24px;
  margin: 32px 0;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 22px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--warm);
}
.article-tags {
  display: flex; gap: 8px;
  padding-top: 32px;
  margin-top: 40px;
  border-top: 1px solid var(--border);
}
.article-tags span {
  padding: 6px 14px;
  background: var(--warm);
  border-radius: 100px;
  font-size: 12px;
  color: var(--ink-soft);
}

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 40px; }
.newsletter, .trending, .quote-box {
  padding: 28px;
  border: 1px solid var(--border);
}
.newsletter { background: var(--warm); border-color: var(--warm); }
.sidebar h4 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}
.newsletter p {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.newsletter form { display: flex; flex-direction: column; gap: 8px; }
.newsletter input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 14px;
  background: white;
}
.newsletter button {
  padding: 12px;
  background: var(--ink);
  color: var(--bg);
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.newsletter button:hover { background: var(--accent); }
.newsletter .ok { font-size: 12px; color: #15803d; text-align: center; margin-top: 8px; }

.trending ol { list-style: none; counter-reset: n; }
.trending li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.trending li:last-child { border-bottom: none; }
.trending li a {
  display: flex; gap: 14px; align-items: flex-start;
  font-size: 15px;
  line-height: 1.3;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.trending li a:hover { color: var(--accent); }
.trending li span {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--accent);
  font-weight: 900;
  line-height: 1;
  flex-shrink: 0;
}

.quote-box { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.quote-box p {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 22px;
  line-height: 1.3;
  margin-bottom: 12px;
}
.quote-box span { font-size: 13px; opacity: 0.7; }

/* Footer */
.footer {
  padding: 60px 0 24px;
  background: var(--ink); color: var(--bg);
  border-top: 1px solid var(--border);
}
.footer .logo { font-size: 36px; text-align: left; color: var(--bg); margin-bottom: 12px; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 40px;
}
.footer p { font-size: 14px; opacity: 0.7; max-width: 320px; }
.footer h5 {
  font-size: 12px; font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
  color: var(--accent);
}
.footer a {
  display: block;
  font-size: 14px;
  padding: 4px 0;
  opacity: 0.7;
}
.footer a:hover { opacity: 1; color: var(--accent); }
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: 12px;
  opacity: 0.5;
}

@media (max-width: 900px) {
  .masthead-grid { grid-template-columns: 1fr; text-align: center; }
  .masthead-nav { justify-content: center; }
  .logo { font-size: 44px; }
  .cats-inner { gap: 16px; overflow-x: auto; }
  .featured, .article-wrap { grid-template-columns: 1fr; gap: 32px; padding: 40px 0; }
  .grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .article-body p { font-size: 16px; }
}

/* Reading progress */
.reading-progress {
  height: 3px;
  background: var(--accent);
  width: 0%;
  transition: width .1s ease-out;
}

/* Card filter hide */
.card.hide-cat { display: none; }

/* Share bar */
.share-bar {
  display: flex; gap: 8px; align-items: center;
  margin: 32px 0;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.share-bar > span { font-size: 13px; color: var(--ink-soft); margin-right: 8px; font-weight: 500; }
.share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--warm);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px; font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
}
.share-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Author card */
.author-card {
  display: flex; gap: 20px;
  padding: 28px;
  background: var(--warm);
  border-radius: 4px;
  margin: 40px 0;
  align-items: flex-start;
}
.author-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background-size: cover; background-position: center;
  flex-shrink: 0;
}
.author-card strong {
  font-family: "Playfair Display", serif;
  font-size: 22px; font-weight: 700;
  display: block;
  margin-bottom: 2px;
}
.author-card > div > span {
  display: block;
  font-size: 12px; color: var(--ink-soft);
  font-style: italic;
  margin-bottom: 14px;
}
.author-card p {
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 14px;
  line-height: 1.6;
}
.author-link {
  font-size: 13px; font-weight: 600;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}

/* Related posts */
.related-posts { margin-top: 40px; }
.related-posts h4 {
  font-family: "Playfair Display", serif;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--rule);
}
.related-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.related-item {
  padding: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: all .2s;
}
.related-item:hover { border-color: var(--accent); background: var(--warm); }
.related-item strong {
  display: block;
  font-family: "Playfair Display", serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  margin: 8px 0 10px;
}
.rp-meta { font-size: 11px; color: var(--ink-soft); font-style: italic; }

/* Search/Subscribe modal */
.search-modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 80px 24px 24px;
}
.search-modal[hidden] { display: none; }
.sm-bg {
  position: absolute; inset: 0;
  background: rgba(26,26,26,.7);
  backdrop-filter: blur(6px);
}
.sm-card {
  position: relative;
  background: var(--bg);
  max-width: 600px; width: 100%;
  border-radius: 4px;
  padding: 0;
  max-height: 80vh; overflow: hidden;
  display: flex; flex-direction: column;
  animation: fadeIn .25s;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
.sm-card input[type=search] {
  border: none; outline: none;
  padding: 24px 28px;
  font-size: 18px;
  font-family: "Playfair Display", serif;
  font-weight: 700;
  background: var(--warm);
  border-bottom: 2px solid var(--rule);
  width: 100%;
}
.sm-results {
  flex: 1; overflow-y: auto;
  padding: 12px 0;
}
.sm-section {
  padding: 12px 28px 8px;
  font-size: 11px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}
.sm-result {
  display: block;
  padding: 12px 28px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.sm-result:hover { background: var(--warm); }
.sm-result strong {
  font-family: "Playfair Display", serif;
  font-size: 17px;
  font-weight: 700;
  display: block;
  margin: 4px 0;
}
.sm-result > span:last-child { font-size: 12px; color: var(--ink-soft); font-style: italic; }
.sm-empty { padding: 32px; text-align: center; color: var(--ink-soft); font-style: italic; }
.sm-hint {
  padding: 14px 28px;
  background: var(--warm);
  border-top: 1px solid var(--border);
  font-size: 11px; color: var(--ink-soft);
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
}
.sm-card-sub {
  padding: 40px;
  align-items: flex-start;
}
.sm-card-sub h3 {
  font-family: "Playfair Display", serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
}
.sm-card-sub p { font-size: 15px; color: var(--ink-soft); margin-bottom: 24px; }
.sm-card-sub form { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.sm-card-sub input {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  background: white;
}
.sm-card-sub button {
  padding: 14px;
  background: var(--ink);
  color: var(--bg);
  border: none; cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  font-size: 14px;
}
.sm-card-sub button:hover { background: var(--accent); }
.sm-ok { color: #15803d; font-size: 13px; text-align: center; margin-top: 4px; }
.sm-close {
  position: absolute; top: 16px; right: 16px;
  background: transparent; border: none;
  font-size: 24px; color: var(--ink-soft);
  cursor: pointer; padding: 4px 10px;
}
.sm-close:hover { color: var(--accent); }

@media (max-width: 700px) {
  .related-grid { grid-template-columns: 1fr; }
  .share-bar { font-size: 12px; }
  .share-btn { padding: 6px 10px; font-size: 11px; }
  .author-card { flex-direction: column; gap: 14px; }
  .author-avatar { width: 56px; height: 56px; }
  .search-modal { padding: 16px; }
  .sm-card-sub { padding: 28px 20px; }
}

/* Mobile polish */
@media (max-width: 700px) {
  .cats { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cats::-webkit-scrollbar { display: none; }
  .cats { scrollbar-width: none; }
  .cats-inner {
    padding: 12px 20px;
    flex-wrap: nowrap;
    gap: 22px;
    width: max-content;
    min-width: 100%;
  }
  .cats-inner a { flex-shrink: 0; white-space: nowrap; }
  .masthead-grid { padding: 12px 16px; gap: 10px; }
  .logo { font-size: 38px; }
  .date { font-size: 11px; }
  .masthead-nav { gap: 18px; font-size: 12px; }
  .featured h1 { font-size: 30px !important; line-height: 1.15; }
  .featured .lede { font-size: 16px; }
  .grid { gap: 28px 16px; }
  .card h3 { font-size: 18px; }
  .article-wrap { padding: 40px 0 60px; gap: 40px; }
  .article-title { font-size: 28px !important; line-height: 1.15; }
  .article .lede { font-size: 16px; }
  .article-body p { font-size: 16px; line-height: 1.6; }
  .article-body h3 { font-size: 22px; }
  blockquote { font-size: 18px; padding: 14px 16px; }
  .dropcap::first-letter { font-size: 56px; padding: 4px 8px 0 0; }
  .share-bar { padding: 14px 0; gap: 6px; margin: 24px 0; }
  .share-bar > span { width: 100%; margin: 0 0 4px 0; }
  .sidebar { gap: 24px; }
  .newsletter, .trending, .quote-box { padding: 20px; }
  .container { padding: 0 16px; }
}

/* H-scroll mobile: grid de cards */
@media (max-width: 700px) {
  .grid {
    display: flex !important;
    gap: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding: 4px 18px 24px;
    margin: 0 -18px;
    scrollbar-width: none;
  }
  .grid::-webkit-scrollbar { display: none; }
  .card {
    flex: 0 0 80vw;
    max-width: 320px;
    scroll-snap-align: start;
  }
}
