@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400;1,6..72,500&family=Instrument+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* ============================================================
   CAFÉ THINKERS — Literary Magazine

   The New Yorker meets a café menu. Editorial typography,
   pull quotes, chapter numbers, coffee-ring watermarks.
   Not a food blog. A food journal.
   ============================================================ */

:root {
  --color-primary: #3D2B1F;
  --color-primary-light: #5A4233;
  --color-accent: #C67D4A;
  --color-accent-light: #D9996B;
  --color-accent-faint: rgba(198, 125, 74, 0.08);
  --color-bg: #FAF6F0;
  --color-bg-pull: #F3ECE2;
  --color-text: #2A2320;
  --color-text-light: #6B5D52;
  --color-text-muted: #A89888;
  --color-sage: #7A9E7E;
  --color-sage-faint: rgba(122, 158, 126, 0.1);
  --color-border: #E4DCD2;
  --color-hairline: rgba(42, 35, 32, 0.08);
  --color-coffee-ring: rgba(198, 125, 74, 0.06);

  --font-editorial: 'Newsreader', Georgia, serif;
  --font-sans: 'Instrument Sans', sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 3.5rem;
  --space-xl: 6rem;
  --space-2xl: 9rem;

  --header-height: 54px;
  --container-max: 1100px;
  --container-narrow: 640px;
  --column-width: 640px;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 2rem); }

body {
  font-family: var(--font-editorial);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.85;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover { color: var(--color-primary); }

h1, h2, h3, h4 {
  font-family: var(--font-editorial);
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-primary);
}

p { margin-bottom: 1.4em; }

::selection { background: var(--color-accent); color: #fff; }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* =============================================
   HEADER — Thin editorial masthead
   ============================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  background: var(--color-bg);
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--color-primary);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.site-logo {
  font-family: var(--font-editorial);
  font-weight: 600;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--color-primary);
  letter-spacing: 0.01em;
}
.site-logo:hover { color: var(--color-accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  list-style: none;
}

.nav-links a {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-light);
}
.nav-links a:hover { color: var(--color-primary); }

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  width: 30px;
  height: 30px;
  cursor: pointer;
  position: relative;
}

.nav-toggle span,
.nav-toggle::before,
.nav-toggle::after {
  content: '';
  position: absolute;
  left: 3px;
  width: 24px;
  height: 1.5px;
  background: var(--color-primary);
  transition: all 0.3s ease;
}
.nav-toggle::before { top: 8px; }
.nav-toggle span { top: 14px; }
.nav-toggle::after { top: 20px; }

.nav-open .nav-toggle::before { top: 14px; transform: rotate(45deg); }
.nav-open .nav-toggle span { opacity: 0; }
.nav-open .nav-toggle::after { top: 14px; transform: rotate(-45deg); }

/* =============================================
   HERO — No image. Just text. Editorial opening.
   A literary magazine doesn't need a hero photo.
   ============================================= */
.hero {
  padding: var(--space-2xl) 0 var(--space-xl);
  max-width: var(--column-width);
  margin: 0 auto;
  text-align: center;
  position: relative;
}

/* Chapter number above the title */
.hero::before {
  content: 'No. 47';
  display: block;
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

/* Coffee ring watermark */
.hero::after {
  content: '';
  position: absolute;
  top: 1rem;
  right: -3rem;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid var(--color-coffee-ring);
  opacity: 0.6;
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: var(--space-sm);
}

.hero h1 em, .hero h1 span {
  font-style: normal;
  color: var(--color-accent);
}

.hero-tagline {
  font-family: var(--font-editorial);
  font-size: 1rem;
  font-weight: 400;
  font-style: italic;
  color: var(--color-text-light);
  line-height: 1.7;
  max-width: 480px;
  margin: 0 auto;
}

/* Thin rule after hero */
.hero + *::before {
  content: '';
  display: block;
  width: 50px;
  height: 1px;
  background: var(--color-accent);
  margin: 0 auto var(--space-xl);
}

/* =============================================
   BUTTONS
   ============================================= */
.btn, .view-all {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: inline-block;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn {
  background: var(--color-primary);
  color: var(--color-bg);
  padding: 0.8rem 2rem;
  border: none;
}
.btn:hover { background: var(--color-accent); color: #fff; }

.view-all {
  color: var(--color-accent);
  background: none;
  border: none;
  padding: 0;
  position: relative;
}
.view-all::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--color-accent);
}
.view-all:hover { color: var(--color-primary); }
.view-all:hover::after { background: var(--color-primary); }

/* =============================================
   LATEST RECIPES
   ============================================= */
.latest-recipes {
  padding: 0 0 var(--space-xl);
}

.latest-recipes h2 {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: var(--space-lg);
}

/* =============================================
   RECIPE GRID — Magazine layout
   One large featured + smaller sidebar cards
   ============================================= */
.recipe-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: auto auto auto;
  gap: var(--space-md);
}

