/* Design Tokens & CSS Reset */
:root {
  --primary: #0f766e; /* Deep Teal / Verde Esmeralda Profundo */
  --primary-hover: #115e59;
  --primary-light: #ccfbf1;
  --primary-dark: #134e4a;
  --accent: #d97706; /* Warm Amber */
  --accent-light: #fef3c7;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-soft: #f1f5f9;
  --text-main: #0f172a; /* WCAG AAA readable dark text */
  --text-muted: #475569;
  --text-light: #64748b;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --success: #15803d;
  --warning: #b45309;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

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

/* Header & Navigation */
.header-top {
  background: #0f172a;
  color: #94a3b8;
  font-size: 0.825rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.header-top .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary-dark);
  text-decoration: none !important;
}

.brand-logo svg {
  width: 34px;
  height: 34px;
  fill: var(--primary);
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  padding: 8px 4px;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  text-decoration: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none !important;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(15, 118, 110, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 8px rgba(15, 118, 110, 0.3);
}

.btn-outline {
  border-color: var(--border-color);
  background: #ffffff;
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-soft);
  border-color: var(--border-hover);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #f0fdfa 0%, #e6fffa 50%, #f8fafc 100%);
  padding: 56px 0 48px;
  border-bottom: 1px solid var(--border-color);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 12px;
  border-radius: 9999px;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  color: #0f172a;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 820px;
  margin-bottom: 24px;
}

.meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.875rem;
  color: var(--text-light);
  padding-top: 12px;
  border-top: 1px solid rgba(15, 118, 110, 0.15);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Layout for Longread */
.content-wrapper {
  padding: 48px 0;
}

.longread-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
}

/* Sticky Table of Contents */
.toc-card {
  position: sticky;
  top: 96px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.toc-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-light);
  color: var(--text-main);
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toc-list a {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: block;
}

.toc-list a:hover {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

/* Main Article Content */
.article-body {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 40px 48px;
  box-shadow: var(--shadow-sm);
}

.article-body h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.article-body h2:first-of-type {
  margin-top: 0;
}

.article-body h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 28px 0 12px;
}

.article-body p {
  margin-bottom: 18px;
  color: var(--text-main);
  font-size: 1.05rem;
}

.callout-box {
  background: var(--bg-soft);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 20px 24px;
  margin: 28px 0;
}

.callout-box.amber {
  background: #fffbeb;
  border-left-color: var(--accent);
}

.callout-box h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #0f172a;
}

.callout-box p {
  margin-bottom: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Comparison Table */
.table-responsive {
  overflow-x: auto;
  margin: 32px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 0.95rem;
  text-align: left;
}

.comparison-table th {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
  padding: 16px 20px;
  border-bottom: 2px solid var(--border-color);
}

.comparison-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
  color: var(--text-muted);
}

.comparison-table tr:hover {
  background-color: #f8fafc;
}

.badge-tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-green {
  background: #dcfce7;
  color: #166534;
}

.badge-blue {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-amber {
  background: #fef3c7;
  color: #92400e;
}

/* Habit Cards */
.habit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 28px 0;
}

.habit-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 20px;
  background: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.habit-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.habit-card .habit-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  margin-bottom: 14px;
  font-weight: bold;
}

.habit-card h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #0f172a;
}

.habit-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* Interactive Checklist */
.checklist-container {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px;
  margin: 36px 0;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
  cursor: pointer;
}

.checklist-item:last-child {
  margin-bottom: 0;
}

.checklist-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
}

.checklist-item span {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.4;
}

/* Footer & Compliance */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 56px 0 24px;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 1rem;
  margin-bottom: 18px;
  font-weight: 700;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: #94a3b8;
  font-size: 0.875rem;
}

.footer-links a:hover {
  color: #38bdf8;
}

.disclaimer-bar {
  background: #1e293b;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 28px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #cbd5e1;
  border-left: 3px solid var(--accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #64748b;
}

/* Responsive */
@media (max-width: 900px) {
  .longread-grid {
    grid-template-columns: 1fr;
  }
  .toc-card {
    position: static;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hero-title {
    font-size: 2rem;
  }
  .article-body {
    padding: 24px 20px;
  }
}

@media (max-width: 600px) {
  .navbar {
    flex-direction: column;
    height: auto;
    padding: 16px 0;
    gap: 12px;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
