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

:root {
  --bg: #d9ebe9;
  --card-bg: #e8f4f2;
  --text: #2c3e42;
  --muted: #46615e;
  --accent: #0085a1;
  --border: #a9c4c0;
  --hero-bg: #343a40;
  --max-width: 75%;
  --font-body: "Lora", Georgia, serif;
  --font-ui: "Open Sans", system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg: #0f2a28;
  --card-bg: #1a3835;
  --text: #e0f0ee;
  --muted: #7eb8b3;
  --accent: #20b2aa;
  --border: #2d5550;
}

html { font-size: 17px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

/* ============================================================
   Google Fonts
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,700;1,400&family=Open+Sans:wght@400;600;700&display=swap');

/* ============================================================
   Nav
   ============================================================ */
.site-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  padding: 1rem 2rem;
  font-family: var(--font-ui);
}

.site-nav .site-title {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: auto;
}
.site-nav .site-title:hover { text-decoration: none; opacity: 0.85; }

.nav-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

@media (min-width: 601px) {
  .nav-end {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
  }
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  margin-bottom: 0;
}
.nav-links a {
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.nav-links a:hover { color: #fff; text-decoration: none; }

/* Dark mode toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 0;
  color: rgba(255,255,255,0.85);
  border-radius: 4px;
  transition: color 0.15s;
}
.theme-toggle:hover { color: #fff; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
[data-theme="light"] .re-player-wrap {
  --player-bg:           #f4f8fa;
  --player-surface:      #ffffff;
  --player-surface-alt:  #e8f2f6;
  --player-accent:       #0099a8;
  --player-accent-text:  #ffffff;
  --player-text:         #0d1f35;
  --player-text-muted:   #4a7a8a;
  --player-border:       rgba(0, 153, 168, 0.2);
}

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 16px;
  margin: -12px;
  background: none;
  border: none;
  position: relative;
  z-index: 20;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: 0.2s;
}

@media (max-width: 601px) {
  .site-nav { padding: 1rem 1.25rem; gap: 0; }
  .nav-toggle { display: flex; }
  .theme-toggle {
    padding: 12px;
    margin: 0 -6px -6px;
    min-width: 44px;
    min-height: 44px;
  }
  .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    background: #1e3a5f;
    gap: 0;
    padding: 0.5rem 0;
    /* closed state */
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity 150ms ease, transform 150ms ease, visibility 0s linear 150ms;
  }
  .nav-links.open {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    transition: opacity 220ms ease-out, transform 220ms ease-out, visibility 0s linear 0s;
  }
  .nav-links a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #f5f7fa;
    border-left: 4px solid transparent;
    transition: background-color 150ms ease, border-color 150ms ease;
  }
  .nav-links a:hover {
    color: #f5f7fa;
    border-left-color: #20b2aa;
    background: rgba(32,178,170,0.15);
    text-decoration: none;
  }
  .nav-links a[aria-current="page"] {
    color: #ffffff;
    border-left-color: #20b2aa;
    background: rgba(32,178,170,0.22);
  }
  /* Hamburger bars stay visible against navy when panel is open */
  .nav-toggle.open span { background: #f5f7fa; }
  .nav-toggle .nav-note {
    position: absolute;
    top: 0px;
    right: 16px;
    left: auto;
    width: 12px;
    height: 24px;
    pointer-events: none;
    transition: right 0.2s ease, left 0.2s ease;
  }
  .nav-toggle.open .nav-note {
    right: auto;
    top: 8px;
    left: 16px;
  }
}

@media (max-width: 600px) and (prefers-reduced-motion: reduce) {
  .nav-links,
  .nav-links.open { transition: none; }
  .nav-links a { transition: none; }
}

/* ============================================================
   Hero image
   ============================================================ */
.site-hero {
  display: block;
  width: 100%;
  margin: 0 0 2rem;
  line-height: 0;
}

.site-hero img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 420px;
  object-fit: cover;
  max-width: none;
}

@media (max-width: 600px) {
  .site-hero img { max-height: none; }
}

/* ============================================================
   Main content
   ============================================================ */
main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
  overflow: hidden;
}

/* ============================================================
   Footer
   ============================================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--muted);
}

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3 { line-height: 1.3; }
h2 { font-size: 1.5rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 2rem 0 0.5rem; }
p { margin-bottom: 1.3rem; }
ul, ol { margin-bottom: 1.3rem; padding-left: 1.5rem; }
li { margin-bottom: 0.3rem; }
blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
  color: var(--muted);
  margin: 1.75rem 0;
  font-style: italic;
}
hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* ============================================================
   Post list (blog index + home)
   ============================================================ */
.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}
.post-list li:first-child { border-top: 1px solid var(--border); }

.post-list .post-title {
  font-family: var(--font-body);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}
.post-list .post-title:hover { color: var(--accent); text-decoration: none; }

.post-list .post-meta-line {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--muted);
}

.post-list li.hidden { display: none; }

/* ============================================================
   Category filter
   ============================================================ */
.category-filter {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.category-filter span { color: var(--muted); font-size: 0.8rem; }

.filter-btn {
  padding: 0.3rem 0.75rem;
  border-radius: 2rem;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  font-size: 0.8rem;
  font-family: var(--font-ui);
  transition: border-color 0.15s, color 0.15s;
}
.filter-btn:hover, .filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   Post (full article)
   ============================================================ */
.post-body { font-size: 1.05rem; }
.post-body p:last-child { margin-bottom: 0; }

.post-tags {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.post-tags a {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  border-radius: 2rem;
}
.post-tags a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

.post-nav {
  margin-top: 2.5rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

/* ============================================================
   Home page
   ============================================================ */
.home-sections {
  display: grid;
  gap: 1rem;
  margin-bottom: 3rem;
}

@media (min-width: 540px) {
  .home-sections { grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; }
}

.home-section-card {
  display: block;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
}
.home-section-card__image {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
}
@media (max-width: 539px) {
  .home-section-card__image { height: 160px; }
}
.home-section-card__overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.home-section-card h2 {
  font-size: 2rem;
  font-family: var(--font-body);
  font-weight: 700;
  margin: 0 0 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
}
.home-section-card p {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.8);
  margin: 0;
}

.home-recent-title {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

/* ============================================================
   Page (static pages like gear, music)
   ============================================================ */
.page-body { font-size: 1.05rem; }

/* ============================================================
   Dark mode surface overrides
   ============================================================ */
[data-theme="dark"] blockquote {
  background: var(--card-bg);
  padding: 1rem 1.25rem;
  border-radius: 0 4px 4px 0;
}

[data-theme="dark"] .filter-btn {
  background: var(--card-bg);
}

[data-theme="dark"] footer {
  background: var(--card-bg);
}
