/* Pelada Segura — caneleira.info | muted-green community journal */

:root {
  --green-900: #2a3d32;
  --green-700: #4a6b58;
  --green-500: #6b8f78;
  --green-300: #a8c4b0;
  --green-100: #e8f0ea;
  --green-50: #f4f8f5;
  --sand: #f0ebe3;
  --ink: #1e2421;
  --ink-muted: #5a6560;
  --border: #c5d4ca;
  --white: #ffffff;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --container: 960px;
  --gap: 1.5rem;
  --font-serif: "Lora", Georgia, serif;
  --font-sans: "Source Sans 3", system-ui, sans-serif;
  --font-display: "Playfair Display", Georgia, serif;
  --shadow-soft: 0 2px 12px rgba(42, 61, 50, 0.08);
  --transition: 0.22s ease;
}

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

html {
  scroll-behavior: smooth;
}

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

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

a {
  color: var(--green-700);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

a:hover {
  color: var(--green-900);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  color: var(--green-900);
  margin-top: 0;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); }
h3 { font-size: 1.2rem; font-family: var(--font-serif); }

p { margin: 0 0 1rem; }

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

/* Cookie top-strip */
.cookie-strip {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--green-900);
  color: var(--green-100);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  transform: translateY(-100%);
  transition: transform var(--transition);
  border-bottom: 2px solid var(--green-500);
}

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

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

.cookie-strip a {
  color: var(--green-300);
}

.cookie-strip .btn {
  border-color: var(--green-300);
  color: var(--green-100);
  font-size: 0.85rem;
  padding: 0.35rem 1rem;
}

.cookie-strip .btn:hover {
  background: var(--green-700);
  color: var(--white);
}

body.cookie-visible {
  padding-top: 3.5rem;
}

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 900;
}

body.cookie-visible .site-header {
  top: 3.5rem;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--green-900);
}

.logo__mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.logo__text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.logo__tagline {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  color: var(--green-900);
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}

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

/* Mobile drawer */
.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 950;
  pointer-events: none;
  visibility: hidden;
}

.nav-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}

.nav-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 36, 33, 0.45);
  opacity: 0;
  transition: opacity var(--transition);
}

.nav-drawer.is-open .nav-drawer__overlay {
  opacity: 1;
}

.nav-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(280px, 85vw);
  height: 100%;
  background: var(--white);
  padding: 2rem 1.5rem;
  transform: translateX(100%);
  transition: transform var(--transition);
  border-left: 1px solid var(--border);
  overflow-y: auto;
}

.nav-drawer.is-open .nav-drawer__panel {
  transform: translateX(0);
}

.nav-drawer__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--green-900);
  line-height: 1;
}

.nav-drawer nav ul {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nav-drawer nav li {
  border-bottom: 1px solid var(--border);
}

.nav-drawer nav a {
  display: block;
  padding: 1rem 0;
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
}

/* 8-col asymmetric grid */
.grid-8 {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: var(--gap);
}

.col-5 { grid-column: span 5; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
.col-2 { grid-column: span 2; }
.col-8 { grid-column: span 8; }

@media (max-width: 768px) {
  .col-5, .col-4, .col-3, .col-2 { grid-column: span 8; }
}

/* Hero split */
.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
  padding: 2.5rem 0;
}

@media (max-width: 768px) {
  .hero-split {
    grid-template-columns: 1fr;
  }
}

.hero-split__media {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--green-100);
  box-shadow: var(--shadow-soft);
}

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

.hero-split__label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green-500);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero-split h1 {
  margin-bottom: 0.75rem;
}

.hero-split__excerpt {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--ink-muted);
  margin-bottom: 1.25rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.55rem 1.25rem;
  border: 2px solid var(--green-700);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--green-700);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.btn:hover {
  background: var(--green-700);
  color: var(--white);
}

/* Tags underline-text */
.tag {
  display: inline;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--green-500);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--green-300);
}

/* Author inline-byline */
.byline {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}

.byline strong {
  color: var(--green-900);
  font-weight: 600;
}

.byline time {
  color: var(--ink-muted);
}

/* Bordered cards */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-soft);
}

