/*
Theme Name: Viflos
Theme URI: https://viflos.store
Author: Viflos Store
Author URI: https://viflos.store
Description: An editorial DIY & home-decor blog theme for Viflos.store — built for AdSense-friendly reading, fast pages, and an editable header/footer from the WordPress Customizer. Ships with 10 built-in niches: Home Organization, Home Decor, Budget & Small-Space Living, Seasonal DIY, Garden & Outdoor, Wedding & Event, Kids & Family, Gift-Making & Handmade Crafts, Cleaning & Hacks, and Furniture Building & Woodworking.
Version: 1.2.1
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: viflos
Tags: blog, e-commerce, custom-logo, custom-menu, editor-style, featured-images, threaded-comments, translation-ready

Viflos is a from-scratch WordPress theme. Component styles below are organized
by section; search the ALL-CAPS section names to jump around.
*/

/* =========================================================
   1. RESET & BASE
========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .25s ease, color .25s ease;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { padding: 0; margin: 0; list-style: none; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: 700; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -0.01em; }
p { margin: 0 0 1.3em; }
button, input, textarea, select { font-family: inherit; font-size: 1rem; color: inherit; }
figure { margin: 0; }
table { border-collapse: collapse; width: 100%; }

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

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

/* =========================================================
   2. DESIGN TOKENS
========================================================= */
:root {
  /* Brand — sampled from the Viflos "V" mark */
  --ink: #141414;
  --ink-soft: #3A3733;
  --red: #F3323A;
  --red-deep: #C81E28;
  --paper: #FAF6EF;
  --paper-alt: #F1EAD9;
  --card: #FFFFFF;
  --line: rgba(20,18,15,0.12);
  --muted: #6E685F;

  /* 10 niche colors — used only as small accents (badges, rail, dividers) */
  --cat-1: #5B7C99; /* Home Organization */
  --cat-2: #C1694F; /* Home Decor */
  --cat-3: #8A8B4E; /* Budget & Small-Space Living */
  --cat-4: #D9A441; /* Seasonal DIY */
  --cat-5: #6E8C5A; /* Garden & Outdoor */
  --cat-6: #C68A9E; /* Wedding & Event */
  --cat-7: #4E9BC7; /* Kids & Family */
  --cat-8: #8B5E83; /* Gift-Making & Handmade Crafts */
  --cat-9: #4F8C82; /* Cleaning & Hacks */
  --cat-10:#8A5A34; /* Furniture Building & Woodworking */

  --font-display: 'Space Grotesk', 'Arial Narrow', Helvetica, sans-serif;
  --font-body: 'Lora', Georgia, 'Times New Roman', serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  --radius: 4px;
  --wrap: 1220px;
  --shadow: 0 1px 2px rgba(20,18,15,.05), 0 10px 24px -14px rgba(20,18,15,.25);
}

/* Dark mode — toggled via the header sun/moon button, remembered in localStorage. */
:root[data-theme="dark"] {
  --ink: #F3EFE6;
  --ink-soft: #C9C3B6;
  --paper: #171512;
  --paper-alt: #211E1A;
  --card: #1D1B17;
  --line: rgba(243,239,230,0.12);
  --muted: #948C7E;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 24px -14px rgba(0,0,0,.6);
}
:root[data-theme="dark"] .footer-brand img.custom-logo { filter: none; }
:root[data-theme="dark"] .comment-form input,
:root[data-theme="dark"] .comment-form textarea,
:root[data-theme="dark"] .widget_search input { background: var(--card); color: var(--ink); }

