/* Eridanus Brewing — Theme styles (light + dark) */
:root {
  /* Light mode (default) */
  --bg-1: #ffffff;
  --bg-2: #f6f8fa;
  --text: #141a1f;
  --muted: #6b7b88;
  --edge: #e4e9ef;
  --edge-2: #d5dde6;
  --accent: #ffd166;
  --accent-emerald: #7ce6d7; /* subtle interactive highlight */

  --surface-1: #ffffff;
  --surface-2: #f6f8fa;
  --nav-bg: #eef2f7;
  --header-bg: rgba(255,255,255,0.85);

  --radius: 14px;
  --shadow: 0 6px 24px rgba(0,0,0,0.08);
}

[data-theme="dark"] {
  --bg-1: #0b0b0c;
  --bg-2: #121317;
  --text: #f6f6f7;
  --muted: #a0a3ab;
  --edge: #24262c;
  --edge-2: #2f323a;
  --accent: #ffd166;
  --accent-emerald: #7ce6d7;

  --surface-1: #14161b;
  --surface-2: #1a1b20;
  --nav-bg: #1a1b20;
  --header-bg: rgba(18,19,23,0.75);

  --radius: 14px;
  --shadow: 0 6px 24px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  font-family: "League Spartan", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.2;
  margin: 0 0 0.5rem 0;
}
/* Slightly larger headings for improved readability */
h2 { font-size: clamp(1.4rem, 2.2vw, 1.8rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem 0; }
a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: -9999px; background: var(--accent); color: #121317; padding: 0.5rem 0.75rem; border-radius: 6px; }
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.container { width: min(980px, 92%); margin: 0 auto; }

/* Header & Nav */
.site-header { position: sticky; top: 0; backdrop-filter: saturate(140%) blur(6px); background: var(--header-bg); border-bottom: 1px solid var(--edge); z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 0; gap: 1rem; }
.logo { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 700; }
.logo img { display: block; filter: drop-shadow(0 4px 14px rgba(124,230,215,0.25)); }
.logo span { letter-spacing: 0.2px; }

.site-nav { display: flex; gap: 0.5rem; align-items: center; }
.site-nav a { padding: 0.45rem 0.8rem; border-radius: 999px; border: 1px solid var(--edge); background: var(--nav-bg); color: var(--text); display: inline-flex; align-items: center; gap: 0.25rem; height: 2.25rem; line-height: 1; vertical-align: middle; }
.site-nav a:hover { background: rgba(0,0,0,0.06); text-decoration: none; border-color: var(--accent-emerald); }
/* Center the nav on desktop, independent of left/right header content */
@media (min-width: 821px) {
  .header-inner { position: relative; }
  .site-nav { position: absolute; left: 50%; transform: translateX(-50%); }
  /* Subtle accent line above nav pills to replace faint default line */
  /* Accent line above pills: solid, closer, thicker, with wider faded edges */
  .site-nav::before {
    content: "";
    position: absolute;
    left: -12px;  /* widen beyond pill group */
    right: -12px;
    top: 4px;     /* moved 5px closer to the pills */
    height: 2px;  /* slightly thicker */
    background: var(--accent-emerald);
    opacity: 0.55;
    pointer-events: none;
    /* fade edges a bit more */
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 18%, black 82%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 18%, black 82%, transparent 100%);
  }
}

/* Mobile header accent line: span from hamburger to theme toggle */
@media (max-width: 820px) {
  .header-inner { position: relative; }
  .header-inner::before {
    content: "";
    position: absolute;
    left: 96px;   /* logo (40) + gap + hamburger (~36) + spacing */
    right: 56px;  /* room for theme toggle (~36) + spacing */
    top: 50%;     /* vertically center between icons */
    transform: translateY(-50%);
    height: 2px;  /* match desktop thickness */
    background: var(--accent-emerald);
    opacity: 0.55;
    pointer-events: none;
    /* fade edges similar to desktop */
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 18%, black 82%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 18%, black 82%, transparent 100%);
  }
}

