/* ============================================================
   CAFÉ COM DIEGO — Design System Global
   Baseado no brandbook oficial v1 · 2026
   ============================================================ */

/* ============================================================
   1. FONTES (Google Fonts)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Hanken+Grotesk:wght@400;500;600;700&display=swap');

/* ============================================================
   2. VARIÁVEIS — Paleta, Tipografia, Espaçamento
   ============================================================ */
:root {
  /* Cores */
  --porcelana:  #F7F3EB;   /* fundo claro principal */
  --linho:      #ECE3D2;   /* painéis e superfícies */
  --ambar:      #C2842E;   /* acento e ênfase */
  --ambar-cl:   #E0A94A;   /* acento em fundo escuro */
  --grafite:    #6E655A;   /* texto secundário */
  --tinta:      #1E1A15;   /* texto principal e fundo escuro */

  /* Semânticas */
  --bg:         var(--porcelana);
  --bg-panel:   var(--linho);
  --text:       var(--tinta);
  --text-muted: var(--grafite);
  --accent:     var(--ambar);
  --accent-dark: var(--ambar-cl);
  --line:       rgba(30, 26, 21, 0.12);

  /* Tipografia */
  --serif:  'Newsreader', Georgia, serif;
  --sans:   'Hanken Grotesk', system-ui, sans-serif;
  --mono:   'Courier New', monospace;

  /* Escala tipográfica */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-md:   1.125rem;   /* 18px */
  --text-lg:   1.25rem;    /* 20px */
  --text-xl:   1.5rem;     /* 24px */
  --text-2xl:  2rem;       /* 32px */
  --text-3xl:  2.5rem;     /* 40px */
  --text-4xl:  3.5rem;     /* 56px */
  --text-5xl:  4.5rem;     /* 72px */

  /* Espaçamento */
  --space-1:   0.25rem;
  --space-2:   0.5rem;
  --space-3:   0.75rem;
  --space-4:   1rem;
  --space-5:   1.25rem;
  --space-6:   1.5rem;
  --space-8:   2rem;
  --space-10:  2.5rem;
  --space-12:  3rem;
  --space-16:  4rem;
  --space-20:  5rem;
  --space-24:  6rem;
  --space-32:  8rem;

  /* Layout */
  --max-w:     1160px;
  --max-w-text: 700px;
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transições */
  --ease:      cubic-bezier(0.25, 0.1, 0.25, 1);
  --duration:  200ms;
}

/* ============================================================
   3. RESET E BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
}

input, textarea, select {
  font: inherit;
}

/* ============================================================
   4. TIPOGRAFIA
   ============================================================ */

/* Headings — Newsreader */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: clamp(var(--text-3xl), 6vw, var(--text-5xl)); }
h2 { font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl)); }
h3 { font-size: clamp(var(--text-xl),  3vw, var(--text-3xl)); }
h4 { font-size: clamp(var(--text-lg),  2vw, var(--text-2xl)); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  line-height: 1.75;
  color: var(--text);
}

/* Kicker — label de seção estilo brandbook */
.kicker {
  font-family: var(--sans);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.kicker::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1.5px;
  background: var(--accent);
  flex-shrink: 0;
}

/* Accent — âmbar no texto */
.accent { color: var(--accent); }

/* Lead — texto de entrada maior */
.lead {
  font-family: var(--serif);
  font-size: clamp(var(--text-md), 2vw, var(--text-xl));
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Quote */
blockquote {
  font-family: var(--serif);
  font-size: var(--text-xl);
  font-style: italic;
  line-height: 1.5;
  color: var(--text);
  border-left: 2px solid var(--accent);
  padding-left: var(--space-6);
  margin: var(--space-8) 0;
}

/* Code inline */
code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--linho);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
}

/* ============================================================
   5. LAYOUT — Wrap e Grid
   ============================================================ */
.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: clamp(var(--space-6), 5vw, var(--space-16));
}

.wrap--text {
  max-width: var(--max-w-text);
}

section {
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
}

.section-line {
  border-top: 1px solid var(--line);
}

/* Grid genérico */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-8); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-8); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ============================================================
   6. COMPONENTES — Botões
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--sans);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius);
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
}

.btn--primary {
  background: var(--tinta);
  color: var(--porcelana);
}
.btn--primary:hover {
  background: #2e2820;
  transform: translateY(-1px);
}