/* =========================================================
   3. LAYOUT HELPERS
========================================================= */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px,1px,1px,1px); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.screen-reader-text:focus {
  position: fixed; left: 8px; top: 8px; width: auto; height: auto; z-index: 100000;
  background: var(--ink); color: #fff; padding: 12px 18px; clip: auto; border-radius: var(--radius);
}
.skip-link { z-index: 100000; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--red-deep); font-weight: 500; margin-bottom: 14px;
}
.eyebrow::before {
  content: ""; width: 10px; height: 14px; background: var(--red);
  clip-path: polygon(0 0, 60% 0, 100% 100%, 40% 100%);
  display: inline-block;
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: .95rem;
  padding: 13px 26px; border-radius: var(--radius); border: 2px solid var(--ink);
  background: var(--ink); color: var(--paper); cursor: pointer; transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { background: var(--red); border-color: var(--red); color: #fff; transform: translateY(-1px); }
.btn.btn-outline { background: transparent; color: var(--ink); }
.btn.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.btn-red:hover { background: var(--ink); border-color: var(--ink); }

.section { padding: 64px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 34px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.7rem, 2.6vw, 2.35rem); margin: 0; }
.section-head .see-all { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; border-bottom: 2px solid var(--red); padding-bottom: 3px; white-space: nowrap; }

.diagonal-divider { position: relative; height: 56px; background: var(--ink); }
.diagonal-divider::after {
  content: ""; position: absolute; inset: 0; background: var(--paper);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

/* =========================================================
   4. TOPBAR + HEADER
========================================================= */
.topbar { background: var(--ink); color: #EDE7DA; font-family: var(--font-mono); font-size: .78rem; letter-spacing: .02em; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 9px; padding-bottom: 9px; gap: 16px; }
.topbar-message a { color: var(--red); font-weight: 500; }
.topbar-social { display: flex; gap: 14px; }
.topbar-social a { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,.08); transition: background .2s ease; }
.topbar-social a:hover { background: var(--red); }
.topbar-social svg { width: 13px; height: 13px; fill: #EDE7DA; }

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 999; transition: box-shadow .2s ease; }
.site-header.is-scrolled { box-shadow: 0 2px 16px rgba(20,18,15,.08); }
.site-header .header-row { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; gap: 20px; transition: padding .2s ease; }
.site-header.is-scrolled .header-row { padding-top: 9px; padding-bottom: 9px; }
.site-header.is-scrolled .site-branding img.custom-logo,
.site-header.is-scrolled .site-title img { max-height: 34px; }

.site-branding { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 0 0 auto; }
.site-branding img.custom-logo { max-height: 42px; width: auto; transition: max-height .2s ease; }
.site-title { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; margin: 0; }
.site-title a { display: flex; align-items: center; gap: 10px; }

.primary-nav-wrap { display: flex; align-items: center; flex: 1 1 auto; min-width: 0; justify-content: center; }
.primary-menu { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
.primary-menu li { position: relative; }
.primary-menu > li > a {
  display: flex; align-items: center; gap: 5px; padding: 10px 14px; font-family: var(--font-display); font-weight: 500; font-size: .96rem;
  border-radius: var(--radius); transition: color .15s ease, background .15s ease; white-space: nowrap;
}
.primary-menu > li > a:hover, .primary-menu > li.current-menu-item > a { color: var(--red-deep); background: var(--paper-alt); }
.primary-menu li.menu-item-has-children > a::after,
.primary-menu li.has-mega > a::after {
  content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); margin-left: 2px; margin-top: -3px; opacity: .6;
}

/* Standard dropdown (fewer than 6 children) */
.primary-menu .sub-menu {
  display: none; position: absolute; top: 100%; left: 0; background: var(--card); min-width: 240px;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; z-index: 20;
}
.primary-menu li:hover > .sub-menu, .primary-menu li.focus-within > .sub-menu { display: block; }
.primary-menu .sub-menu li { width: 100%; }
.primary-menu .sub-menu a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: var(--radius); font-size: .92rem; font-weight: 400; }
.primary-menu .sub-menu a:hover { background: var(--paper-alt); color: var(--red-deep); }
.primary-menu .sub-menu .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--c, var(--ink)); flex: none; transform: rotate(45deg); }

