/* ==========================================================================
   Hot Tub Articles — Urban Hot Tubs & Leisure
   Editorial wellness blog design system
   ========================================================================== */

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

/* ---------- Design tokens ---------- */
:root {
  /* Brand palette — light  (brand: #47756F sage-teal, #212631 charcoal) */
  --bg:          #F4F2EE;  /* warm paper */
  --surface:     #FFFFFF;
  --surface-2:   #EBE8E2;
  --ink:         #212631;  /* brand charcoal */
  --ink-soft:    #424A57;
  --muted:       #6A727F;
  --line:        #E2DED6;
  --line-strong: #D2CCC1;

  --primary:     #47756F;  /* brand sage-teal */
  --primary-700: #365C57;
  --primary-100: #E0EAE7;
  --aqua:        #76A099;
  --accent:      #C2763E;  /* warm cedar — CTA pop */
  --accent-700:  #A45E2B;
  --accent-100:  #F4E7D9;

  --shadow-sm: 0 1px 2px rgba(22, 48, 46, .06), 0 1px 3px rgba(22, 48, 46, .05);
  --shadow-md: 0 4px 14px rgba(22, 48, 46, .08), 0 2px 6px rgba(22, 48, 46, .05);
  --shadow-lg: 0 18px 48px rgba(22, 48, 46, .14), 0 6px 16px rgba(22, 48, 46, .08);

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

  /* Spacing scale (8pt) */
  --space-1: .25rem; --space-2: .5rem;  --space-3: .75rem; --space-4: 1rem;
  --space-5: 1.5rem; --space-6: 2rem;   --space-8: 3rem;   --space-10: 4rem;
  --space-12: 6rem;

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --container: 1180px;
  --measure: 68ch;     /* readable article width */

  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: 220ms;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg:          #171B23;  /* derived from brand charcoal #212631 */
  --surface:     #212631;
  --surface-2:   #2A303D;
  --ink:         #ECEFF3;
  --ink-soft:    #BCC4CC;
  --muted:       #8B95A1;
  --line:        #313845;
  --line-strong: #3E4655;

  --primary:     #78A8A1;
  --primary-700: #5C8B84;
  --primary-100: #243530;
  --aqua:        #92BDB6;
  --accent:      #D98F52;
  --accent-700:  #C2763E;
  --accent-100:  #2C2417;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 6px 18px rgba(0,0,0,.45);
  --shadow-lg: 0 22px 54px rgba(0,0,0,.55);

  color-scheme: dark;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--primary-100); color: var(--primary-700); }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2.5rem);
}

.eyebrow {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-700);
}
[data-theme="dark"] .eyebrow { color: var(--accent); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--primary);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 200;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.18rem;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.brand .mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  color: var(--primary);
  flex: none;
}
.brand .mark svg { width: 100%; height: 100%; }
.brand .mark img { width: 100%; height: 100%; object-fit: contain; }
.brand small {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: -2px;
}

.main-nav { margin-left: auto; }
.main-nav ul {
  list-style: none; padding: 0;
  display: flex; align-items: center; gap: var(--space-5);
}
.main-nav a {
  font-size: .94rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: .4rem 0;
  position: relative;
  transition: color var(--dur) var(--ease);
}
.main-nav a::after {
  content: "";
  position: absolute; left: 0; right: 100%; bottom: -2px;
  height: 2px; background: var(--primary);
  transition: right var(--dur) var(--ease);
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--ink); }
.main-nav a:hover::after, .main-nav a[aria-current="page"]::after { right: 0; }

.header-actions { display: flex; align-items: center; gap: var(--space-3); }

.icon-btn {
  width: 42px; height: 42px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-1px); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .sun { display: none; }
[data-theme="dark"] .icon-btn .sun { display: block; }
[data-theme="dark"] .icon-btn .moon { display: none; }

.nav-toggle { display: none; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .94rem;
  padding: .7rem 1.25rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-700); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { width: 100%; justify-content: center; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem);
}
.hero-head {
  max-width: 720px;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.hero-head h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  margin: .6rem 0 1rem;
}
.hero-head p {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--ink-soft);
  max-width: 56ch;
}