/* First card spans two rows — the feature story */
.recipe-grid .recipe-card:first-child {
  grid-row: 1 / 3;
}

/* =============================================
   RECIPE CARD — Editorial article preview
   ============================================= */
.recipe-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.3s ease;
  border-bottom: 1px solid var(--color-hairline);
  padding-bottom: var(--space-sm);
}

.recipe-card:hover { opacity: 0.75; }

/* First card — large image */
.recipe-grid .recipe-card:first-child .card-image {
  aspect-ratio: 4 / 5;
}

.card-image {
  overflow: hidden;
  aspect-ratio: 3 / 2;
  line-height: 0;
  margin-bottom: var(--space-sm);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
  filter: saturate(0.9);
}

.recipe-card:hover .card-image img {
  transform: scale(1.02);
  filter: saturate(1);
}

.card-body {
  flex: 1;
}

.card-body h3 {
  font-family: var(--font-editorial);
  font-weight: 500;
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.35;
  margin-bottom: 0.25rem;
  color: var(--color-primary);
}

/* First card gets bigger heading */
.recipe-grid .recipe-card:first-child .card-body h3 {
  font-size: 1.4rem;
}

.card-body p {
  font-size: 0.82rem;
  color: var(--color-text-light);
  line-height: 1.6;
  margin: 0;
}

.card-time {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: 0.4rem;
}

/* =============================================
   SINGLE RECIPE — Essay format
   ============================================= */
.recipe-single {
  max-width: var(--column-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
}

.recipe-header {
  margin-bottom: var(--space-lg);
  text-align: left;
}

/* Chapter indicator */
.recipe-header::before {
  content: 'Café Mornings · Recipe';
  display: block;
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.recipe-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-sm);
}

.recipe-description {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--color-text-light);
  line-height: 1.8;
  border-left: 2px solid var(--color-accent);
  padding-left: var(--space-sm);
  margin-left: 0;
}

.recipe-meta {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-hairline);
  border-bottom: 1px solid var(--color-hairline);
  padding-bottom: var(--space-sm);
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-item strong {
  font-family: var(--font-editorial);
  font-weight: 500;
  font-size: 1rem;
  color: var(--color-accent);
}

.meta-item span {
  font-family: var(--font-sans);
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.recipe-hero-image {
  margin: var(--space-lg) 0;
  line-height: 0;
  position: relative;
}

.recipe-hero-image img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

/* Photo caption line beneath */
.recipe-hero-image::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--color-accent);
  margin-top: var(--space-sm);
}

/* =============================================
   RECIPE BODY — Essay with drop caps
   ============================================= */
.recipe-body {
  font-size: 1rem;
  line-height: 1.9;
}

/* Drop cap on first paragraph */
.recipe-body > p:first-of-type::first-letter {
  font-family: var(--font-editorial);
  font-weight: 600;
  font-size: 3.8rem;
  float: left;
  line-height: 0.8;
  margin-right: 0.1em;
  margin-top: 0.05em;
  color: var(--color-accent);
}

.recipe-body h2 {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--color-hairline);
}

/* =============================================
   PULL QUOTE — Editorial callout
   ============================================= */
.recipe-body blockquote,
.pull-quote {
  font-family: var(--font-editorial);
  font-size: 1.3rem;
  font-style: italic;
  font-weight: 400;
  color: var(--color-accent);
  line-height: 1.5;
  padding: var(--space-md) 0;
  margin: var(--space-md) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* =============================================
   INGREDIENTS — Book appendix style
   ============================================= */
.recipe-ingredients {
  margin: var(--space-lg) 0;
  padding: var(--space-lg) var(--space-md);
  background: var(--color-bg-pull);
  position: relative;
}

/* Coffee ring watermark */
.recipe-ingredients::before {
  content: '';
  position: absolute;
  top: -1.5rem;
  right: 1rem;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--color-coffee-ring);
  pointer-events: none;
}

.recipe-ingredients h2,
.recipe-ingredients h3 {
  font-family: var(--font-sans);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  font-variant: small-caps;
  border: none;
  padding: 0;
}

.recipe-ingredients ul {
  list-style: none;
  padding: 0;
}

.recipe-ingredients li {
  padding: 0.4em 0 0.4em 1.2em;
  position: relative;
  font-family: var(--font-editorial);
  font-size: 0.92rem;
  line-height: 1.7;
  font-style: italic;
  color: var(--color-text);
  border-bottom: 1px dotted var(--color-border);
}

.recipe-ingredients li:last-child { border-bottom: none; }

/* Small diamond bullet */
.recipe-ingredients li::before {
  content: '◆';
  position: absolute;
  left: 0;
  top: 0.45em;
  color: var(--color-accent);
  font-size: 0.35rem;
  font-style: normal;
}

/* =============================================
   INSTRUCTIONS — Essay paragraphs with drop-cap numbers
   ============================================= */
