/*
 * Design: Elegância Literária Portuguesa — Dark Mode
 * Paleta: Carvão profundo, dourado-âmbar, creme-pergaminho, azul-ardósia
 * Tipografia: Cormorant Garamond (títulos) + EB Garamond (corpo)
 * Filosofia: Espaço como respiração, hierarquia tipográfica clara, referências ao livro e à Lisboa histórica
 */

:root {
  /* === DARK MODE — Paleta Literária Portuguesa === */

  /* Fundos escuros em camadas */
  --bg-deepest:   oklch(0.10 0.010 50);   /* Quase preto — fundo base */
  --bg-deep:      oklch(0.13 0.012 52);   /* Fundo principal */
  --bg-surface:   oklch(0.16 0.012 52);   /* Cards, secções */
  --bg-elevated:  oklch(0.19 0.012 54);   /* Cards elevados */
  --bg-hover:     oklch(0.22 0.013 55);   /* Hover states */

  /* Dourado — cor de destaque */
  --gold:         oklch(0.72 0.12 72);    /* Dourado principal */
  --gold-light:   oklch(0.82 0.10 75);    /* Dourado claro */
  --gold-dark:    oklch(0.55 0.11 68);    /* Dourado escuro */
  --gold-subtle:  oklch(0.72 0.12 72 / 0.15); /* Dourado muito subtil */

  /* Texto */
  --text-primary:   oklch(0.90 0.008 75); /* Texto principal — creme */
  --text-secondary: oklch(0.72 0.010 70); /* Texto secundário */
  --text-muted:     oklch(0.52 0.010 65); /* Texto muted */

  /* Azul-ardósia (azulejo) */
  --slate-blue:   oklch(0.35 0.07 240);
  --slate-blue-l: oklch(0.45 0.07 240);

  /* Bordas */
  --border-subtle: oklch(1 0 0 / 0.07);
  --border-gold:   oklch(0.72 0.12 72 / 0.30);

  /* Fontes */
  --font-cormorant: 'Cormorant Garamond', Georgia, serif;
  --font-garamond: 'Lora', Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-garamond);
  font-size: 20px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-cormorant);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

button:not(:disabled),
[role="button"]:not([aria-disabled="true"]),
[type="button"]:not(:disabled),
[type="submit"]:not(:disabled),
a[href],
select:not(:disabled) {
  cursor: pointer;
}

::selection {
  background: var(--gold-subtle);
  color: var(--gold-light);
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deepest);
}
::-webkit-scrollbar-thumb {
  background: var(--gold-dark);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* Animação de entrada */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── HEADER ─── */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  backdrop-filter: none;
  border-bottom: none;
  transition: all 0.35s ease;
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header.scrolled {
  background: oklch(0.10 0.010 50 / 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

header .logo {
  font-family: var(--font-cormorant);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}

nav {
  display: flex;
  gap: 0.1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav button {
  font-family: var(--font-cormorant);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  transition: color 0.2s;
  font-weight: 400;
}

nav button.active {
  color: var(--gold);
  font-weight: 600;
}

nav button:hover {
  color: var(--gold);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-gold);
  padding: 0.35rem 0.75rem;
  font-family: var(--font-cormorant);
  font-size: 0.85rem;
  color: var(--gold);
  cursor: pointer;
}

.mobile-menu {
  position: fixed;
  top: 3.5rem;
  left: 0;
  right: 0;
  z-index: 99;
  background: oklch(0.12 0.010 50 / 0.98);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 2rem;
  backdrop-filter: blur(12px);
  display: none;
  flex-direction: column;
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu button {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font-cormorant);
  font-size: 1.1rem;
  color: var(--text-secondary);
  background: none;
  border: none;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  font-weight: 400;
}

.mobile-menu button.active {
  color: var(--gold);
  font-weight: 600;
}

@media (max-width: 768px) {
  nav {
    display: none;
  }
  
  .nav-toggle {
    display: block;
  }
}

/* ─── HERO ─── */
.hero {
  position: relative;
  height: 100vh;
  min-height: 640px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, oklch(0.10 0.010 50 / 0.95), transparent 40%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 10;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding-bottom: 6rem;
}

.hero-content h1 {
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.1;
  margin: 0.5rem 0 0 0;
}

.hero-content .subtitle {
  font-family: var(--font-cormorant);
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 300;
  color: var(--gold);
  margin: 0.75rem 0 0 0;
  letter-spacing: 0.05em;
}

.hero-content .description {
  font-family: var(--font-garamond);
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.9;
  max-width: 600px;
  margin-top: 1.5rem;
  margin-bottom: 0;
}

/* ─── MAIN CONTENT ─── */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

section {
  padding-top: 6rem;
  padding-bottom: 6rem;
}

/* ─── LABELS & HEADINGS ─── */
.section-label {
  font-family: var(--font-cormorant);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
  display: block;
}

.section-title {
  font-family: var(--font-cormorant);
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.1;
  margin: 0;
}

.section-subtitle {
  font-family: var(--font-garamond);
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.9;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.gold-line {
  width: 4.5rem;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), transparent);
  margin: 1.25rem 0;
}

/* ─── CARDS ─── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 2rem;
}

.card-highlight {
  background: var(--bg-elevated);
  border-left: 3px solid var(--gold);
  padding: 1.75rem;
}

.card-header {
  position: relative;
  overflow: hidden;
}

.card-number {
  position: absolute;
  top: -1rem;
  right: 1rem;
  font-family: var(--font-cormorant);
  font-size: 7rem;
  color: var(--gold);
  opacity: 0.06;
  line-height: 1;
  user-select: none;
}

/* ─── TAGS ─── */
.tag {
  display: inline-block;
  padding: 0.2rem 0.8rem;
  border: 1px solid var(--border-gold);
  color: var(--gold);
  font-family: var(--font-cormorant);
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 0.45rem;
  margin-bottom: 0.45rem;
}

/* ─── GRID LAYOUTS ─── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
  align-items: start;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

/* ─── DIVIDER ─── */
.azulejo-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
  margin: 0;
}

/* ─── TABLE ─── */
table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-garamond);
  font-size: 0.97rem;
  margin-top: 1.25rem;
}