/* Featured article */
.featured {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.featured .cover { min-height: 360px; }
.featured .featured-body {
  padding: clamp(1.5rem, 3vw, 2.75rem);
  display: flex; flex-direction: column;
  justify-content: center;
  gap: var(--space-4);
}
.featured h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  line-height: 1.12;
}
.featured h2 a { transition: color var(--dur) var(--ease); }
.featured h2 a:hover { color: var(--primary); }
.featured p { color: var(--ink-soft); font-size: 1.05rem; }

/* ==========================================================================
   Cover visuals (gradient + wave texture, swap for real photos)
   ========================================================================== */
.cover {
  position: relative;
  background: linear-gradient(140deg, var(--c1, #47756F), var(--c2, #76A099));
  overflow: hidden;
  isolation: isolate;
}
.cover::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(120% 80% at 80% -10%, rgba(255,255,255,.32), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.16' stroke-width='2'%3E%3Cpath d='M0 40c20-12 40-12 60 0s40 12 60 0 40-12 60 0'/%3E%3Cpath d='M-20 80c20-12 40-12 60 0s40 12 60 0 40-12 60 0 40-12 60 0'/%3E%3Cpath d='M0 120c20-12 40-12 60 0s40 12 60 0 40-12 60 0'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover, 200px 200px;
  z-index: -1;
}
.cover .cover-icon {
  position: absolute;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  width: clamp(48px, 9vw, 92px);
  height: auto;
  color: rgba(255,255,255,.55);
}
/* Category color variants */
.c-guide    { --c1:#47756F; --c2:#76A099; }
.c-water    { --c1:#3B6E84; --c2:#6FA7B8; }
.c-wellness { --c1:#566A7A; --c2:#8C9BA8; }
.c-maint    { --c1:#3F6B5C; --c2:#74A287; }
.c-lifestyle{ --c1:#C2763E; --c2:#DBA169; }

/* ==========================================================================
   Filter bar
   ========================================================================== */
.section-head {
  display: flex; align-items: end; justify-content: space-between;
  gap: var(--space-4); flex-wrap: wrap;
  margin-bottom: var(--space-6);
}
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); }

.filters {
  display: flex; flex-wrap: wrap; gap: .5rem;
  list-style: none; padding: 0;
}
.chip {
  font-family: var(--font-body);
  font-size: .88rem; font-weight: 500;
  padding: .5rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip[aria-pressed="true"] {
  background: var(--primary); border-color: var(--primary); color: #fff;
}

/* ==========================================================================
   Article grid + cards
   ========================================================================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem);
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.card .cover { height: 200px; }
.card-body { padding: var(--space-5); display: flex; flex-direction: column; gap: .65rem; flex: 1; }
.card h3 { font-size: 1.3rem; line-height: 1.2; }
.card h3 a { transition: color var(--dur) var(--ease); }
.card:hover h3 a { color: var(--primary); }
.card p { color: var(--ink-soft); font-size: .96rem; flex: 1; }

.tag {
  align-self: flex-start;
  font-size: .72rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  padding: .32rem .7rem;
  border-radius: var(--radius-pill);
  background: var(--primary-100);
  color: var(--primary-700);
}
[data-theme="dark"] .tag { color: var(--primary); }
.tag.t-water    { background: #DAEEF8; color: #1668A8; }
.tag.t-wellness { background: #E8E5F4; color: #5A52A0; }
.tag.t-maint    { background: #DEEEDF; color: #2F6F4E; }
.tag.t-lifestyle{ background: var(--accent-100); color: var(--accent-700); }
[data-theme="dark"] .tag.t-water,
[data-theme="dark"] .tag.t-wellness,
[data-theme="dark"] .tag.t-maint,
[data-theme="dark"] .tag.t-lifestyle { background: var(--surface-2); }

.meta {
  display: flex; align-items: center; gap: .5rem;
  font-size: .84rem; color: var(--muted);
  margin-top: auto; padding-top: .4rem;
}
.meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }

.hidden { display: none !important; }

/* Breathing room below the article grid, before the footer */
#categories { padding-bottom: clamp(3.5rem, 8vw, 6.5rem); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding-block: var(--space-8) var(--space-6);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(2, 1fr);
  gap: var(--space-6);
}
.footer-grid h4 { font-family: var(--font-body); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.footer-grid ul { list-style: none; padding: 0; display: grid; gap: .6rem; }
.footer-grid a { color: var(--ink-soft); font-size: .95rem; transition: color var(--dur) var(--ease); }
.footer-grid a:hover { color: var(--primary); }
.footer-about p { color: var(--ink-soft); font-size: .95rem; max-width: 36ch; margin-top: .9rem; }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  margin-top: var(--space-8); padding-top: var(--space-5);
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: .86rem;
}
.social { display: flex; gap: .5rem; }

/* ==========================================================================
   Article page
   ========================================================================== */
.article-hero { padding-block: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 3vw, 2.5rem); }
.breadcrumb { font-size: .88rem; color: var(--muted); margin-bottom: 1.25rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb svg { width: 14px; height: 14px; opacity: .6; }

.article-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  max-width: 20ch;
  margin: .6rem 0 1.1rem;
}
.article-lead { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--ink-soft); max-width: var(--measure); }

.byline {
  display: flex; align-items: center; gap: .8rem;
  margin-top: var(--space-5);
  font-size: .92rem;
}
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--aqua));
  color: #fff; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600;
  flex: none;
}
.byline .who strong { display: block; color: var(--ink); }
.byline .who span { color: var(--muted); }