/* Mega-menu (6+ children) — a full-width grid anchored under the sticky header */
.primary-menu li.has-mega { position: static; }
.primary-menu .sub-menu.mega-menu {
  display: none; position: absolute; top: 100%; left: 0; right: 0; width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 4px;
  background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow); max-width: var(--wrap); margin: 0 auto; padding: 30px 24px; z-index: 20;
}
.primary-menu li.has-mega:hover > .sub-menu.mega-menu,
.primary-menu li.has-mega.focus-within > .sub-menu.mega-menu { display: grid; }
.primary-menu .sub-menu.mega-menu a {
  flex-direction: column; align-items: flex-start; gap: 5px; padding: 14px 16px; border-radius: 6px; height: 100%;
}
.primary-menu .sub-menu.mega-menu a:hover { background: var(--paper-alt); }
.sub-menu.mega-menu .label { font-weight: 700; }
.sub-menu.mega-menu .dot { width: 12px; height: 14px; border-radius: 0; clip-path: polygon(0 0, 60% 0, 100% 100%, 40% 100%); transform: none; }
.sub-menu.mega-menu .desc { font-family: var(--font-body); font-size: .84rem; color: var(--muted); font-weight: 400; line-height: 1.4; }

.header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.header-icon-btn {
  width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--line); background: var(--card); cursor: pointer; transition: background .2s ease, border-color .2s ease; flex: none;
}
.header-icon-btn:hover { background: var(--ink); border-color: var(--ink); }
.header-icon-btn:hover svg { fill: var(--paper); }
.header-icon-btn svg { width: 17px; height: 17px; fill: var(--ink); stroke: none; }

#theme-toggle .icon-moon { display: none; }
#theme-toggle svg { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#theme-toggle:hover svg { stroke: var(--paper); }
:root[data-theme="dark"] #theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] #theme-toggle .icon-moon { display: block; }

/* Search overlay: real close button + backdrop + responsive layout */
.header-search {
  visibility: hidden; opacity: 0; position: absolute; left: 0; right: 0; top: 100%; background: var(--ink);
  padding: 0; max-height: 0; overflow: hidden; transition: max-height .25s ease, opacity .2s ease, padding .25s ease; z-index: 30;
}
.header-search.is-open { visibility: visible; opacity: 1; max-height: 140px; padding: 22px 0; }
.header-search .wrap { display: flex; align-items: center; gap: 12px; }
.header-search form { display: flex; gap: 10px; flex: 1 1 auto; min-width: 0; }
.header-search input[type="search"] { flex: 1; min-width: 0; padding: 14px 18px; border: none; border-radius: var(--radius); font-family: var(--font-display); font-size: 1.05rem; }
.header-search button[type="submit"] { border: none; flex: none; }
.header-search-close {
  flex: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: transparent;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.header-search-close svg { width: 16px; height: 16px; fill: var(--paper); }
.header-search-close:hover { background: var(--red); border-color: var(--red); }
.header-search-backdrop, .nav-backdrop {
  position: fixed; inset: 0; background: rgba(10,9,7,.5); opacity: 0; visibility: hidden; transition: opacity .2s ease; z-index: 25;
}
.header-search-backdrop.is-visible, .nav-backdrop.is-visible { opacity: 1; visibility: visible; }
.nav-backdrop { z-index: 1000; }

.menu-toggle { display: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); flex: none; }
.menu-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); margin: 4px auto; transition: transform .2s ease, opacity .2s ease; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* -----------------------------------------------------------
   Adaptive primary nav: collapses to the hamburger drawer the
   moment the menu doesn't fit on one line — not just below a
   fixed screen width. This is what keeps a menu with many
   top-level items (e.g. all 10 category links added flat,
   without nesting them under a "Categories" parent) from ever
   overlapping the logo or running off-screen, at any viewport
   width. Toggled by checkNavFit() in assets/js/main.js.
   The mobile-width media query further down is a no-JS floor
   under this, not the only trigger.
----------------------------------------------------------- */
.site-header.nav-collapsed .primary-nav-wrap .primary-menu { display: none; }
.site-header.nav-collapsed .menu-toggle { display: block; }

