/* ===========================================
   GLOSSÁRIO AVANÇADO — Logística Afetiva
   Design: High-Contrast Dark Noir & Gold
   =========================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-card: rgba(255, 255, 255, 0.02);
  --bg-card-hover: rgba(255, 255, 255, 0.04);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(201, 168, 76, 0.3);

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.45);

  --accent-gold: #C9A84C;
  --accent-gold-dim: #8a7122;
  --accent-gold-glow: rgba(201, 168, 76, 0.1);
  --gradient-accent: linear-gradient(135deg, #C9A84C, #8a7122);
  --gradient-warm: linear-gradient(135deg, #ffffff 0%, #C9A84C 100%);
  --gradient-bg: radial-gradient(ellipse at 50% 0%, rgba(201, 168, 76, 0.06) 0%, transparent 60%);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(201, 168, 76, 0.08);

  --transition-fast: 0.2s ease;
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--gradient-bg);
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ─────────────────────────── */

.glossario-container {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 60px auto;
  padding: 0 20px 80px;
}

/* ── Header Logo ────────────────────── */

.legal-logo-wrap {
  text-align: center;
  margin-bottom: 25px;
}

.legal-logo {
  max-width: 80px;
  height: auto;
  opacity: 0.95;
  transition: opacity var(--transition-fast);
}

.legal-logo:hover {
  opacity: 1;
}

/* ── Navigation Bar ─────────────────── */

.glossario-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 0;
  margin-bottom: 2.5rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.header-back:hover {
  color: var(--text-primary);
}

.header-back svg {
  width: 14px;
  height: 14px;
}

.glossario-nav .nav-separator {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.glossario-nav .nav-current {
  color: var(--accent-gold);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.85rem;
}

/* ── Hero Section ───────────────────── */

.glossario-hero {
  text-align: center;
  padding: 2rem 0 3rem;
}

.glossario-hero .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.25);
  color: var(--accent-gold);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.45rem 1rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.glossario-hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: var(--accent-gold);
  border-bottom: 1px solid rgba(201, 168, 76, 0.2);
  padding-bottom: 15px;
  display: inline-block;
  width: 100%;
}

.glossario-hero .subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 1.5rem auto 0;
  line-height: 1.6;
}

.glossario-hero .stat-bar {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.glossario-hero .stat-item {
  text-align: center;
}

.glossario-hero .stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.glossario-hero .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.2rem;
}

/* ── Search Bar ─────────────────────── */

.glossario-search {
  position: relative;
  max-width: 500px;
  margin: 2rem auto 3rem;
}

.glossario-search input {
  width: 100%;
  padding: 0.9rem 1.2rem 0.9rem 3rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.glossario-search input::placeholder {
  color: var(--text-muted);
}

.glossario-search input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

.glossario-search .search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

/* ── Cards Grid ─────────────────────── */

.glossario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

.glossario-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-smooth);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.glossario-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.glossario-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.glossario-card:hover::before {
  opacity: 1;
}

.glossario-card .card-id {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  opacity: 0.8;
}

.glossario-card .card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.glossario-card .card-def {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  flex-grow: 1;
}

.glossario-card .card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.glossario-card .card-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.25rem 0.6rem;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* ── Term Detail Page ───────────────── */

.term-header {
  margin-bottom: 3rem;
}

.term-header .term-id {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

.term-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 500;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  color: var(--accent-gold);
  border-bottom: 1px solid rgba(201, 168, 76, 0.2);
  padding-bottom: 10px;
}

.term-header .term-definition {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 700px;
  padding-left: 1rem;
  border-left: 3px solid var(--accent-gold);
}

/* ── Trigger Section ────────────────── */

.term-section {
  margin-bottom: 3.5rem;
}

.term-section h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 500;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #ffffff;
}

.term-section h2 .emoji {
  font-size: 1.3rem;
}

.triggers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.8rem;
}

.trigger-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-style: italic;
  transition: all var(--transition-fast);
  position: relative;
  padding-left: 2rem;
}

.trigger-item::before {
  content: '"';
  position: absolute;
  left: 0.8rem;
  top: 0.6rem;
  font-size: 1.4rem;
  color: var(--accent-gold);
  opacity: 0.5;
  font-style: normal;
  font-weight: 800;
}

.trigger-item:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}

/* ── Related Concepts ───────────────── */

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-smooth);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.related-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.related-card .related-id {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-gold-dim);
  letter-spacing: 0.1em;
}

.related-card .related-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: #ffffff;
}

.related-card .related-def {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ── CTA Section ────────────────────── */

.glossario-cta {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  margin-top: 3rem;
  box-shadow: var(--shadow-glow);
}

.glossario-cta h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 500;
  margin-bottom: 0.6rem;
  color: #ffffff;
}

.glossario-cta p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.8rem;
  background: var(--accent-gold);
  color: #000000;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 100px;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: 'Inter', sans-serif;
}

.btn-primary:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.3);
  background: #ffffff;
}

/* ── Footer ─────────────────────────── */

.glossario-footer {
  margin-top: 60px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 30px;
}

.glossario-footer .disclaimer-box {
  background: rgba(201, 168, 76, 0.03);
  border-left: 3px solid var(--accent-gold);
  padding: 15px 20px;
  font-size: 0.85rem;
  border-radius: 0 6px 6px 0;
  color: var(--text-secondary);
  text-align: left;
  line-height: 1.6;
  margin-bottom: 30px;
}

.legal-footer-signature {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.legal-footer-signature p {
  margin-bottom: 6px;
}

.legal-footer-signature a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: opacity 0.3s;
}

.legal-footer-signature a:hover {
  opacity: 0.8;
}

/* ── Animations ─────────────────────── */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.glossario-card,
.trigger-item,
.related-card {
  animation: fadeInUp 0.5s ease both;
}

.glossario-card:nth-child(1) { animation-delay: 0.05s; }
.glossario-card:nth-child(2) { animation-delay: 0.1s; }
.glossario-card:nth-child(3) { animation-delay: 0.15s; }
.glossario-card:nth-child(4) { animation-delay: 0.2s; }
.glossario-card:nth-child(5) { animation-delay: 0.25s; }
.glossario-card:nth-child(6) { animation-delay: 0.3s; }
.glossario-card:nth-child(7) { animation-delay: 0.35s; }
.glossario-card:nth-child(8) { animation-delay: 0.4s; }
.glossario-card:nth-child(9) { animation-delay: 0.45s; }
.glossario-card:nth-child(10) { animation-delay: 0.5s; }
.glossario-card:nth-child(11) { animation-delay: 0.55s; }
.glossario-card:nth-child(12) { animation-delay: 0.6s; }

/* ── Responsive ─────────────────────── */

@media (max-width: 640px) {
  .glossario-container {
    margin: 30px auto;
    padding: 0 15px 40px;
  }

  .glossario-hero {
    padding: 1.5rem 0 2rem;
  }

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

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

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