.btn--accent {
  background: var(--accent);
  color: var(--porcelana);
}
.btn--accent:hover {
  background: #a86e22;
  transform: translateY(-1px);
}

.btn--outline {
  border: 1.5px solid var(--tinta);
  color: var(--tinta);
}
.btn--outline:hover {
  background: var(--tinta);
  color: var(--porcelana);
}

.btn--ghost {
  color: var(--text-muted);
}
.btn--ghost:hover {
  color: var(--text);
}

.btn--lg {
  font-size: var(--text-base);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-lg);
}

/* ============================================================
   7. COMPONENTES — Cards
   ============================================================ */
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(30, 26, 21, 0.08);
}

.card__cover {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--linho);
}
.card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms var(--ease);
}
.card:hover .card__cover img {
  transform: scale(1.03);
}

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

.card__kicker {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__title {
  font-family: var(--serif);
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-3);
}

.card__excerpt {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-4);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: var(--grafite);
  border-top: 1px solid var(--line);
  padding-top: var(--space-4);
  margin-top: auto;
}

/* ============================================================
   8. COMPONENTES — Tags e Badges
   ============================================================ */
.tag {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: var(--space-1) var(--space-3);
  border-radius: 100px;
  background: var(--linho);
  color: var(--grafite);
  border: 1px solid var(--line);
}

.tag--accent {
  background: rgba(194, 132, 46, 0.12);
  color: var(--accent);
  border-color: rgba(194, 132, 46, 0.2);
}

.tag--dark {
  background: var(--tinta);
  color: var(--porcelana);
  border-color: transparent;
}

/* ============================================================
   9. COMPONENTES — Forms
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-size: var(--text-base);
  transition: border-color var(--duration) var(--ease);
  outline: none;
}

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

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

/* ============================================================
   10. COMPONENTES — Divider
   ============================================================ */
.divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: var(--space-12) 0;
}

/* ============================================================
   11. UTILITÁRIOS
   ============================================================ */
.text-center   { text-align: center; }
.text-muted    { color: var(--text-muted); }
.text-accent   { color: var(--accent); }
.text-serif    { font-family: var(--serif); }
.text-italic   { font-style: italic; }

.flex          { display: flex; }
.flex-center   { display: flex; align-items: center; justify-content: center; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.flex-col      { display: flex; flex-direction: column; }
.gap-2         { gap: var(--space-2); }
.gap-4         { gap: var(--space-4); }
.gap-6         { gap: var(--space-6); }
.gap-8         { gap: var(--space-8); }

.mt-4          { margin-top: var(--space-4); }
.mt-6          { margin-top: var(--space-6); }
.mt-8          { margin-top: var(--space-8); }
.mb-4          { margin-bottom: var(--space-4); }
.mb-6          { margin-bottom: var(--space-6); }
.mb-8          { margin-bottom: var(--space-8); }

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

.hidden { display: none !important; }

/* ============================================================
   12. MODO ESCURO (seções dark como o hero)
   ============================================================ */
.dark-section {
  background: var(--tinta);
  color: var(--porcelana);
}
.dark-section h1,
.dark-section h2,
.dark-section h3,
.dark-section h4 {
  color: var(--porcelana);
}
.dark-section p,
.dark-section .lead {
  color: var(--grafite);
}
.dark-section .kicker {
  color: var(--ambar-cl);
}
.dark-section .kicker::before {
  background: var(--ambar-cl);
}
.dark-section .accent {
  color: var(--ambar-cl);
}

/* ============================================================
   13. ANIMAÇÕES
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up {
  animation: fadeUp 600ms var(--ease) both;
}
.fade-up--delay-1 { animation-delay: 100ms; }
.fade-up--delay-2 { animation-delay: 200ms; }
.fade-up--delay-3 { animation-delay: 300ms; }

/* ============================================================
   14. SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--linho); }
::-webkit-scrollbar-thumb { background: var(--grafite); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--tinta); }

/* ============================================================
   15. BOTÃO VOLTAR AO TOPO
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--tinta);
  color: var(--porcelana);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(30, 26, 21, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 300ms var(--ease), visibility 300ms var(--ease), transform 300ms var(--ease);
  z-index: 100;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--accent);
  transform: translateY(-2px);
}