.card__body {
  padding: 1.25rem;
}

/* Horizontal article rows */
.article-rows {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 2rem 0;
}

.article-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.25rem;
  align-items: start;
  padding: 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.article-row:hover {
  box-shadow: var(--shadow-soft);
  border-color: var(--green-300);
}

.article-row__thumb {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--green-100);
}

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

.article-row h3 {
  margin: 0.25rem 0 0.5rem;
  font-family: var(--font-display);
  color: var(--green-900);
}

.article-row p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

@media (max-width: 600px) {
  .article-row {
    grid-template-columns: 1fr;
  }
  .article-row__thumb {
    max-width: 200px;
  }
}

/* Sidebar left-rail layout */
.layout-sidebar {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2.5rem;
  padding: 2rem 0 3rem;
  align-items: start;
}

.sidebar-rail {
  position: sticky;
  top: 5rem;
  padding-top: 0.5rem;
}

.sidebar-rail__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 3px solid var(--green-300);
}

.sidebar-rail__nav li a {
  display: block;
  padding: 0.5rem 0 0.5rem 1rem;
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--ink-muted);
  border-left: 3px solid transparent;
  margin-left: -3px;
}

.sidebar-rail__nav li a:hover,
.sidebar-rail__nav li a.is-active {
  color: var(--green-700);
  border-left-color: var(--green-700);
  font-weight: 600;
}

.article-content {
  max-width: 640px;
}

.article-content .lead {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
}

.article-content figure {
  margin: 2rem 0;
}

.article-content figure img,
.article-content figure svg {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--green-100);
}

.article-content figcaption {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-top: 0.5rem;
  font-style: italic;
}

@media (max-width: 768px) {
  .layout-sidebar {
    grid-template-columns: 1fr;
  }
  .sidebar-rail {
    position: static;
  }
  .nav-toggle { display: block; }
  .site-nav { display: none; }
}

/* Section blocks */
.section {
  padding: 2rem 0;
}

.section__header {
  border-bottom: 2px solid var(--green-300);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}

.section__header h2 {
  margin: 0;
  font-size: 1.35rem;
}

/* Feed sidebar widget */
.feed-widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 2rem;
}

.feed-widget h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green-500);
  margin-bottom: 1rem;
  font-family: var(--font-sans);
}

.feed-widget ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: feed;
}

.feed-widget li {
  counter-increment: feed;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.feed-widget li:last-child {
  border-bottom: none;
}

.feed-widget li::before {
  content: counter(feed) ".";
  color: var(--green-500);
  font-weight: 700;
  margin-right: 0.5rem;
}

.feed-widget a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}

.feed-widget a:hover {
  color: var(--green-700);
  text-decoration: underline;
}

/* Page header */
.page-header {
  padding: 2rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin-bottom: 0.5rem;
}

.page-header .meta {
  font-size: 0.9rem;
  color: var(--ink-muted);
}

/* Prose pages */
.prose {
  max-width: 680px;
  padding-bottom: 3rem;
}

.prose ul, .prose ol {
  margin: 0 0 1rem 1.25rem;
  padding: 0;
}

.prose li {
  margin-bottom: 0.5rem;
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 480px;
}

.contact-form label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--green-900);
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 1rem;
  background: var(--white);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--green-300);
  border-color: var(--green-500);
}

/* Three-column footer */
.site-footer {
  background: var(--green-900);
  color: var(--green-100);
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
}

.site-footer a {
  color: var(--green-300);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--white);
  text-decoration: underline;
}

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

.footer-col h3 {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green-300);
  margin-bottom: 1rem;
  font-weight: 700;
}

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

.footer-col li {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.footer-bottom {
  border-top: 1px solid var(--green-700);
  padding-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--green-300);
  text-align: center;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Articles listing page */
.articles-intro {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--ink-muted);
  margin-bottom: 2rem;
  max-width: 720px;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  margin-bottom: 2rem;
}

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

.article-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.article-card__img {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  overflow: hidden;
  background: var(--green-100);
}

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

.article-card .card__body h2 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

/* 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; }
.mt-2 { margin-top: 2rem; }