table thead tr {
  background: var(--bg-elevated);
  border-bottom: 2px solid var(--gold);
}

table th {
  padding: 0.85rem 1.25rem;
  text-align: left;
  font-family: var(--font-cormorant);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text-primary);
}

table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
}

table tbody tr:nth-child(even) {
  background: var(--bg-surface);
}

table tbody tr:nth-child(odd) {
  background: var(--bg-elevated);
}

table td {
  padding: 0.75rem 1.25rem;
  color: var(--text-secondary);
  font-size: 1.02rem;
}

table td:first-child {
  font-weight: 600;
  color: var(--gold);
  font-family: var(--font-cormorant);
  font-size: 1rem;
}

/* ─── LISTS ─── */
ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

li {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  font-family: var(--font-garamond);
  font-size: 1.05rem;
  color: var(--text-secondary);
  align-items: flex-start;
}

li::before {
  content: '▸';
  color: var(--gold);
  flex-shrink: 0;
  margin-top: 0.2rem;
}

/* ─── BLOCKQUOTE ─── */
blockquote {
  font-family: var(--font-cormorant);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--gold);
  border-left: 2px solid var(--gold);
  padding-left: 1rem;
  margin: 0;
}

/* ─── FOOTER ─── */
footer {
  background: var(--bg-deepest);
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 2rem;
  text-align: center;
}

footer p {
  font-family: var(--font-cormorant);
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ─── VIDEO PLAYER ─── */
.video-container {
  background: var(--bg-deepest);
  border: 1px solid var(--border-subtle);
}

.video-container video {
  width: 100%;
  display: block;
  max-height: 560px;
}

.video-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.video-info p {
  font-family: var(--font-cormorant);
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
}

.video-placeholder {
  padding: 4rem 2rem;
  text-align: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.video-placeholder .icon {
  font-size: 3.5rem;
  margin-bottom: 1.25rem;
  opacity: 0.3;
}

.video-placeholder h3 {
  font-family: var(--font-cormorant);
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.video-placeholder p {
  font-family: var(--font-garamond);
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.video-placeholder code {
  display: block;
  font-family: monospace;
  font-size: 0.95rem;
  background: var(--bg-elevated);
  color: var(--gold);
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border-gold);
  margin-bottom: 1.5rem;
}

.video-placeholder .small {
  font-family: var(--font-garamond);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  header {
    padding: 0.9rem 1.5rem;
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  section {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
  
  main {
    padding: 0 1rem;
  }
}
