/* Trama Editorial — academic-stone longform journal */

:root {
  --stone-50: #faf9f7;
  --stone-100: #f0ede8;
  --stone-200: #e2ddd4;
  --stone-300: #c9c2b5;
  --stone-400: #a89f8e;
  --stone-500: #8a8070;
  --stone-600: #6e6558;
  --stone-700: #524b41;
  --stone-800: #3a352e;
  --stone-900: #25221d;
  --accent: #5c4d3c;
  --accent-light: #7a6b58;
  --line: #d4cfc6;
  --bg: var(--stone-50);
  --text: var(--stone-800);
  --text-muted: var(--stone-600);
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --space-xs: 12px;
  --space-sm: 24px;
  --space-md: 36px;
  --space-lg: 48px;
  --space-xl: 72px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --container: 1140px;
  --header-height: 88px;
  --header-shrink: 64px;
  --transition: 0.3s ease;
}

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

html { scroll-behavior: smooth; font-size: 18px; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--stone-900); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.25;
  color: var(--stone-900);
}

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

/* Header — centered logo, sticky shrink */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transition: box-shadow var(--transition), padding var(--transition);
}

.site-header.is-shrunk {
  box-shadow: 0 2px 12px rgba(37, 34, 29, 0.06);
}

.site-header.is-shrunk .header-inner { padding: var(--space-xs) 0; }
.site-header.is-shrunk .logo-text { font-size: 1.35rem; }
.site-header.is-shrunk .logo-tagline { display: none; }

.header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-sm) 0;
  transition: padding var(--transition);
}

.logo-link {
  text-decoration: none;
  text-align: center;
  color: var(--stone-900);
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: font-size var(--transition);
}

.logo-tagline {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-top: 4px;
}

.nav-toggle {
  display: none;
  position: absolute;
  right: var(--space-sm);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text);
}

.site-nav { margin-top: var(--space-xs); }

.site-nav ul {
  display: flex;
  gap: var(--space-sm);
  list-style: none;
  flex-wrap: wrap;
  justify-content: center;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--stone-900);
  border-bottom-color: var(--accent);
}

/* Hero — split image text */
.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
  padding: var(--space-xl) 0 var(--space-lg);
}

.hero-split__image {
  aspect-ratio: 3 / 2;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
}

.hero-split__image img,
.hero-split__image svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-split__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.hero-split h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: var(--space-sm);
}

.hero-split__deck {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  line-height: 1.6;
}

.hero-split__meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--stone-800);
  color: var(--stone-50);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background var(--transition);
}

.btn:hover { background: var(--stone-900); color: var(--stone-50); }

.btn--outline {
  background: transparent;
  color: var(--stone-800);
  border: 1px solid var(--stone-800);
}

.btn--outline:hover { background: var(--stone-800); color: var(--stone-50); }

/* Section headings */
.section-header {
  border-top: 2px solid var(--stone-900);
  padding-top: var(--space-xs);
  margin-bottom: var(--space-md);
}

.section-header h2 {
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Article cards — vertical, editorial lines */
.article-feed { padding-bottom: var(--space-xl); }

.article-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background var(--transition);
}

.article-card:first-child { border-top: 1px solid var(--line); }

.article-card:hover { background: var(--stone-100); }

.article-card__thumb {
  aspect-ratio: 3 / 2;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
}

.article-card__thumb img,
.article-card__thumb svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card__category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
}

.article-card h3 {
  font-size: 1.35rem;
  margin: var(--space-xs) 0;
  color: var(--stone-900);
}

.article-card__excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.article-card__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* Page hero */
.page-hero {
  padding: var(--space-lg) 0 var(--space-md);
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.page-hero h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); margin-bottom: var(--space-xs); }

.page-hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Article layout — pull quote led, sticky TOC */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: var(--space-lg);
  padding: var(--space-md) 0 var(--space-xl);
}

.article-main { min-width: 0; }

.article-header { margin-bottom: var(--space-lg); }

.article-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: var(--space-sm);
}

.article-header__deck {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  line-height: 1.6;
}

.article-header__meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--line);
}

.article-hero-img {
  aspect-ratio: 3 / 2;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: var(--space-lg);
}

.article-hero-img img,
.article-hero-img svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Pull quote — leads article */
.pull-quote {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  font-style: italic;
  color: var(--stone-700);
  border-left: 3px solid var(--accent);
  padding: var(--space-sm) 0 var(--space-sm) var(--space-md);
  margin: var(--space-lg) 0;
  line-height: 1.5;
}