/* Submenu (Events) */
.menu-item { position: relative; display: inline-flex; align-items: center; }
.menu-trigger { padding: 0.45rem 0.8rem; border-radius: 999px; border: 1px solid var(--edge); background: var(--nav-bg); color: var(--text); font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 0.25rem; height: 2.25rem; line-height: 1; vertical-align: middle; }
.menu-trigger:hover { border-color: var(--accent-emerald); }
.menu-trigger .caret { display: inline-block; margin-left: 0.25rem; line-height: 1; transition: transform 180ms ease; }
.menu-item.open > .menu-trigger .caret { transform: rotate(180deg); }
/* Submenu with smooth transitions */
.submenu { position: absolute; top: calc(100% + 8px); left: 0; background: transparent; border: 0; border-radius: var(--radius); box-shadow: none; padding: 0; min-width: 200px; z-index: 40; overflow: hidden; max-height: 0; opacity: 0; transform: translateY(-4px); pointer-events: none; transition: max-height 220ms ease, opacity 160ms ease, transform 160ms ease; display: grid; gap: 0.25rem; }
.submenu a { display: block; padding: 0.5rem 0.75rem; border: 1px solid transparent; border-radius: 10px; }
.submenu a:hover, .submenu a:focus-visible { border-color: var(--accent-emerald); text-decoration: none; }
.menu-item.open > .submenu { background: var(--surface-1); border: 1px solid var(--edge); box-shadow: var(--shadow); padding: 0.4rem; max-height: 600px; opacity: 1; transform: translateY(0); pointer-events: auto; }

@media (max-width: 820px) {
  .submenu { position: static; background: transparent; border: none; box-shadow: none; padding: 0.3rem 0.4rem; gap: 0.25rem; }
  .site-nav.open > .menu-item { width: 100%; display: block; }
  .menu-trigger { width: 100%; display: block; text-align: left; height: auto; }
  .submenu a { padding: 0.5rem 0.75rem; }
  /* Ensure consistent height/spacing for top-level entries */
  .site-nav.open { gap: 0.6rem; }
  .site-nav.open > a,
  .site-nav.open > .menu-item > .menu-trigger {
    padding: 0.6rem 0.85rem; /* unify vertical rhythm */
  }
  .site-nav.open > .menu-item > a { padding: 0.6rem 0.85rem; }
}

/* Compact header on small screens: hide text label next to logo */
@media (max-width: 700px) {
  .logo span { display: none; }
}

