/* Maré Clara — enseadabr.info | warm-earth editorial */

:root {
  --sand-50: #faf6f1;
  --sand-100: #f0e8dc;
  --sand-200: #e2d4c2;
  --clay-400: #b8896a;
  --clay-600: #8f6347;
  --clay-800: #5c4030;
  --terra-500: #c46f4e;
  --terra-700: #9a4f35;
  --moss-500: #6d8f7a;
  --moss-700: #4a6b58;
  --ink: #2c241c;
  --ink-soft: #4a3f36;
  --muted: #7a6e63;
  --line: #d9cbb8;
  --white: #fffcf8;

  --font-serif: "Source Serif 4", "Georgia", serif;
  --font-display: "Libre Baskerville", "Georgia", serif;

  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --container: 960px;
  --sidebar-w: 200px;
  --reading: 640px;
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--sand-50);
}

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

a {
  color: var(--clay-600);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover { color: var(--terra-700); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--clay-800);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.375rem); }
h2 { font-size: clamp(1.375rem, 3vw, 1.75rem); margin-top: var(--space-lg); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 var(--space-sm); }

.container {
  width: min(100% - var(--space-md) * 2, var(--container));
  margin-inline: auto;
}

/* Cookie top-strip */
.cookie-strip {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--clay-800);
  color: var(--sand-100);
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.875rem;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

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

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

.cookie-strip a { color: var(--sand-200); }

.cookie-accept {
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  color: var(--sand-100);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0;
}

.cookie-accept:hover { color: var(--white); }

/* Stacked header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding-top: var(--space-md);
}

.site-header--offset { padding-top: calc(var(--space-md) + 40px); }

.site-header__brand {
  text-align: center;
  padding-bottom: var(--space-sm);
}

.site-logo {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--clay-800);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-logo:hover { color: var(--terra-700); text-decoration: none; }

.site-tagline {
  margin: var(--space-xs) 0 0;
  font-size: 0.875rem;
  color: var(--muted);
  font-style: italic;
}

.site-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-md);
  padding: var(--space-sm) 0 var(--space-md);
  border-top: 1px solid var(--line);
}

.site-nav a {
  font-size: 0.9375rem;
  text-decoration: none;
  color: var(--ink-soft);
  padding: var(--space-xs) 0;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--terra-700);
  text-decoration: underline;
}

.menu-toggle {
  display: none;
  position: absolute;
  top: var(--space-md);
  right: var(--space-sm);
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-xs) var(--space-sm);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--ink);
  cursor: pointer;
}

.site-header__top {
  position: relative;
}

/* Mobile drawer */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(44, 36, 28, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.mobile-nav.open { opacity: 1; visibility: visible; }

.mobile-nav__panel {
  width: min(280px, 85vw);
  height: 100%;
  background: var(--white);
  padding: var(--space-lg) var(--space-md);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.mobile-nav.open .mobile-nav__panel { transform: translateX(0); }

.mobile-nav__close {
  align-self: flex-end;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: var(--space-xs);
}

.mobile-nav a {
  font-family: var(--font-display);
  font-size: 1.125rem;
  text-decoration: none;
  color: var(--clay-800);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--line);
}

/* Layout: left-rail sidebar + 8-col asymmetric */
.page-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: var(--space-lg);
  padding: var(--space-lg) 0 var(--space-xl);
}

.sidebar {
  font-size: 0.875rem;
}

.sidebar__block {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--line);
}

.sidebar__title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 var(--space-xs);
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

.sidebar a { text-decoration: none; }
.sidebar a:hover { text-decoration: underline; }

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

/* Hero split */
.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
  margin-bottom: var(--space-xl);
}

.hero-split__text h1 { margin-top: 0; }

.hero-split__image {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--sand-200);
}

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

/* Article stream — horizontal rows */
.article-stream { margin-bottom: var(--space-xl); }

.section-label {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--terra-700);
  margin: 0 0 var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--terra-500);
  display: inline-block;
}

