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

:root {
  --acidic: #EB3C30;
  --basic: #F1732A;
  --polar: #0DA296;
  --nonpolar: #0089C9;
  --dark: #1B2035;
  --dark2: #252A40;
  --bg: #F5F4F0;
  --white: #FFFFFF;
  --text: #1E1E1E;
  --muted: #6B7280;
  --border: #E5E3DC;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --radius: 10px;
}

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

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 1rem;
}

/* ===== HEADER ===== */
header {
  background: var(--dark);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 24px rgba(0,0,0,0.3);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-family: 'Playfair Display', serif;
  color: white;
  text-decoration: none;
  font-size: 1.35rem;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--polar), var(--nonpolar));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

nav { display: flex; align-items: center; gap: 0.2rem; }

nav a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: all 0.2s;
  letter-spacing: 0.2px;
}

nav a:hover { color: white; background: rgba(255,255,255,0.1); }
nav a.active { color: white; background: rgba(255,255,255,0.15); }

.nav-chart {
  background: rgba(13, 162, 150, 0.3) !important;
  color: #5eead4 !important;
  margin-left: 0.5rem;
}
.nav-chart:hover { background: rgba(13, 162, 150, 0.5) !important; color: white !important; }

/* ===== MOBILE MENU ===== */
.hamburger, .nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  color: white;
  font-size: 1.5rem;
  line-height: 1;
}
.hamburger span, .nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s;
}

@media (max-width: 768px) {
  .hamburger, .nav-toggle { display: flex; }
  nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--dark2);
    flex-direction: column;
    padding: 1rem;
    gap: 0.25rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  }
  nav.open { display: flex; }
  nav a { width: 100%; padding: 0.6rem 1rem; }
}

/* ===== COOKIE BANNER ===== */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--dark);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
  flex-wrap: wrap;
}

#cookie-banner p { font-size: 0.875rem; opacity: 0.9; flex: 1; min-width: 200px; }
#cookie-banner a { color: var(--polar); }

.cookie-btns { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn-accept {
  background: var(--polar);
  color: white;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  transition: opacity 0.2s;
}
.btn-accept:hover { opacity: 0.85; }

.btn-decline {
  background: transparent;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s;
}
.btn-decline:hover { color: white; border-color: rgba(255,255,255,0.5); }

/* ===== CONTAINER ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.container-narrow { max-width: 820px; margin: 0 auto; padding: 0 2rem; }

/* ===== FOOTER ===== */
footer {
  background: var(--dark);
  color: rgba(255,255,255,0.65);
  padding: 3rem 2rem 2rem;
  margin-top: 5rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.8fr 1fr 1.2fr 1fr 1fr 0.8fr;
  gap: 2.5rem;
}

.footer-brand .logo { font-size: 1.2rem; margin-bottom: 0.75rem; }
.footer-brand p { font-size: 0.875rem; line-height: 1.6; max-width: 280px; }

.footer-col h4 {
  color: white;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}
.footer-col ul a:hover { color: white; }

.footer-bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-cats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.cat-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
}

.cat-dot::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.cat-dot.acidic::before { background: var(--acidic); }
.cat-dot.basic::before { background: var(--basic); }
.cat-dot.polar::before { background: var(--polar); }
.cat-dot.nonpolar::before { background: var(--nonpolar); }

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

/* ===== SECTION HEADERS ===== */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--polar);
  margin-bottom: 0.75rem;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 2px;
  background: var(--polar);
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 600px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--dark);
  color: white;
}
.btn-primary:hover { background: var(--dark2); transform: translateY(-1px); }

.btn-teal {
  background: var(--polar);
  color: white;
}
.btn-teal:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--dark);
  border: 2px solid var(--border);
}
.btn-outline:hover { border-color: var(--dark); }

/* ===== CATEGORY BADGE ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
}
.badge.acidic { background: var(--acidic); }
.badge.basic { background: var(--basic); }
.badge.polar { background: var(--polar); }
.badge.nonpolar { background: var(--nonpolar); }

/* ===== PAGE HERO ===== */
.page-hero {
  background: var(--dark);
  color: white;
  padding: 4rem 2rem 3rem;
}

.page-hero .container { text-align: center; }

.page-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  margin: 0.5rem 0;
  line-height: 1.15;
}

.page-hero p {
  font-size: 1.1rem;
  opacity: 0.75;
  max-width: 580px;
  margin: 0.75rem auto 0;
}

/* ===== ARTICLE CARDS ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.article-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.13);
}

.card-color-bar { height: 5px; }
.card-color-bar.acidic { background: var(--acidic); }
.card-color-bar.basic { background: var(--basic); }
.card-color-bar.polar { background: var(--polar); }
.card-color-bar.nonpolar { background: var(--nonpolar); }

.card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.card-body .badge { margin-bottom: 0.75rem; width: fit-content; }

.card-body h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--dark);
  line-height: 1.3;
}

.card-body p { font-size: 0.925rem; color: var(--muted); flex: 1; }

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.card-arrow { font-size: 1.1rem; }

/* ===== AMINO ACID DATA TABLE ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  background: var(--dark);
  color: rgba(255,255,255,0.8);
  padding: 0.6rem 1rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:hover td { background: rgba(0,0,0,0.02); }
.data-table tr:last-child td { border-bottom: none; }

/* ===== INFO BOX ===== */
.info-box {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.info-box h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--dark);
}

/* ===== FACTS LIST ===== */
.fact-item {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.fact-item:last-child { border-bottom: none; }

.fact-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.875rem;
  flex-shrink: 0;
  color: white;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  padding: 1rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  font-size: 0.85rem;
  color: var(--muted);
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--polar); }
.breadcrumb span { margin: 0 0.4rem; }

/* ===== UTILITY ===== */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }

/* ===== COOKIE CONSENT JS HELPERS ===== */
.hidden { display: none !important; }
