/* ============================================
   Editorial magazine theme
   Type: Fraunces (display serif) + Inter Tight (sans)
   ============================================ */

:root {
  --ink: #1a1814;
  --ink-soft: #4a453d;
  --ink-muted: #8a8378;
  --paper: #f5f1e8;
  --paper-warm: #ebe5d4;
  --accent: #b8472a;
  --rule: rgba(26, 24, 20, 0.12);
  --measure: 64ch;
}

@font-face {
  font-family: 'system-fallback';
  src: local('Georgia');
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: 'Fraunces', 'Georgia', serif;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.1;
  color: var(--ink);
}

h1 { font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 300; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 400; }
h3 { font-size: 1.25rem; font-weight: 500; }

p { max-width: var(--measure); }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color 0.2s; }
a:hover { color: var(--accent); }

/* ---------- Layout ---------- */
.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ---------- Header ---------- */
header {
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.logo em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
}

nav ul {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  flex-wrap: wrap;
}

nav a {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

nav a:hover, nav a.active {
  border-bottom-color: var(--accent);
  color: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  padding: 5rem 0 4rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  position: relative;
}

@media (min-width: 800px) {
  .hero { grid-template-columns: 2fr 1fr; gap: 4rem; align-items: end; }
}

.hero .lede {
  font-family: 'Fraunces', serif;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 16ch;
}

.hero .lede em {
  font-style: italic;
  color: var(--accent);
}

.hero .intro {
  font-size: 1.05rem;
  color: var(--ink-soft);
  border-left: 2px solid var(--accent);
  padding-left: 1.25rem;
}

/* ---------- Section markers ---------- */
.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-label::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--ink-muted);
}

section { padding: 4rem 0; border-top: 1px solid var(--rule); }

/* ---------- Card grids ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.card {
  text-decoration: none;
  display: block;
  transition: transform 0.3s ease;
}

.card:hover { transform: translateY(-4px); }

.card .thumb {
  aspect-ratio: 4 / 3;
  background: var(--paper-warm);
  margin-bottom: 1rem;
  overflow: hidden;
  position: relative;
}

.card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.card:hover .thumb img { transform: scale(1.04); }

.card .kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.card h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.card .meta {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-top: 0.75rem;
}

/* ---------- Featured (asymmetric) ---------- */
.featured {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

@media (min-width: 800px) {
  .featured { grid-template-columns: 1.4fr 1fr; align-items: center; }
}

.featured .thumb {
  aspect-ratio: 5 / 4;
  background: var(--paper-warm);
  overflow: hidden;
}

.featured .thumb img {
  width: 100%; height: 100%; object-fit: cover;
}

.featured h3 {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 400;
  margin: 1rem 0;
  line-height: 1.15;
}

/* ---------- Photography grid ---------- */
.photo-grid {
  columns: 1;
  column-gap: 1rem;
  margin-top: 2rem;
}

@media (min-width: 600px) { .photo-grid { columns: 2; } }
@media (min-width: 1000px) { .photo-grid { columns: 3; } }

.photo-grid figure {
  break-inside: avoid;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.photo-grid img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s ease, filter 0.4s;
  filter: saturate(0.95);
}

.photo-grid figure:hover img { transform: scale(1.03); filter: saturate(1.1); }

.photo-grid figcaption {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-top: 0.4rem;
  font-style: italic;
}

/* ---------- Article (post) ---------- */
article.post {
  max-width: 720px;
  margin: 4rem auto;
  padding: 0 2rem;
}

article.post .kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 1rem;
}

article.post h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 400;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

article.post .byline {
  color: var(--ink-muted);
  font-size: 0.9rem;
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
}

article.post p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  max-width: none;
}

article.post p:first-of-type::first-letter {
  font-family: 'Fraunces', serif;
  font-size: 4.5rem;
  float: left;
  line-height: 0.9;
  padding: 0.4rem 0.75rem 0 0;
  font-weight: 300;
  color: var(--accent);
}

article.post h2 {
  margin: 2.5rem 0 1rem;
  font-size: 1.6rem;
}

article.post blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 1.3rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

article.post code {
  background: var(--paper-warm);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

article.post pre {
  background: var(--ink);
  color: var(--paper);
  padding: 1.5rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

article.post pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

article.post img {
  width: 100%;
  height: auto;
  margin: 2rem 0;
}

/* ---------- Footer ---------- */
footer {
  margin-top: 6rem;
  padding: 3rem 0;
  border-top: 1px solid var(--rule);
  color: var(--ink-muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

footer a { color: var(--ink-soft); }

/* ---------- Subtle animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero .lede, .hero .intro, section > * {
  animation: fadeUp 0.8s ease-out backwards;
}

.hero .intro { animation-delay: 0.15s; }
section .cards > *:nth-child(1) { animation-delay: 0.05s; }
section .cards > *:nth-child(2) { animation-delay: 0.15s; }
section .cards > *:nth-child(3) { animation-delay: 0.25s; }
