/* ==========================================================================
   CAREZZA MAGAZINE — Design System
   Palette: warm near-black with an antique-brass accent (not the default
   cream/terracotta or neon-on-black combos). Fraunces for display type,
   Work Sans for everything functional.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,500;1,9..144,400;1,9..144,600&family=Work+Sans:wght@300;400;500;600&display=swap');

:root {
  --bg: #14100f;
  --bg-raised: #1c1714;
  --line: #33291f;
  --ink: #f1ece4;
  --ink-dim: #a89b8c;
  --brass: #b9975b;
  --brass-dim: #8a744a;

  --font-display: 'Fraunces', serif;
  --font-body: 'Work Sans', sans-serif;

  --max: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; margin: 0 0 0.4em; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(20, 16, 15, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--max); margin: 0 auto; padding: 1.1rem var(--gutter);
  display: flex; align-items: center; gap: 2rem;
}
.wordmark {
  font-family: var(--font-display); font-style: italic; font-size: 1.4rem;
  letter-spacing: 0.01em; margin-right: auto;
}
.site-nav { display: flex; gap: 1.75rem; font-size: 0.95rem; }
.site-nav a { color: var(--ink-dim); border-bottom: 1px solid transparent; padding-bottom: 2px; }
.site-nav a.active, .site-nav a:hover { color: var(--ink); border-color: var(--brass); }
.submit-link {
  border: 1px solid var(--brass-dim); color: var(--brass);
  padding: 0.5rem 1.1rem; font-size: 0.9rem; white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}
.submit-link:hover { background: var(--brass); color: var(--bg); }
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .site-nav { position: fixed; inset: 4.2rem 0 auto 0; background: var(--bg);
    flex-direction: column; padding: 1.5rem var(--gutter); border-bottom: 1px solid var(--line);
    transform: translateY(-110%); transition: transform 0.25s ease; }
  .site-nav.open { transform: translateY(0); }
  .nav-toggle {
    display: block; width: 26px; height: 18px; position: relative;
    background: none; border: none; cursor: pointer; margin-left: 0.5rem;
  }
  .nav-toggle span, .nav-toggle::before, .nav-toggle::after {
    content: ''; position: absolute; left: 0; right: 0; height: 1px; background: var(--ink);
  }
  .nav-toggle::before { top: 0; }
  .nav-toggle span { top: 8px; }
  .nav-toggle::after { top: 16px; }
  .submit-link { margin-left: 0.5rem; }
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max); margin: 0 auto; padding: clamp(2.5rem, 8vw, 5rem) var(--gutter);
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center;
}
.hero-kicker { color: var(--ink-dim); font-size: 0.9rem; margin: 0 0 1rem; }
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1.02; margin-bottom: 1.2rem;
}
.hero h1 em { font-style: italic; color: var(--brass); font-weight: 400; }
.hero-standfirst { max-width: 42ch; color: var(--ink-dim); margin-bottom: 1.8rem; }
.hero-image { aspect-ratio: 4/5; overflow: hidden; }
.hero-image img { width: 100%; height: 100%; object-fit: cover; }

.btn-outline {
  display: inline-block; border: 1px solid var(--brass-dim); color: var(--brass);
  padding: 0.75rem 1.6rem; font-size: 0.9rem; transition: background 0.2s ease, color 0.2s ease;
}
.btn-outline:hover { background: var(--brass); color: var(--bg); }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero-image { order: -1; }
}

/* ---------- Filter row ---------- */
.filter-row {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 1.5rem;
  display: flex; gap: 1.5rem; flex-wrap: wrap; border-bottom: 1px solid var(--line);
  padding-bottom: 1.2rem;
}
.filter {
  background: none; border: none; color: var(--ink-dim); font-family: var(--font-body);
  font-size: 0.95rem; cursor: pointer; padding: 0.2rem 0; border-bottom: 1px solid transparent;
}
.filter.active, .filter:hover { color: var(--ink); border-color: var(--brass); }

/* ---------- Story grid (asymmetric, editorial) ---------- */
.story-grid {
  max-width: var(--max); margin: 0 auto; padding: clamp(1.5rem, 4vw, 2.5rem) var(--gutter) 0;
  display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 16vw; gap: 2px;
}
.story { position: relative; overflow: hidden; background: var(--bg-raised); }
.story--feature { grid-column: span 4; grid-row: span 2; }
.story:nth-of-type(2) { grid-column: span 2; grid-row: span 1; }
.story:nth-of-type(3) { grid-column: span 2; grid-row: span 1; }
.story a { display: block; height: 100%; }
.story img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.story:hover img { transform: scale(1.035); }
.story-caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1.1rem 1.2rem;
  background: linear-gradient(to top, rgba(10,8,7,0.85), transparent);
}
.story-category { display: block; font-size: 0.78rem; color: var(--brass); margin-bottom: 0.2rem; }
.story-caption h2 { font-size: 1.15rem; margin: 0; }
.story--feature .story-caption h2 { font-size: 1.6rem; }
.story[hidden] { display: none; }

@media (max-width: 760px) {
  .story-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .story, .story--feature, .story:nth-of-type(2), .story:nth-of-type(3) { grid-column: span 1; grid-row: span 1; aspect-ratio: 4/5; }
}