.article-cover {
  height: clamp(240px, 42vw, 460px);
  border-radius: var(--radius-lg);
  margin-block: clamp(1.5rem, 3vw, 2.5rem);
}

.article-body {
  max-width: var(--measure);
  margin-inline: auto;
  font-size: 1.12rem;
  line-height: 1.78;
  color: var(--ink-soft);
}
.article-body > * + * { margin-top: 1.4rem; }
.article-body h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--ink);
  margin-top: 2.6rem;
  scroll-margin-top: 90px;
}
.article-body h3 { font-size: 1.32rem; color: var(--ink); margin-top: 2rem; }
.article-body p { color: var(--ink-soft); }
.article-body strong { color: var(--ink); font-weight: 600; }
.article-body a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.article-body a:hover { color: var(--primary-700); }
.article-body ul, .article-body ol { padding-left: 1.4rem; }
.article-body li { margin-top: .55rem; }
.article-body li::marker { color: var(--accent); }
.article-body blockquote {
  border-left: 4px solid var(--accent);
  background: var(--surface);
  padding: 1.1rem 1.4rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--ink);
}
.article-body figure { margin-block: 2rem; }
.article-body figcaption { font-size: .88rem; color: var(--muted); text-align: center; margin-top: .6rem; }
.article-body img { border-radius: var(--radius); }

.callout {
  background: var(--primary-100);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  color: var(--ink);
}
.callout strong { color: var(--primary-700); }
[data-theme="dark"] .callout strong { color: var(--primary); }

.article-tags {
  max-width: var(--measure);
  margin: var(--space-8) auto 0;
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
}
.article-tags .label { font-size: .85rem; color: var(--muted); margin-right: .3rem; }

/* Related */
.related { margin-block: clamp(3rem, 6vw, 5rem); }

/* Reading progress */
.progress-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--accent); z-index: 200;
  transition: width 80ms linear;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 860px) {
  .featured { grid-template-columns: 1fr; }
  .featured .cover { min-height: 220px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }

  .main-nav {
    position: fixed; inset: 72px 0 auto 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    margin: 0; padding: var(--space-4);
    transform: translateY(-120%);
    transition: transform var(--dur) var(--ease);
  }
  .main-nav[data-open="true"] { transform: translateY(0); }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav li { border-bottom: 1px solid var(--line); }
  .main-nav a { display: block; padding: .9rem .25rem; }
  .main-nav a::after { display: none; }
  .nav-toggle { display: inline-grid; }
  .header-cta { display: none; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .brand small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* Entrance animation */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.reveal { animation: rise .6s var(--ease) both; }
.reveal:nth-child(2) { animation-delay: .06s; }
.reveal:nth-child(3) { animation-delay: .12s; }
.reveal:nth-child(4) { animation-delay: .18s; }
.reveal:nth-child(5) { animation-delay: .24s; }
.reveal:nth-child(6) { animation-delay: .30s; }