.recipe-instructions {
  margin: var(--space-lg) 0;
  counter-reset: essay-step;
}

.recipe-instructions h2,
.recipe-instructions h3 {
  margin-bottom: var(--space-md);
}

.recipe-instructions ol {
  list-style: none;
  padding: 0;
}

.recipe-instructions li {
  counter-increment: essay-step;
  position: relative;
  padding: var(--space-md) 0 var(--space-md) 0;
  line-height: 1.9;
  border-bottom: 1px solid var(--color-hairline);
}

.recipe-instructions li:last-child { border-bottom: none; }

/* Drop-cap style step number integrated into text */
.recipe-instructions li::before {
  content: counter(essay-step);
  font-family: var(--font-editorial);
  font-weight: 600;
  font-size: 2.8rem;
  float: left;
  line-height: 0.85;
  margin-right: 0.15em;
  margin-top: 0.05em;
  color: var(--color-border);
}

/* =============================================
   NUTRITION
   ============================================= */
.recipe-nutrition {
  margin: var(--space-lg) 0;
  padding: var(--space-sm) var(--space-md);
  border-left: 2px solid var(--color-sage);
  background: var(--color-sage-faint);
  font-size: 0.88rem;
  color: var(--color-text-light);
}

.recipe-nutrition h2,
.recipe-nutrition h3 {
  font-family: var(--font-sans);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-sage);
  margin-bottom: var(--space-xs);
  border: none;
  padding: 0;
}

/* =============================================
   RECIPE FOOTER
   ============================================= */
.recipe-footer {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 2px solid var(--color-primary);
}

.recipe-categories,
.recipe-tags {
  margin-bottom: var(--space-sm);
}

.recipe-categories h4,
.recipe-tags h4 {
  font-family: var(--font-sans);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.3rem;
}

.tag {
  display: inline-block;
  font-family: var(--font-editorial);
  font-size: 0.82rem;
  font-style: italic;
  color: var(--color-text-light);
  margin-right: 1rem;
  padding: 0.15rem 0;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
}

.tag:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
}

/* =============================================
   LIST PAGE
   ============================================= */
.list-page {
  padding: var(--space-xl) 0;
}

.list-page h1 {
  font-family: var(--font-editorial);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 400;
  font-style: italic;
  text-align: center;
  margin-bottom: var(--space-xs);
}

.list-description {
  text-align: center;
  font-family: var(--font-editorial);
  font-size: 0.92rem;
  font-style: italic;
  color: var(--color-text-light);
  max-width: 420px;
  margin: 0 auto var(--space-lg);
}

.empty-message {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  font-family: var(--font-editorial);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--color-text-muted);
}

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
}

.page-item {
  font-family: var(--font-editorial);
  font-size: 0.95rem;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-item:hover,
.page-item.active {
  color: var(--color-primary);
}

.page-item.active {
  border-bottom: 1px solid var(--color-accent);
}

/* =============================================
   FOOTER — Masthead colophon
   ============================================= */
.site-footer {
  border-top: 2px solid var(--color-primary);
  padding: var(--space-lg) 0;
  text-align: center;
  margin-top: var(--space-xl);
}

.site-footer p {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}

.site-footer a {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
}
.site-footer a:hover { color: var(--color-primary); }

/* =============================================
   RESPONSIVE — 768px
   ============================================= */
@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .nav-links {
    position: fixed;
    top: var(--header-height);
    left: 0; right: 0; bottom: 0;
    background: var(--color-bg);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 999;
  }
  .nav-open .nav-links { opacity: 1; visibility: visible; }
  .nav-links a { font-size: 0.85rem; }

  .recipe-grid {
    grid-template-columns: 1fr;
  }

  .recipe-grid .recipe-card:first-child {
    grid-row: auto;
  }

  .recipe-grid .recipe-card:first-child .card-image {
    aspect-ratio: 3 / 2;
  }

  .hero::after { display: none; }
}

/* =============================================
   RESPONSIVE — 480px
   ============================================= */
@media (max-width: 480px) {
  :root {
    --header-height: 48px;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
  }

  html { font-size: 16px; }

  .hero { padding: var(--space-xl) 0 var(--space-lg); }

  .recipe-body > p:first-of-type::first-letter {
    font-size: 3rem;
  }

  .recipe-instructions li::before {
    font-size: 2.2rem;
  }

  .recipe-ingredients {
    padding: var(--space-md);
  }

  .recipe-ingredients::before { display: none; }

  .recipe-meta {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }
}

/* === Focus === */
:focus-visible {
  outline: 1px solid var(--color-accent);
  outline-offset: 3px;
}

/* === Print === */
@media print {
  .site-header, .site-footer, .nav-toggle, .pagination, .view-all, .btn { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .recipe-ingredients { background: #f8f8f8; }
  .recipe-ingredients::before { display: none; }
  .hero::after { display: none; }
}