/* Hamburger drawer itself — unconditional so it works whether it was
   triggered by nav-collapsed (any width) or the mobile media query below. */
.primary-nav-wrap.nav-open .primary-menu {
  display: flex; flex-direction: column; align-items: stretch; position: fixed; inset: 0 0 0 auto;
  width: 84%; max-width: 340px; background: var(--paper); padding: 90px 20px 30px; z-index: 1001; box-shadow: var(--shadow);
  gap: 0; overflow-y: auto;
}
.primary-nav-wrap.nav-open .primary-menu > li { border-bottom: 1px solid var(--line); }
.primary-nav-wrap.nav-open .primary-menu > li > a { padding: 14px 4px; justify-content: space-between; }
.primary-nav-wrap.nav-open .sub-menu,
.primary-nav-wrap.nav-open .sub-menu.mega-menu {
  position: static; box-shadow: none; display: none; border: none; background: transparent;
  grid-template-columns: 1fr; padding: 0 0 10px 14px; max-width: none;
}
.primary-nav-wrap.nav-open li.is-open > .sub-menu,
.primary-nav-wrap.nav-open li.is-open > .sub-menu.mega-menu { display: grid; }
.primary-nav-wrap.nav-open .sub-menu a { padding: 10px 4px; }
.primary-nav-wrap.nav-open .sub-menu.mega-menu a { padding: 10px 4px; }

/* Reading progress bar (single posts) */
.reading-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--red); z-index: 1100; transition: width .1s linear; }

/* Back to top */
.back-to-top {
  position: fixed; right: 22px; bottom: 22px; width: 46px; height: 46px; border-radius: 50%; background: var(--ink);
  border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 400;
  opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top svg { width: 18px; height: 18px; fill: var(--paper); }
.back-to-top:hover { background: var(--red); }

/* Cookie consent banner */
.consent-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1200;
  background: var(--ink); color: #fff; box-shadow: 0 -6px 24px rgba(0,0,0,.18);
}
.consent-banner[hidden] { display: none; }
.consent-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 16px 24px; }
.consent-inner p { margin: 0; font-size: .88rem; line-height: 1.5; color: rgba(255,255,255,.9); max-width: 640px; }
.consent-inner a { color: #fff; text-decoration: underline; }
.consent-actions { display: flex; gap: 10px; flex-shrink: 0; }
.consent-actions .btn { padding: 10px 18px; font-size: .82rem; }
.consent-actions .btn-outline { border-color: rgba(255,255,255,.4); color: #fff; }
.consent-actions .btn-outline:hover { background: rgba(255,255,255,.1); }

/* Breadcrumbs */
.breadcrumbs { padding: 16px 0; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.breadcrumbs a:hover { color: var(--red-deep); }
.breadcrumbs li.sep { opacity: .5; }
.breadcrumbs [aria-current="page"] { color: var(--ink); }

/* =========================================================
   5. HERO + CATEGORY RAIL
========================================================= */
.hero { padding: 68px 0 44px; }
.hero-inner { max-width: 760px; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); }
.hero h1 .accent { color: var(--red); }
.hero p.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 58ch; }
.hero-cta { display: flex; gap: 14px; margin-top: 22px; flex-wrap: wrap; }

.cat-rail { display: flex; gap: 14px; overflow-x: auto; padding: 6px 0 20px; scrollbar-width: thin; }
.cat-rail::-webkit-scrollbar { height: 6px; }
.cat-rail::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
.cat-pill {
  --c: var(--ink);
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px; background: var(--card);
  border: 1px solid var(--line); padding: 12px 18px 12px 14px; border-radius: 999px; white-space: nowrap;
  transition: border-color .2s ease, transform .2s ease;
}
.cat-pill:hover { border-color: var(--c); transform: translateY(-2px); }
.cat-pill .dot { width: 10px; height: 10px; border-radius: 2px; background: var(--c); transform: rotate(45deg); flex: none; }
.cat-pill .name { font-family: var(--font-display); font-weight: 500; font-size: .92rem; }
.cat-pill .count { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); }