/* Hero */
.hero { text-align: center; padding: calc(4.5rem - 75px) 0 3rem; border-bottom: 1px solid var(--edge); }
.hero img { width: 400px; max-width: 100%; height: auto; filter: drop-shadow(0 8px 28px rgba(124,230,215,0.25)); }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin-top: 0.6rem; }
.hero p { max-width: 60ch; color: var(--muted); font-size: 1.05rem; margin: 0.5rem auto 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.6rem 0.9rem; border-radius: 999px; border: 1px solid var(--edge); background: var(--nav-bg); color: var(--text); font-weight: 600; text-decoration: none; box-shadow: 0 1px 0 rgba(0,0,0,0.12); transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease; }
.btn:hover { text-decoration: none; background: rgba(0,0,0,0.06); border-color: var(--accent-emerald); box-shadow: 0 1px 0 rgba(0,0,0,0.12), 0 0 0 2px rgba(124,230,215,0.34); }
.btn .icon { width: 1.1em; height: 1.1em; display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
/* Keep phone reveal pill consistent size before/after reveal */
.phone-reveal { display: inline-block; min-width: 16ch; }
.phone-reveal .btn { width: 100%; justify-content: center; font-family: inherit; font-weight: 600; font-size: 1rem; line-height: 1.2; }
.btn-primary { background: var(--accent); color: #121317; border-color: #e8b957; }
.btn-primary:hover { background: #f8c64f; }
.btn-link { border: none; background: transparent; color: var(--accent); padding-left: 0; }

/* Theme toggle */
.theme-toggle {
  font-size: 1.3em; /* ~30% larger icons */
  line-height: 1;
  padding: 0; /* icon-only */
  width: 2.25rem; /* ~36px desktop hit target */
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  border-radius: 999px; /* ensure pill stays circular */
}
.theme-toggle.fixed { position: fixed; top: 12px; right: 12px; z-index: 50; }

@media (max-width: 700px) {
  .theme-toggle {
    width: 2.5rem;  /* ~40px mobile tap target */
    height: 2.5rem;
    font-size: 1.4em; /* slightly larger icon on small screens */
  }
}

@media (max-width: 700px) {
  .nav-toggle {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.4em;
  }
}

/* Cards / grid */
.home-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 2rem auto; }
@media (max-width: 980px) { .home-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .home-grid { grid-template-columns: 1fr; } }

.card { background: var(--surface-1); border: 1px solid var(--edge); padding: 1.1rem; border-radius: var(--radius); box-shadow: var(--shadow); transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease; }
.card:hover { border-color: var(--accent-emerald); transform: translateY(-2px); box-shadow: var(--shadow), 0 0 0 2px rgba(124,230,215,0.34); }
.card h2 { font-size: 1.45rem; }
.muted { color: var(--muted); }

/* Content */
main { min-height: 60vh; }
section { padding: 1rem 0; }
.content { padding: 2rem 0; }
.prose { max-width: 72ch; }
.stack { display: grid; gap: 0.75rem; }
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 800px) { .grid.cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }

.beer { border: 1px solid var(--edge); border-radius: var(--radius); padding: 0.9rem; background: var(--surface-1); }
.beer h3 { margin-bottom: 0.2rem; font-size: 1.2rem; }
.beer .style { color: var(--muted); font-size: 0.95rem; }
.beer .meta { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.beer-header { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.hops { color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; }
.ingredients { color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; }
/* Menu cards */
.menu-cat { margin-top: 1rem; }
.menu-item { border-top: 1px dashed var(--edge); padding-top: 0.5rem; margin-top: 0.5rem; }
/* removed menu row/name/price styles as PDF cards are no longer used */

/* Footer */
.site-footer { border-top: 1px solid var(--edge); margin-top: 3rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: start; gap: 1rem; padding: 1.4rem 0 1.8rem; }
.footer-links { display: grid; grid-auto-flow: column; gap: 0.8rem; }
.site-footer .muted { color: var(--muted); }
@media (max-width: 700px) { .footer-inner { flex-direction: column; } .footer-links { grid-auto-flow: row; } }
/* Footer brand in a single line */
.footer-brand { display: inline-flex; align-items: center; gap: 0.6rem; }

/* Focus styles */
:focus-visible { outline: 3px solid var(--accent-emerald); outline-offset: 3px; border-radius: 6px; }

/* Stronger focus cues on interactive elements */
.btn:focus-visible, .site-nav a:focus-visible, .nav-toggle:focus-visible, .theme-toggle:focus-visible {
  box-shadow: 0 0 0 3px rgba(124,230,215,0.42);
  border-color: var(--accent-emerald);
}

/* Embeds */
.map-embed {
  margin-top: 0.75rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  /* Responsive aspect: prefer aspect-ratio when available */
  aspect-ratio: 4 / 3;
  /* Fallback for browsers without aspect-ratio */
  position: relative;
  padding-top: 75%;
  min-height: 260px;
}
.map-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

/* Header layout helpers (override base) */
.header-inner { position: relative; }
.header-left { display: inline-flex; align-items: center; gap: 0.6rem; }
.nav-toggle {
  display: none;
  padding: 0; /* icon-only to match theme toggle */
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.3em;
  line-height: 1;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: var(--nav-bg);
  font-weight: 700;
}

/* Mobile nav behavior */
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .site-nav { display: none; }
  .site-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    margin: 0 auto;
    width: min(600px, 96%);
    background: var(--surface-1);
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.6rem;
    gap: 0.5rem;
    z-index: 30;
  }
  /* Top-level items spacing and alignment */
  .site-nav.open > a { width: 100%; display: block; text-align: left; }
  .site-nav.open > .menu-item > .menu-trigger { padding: 0.55rem 0.8rem; }
}