/* ---------- Issue band ---------- */
.issue-band {
  max-width: var(--max); margin: clamp(3rem, 8vw, 5rem) auto 0; padding: 0 var(--gutter) clamp(3rem, 8vw, 5rem);
  display: grid; grid-template-columns: 220px 1fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: center;
  border-top: 1px solid var(--line); padding-top: clamp(3rem, 8vw, 5rem);
}
.issue-cover { aspect-ratio: 3/4; object-fit: cover; }
.issue-kicker { color: var(--brass); font-size: 0.85rem; margin-bottom: 0.6rem; }
.issue-text h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.issue-text p { color: var(--ink-dim); max-width: 46ch; }
@media (max-width: 620px) { .issue-band { grid-template-columns: 1fr; } .issue-cover { max-width: 200px; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: clamp(2.5rem, 6vw, 4rem) 0 2rem; }
.footer-grid {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 1.2fr 1fr 1fr 1.3fr; gap: 2.5rem;
}
.footer-tagline { color: var(--ink-dim); font-size: 0.9rem; max-width: 22ch; }
.footer-links, .footer-social { display: flex; flex-direction: column; gap: 0.6rem; font-size: 0.92rem; }
.footer-links a, .footer-social a { color: var(--ink-dim); }
.footer-links a:hover, .footer-social a:hover { color: var(--brass); }
.newsletter-form label { display: block; font-size: 0.85rem; color: var(--ink-dim); margin-bottom: 0.6rem; }
.newsletter-row { display: flex; gap: 0.5rem; }
.newsletter-row input {
  flex: 1; background: var(--bg-raised); border: 1px solid var(--line); color: var(--ink);
  padding: 0.6rem 0.8rem; font-family: var(--font-body); font-size: 0.9rem;
}
.newsletter-row button {
  background: none; border: 1px solid var(--brass-dim); color: var(--brass);
  padding: 0.6rem 1rem; font-size: 0.9rem; cursor: pointer;
}
.newsletter-row button:hover { background: var(--brass); color: var(--bg); }
.form-note { font-size: 0.78rem; color: var(--ink-dim); opacity: 0.7; margin-top: 0.5rem; }
.copyright { max-width: var(--max); margin: 2.5rem auto 0; padding: 1.2rem var(--gutter) 0; border-top: 1px solid var(--line); color: var(--ink-dim); font-size: 0.82rem; }

@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Editorial detail page ---------- */
.editorial-header { max-width: var(--max); margin: 0 auto; padding: clamp(2.5rem, 6vw, 4rem) var(--gutter) 2rem; }
.editorial-header .story-category { font-size: 0.85rem; }
.editorial-header h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-style: italic; font-weight: 400; }
.editorial-meta { color: var(--ink-dim); font-size: 0.9rem; }

.credit-list {
  max-width: var(--max); margin: 0 auto 3rem; padding: 1.6rem var(--gutter);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem;
}
.credit-list dt { font-size: 0.78rem; color: var(--ink-dim); margin-bottom: 0.3rem; }
.credit-list dd { margin: 0; font-size: 0.95rem; }
.credit-list dd a { color: var(--brass); }
@media (max-width: 700px) { .credit-list { grid-template-columns: 1fr 1fr; } }

.gallery { max-width: 920px; margin: 0 auto; padding: 0 var(--gutter); display: flex; flex-direction: column; gap: clamp(1.5rem, 4vw, 3rem); }
.gallery img { width: 100%; }

.story-nav {
  max-width: var(--max); margin: clamp(3rem, 6vw, 4rem) auto 4rem; padding: 1.6rem var(--gutter) 0;
  border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-size: 0.9rem;
}
.story-nav a { color: var(--ink-dim); }
.story-nav a:hover { color: var(--brass); }

/* ---------- Simple content pages (About / Submissions) ---------- */
.page-header { max-width: 780px; margin: 0 auto; padding: clamp(2.5rem, 6vw, 4rem) var(--gutter) 1rem; }
.page-header h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); font-style: italic; font-weight: 400; }
.page-header p.lede { color: var(--ink-dim); max-width: 56ch; }

.content-block { max-width: 780px; margin: 0 auto; padding: 1.2rem var(--gutter) 3rem; }
.content-block h2 { font-size: 1.3rem; margin-top: 2.2rem; }
.content-block ul { padding-left: 1.1rem; color: var(--ink-dim); }
.content-block li { margin-bottom: 0.5rem; }
.content-block li::marker { color: var(--brass); }

.issues-list { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: 1.5rem 0; }
.issue-item { width: 150px; }
.issue-item img { aspect-ratio: 3/4; object-fit: cover; margin-bottom: 0.5rem; }
.issue-item span { font-size: 0.85rem; color: var(--ink-dim); }

.contact-block { display: flex; flex-direction: column; gap: 0.4rem; }
.contact-block a { color: var(--brass); }

/* ---------- Form ---------- */
.field { margin-bottom: 1.3rem; display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-size: 0.85rem; color: var(--ink-dim); }
.field input, .field select, .field textarea {
  background: var(--bg-raised); border: 1px solid var(--line); color: var(--ink);
  padding: 0.7rem 0.9rem; font-family: var(--font-body); font-size: 0.95rem; width: 100%;
}
.field textarea { min-height: 120px; resize: vertical; }
.submit-form button[type="submit"] {
  background: none; border: 1px solid var(--brass-dim); color: var(--brass);
  padding: 0.75rem 1.8rem; font-size: 0.9rem; cursor: pointer;
}
.submit-form button[type="submit"]:hover { background: var(--brass); color: var(--bg); }
.form-response { margin-top: 1rem; font-size: 0.9rem; color: var(--brass); display: none; }
.form-response.visible { display: block; }