/* Homepage-only: split hero with a diagonal collage instead of plain text */
.hero-split { padding: 56px 0 20px; }
.hero-split .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: 50px; align-items: center; }
.hero-collage { position: relative; height: 380px; }
.hero-collage .slab { position: absolute; border-radius: 8px; box-shadow: var(--shadow); }
.hero-collage .slab-1 { width: 62%; height: 68%; left: 0; top: 0; background: var(--ink); clip-path: polygon(0 0, 88% 0, 100% 100%, 0% 100%); }
.hero-collage .slab-2 { width: 46%; height: 52%; right: 0; bottom: 0; background: var(--red); clip-path: polygon(14% 0, 100% 0, 100% 100%, 0 100%); }
.hero-collage .slab-3 { width: 40%; height: 34%; right: 6%; top: 6%; background: var(--paper-alt); border: 1px solid var(--line); }
.hero-collage .collage-tag { position: absolute; left: 8%; bottom: 8%; background: var(--card); border-radius: 6px; padding: 12px 16px; box-shadow: var(--shadow); font-family: var(--font-mono); font-size: .74rem; }
.hero-collage .collage-tag b { display: block; font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); }

.stat-strip { display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 10px 0 0; }
.stat-strip .stat { flex: 1 1 200px; padding: 22px 24px; border-right: 1px solid var(--line); }
.stat-strip .stat:last-child { border-right: none; }
.stat-strip .stat b { display: block; font-family: var(--font-display); font-size: 1.8rem; color: var(--red); }
.stat-strip .stat span { font-family: var(--font-mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* "Browse by Room" visual tile grid */
.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.cat-tile {
  --c: var(--ink);
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 20px 18px; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.cat-tile:hover { transform: translateY(-4px); border-color: var(--c); box-shadow: var(--shadow); }
.cat-tile-mark { position: relative; width: 42px; height: 42px; }
.cat-tile-slash { position: absolute; inset: 0; background: var(--c); clip-path: polygon(30% 0, 70% 0, 40% 100%, 0 100%); border-radius: 3px; }
.cat-tile-letter { position: relative; z-index: 1; font-family: var(--font-display); font-weight: 700; color: #fff; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 1.1rem; }
.cat-tile-name { font-family: var(--font-display); font-weight: 700; font-size: 1rem; line-height: 1.25; }
.cat-tile-count { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); }

/* Tabbed "Latest by Category" */
.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.cat-tabs [role="tab"] {
  --c: var(--ink);
  font-family: var(--font-display); font-weight: 500; font-size: .88rem; padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); cursor: pointer; color: var(--ink); transition: all .2s ease;
}
.cat-tabs [role="tab"]::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--c); transform: rotate(45deg) translateY(-1px); margin-right: 8px; }
.cat-tabs [role="tab"].is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.cat-tab-panel { display: none; }
.cat-tab-panel.is-active { display: block; }

/* =========================================================
   6. POST CARDS + GRIDS
========================================================= */
.badge {
  --c: var(--ink);
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono);
  font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 500;
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); padding: 5px 10px 5px 8px; border-radius: 3px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 6px 100%);
}
.badge .dot { width: 6px; height: 6px; background: var(--c); border-radius: 1px; }

.spotlight { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.spotlight .spotlight-media { height: 100%; min-height: 360px; overflow: hidden; }
.spotlight .spotlight-media img { width: 100%; height: 100%; object-fit: cover; }
.spotlight .spotlight-body { padding: 12px 40px 12px 0; }
.spotlight h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin: 10px 0 12px; }
.spotlight h2 a:hover { color: var(--red-deep); }
.spotlight .excerpt { color: var(--ink-soft); }