.pull-quote cite {
  display: block;
  font-style: normal;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.article-body p { margin-bottom: var(--space-sm); }

.article-body h2 {
  font-size: 1.4rem;
  margin: var(--space-lg) 0 var(--space-sm);
}

.article-body h3 {
  font-size: 1.15rem;
  margin: var(--space-md) 0 var(--space-xs);
}

.article-body blockquote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--stone-700);
  border-left: 2px solid var(--line);
  padding-left: var(--space-md);
  margin: var(--space-md) 0;
}

.article-body ul, .article-body ol {
  margin: var(--space-sm) 0 var(--space-sm) var(--space-md);
}

.article-body li { margin-bottom: var(--space-xs); }

/* Sticky TOC sidebar */
.article-sidebar { position: relative; }

.toc {
  position: sticky;
  top: calc(var(--header-shrink) + var(--space-sm));
  padding: var(--space-sm);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--stone-100);
}

.toc h4 {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.toc ol {
  list-style: none;
  counter-reset: toc;
}

.toc li {
  counter-increment: toc;
  margin-bottom: 8px;
}

.toc a {
  text-decoration: none;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: block;
  padding: 4px 0;
  border-left: 2px solid transparent;
  padding-left: var(--space-xs);
  transition: color var(--transition), border-color var(--transition);
}

.toc a:hover,
.toc a.is-active {
  color: var(--stone-900);
  border-left-color: var(--accent);
}

/* Author bio */
.author-box {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md);
  margin-top: var(--space-lg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--stone-100);
}

.author-box__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--line);
}

.author-box__avatar img,
.author-box__avatar svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-box h4 {
  font-family: var(--font-serif);
  font-size: 1rem;
  margin-bottom: 4px;
}

.author-box__role {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.author-box p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Prose pages */
.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-md) 0 var(--space-xl);
}

.prose h2 {
  font-size: 1.35rem;
  margin: var(--space-lg) 0 var(--space-sm);
}

.prose h3 {
  font-size: 1.1rem;
  margin: var(--space-md) 0 var(--space-xs);
}

.prose p { margin-bottom: var(--space-sm); }

.prose ul, .prose ol {
  margin: var(--space-sm) 0 var(--space-sm) var(--space-md);
}

.prose li { margin-bottom: var(--space-xs); }

/* Contact form */
.contact-form {
  max-width: 560px;
  margin: var(--space-md) auto var(--space-xl);
}

.form-group { margin-bottom: var(--space-sm); }

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 1rem;
  background: var(--stone-50);
  color: var(--text);
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea { min-height: 140px; resize: vertical; }

/* Footer — editorial masthead */
.site-footer {
  background: var(--stone-900);
  color: var(--stone-300);
  padding: var(--space-lg) 0 var(--space-md);
}

.footer-masthead {
  text-align: center;
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--stone-700);
  margin-bottom: var(--space-md);
}

.footer-masthead .logo-text {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--stone-100);
  margin-bottom: var(--space-xs);
}

.footer-masthead p {
  font-size: 0.85rem;
  color: var(--stone-400);
  max-width: 480px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.footer-col h4 {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--stone-400);
  margin-bottom: var(--space-xs);
}

.footer-col ul { list-style: none; }

.footer-col a {
  color: var(--stone-300);
  text-decoration: none;
  font-size: 0.9rem;
  display: block;
  padding: 4px 0;
}

.footer-col a:hover { color: var(--stone-50); }

.footer-bottom {
  text-align: center;
  font-size: 0.8rem;
  color: var(--stone-500);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--stone-700);
}

/* Cookie bar */
.cookie-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--stone-800);
  color: var(--stone-200);
  padding: var(--space-sm);
  transform: translateY(100%);
  transition: transform var(--transition);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}

.cookie-bar.is-visible { transform: translateY(0); }

.cookie-bar__inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.cookie-bar p {
  font-size: 0.9rem;
  flex: 1;
  min-width: 240px;
}

.cookie-bar a { color: var(--stone-100); }

.cookie-bar__actions {
  display: flex;
  gap: var(--space-xs);
}

.cookie-bar .btn {
  padding: 8px 20px;
  font-size: 0.85rem;
}

.cookie-bar .btn--outline {
  border-color: var(--stone-400);
  color: var(--stone-200);
}

.cookie-bar .btn--outline:hover {
  background: var(--stone-700);
  border-color: var(--stone-700);
}

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

.text-center { text-align: center; }

/* Responsive */
@media (max-width: 900px) {
  .hero-split { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { order: -1; }
  .toc { position: static; }
  .article-card { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
}

@media (max-width: 768px) {
  .site-header .header-inner { position: relative; }

  .nav-toggle { display: block; }

  .site-nav {
    display: none;
    width: 100%;
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--line);
  }

  .site-nav.is-open { display: block; }

  .site-nav ul { flex-direction: column; align-items: center; gap: var(--space-xs); }
}