.article-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.article-row__thumb {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--sand-200);
}

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

.article-row__meta {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: var(--space-xs);
}

.article-row h2,
.article-row h3 {
  margin: 0 0 var(--space-xs);
  font-size: 1.25rem;
}

.article-row h2 a,
.article-row h3 a {
  color: var(--clay-800);
  text-decoration: none;
}

.article-row h2 a:hover,
.article-row h3 a:hover { text-decoration: underline; color: var(--terra-700); }

.article-row p {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin: 0;
}

/* Cards stacked-text-below */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
}

.card__image {
  aspect-ratio: 4 / 3;
  background: var(--sand-200);
}

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

.card__body { padding: var(--space-sm); }

.card__body h3 {
  margin: 0 0 var(--space-xs);
  font-size: 1.0625rem;
}

.card__body h3 a {
  color: var(--clay-800);
  text-decoration: none;
}

.card__body h3 a:hover { text-decoration: underline; }

.card__meta {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Tags underline-text */
.tag {
  font-size: 0.75rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  color: var(--moss-700);
}

.tag:hover { color: var(--terra-700); }

/* Text-link buttons */
.text-link {
  display: inline;
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  color: var(--clay-600);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0;
}

.text-link:hover { color: var(--terra-700); }

/* Narrow reading article */
.article-narrow {
  max-width: var(--reading);
}

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

.article-header h1 { margin: var(--space-sm) 0; }

.article-deck {
  font-size: 1.1875rem;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: var(--space-md);
}

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

.article-featured-image {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--space-lg) 0;
  background: var(--sand-200);
}

.article-body h2 { margin-top: var(--space-lg); }
.article-body ul, .article-body ol {
  margin: 0 0 var(--space-sm);
  padding-left: var(--space-md);
}

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

/* Footer author note */
.author-note {
  margin-top: var(--space-xl);
  padding: var(--space-md);
  background: var(--sand-100);
  border-radius: var(--radius-md);
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.author-note__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--sand-200);
}

.author-note__name {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0 0 var(--space-xs);
  font-size: 1rem;
}

.author-note p {
  font-size: 0.875rem;
  margin: 0;
  color: var(--ink-soft);
}

/* Related articles */
.related-block {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--line);
}

.related-block h2 {
  font-size: 1.125rem;
  margin-top: 0;
}

/* Page content (about, legal) */
.page-content {
  max-width: var(--reading);
}

.page-content h1 { margin-top: 0; }

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

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

.form-group label {
  display: block;
  font-size: 0.875rem;
  margin-bottom: var(--space-xs);
  color: var(--ink-soft);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: var(--space-xs) var(--space-sm);
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
}

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

.form-success {
  margin-top: var(--space-sm);
  padding: var(--space-sm);
  background: var(--moss-500);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
}

/* Two-column footer */
.site-footer {
  background: var(--clay-800);
  color: var(--sand-200);
  padding: var(--space-xl) 0 var(--space-lg);
  margin-top: var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.footer-grid h2 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sand-100);
  margin: 0 0 var(--space-sm);
}

.footer-grid p,
.footer-grid li {
  font-size: 0.875rem;
  line-height: 1.6;
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

.footer-grid a { color: var(--sand-200); }
.footer-grid a:hover { color: var(--white); }

.footer-bottom {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.8125rem;
  color: var(--sand-200);
  opacity: 0.85;
}

/* Articles listing page */
.articles-intro {
  margin-bottom: var(--space-lg);
  max-width: var(--reading);
}

/* Responsive */
@media (max-width: 768px) {
  .menu-toggle { display: block; }

  .site-nav { display: none; }

  .page-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
  }

  .sidebar__block { border-bottom: none; }

  .hero-split {
    grid-template-columns: 1fr;
  }

  .article-row {
    grid-template-columns: 1fr;
  }

  .article-row__thumb {
    max-width: 240px;
  }

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

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

@media (max-width: 480px) {
  .sidebar { grid-template-columns: 1fr; }
}
