/* ============================================================
   FITOUT.SG — Singapore Home Fit-Out Intelligence Portal
   Design System: Editorial Warm Minimal
   Palette: oklch warm neutrals + terracotta accent
   Typography: Fraunces (display) + Instrument Sans (body)
   Layout: fluid grid, divider lines, no card shadows
   Responsive: mobile-first, container queries
   ============================================================ */

/* ── 1. CUSTOM PROPERTIES (Design Tokens) ─────────────────── */
:root {
  /* Surface — hex fallbacks kept BEFORE oklch() so old browsers
     (Baidu / 2345 / old WebViews) that lack oklch() keep their colors */
  --bg-paper: #f8f6f2;
  --bg-paper: oklch(0.97 0.005 80);
  --bg-warm:  #f0ece4;
  --bg-warm:  oklch(0.94 0.012 75);
  --bg-cream: #e8e1d6;
  --bg-cream: oklch(0.91 0.018 70);

  /* Ink */
  --ink-primary:   #2b2722;
  --ink-primary:   oklch(0.22 0.02 50);
  --ink-secondary: #5a554e;
  --ink-secondary: oklch(0.38 0.015 55);
  --ink-muted:     #8f897f;
  --ink-muted:     oklch(0.58 0.012 60);
  --ink-faint:     #c7c1b6;
  --ink-faint:     oklch(0.78 0.008 70);

  /* Accent — terracotta / warm clay */
  --accent:        #c0563a;
  --accent:        oklch(0.62 0.16 35);
  --accent-hover:  #aa4f2f;
  --accent-hover:  oklch(0.58 0.18 33);
  --accent-subtle: #f0e2d8;
  --accent-subtle: oklch(0.93 0.04 38);

  /* Divider */
  --rule:          #e0dcd3;
  --rule:          oklch(0.88 0.01 72);

  /* Typography scale (modular) */
  --fs-xs:    clamp(0.7rem, 0.65rem + 0.25vw, 0.78rem);
  --fs-sm:    clamp(0.8rem, 0.76rem + 0.25vw, 0.89rem);
  --fs-base:  clamp(0.95rem, 0.9rem + 0.3vw, 1.05rem);
  --fs-md:    clamp(1.08rem, 1rem + 0.4vw, 1.2rem);
  --fs-lg:    clamp(1.28rem, 1.14rem + 0.7vw, 1.52rem);
  --fs-xl:    clamp(1.56rem, 1.32rem + 1.2vw, 1.96rem);
  --fs-2xl:   clamp(2rem, 1.6rem + 2vw, 2.8rem);
  --fs-hero:  clamp(2.4rem, 1.8rem + 3vw, 4.2rem);

  /* Spacing rhythm */
  --sp-1:  clamp(0.25rem, 0.2rem + 0.25vw, 0.4rem);
  --sp-2:  clamp(0.5rem, 0.45rem + 0.25vw, 0.7rem);
  --sp-3:  clamp(0.85rem, 0.75rem + 0.5vw, 1.15rem);
  --sp-4:  clamp(1.2rem, 1rem + 1vw, 1.8rem);
  --sp-5:  clamp(1.8rem, 1.4rem + 2vw, 3rem);
  --sp-6:  clamp(2.6rem, 2rem + 3vw, 4.5rem);

  /* Layout */
  --max-read: 68ch;
  --site-max: 1280px;
  --gutter:   clamp(1rem, 0.9rem + 0.5vw, 1.6rem);

  /* Radius */
  --r-sm: 3px;
  --r-md: 6px;
  --r-lg: 10px;

  /* Transition */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 180ms;
  --dur-med: 320ms;

  /* Font stack */
  --font-display: "Fraunces", "Georgia", "Times New Roman", serif;
  --font-body:    "Instrument Sans", "Inter", system-ui, -apple-system, sans-serif;
}