.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.post-card { display: flex; flex-direction: column; }
.post-card .thumb { position: relative; aspect-ratio: 4/3; overflow: hidden; border-radius: 5px; margin-bottom: 14px; background: var(--paper-alt); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.post-card:hover .thumb img { transform: scale(1.05); }
.post-card .thumb .badge { position: absolute; top: 12px; left: 0; }
.post-card h3 { font-size: 1.18rem; margin: 4px 0 8px; }
.post-card h3 a:hover { color: var(--red-deep); }
.post-card .excerpt { color: var(--ink-soft); font-size: .96rem; margin-bottom: 8px; }
.post-meta { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.post-meta .sep { width: 3px; height: 3px; background: var(--muted); border-radius: 50%; }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 48px; flex-wrap: wrap; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; border: 1px solid var(--line); border-radius: var(--radius); font-family: var(--font-display); font-weight: 500; padding: 0 6px; }
.pagination .current { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pagination a:hover { border-color: var(--red); color: var(--red-deep); }

/* =========================================================
   7. NEWSLETTER BAND
========================================================= */
.newsletter-band { background: var(--ink); color: var(--paper); position: relative; overflow: hidden; }
.newsletter-band .wrap { padding: 52px 24px; display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.newsletter-band h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 0 0 6px; }
.newsletter-band p { margin: 0; color: #C9C3B6; }
.newsletter-band form { display: flex; gap: 10px; flex: 0 0 auto; }
.newsletter-band input[type="email"] { padding: 14px 16px; border-radius: var(--radius); border: none; min-width: 260px; font-family: var(--font-display); }
.newsletter-band::before {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; background: var(--red);
  clip-path: polygon(30% 0, 70% 0, 100% 100%, 40% 100%); opacity: .9;
}

/* =========================================================
   8. SIDEBAR
========================================================= */
.content-layout { display: grid; grid-template-columns: 2.2fr .9fr; gap: 56px; align-items: start; }
.content-layout.no-sidebar { grid-template-columns: 1fr; max-width: 820px; margin: 0 auto; }
.widget { margin-bottom: 40px; }
.widget-title { font-family: var(--font-display); font-size: 1.05rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 16px; }
.widget ul li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.widget ul li a:hover { color: var(--red-deep); }
.widget_search .search-form { display: flex; }
.widget_search input[type="search"] { flex: 1; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius) 0 0 var(--radius); }
.widget_search button { background: var(--ink); color: var(--paper); border: none; padding: 0 16px; border-radius: 0 var(--radius) var(--radius) 0; }
.mini-post { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mini-post .thumb { width: 70px; height: 70px; flex: none; border-radius: 4px; overflow: hidden; background: var(--paper-alt); }
.mini-post .thumb img { width: 100%; height: 100%; object-fit: cover; }
.mini-post h4 { font-size: .93rem; margin: 0 0 4px; line-height: 1.35; }
.mini-post h4 a:hover { color: var(--red-deep); }
.ad-slot { border: 1px dashed var(--line); border-radius: var(--radius); padding: 10px; text-align: center; overflow: hidden; }
.ad-slot span { display: block; font-family: var(--font-mono); font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.in-feed-ad-cell { grid-column: 1 / -1; }
.in-feed-ad-cell .ad-slot { padding: 18px; }
.sidebar { position: sticky; top: 96px; max-height: calc(100vh - 116px); overflow-y: auto; scrollbar-width: thin; }

/* =========================================================
   9. SINGLE POST
========================================================= */
.post-header-single { padding: 44px 0 10px; text-align: center; }
.post-header-single .badge { margin-bottom: 16px; }
.post-header-single h1 { max-width: 900px; margin: 0 auto 18px; font-size: clamp(2rem, 4vw, 2.85rem); }
.post-header-single .post-meta { justify-content: center; }
.post-header-single .author { display: flex; align-items: center; gap: 8px; }
.post-header-single .author img { width: 26px; height: 26px; border-radius: 50%; }

.featured-media { max-width: var(--wrap); margin: 30px auto; padding: 0 24px; }
.featured-media img { width: 100%; border-radius: 6px; aspect-ratio: 16/8; object-fit: cover; }
.featured-media figcaption { text-align: center; font-family: var(--font-mono); font-size: .78rem; color: var(--muted); margin-top: 10px; }

.project-info-bar { display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: center; margin: 22px 0 0; }
.pi-item { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: .82rem; color: var(--ink-soft); }
.pi-item svg { width: 16px; height: 16px; fill: var(--red); flex: none; }

.toc-box { background: var(--paper-alt); border-radius: 6px; padding: 22px 26px; margin: 0 0 2em; }
.toc-box .toc-title { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--red-deep); font-weight: 500; margin: 0 0 10px; }
.toc-box ol { counter-reset: toc; margin: 0; }
.toc-box ol > li { counter-increment: toc; padding: 5px 0; font-size: .95rem; }
.toc-box ol > li::before { content: counter(toc) ". "; font-family: var(--font-mono); color: var(--muted); margin-right: 4px; }
.toc-box ol > li.toc-sub { padding-left: 20px; }
.toc-box ol > li.toc-sub::before { content: "– "; }
.toc-box a:hover { color: var(--red-deep); text-decoration: underline; }

.entry-content { font-size: 1.08rem; }
.entry-content h2 { font-size: 1.55rem; margin-top: 1.6em; }
.entry-content h3 { font-size: 1.25rem; margin-top: 1.4em; }
.entry-content > h2:first-child, .entry-content > h3:first-child { margin-top: 0; }
.entry-content p:first-of-type { font-size: 1.18rem; color: var(--ink-soft); }
.entry-content a { color: var(--red-deep); text-decoration: underline; text-underline-offset: 3px; }
.entry-content img, .entry-content figure { border-radius: 6px; margin: 1.6em 0; }
.entry-content blockquote { margin: 1.8em 0; padding: 6px 0 6px 22px; border-left: 3px solid var(--red); font-style: italic; color: var(--ink-soft); }
.entry-content ul, .entry-content ol { margin: 0 0 1.4em; padding-left: 1.3em; list-style: revert; }
.entry-content ul { list-style: none; padding-left: 0; }
.entry-content ul > li { position: relative; padding-left: 22px; margin-bottom: .5em; }
.entry-content ul > li::before { content: ""; position: absolute; left: 0; top: .55em; width: 9px; height: 11px; background: var(--red); clip-path: polygon(0 0, 60% 0, 100% 100%, 40% 100%); }
.entry-content table { margin: 1.6em 0; font-size: .95rem; }
.entry-content table th, .entry-content table td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.entry-content table th { background: var(--paper-alt); font-family: var(--font-display); }
.entry-content hr { border: none; border-top: 1px solid var(--line); margin: 2.2em 0; }
.entry-content .wp-caption-text { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); text-align: center; margin-top: 8px; }

.in-content-ad { margin: 2.4em 0; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 40px 0 0; }
.tag-list a { font-family: var(--font-mono); font-size: .78rem; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; }
.tag-list a:hover { border-color: var(--red); color: var(--red-deep); }

.share-row { display: flex; align-items: center; gap: 12px; margin: 28px 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.share-row span.label { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.share-row a { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; }
.share-row a:hover { background: var(--ink); border-color: var(--ink); }
.share-row a:hover svg { fill: var(--paper); }
.share-row svg { width: 15px; height: 15px; fill: var(--ink); }

.author-box { display: flex; gap: 20px; background: var(--paper-alt); border-radius: 6px; padding: 26px; margin: 40px 0; align-items: flex-start; }
.author-box img { width: 64px; height: 64px; border-radius: 50%; flex: none; }
.author-box h4 { margin: 0 0 4px; font-size: 1.05rem; }
.author-box p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

.related-posts { margin-top: 56px; }

.comments-area { margin-top: 56px; }
.comment-list { margin: 0; }
.comment-list .comment { border-top: 1px solid var(--line); padding: 22px 0; }
.comment-author { font-family: var(--font-display); font-weight: 700; }
.comment-meta { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); margin-bottom: 8px; }
.comment-form input, .comment-form textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; background: var(--card); }
.comment-form textarea { min-height: 130px; }
.comment-respond h3 { margin-bottom: 18px; }

/* =========================================================
   10. ARCHIVE / CATEGORY / SEARCH / 404
========================================================= */
.archive-header { padding: 48px 0 8px; text-align: center; }
.archive-header .cat-icon { width: 54px; height: 54px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.archive-header h1 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); }
.archive-header p { max-width: 640px; margin: 0 auto; color: var(--ink-soft); }

.error-404 { text-align: center; padding: 90px 0; }
.error-404 h1 { font-size: 5rem; color: var(--red); margin-bottom: 0; }
.error-404 .search-form { max-width: 460px; margin: 26px auto; display: flex; }

/* =========================================================
   11. FOOTER
========================================================= */
.site-footer { background: var(--ink); color: #C9C3B6; margin-top: 60px; }
.footer-top { padding: 60px 0 40px; display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.1fr; gap: 40px; }
.footer-brand .site-title, .footer-brand .site-title a { color: var(--paper); }
.footer-brand img.custom-logo { max-height: 40px; margin-bottom: 14px; filter: brightness(0) invert(1); }
.footer-brand p { color: #A29C8F; font-size: .95rem; }
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.footer-social a { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); display: inline-flex; align-items: center; justify-content: center; }
.footer-social a:hover { background: var(--red); border-color: var(--red); }
.footer-social svg { width: 14px; height: 14px; fill: #EDE7DA; }
.footer-col h3.widget-title { color: var(--paper); border-bottom-color: rgba(255,255,255,.2); font-size: .92rem; }
.footer-col ul li { border-bottom: 1px solid rgba(255,255,255,.08); padding: 8px 0; }
.footer-col ul li a { color: #C9C3B6; }
.footer-col ul li a:hover { color: var(--red); }
.footer-newsletter form { display: flex; margin-top: 12px; }
.footer-newsletter input { flex: 1; padding: 11px 12px; border: 1px solid rgba(255,255,255,.2); background: transparent; color: var(--paper); border-radius: var(--radius) 0 0 var(--radius); }
.footer-newsletter button { border-radius: 0 var(--radius) var(--radius) 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 20px 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: .85rem; }
.footer-bottom-menu { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-bottom-menu a:hover { color: var(--red); }

/* =========================================================
   12. RESPONSIVE
========================================================= */
@media (max-width: 1080px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .content-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; overflow: visible; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .spotlight { grid-template-columns: 1fr; }
  .spotlight .spotlight-body { padding: 0 28px 28px; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-split .wrap { grid-template-columns: 1fr; }
  .hero-collage { height: 260px; order: -1; }
}
@media (max-width: 640px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-strip .stat { flex: 1 1 50%; border-bottom: 1px solid var(--line); }
}
@media (max-width: 420px) {
  .cat-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1080px) {
  .header-icon-btn--desktop { display: none; }
}
@media (max-width: 900px) {
  .topbar .wrap { font-size: .7rem; }
  .primary-nav-wrap .primary-menu { display: none; }
  .menu-toggle { display: block; }
  .header-search .wrap { flex-wrap: nowrap; }
  .header-search input[type="search"] { font-size: .95rem; padding: 12px 14px; }
  .post-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; padding: 44px 0 20px; }
  .newsletter-band form { width: 100%; }
  .newsletter-band input[type="email"] { min-width: 0; flex: 1; }
  .author-box { flex-direction: column; }
  .back-to-top { right: 14px; bottom: 14px; width: 42px; height: 42px; }
}

/* Print */
@media print {
  .site-header, .site-footer, .sidebar, .share-row, .newsletter-band, .topbar, .ad-slot, .in-content-ad, .consent-banner, .back-to-top { display: none !important; }
}
