/* ============================================================
   WHISKEY FAMILY TREE — MAIN STYLESHEET
   styles.css — Global variables, reset, typography, layout
   ============================================================ */

/* ── Custom Properties ─────────────────────────────────────── */
:root {
  /* Brand Colors */
  --bg-base:        #1a0e00;
  --bg-card:        #261506;
  --bg-card-hover:  #301b08;
  --bg-nav:         #0f0800;
  --bg-section:     #1f1100;
  --bg-table-alt:   #221200;

  /* Accent Palette */
  --gold:           #c8860a;
  --gold-bright:    #e8a020;
  --gold-dim:       #7a5205;
  --gold-glow:      rgba(200,134,10,.25);

  /* Region Colors */
  --american:       #c8860a;
  --scotch:         #2e7d32;
  --irish:          #1565c0;
  --canadian:       #b71c1c;
  --japanese:       #6a1b9a;
  --world:          #00695c;

  /* Region Glows */
  --american-glow:  rgba(200,134,10,.2);
  --scotch-glow:    rgba(46,125,50,.2);
  --irish-glow:     rgba(21,101,192,.2);
  --canadian-glow:  rgba(183,28,28,.2);
  --japanese-glow:  rgba(106,27,154,.2);
  --world-glow:     rgba(0,105,92,.2);

  /* Text */
  --text-primary:   #f5e6c8;
  --text-secondary: #c8a96e;
  --text-muted:     #8a6e44;
  --text-inverse:   #1a0e00;

  /* Borders */
  --border:         rgba(200,134,10,.25);
  --border-strong:  rgba(200,134,10,.55);
  --border-subtle:  rgba(200,134,10,.12);

  /* Spacing */
  --space-xs:   .25rem;
  --space-sm:   .5rem;
  --space-md:   1rem;
  --space-lg:   1.5rem;
  --space-xl:   2rem;
  --space-2xl:  3rem;
  --space-3xl:  4rem;

  /* Typography */
  --font-display: Georgia, 'Times New Roman', serif;
  --font-body:    'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono:    'Courier New', Courier, monospace;

  /* Radius */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 4px rgba(0,0,0,.4);
  --shadow-md:  0 4px 12px rgba(0,0,0,.5);
  --shadow-lg:  0 8px 24px rgba(0,0,0,.6);
  --shadow-gold: 0 0 20px rgba(200,134,10,.15);

  /* Transitions */
  --transition: .2s ease;
  --transition-slow: .35s ease;

  /* Nav height */
  --nav-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--gold-bright);
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; }

p {
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  max-width: 75ch;
}

a {
  color: var(--gold-bright);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: #fff; text-decoration: underline; }

strong { color: var(--gold-bright); font-weight: 600; }
em { color: var(--text-secondary); }

code {
  font-family: var(--font-mono);
  background: var(--bg-card);
  color: var(--gold-bright);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: .85em;
}

ul, ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}
li { margin-bottom: var(--space-xs); color: var(--text-primary); }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-xl) 0;
}

/* ── Layout ─────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container--wide {
  max-width: 1440px;
}

.container--narrow {
  max-width: 900px;
}

.page-body {
  padding-top: var(--nav-height);
  min-height: 100vh;
}

section[id],
.subtype-card[id],
.accordion-item[id] {
  scroll-margin-top: var(--nav-height);
}

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-lg); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-lg); }

/* Flex helpers */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.flex-wrap  { flex-wrap: wrap; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* Spacing helpers */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* Text align */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* ── Section ─────────────────────────────────────────────────── */
.section {
  padding: var(--space-3xl) 0;
}

.section--alt {
  background: var(--bg-section);
}

.section-header {
  margin-bottom: var(--space-2xl);
}

.section-label {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-sm);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--gold-bright);
  margin-bottom: var(--space-sm);
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 60ch;
}

.section-header.text-center .section-subtitle {
  margin-left: auto;
  margin-right: auto;
}

/* ── Ornamental Divider ─────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-xl) 0;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.divider-icon {
  color: var(--gold);
  font-size: 1.2rem;
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  position: relative;
  background: linear-gradient(180deg, #0f0800 0%, var(--bg-base) 100%);
  padding: var(--space-3xl) 0 var(--space-2xl);
  text-align: center;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(200,134,10,.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  font-size: .8rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 auto var(--space-md);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 4rem);
  color: var(--gold-bright);
  line-height: 1.1;
  margin-bottom: var(--space-md);
  text-shadow: 0 2px 20px rgba(200,134,10,.3);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 65ch;
  margin: 0 auto var(--space-xl);
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: .85rem;
}

.hero-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* ── Page Hero (inner pages) ─────────────────────────────────── */
.page-hero {
  padding: var(--space-2xl) 0 var(--space-xl);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #0f0800 0%, var(--bg-base) 100%);
}

.page-hero-flag {
  font-size: 3rem;
  margin-bottom: var(--space-sm);
  display: block;
}

.page-hero-region {
  display: inline-block;
  padding: .25rem .8rem;
  border-radius: var(--radius-full);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
}

/* ── Scroll-to-Top ───────────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  width: 44px;
  height: 44px;
  background: var(--gold);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-full);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition), transform var(--transition);
  z-index: 999;
}
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}
#back-to-top:hover {
  background: var(--gold-bright);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --nav-height: 56px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: var(--space-2xl) 0; }
  .container { padding: 0 var(--space-md); }
}

@media (max-width: 480px) {
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
  .hero-title { font-size: 1.8rem; }
}