/* ── 2. RESET & BASE ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.66;
  color: #2b2722;
  color: var(--ink-primary);
  background-color: #f8f6f2;
  background-color: var(--bg-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
a:hover { color: #c0563a; color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-sm); }

ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #2b2722;
  color: var(--ink-primary);
}
h1 { font-size: var(--fs-hero); font-weight: 800; }
h2 { font-size: var(--fs-2xl); font-weight: 700; }
h3 { font-size: var(--fs-xl);  font-weight: 600; }
h4 { font-size: var(--fs-lg);  font-weight: 600; }

p { max-width: var(--max-read); }

::selection { background: #f0e2d8; background: var(--accent-subtle); color: #2b2722; color: var(--ink-primary); }

/* ── 3. LAYOUT UTILITIES ─────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--site-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.grid-main {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .grid-main {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

@media (min-width: 1100px) {
  .grid-main {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
}

.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;
}

/* ── 4. TOP BAR ──────────────────────────────────────────── */
.topbar {
  font-size: var(--fs-xs);
  color: #8f897f;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--rule);
  padding-block: var(--sp-1);
  background: #f0ece4;
  background: var(--bg-warm);
}
.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-1);
}
.topbar__date {}
.topbar__links a { margin-left: var(--sp-2); opacity: 0.75; }
.topbar__links a:hover { opacity: 1; color: #c0563a; color: var(--accent); }

/* ── 5. HEADER / NAVIGATION ──────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 246, 242, 0.96);
  /* NOTE: no backdrop-filter here on purpose — it creates a containing block
     for position:fixed descendants, which traps the mobile .main-nav overlay
     (and breaks it in old kernels / WeChat X5). The rgba bg keeps the frosted look. */
  border-bottom: 1px solid var(--rule);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--sp-2);
  gap: var(--sp-3);
}

.logo {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-lg);
  letter-spacing: -0.03em;
  color: #2b2722;
  color: var(--ink-primary);
  white-space: nowrap;
}
.logo span { color: #c0563a; color: var(--accent); }

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: none; border: none; cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block; width: 100%; height: 2px;
  background: #2b2722;
  background: var(--ink-primary);
  border-radius: 2px;
  transition: transform var(--dur-med) var(--ease-out), opacity var(--dur-fast);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.main-nav {
  display: none;
  position: fixed;
  /* explicit top/left/right/bottom for old kernels (Baidu/2345/WeChat X5) that don't support the `inset` shorthand */
  top: 0; left: 0; right: 0; bottom: 0;
  inset: 0;
  z-index: 200;
  height: 100%;
  background: #f8f6f2;
  background: var(--bg-paper);
  padding: calc(var(--sp-5) + 60px + env(safe-area-inset-top, 0px)) var(--gutter) calc(var(--sp-5) + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: fadeSlideIn 280ms var(--ease-out);
}
.main-nav.is-open { display: block; }

/* Dedicated mobile close (X) button — guarantees the menu can always be
   dismissed even if the hamburger toggle ends up behind the overlay. */
.nav-close {
  position: absolute;
  top: calc(var(--sp-3) + env(safe-area-inset-top, 0px));
  right: var(--gutter);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: #fff;
  color: #2b2722;
  color: var(--ink-primary);
  font-size: 1.5rem; line-height: 1;
  cursor: pointer;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
.nav-close:hover { border-color: #c0563a; border-color: var(--accent); color: #c0563a; color: var(--accent); }
.nav-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Reliable background scroll lock for mobile menu (works in WeChat X5 where
   body overflow:hidden alone is unreliable). */
html.nav-open,
html.nav-open body { overflow: hidden; }
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.main-nav ul {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.main-nav li { border-bottom: 1px solid var(--rule); }
.main-nav a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: var(--sp-3) 0;
  font-size: var(--fs-md);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.main-nav a:hover,
.main-nav a.active {
  color: #c0563a;
  color: var(--accent);
}
.main-nav .nav-arrow {
  font-size: var(--fs-sm);
  transition: transform var(--dur-fast) var(--ease-out);
}
.main-nav a:hover .nav-arrow { transform: translateX(3px); }

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.search-trigger {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: transparent;
  cursor: pointer;
  color: #5a554e;
  color: var(--ink-secondary);
  transition: all var(--dur-fast) var(--ease-out);
}
.search-trigger:hover {
  border-color: #c0563a;
  border-color: var(--accent);
  color: #c0563a;
  color: var(--accent);
}

/* Desktop nav */
@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .nav-close { display: none; } /* overlay is a static row on desktop, no close button needed */
  .main-nav {
    display: flex !important;
    position: static;
    background: transparent;
    padding: 0;
    animation: none;
    overflow: visible;
  }
  .main-nav ul {
    flex-direction: row;
    gap: 0;
  }
  .main-nav li { border-bottom: none; border-top: 3px solid transparent; }
  .main-nav li:hover { border-top-color: #c0563a; border-top-color: var(--accent); }
  .main-nav a {
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--fs-sm);
    font-weight: 500;
  }
  .main-nav .nav-arrow { font-size: var(--fs-xs); }
}

/* Search overlay */
.search-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  inset: 0;
  z-index: 500;
  background: rgba(248, 246, 242, 0.96);
  animation: fadeSlideIn 200ms var(--ease-out);
  padding: var(--sp-6) var(--gutter);
}
.search-overlay.is-open { display: block; }
.search-overlay form {
  max-width: 720px;
  margin: 0 auto;
}
.search-overlay input[type="search"] {
  width: 100%;
  font-size: var(--fs-xl);
  font-family: var(--font-display);
  font-weight: 700;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--rule);
  padding: var(--sp-2) 0;
  outline: none;
  color: #2b2722;
  color: var(--ink-primary);
  transition: border-color var(--dur-fast);
}
.search-overlay input:focus { border-bottom-color: #c0563a; border-bottom-color: var(--accent); }
.search-close {
  position: absolute;
  top: var(--sp-4); right: var(--gutter);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer;
  font-size: var(--fs-lg);
  color: #8f897f;
  color: var(--ink-muted);
}

/* ── 6. TICKER / BREAKING NEWS ──────────────────────────── */
.ticker {
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
  background: #f0ece4;
  background: var(--bg-warm);
  font-size: var(--fs-sm);
}
.ticker__inner {
  display: flex;
  gap: var(--sp-4);
  animation: tickerScroll 30s linear infinite;
  white-space: nowrap;
  padding: var(--sp-2) 0;
}
.ticker__item {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}
.ticker__label {
  font-weight: 700;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #c0563a;
  color: var(--accent);
  background: #f0e2d8;
  background: var(--accent-subtle);
  padding: 2px 8px;
  border-radius: var(--r-sm);
}
.ticker__item a:hover { color: #c0563a; color: var(--accent); }
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── 7. HERO / HEADLINE SECTION ─────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}
.hero__media {
  aspect-ratio: 21/9;
  object-fit: cover;
  width: 100%;
}
.hero__overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: var(--sp-5) var(--gutter);
  background: linear-gradient(to top, rgba(34,30,26,0.82), transparent 70%);
  color: #fff;
}
.hero__kicker {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #c0563a;
  color: var(--accent);
  margin-bottom: var(--sp-1);
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1.3rem + 2vw, 2.8rem);
  font-weight: 800;
  line-height: 1.12;
  color: #fff;
  max-width: 64ch;
  margin-bottom: var(--sp-2);
}
.hero__excerpt {
  font-size: var(--fs-base);
  opacity: 0.88;
  max-width: 54ch;
  line-height: 1.58;
  margin-bottom: var(--sp-3);
}
.hero__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  opacity: 0.7;
}
.hero__meta time { white-space: nowrap; }

/* ── 8. SECTION WRAPPER ──────────────────────────────────── */
.section {
  padding-block: var(--sp-5);
  border-bottom: 1px solid var(--rule);
}
.section--alt { background: #f0ece4; background: var(--bg-warm); }

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.section__title {
  font-size: var(--fs-xl);
  font-weight: 700;
  position: relative;
  padding-left: var(--sp-3);
}
.section__title::before {
  content: "";
  position: absolute;
  left: 0; top: 0.15em; bottom: 0.15em;
  width: 3px;
  background: #c0563a;
  background: var(--accent);
  border-radius: 2px;
}
.section__link {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #c0563a;
  color: var(--accent);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.section__link:hover { color: #aa4f2f; color: var(--accent-hover); }
.section__link svg { transition: transform var(--dur-fast) var(--ease-out); }
.section__link:hover svg { transform: translateX(3px); }

/* ── 9. ARTICLE LIST ITEMS ───────────────────────────────── */
.article-list { display: flex; flex-direction: column; }
.article-list > * + * { border-top: 1px solid var(--rule); }

.article-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-2);
  padding: var(--sp-3) 0;
  transition: background var(--dur-fast) var(--ease-out);
}
.article-item:hover { background: #f0ece4; background: var(--bg-warm); }

@media (min-width: 640px) {
  .article-item {
    grid-template-columns: 220px 1fr;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-3);
    border-radius: var(--r-md);
  }
}

.article-item__thumb {
  aspect-ratio: 3/2;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: #e8e1d6;
  background: var(--bg-cream);
}
.article-item__cat {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #c0563a;
  color: var(--accent);
  margin-bottom: 4px;
}

/* Reusable keyword/category pill */
.tag-pill,
.tag-pill:link {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  text-transform: none;
  letter-spacing: 0.02em;
  color: #5a554e;
  color: var(--ink-secondary);
  background: #f3efe8;
  background: var(--bg-paper);
  border: 1px solid #d6cfc4;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 4px 10px;
  margin: 0 5px 4px 0;
  text-decoration: none;
  white-space: nowrap;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.tag-pill:hover {
  background: #e8e1d6;
  background: var(--bg-cream);
  color: #c0563a;
  color: var(--accent);
  border-color: #c7c1b6;
  border-color: var(--ink-faint);
}

/* Remove extra margin when pills sit inside flex-gap containers */
.tag-cloud .tag-pill {
  margin: 0;
}

.article-item__title {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--sp-1);
}
.article-item__title a:hover { color: #c0563a; color: var(--accent); }
.article-item__desc {
  font-size: var(--fs-sm);
  color: #5a554e;
  color: var(--ink-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-item__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  color: #8f897f;
  color: var(--ink-muted);
  margin-top: var(--sp-1);
  flex-wrap: wrap;
}
.article-item__meta svg { width: 13px; height: 13px; opacity: 0.6; }

/* Featured article variant */
.article-item--featured {
  grid-template-columns: 1fr;
  border-bottom: 1px solid var(--rule);
  padding-bottom: var(--sp-4);
}
.article-item--featured .article-item__thumb {
  aspect-ratio: 16/9;
  margin-bottom: var(--sp-2);
}
.article-item--featured .article-item__title {
  font-size: var(--fs-lg);
}
.article-item--featured .article-item__desc {
  -webkit-line-clamp: 3;
}

/* Compact list for sidebar */
.article-compact { display: flex; gap: var(--sp-2); padding: var(--sp-2) 0; }
.article-compact + .article-compact { border-top: 1px solid var(--rule); }
.article-compact__num {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 800;
  color: #c0563a;
  color: var(--accent);
  opacity: 0.5;
  min-width: 28px;
  line-height: 1;
}
.article-compact__info { flex: 1; min-width: 0; }
.article-compact__title {
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-compact__title a:hover { color: #c0563a; color: var(--accent); }
.article-compact__meta {
  font-size: var(--fs-xs);
  color: #8f897f;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* ── 10. SIDEBAR WIDGETS ─────────────────────────────────── */
.sidebar-widget {
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--rule);
}
.sidebar-widget:first-child { padding-top: 0; }
.sidebar-widget__title {
  font-size: var(--fs-md);
  font-weight: 700;
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* Newsletter box */
.newsletter-box {
  background: #e8e1d6;
  background: var(--bg-cream);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  border: 1px solid var(--rule);
}
.newsletter-box p {
  font-size: var(--fs-sm);
  color: #5a554e;
  color: var(--ink-secondary);
  margin-bottom: var(--sp-3);
  line-height: 1.55;
}
.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.newsletter-form input[type="email"] {
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  font-size: var(--fs-base);
  font-family: var(--font-body);
  background: #f8f6f2;
  background: var(--bg-paper);
  color: #2b2722;
  color: var(--ink-primary);
  outline: none;
  transition: border-color var(--dur-fast);
}
.newsletter-form input:focus { border-color: #c0563a; border-color: var(--accent); }
.newsletter-form button {
  padding: var(--sp-2) var(--sp-3);
  background: #2b2722;
  background: var(--ink-primary);
  color: #f8f6f2;
  color: var(--bg-paper);
  border: none;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.newsletter-form button:hover { background: #c0563a; background: var(--accent); }

/* Tag cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
}

/* ── 11. PAGINATION ──────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  padding: var(--sp-5) 0;
  border-top: 1px solid var(--rule);
  margin-top: var(--sp-4);
}
.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px; height: 40px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #5a554e;
  color: var(--ink-secondary);
  transition: all var(--dur-fast) var(--ease-out);
}
.pagination a:hover {
  border-color: #c0563a;
  border-color: var(--accent);
  color: #c0563a;
  color: var(--accent);
}
.pagination .active {
  background: #2b2722;
  background: var(--ink-primary);
  border-color: #2b2722;
  border-color: var(--ink-primary);
  color: #f8f6f2;
  color: var(--bg-paper);
}
.pagination .disabled { opacity: 0.35; pointer-events: none; }

/* ── 12. BREADCRUMB ──────────────────────────────────────── */
.breadcrumb {
  font-size: var(--fs-xs);
  color: #8f897f;
  color: var(--ink-muted);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--rule);
}
.breadcrumb a { color: #8f897f; color: var(--ink-muted); }
.breadcrumb a:hover { color: #c0563a; color: var(--accent); }
.breadcrumb__sep { margin: 0 var(--sp-1); opacity: 0.5; }

/* ── 13. ARTICLE DETAIL PAGE ─────────────────────────────── */
.article-detail {
  padding: var(--sp-4) 0;
}
.article-detail__header {
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--rule);
}
.article-detail__cat {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #c0563a;
  color: var(--accent);
  margin-bottom: var(--sp-2);
}
.article-detail__title {
  font-size: var(--fs-2xl);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: var(--sp-3);
  max-width: 72ch;
}
.article-detail__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
  color: #8f897f;
  color: var(--ink-muted);
  flex-wrap: wrap;
}
.article-detail__meta svg { width: 14px; height: 14px; opacity: 0.6; margin-right: 4px; }

.article-detail__cover {
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--r-md);
  margin-bottom: var(--sp-5);
  width: 100%;
}

.article-detail__body {
  font-size: var(--fs-base);
  line-height: 1.78;
  color: #2b2722;
  color: var(--ink-primary);
  max-width: var(--max-read);
}
.article-detail__body h2 {
  font-size: var(--fs-xl);
  margin: var(--sp-5) 0 var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--rule);
}
.article-detail__body h3 {
  font-size: var(--fs-lg);
  margin: var(--sp-4) 0 var(--sp-2);
}
.article-detail__body p { margin-bottom: var(--sp-3); }
.article-detail__body img {
  border-radius: var(--r-md);
  margin: var(--sp-4) 0;
}
.article-detail__body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: var(--sp-3);
  margin: var(--sp-4) 0;
  font-style: italic;
  color: #5a554e;
  color: var(--ink-secondary);
  font-size: var(--fs-md);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--rule);
}

.prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  background: #f0ece4;
  background: var(--bg-warm);
  border-radius: var(--r-md);
  border: 1px solid var(--rule);
}
.prev-next__label {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8f897f;
  color: var(--ink-muted);
  margin-bottom: 4px;
}
.prev-next__title {
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.35;
}
.prev-next__title a:hover { color: #c0563a; color: var(--accent); }

/* Related articles */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}
.related-card {
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.related-card:hover { border-color: #c0563a; border-color: var(--accent); }
.related-card img {
  aspect-ratio: 16/10;
  object-fit: cover;
  width: 100%;
}
.related-card__body { padding: var(--sp-3); }
.related-card__title {
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.related-card__title a:hover { color: #c0563a; color: var(--accent); }
.related-card__date {
  font-size: var(--fs-xs);
  color: #8f897f;
  color: var(--ink-muted);
  margin-top: var(--sp-1);
}

/* ── 14. FOOTER ──────────────────────────────────────────── */
.site-footer {
  background: #2b2722;
  background: var(--ink-primary);
  color: #e2ddd4;
  color: oklch(0.88 0.008 75);
  padding: var(--sp-6) 0 var(--sp-4);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-5);
  margin-bottom: var(--sp-5);
}
.footer-col__title {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: #f4f1ec;
  color: oklch(0.96 0.005 75);
  margin-bottom: var(--sp-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.footer-col a {
  display: block;
  font-size: var(--fs-sm);
  color: #cac4ba;
  color: oklch(0.74 0.01 70);
  padding: 3px 0;
  transition: color var(--dur-fast);
}
.footer-col a:hover { color: #faece4; color: oklch(0.98 0.03 40); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  color: #938d83;
  color: oklch(0.6 0.01 60);
}

/* ── Footer Sitemap link ──────────────────────────────── */
.footer-sitemap-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.footer-sitemap-link:hover,
.footer-sitemap-link:focus {
  color: #f8f6f2;
  color: var(--paper, #f8f6f2);
  border-color: #c0563a;
  border-color: var(--accent, #c0563a);
}

/* ── 15. SCROLL TO TOP ───────────────────────────────────── */
.scrolltop {
  position: fixed;
  bottom: var(--sp-4); right: var(--sp-4);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: #2b2722;
  background: var(--ink-primary);
  color: #f8f6f2;
  color: var(--bg-paper);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--dur-med) var(--ease-out);
  z-index: 90;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.scrolltop.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.scrolltop:hover { background: #c0563a; background: var(--accent); }

/* ── 16. RESPONSIVE PICTURE ─────────────────────────────── */
.resp-img {
  width: 100%; height: auto;
  display: block;
}
.resp-img img { width: 100%; height: auto; object-fit: cover; }

/* ── 17. UTILITY CLASSES ─────────────────────────────────── */
.text-accent { color: #c0563a; color: var(--accent); }
.text-muted  { color: #8f897f; color: var(--ink-muted); }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }

/* ── 18. REDUCED MOTION ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .ticker__inner { animation: none; }
}

/* ── 19. PRINT STYLES ───────────────────────────────────── */
@media print {
  .site-header, .topbar, .ticker, .sidebar-widget, .scrolltop,
  .search-overlay, .footer-grid { display: none !important; }
  body { background: #fff; color: #000; }
  .hero__overlay { background: none; color: #000; }
  a { color: #000; text-decoration: underline; }
}

/* ── 20. NEW HOMEPAGE LAYOUT (hero grid + popular grid) ───────── */
.hero-grid {
  display: grid;
  gap: var(--gutter);
  padding-block: var(--sp-4);
  border-bottom: 1px solid var(--rule);
}
.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--sp-4);
  color: #fff;
  background: #c0563a;
  background: var(--accent);
  isolation: isolate;
}
.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.35) 55%, rgba(0,0,0,0.15) 100%);
  z-index: 1;
}
.hero-card__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: transform 0.5s var(--ease-out);
}
.hero-card:hover .hero-card__bg { transform: scale(1.04); }
.hero-card__content { position: relative; z-index: 2; }
.hero-card__tag {
  display: inline-flex;
  align-self: flex-start;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-2);
}
.hero-card__title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.05rem + 1.4vw, 2.1rem);
  font-weight: 800;
  line-height: 1.12;
  color: #fff;
  margin-bottom: var(--sp-2);
}
.hero-card__title a { color: inherit; }
.hero-card__title a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.hero-card--small .hero-card__title {
  font-size: clamp(1.05rem, 0.95rem + 0.7vw, 1.35rem);
}
.hero-card__desc {
  font-size: var(--fs-sm);
  line-height: 1.55;
  opacity: 0.92;
  margin-bottom: var(--sp-3);
  max-width: 52ch;
}
.hero-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 10px 18px;
  background: #fff;
  color: #2b2722;
  color: var(--ink-primary);
  border-radius: 99px;
  font-size: var(--fs-sm);
  font-weight: 700;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast);
}
.hero-card__cta:hover { transform: translateY(-2px); color: #2b2722; color: var(--ink-primary); background: #f8f6f2; background: var(--bg-paper); }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.55fr 1fr; grid-template-rows: 1fr 1fr; }
  .hero-card--large { grid-row: 1 / 3; min-height: 420px; }
  .hero-card--small { min-height: 200px; }
}
@media (max-width: 640px) {
  .hero-card { padding: var(--sp-3); }
  .hero-card__desc { display: none; }
  .hero-card__cta { padding: 8px 14px; }
}

.popular-grid {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr;
}
@media (min-width: 480px) and (max-width: 899px) {
  .popular-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) {
  .popular-grid { grid-template-columns: repeat(2, 1fr); }
}
.popular-card { display: flex; flex-direction: column; gap: 6px; }
.popular-card__thumb {
  aspect-ratio: 16/10;
  object-fit: cover;
  width: 100%;
  border-radius: var(--r-md);
  background: #e8e1d6;
  background: var(--bg-cream);
}
.popular-card__title {
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.popular-card__title a:hover { color: #c0563a; color: var(--accent); }
.popular-card__meta {
  font-size: var(--fs-xs);
  color: #8f897f;
  color: var(--ink-muted);
}

@media (prefers-reduced-motion: reduce) {
  .hero-card:hover .hero-card__bg { transform: none; }
  .hero-card__bg { transition: none; }
}