/*
Theme Name: Dyvly
Theme URI: https://dyvly.com
Author: Dyvly
Description: A bold editorial tech-news theme for dyvly.com — dark espresso header, category bar, magazine layout.
Version: 1.0.0
Requires at least: 6.2
Tested up to: 6.7
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dyvly
Tags: news, magazine, blog, technology, dark-header, custom-menu, featured-images, sticky-post, threaded-comments
*/

/* ═══════════════════════════════════════════
   RESET & VARIABLES
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --espresso:      #4A2C0A;
  --espresso-d:    #2e1a06;
  --espresso-l:    #7a4f28;
  --espresso-pale: #f5ede4;
  --espresso-gold: #c8893a;
  --paper:         #f7f7f5;
  --paper-b:       #ffffff;
  --border:        #e2e0db;
  --ink:           #1a1a18;
  --ink-m:         #555551;
  --ink-f:         #999993;
  --sans:          'DM Sans', system-ui, sans-serif;
  --serif:         'Playfair Display', Georgia, serif;
  --max-w:         1200px;
  --gutter:        clamp(1rem, 3vw, 1.5rem);
  --trans:         0.18s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { padding-left: 1.5rem; }

h1,h2,h3,h4,h5,h6 {
  font-family: var(--serif);
  line-height: 1.25;
  color: var(--ink);
}

/* ═══════════════════════════════════════════
   LAYOUT HELPERS
═══════════════════════════════════════════ */
.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ═══════════════════════════════════════════
   READING PROGRESS BAR
═══════════════════════════════════════════ */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: var(--espresso-gold);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s linear;
}

/* ═══════════════════════════════════════════
   SITE HEADER
═══════════════════════════════════════════ */
.site-header {
  background: var(--espresso-d);
  position: sticky;
  top: 0;
  z-index: 200;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  gap: 0.5rem;
}

/* Logo */
.site-logo {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  text-decoration: none;
}
.site-logo__dot { color: var(--espresso-gold); }

/* Primary nav */
.primary-nav { display: flex; align-items: center; gap: 0; }

.primary-nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 0;
  align-items: center;
}

.primary-nav li a {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.65);
  padding: 0 0.875rem;
  height: 52px;
  line-height: 52px;
  transition: color var(--trans), background var(--trans);
  font-weight: 500;
}

.primary-nav li a:hover,
.primary-nav li.current-menu-item > a,
.primary-nav li.current-menu-ancestor > a {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

/* Primary nav dropdown */
.primary-nav li { position: relative; }

.primary-nav li.menu-item-has-children > a::after {
  content: ' ▾';
  font-size: 0.6rem;
  opacity: 0.6;
}

.primary-nav ul ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--espresso-d);
  border-top: 2px solid var(--espresso-gold);
  min-width: 180px;
  z-index: 500;
  list-style: none;
  padding: 0.375rem 0;
  margin: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}

.primary-nav li:hover > ul { display: block; }

.primary-nav ul ul li { display: block; width: 100%; }

.primary-nav ul ul li a {
  display: block;
  width: 100%;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.65);
  padding: 0.6rem 1rem;
  height: auto;
  line-height: 1.4;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--trans), color var(--trans);
}
.primary-nav ul ul li:last-child a { border-bottom: none; }
.primary-nav ul ul li a:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
  padding-left: 1.25rem;
}

/* Header right */
.site-header__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.header-search-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.65);
  display: flex;
  align-items: center;
  padding: 0.25rem;
  transition: color var(--trans);
}
.header-search-btn:hover { color: #fff; }
.header-search-btn svg { width: 18px; height: 18px; }

/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.75);
  padding: 0.25rem;
}
.nav-toggle svg { width: 22px; height: 22px; }

/* ═══════════════════════════════════════════
   CATEGORY BAR
═══════════════════════════════════════════ */
.cat-bar {
  background: var(--espresso);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.cat-bar__inner {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-bar__inner::-webkit-scrollbar { display: none; }

.cat-bar a {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.7);
  padding: 0.5rem 0.875rem;
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,0.1);
  font-weight: 500;
  transition: background var(--trans), color var(--trans);
}
.cat-bar a:hover,
.cat-bar a.current { background: rgba(255,255,255,0.12); color: #fff; }

/* ── Cat-bar dropdown (sub-menu) ── */
.cat-bar .menu { display: flex; list-style: none; padding: 0; margin: 0; }
.cat-bar .menu > li { position: relative; }
.cat-bar .menu > li > a {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.7);
  padding: 0.5rem 0.875rem;
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,0.1);
  font-weight: 500;
  transition: background var(--trans), color var(--trans);
}
.cat-bar .menu > li > a:hover,
.cat-bar .menu > li.current-menu-item > a,
.cat-bar .menu > li.current-menu-ancestor > a {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* Dropdown panel */
.cat-bar .menu > li > .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--espresso-d);
  border-top: 2px solid var(--espresso-gold);
  min-width: 180px;
  z-index: 500;
  list-style: none;
  padding: 0.375rem 0;
  margin: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}

.cat-bar .menu > li:hover > .sub-menu { display: block; }

.cat-bar .menu > li > .sub-menu li a {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.65);
  padding: 0.5rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-weight: 500;
  transition: background var(--trans), color var(--trans);
  white-space: nowrap;
}
.cat-bar .menu > li > .sub-menu li:last-child a { border-bottom: none; }
.cat-bar .menu > li > .sub-menu li a:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* Arrow indicator for items with children */
.cat-bar .menu > li.menu-item-has-children > a::after {
  content: ' ▾';
  font-size: 0.6rem;
  opacity: 0.6;
}

/* ═══════════════════════════════════════════
   HOME — HERO LAYOUT
═══════════════════════════════════════════ */
.home-main { padding: 1.5rem 0 0; }

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
  border: 1px solid var(--border);
  background: var(--paper-b);
  margin-bottom: 1.5rem;
}

.hero-main {
  padding: 1.25rem;
  border-right: 1px solid var(--border);
}

.hero-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 2px;
  display: block;
  background: var(--border);
  margin-bottom: 1rem;
}

/* Cat label */
.cat-label {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--espresso);
  margin-bottom: 0.4rem;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  line-height: 1.25;
  margin-bottom: 0.6rem;
  color: var(--ink);
}

.hero-desc {
  font-size: 0.9rem;
  color: var(--ink-m);
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--ink-f);
  flex-wrap: wrap;
}

.post-meta .sep { opacity: 0.4; }

.read-btn {
  display: inline-block;
  background: var(--espresso);
  color: #fff;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  padding: 0.4rem 0.875rem;
  border-radius: 2px;
  margin-top: 0.75rem;
  transition: background var(--trans);
}
.read-btn:hover { background: var(--espresso-l); }

/* More stories inside hero */
.hero-more { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* ═══════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════ */
.sidebar { padding: 1.25rem; }

.widget { margin-bottom: 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.widget:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.widget-title {
  font-family: var(--sans);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--ink-f);
  margin-bottom: 0.75rem;
}

/* Thumb items */
.thumb-item {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}
.thumb-item:last-child { margin-bottom: 0; }

.thumb-item__img {
  width: 64px;
  height: 46px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  background: var(--border);
}

.thumb-item__title {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--ink);
  font-weight: 500;
}
.thumb-item__meta { font-size: 0.7rem; color: var(--ink-f); margin-top: 2px; }

/* List items */
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--ink-m);
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item__count { font-size: 0.7rem; color: var(--ink-f); }

/* Tags */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag-cloud a {
  font-size: 0.7rem;
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
  color: var(--ink-m);
  transition: border-color var(--trans), color var(--trans);
}
.tag-cloud a:hover { border-color: var(--espresso); color: var(--espresso); }

/* Editor pick thumb */
.editor-pick__img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 2px;
  background: var(--border);
  display: block;
  margin-bottom: 0.6rem;
}
.editor-pick__title {
  font-family: var(--serif);
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 0.3rem;
}

/* ═══════════════════════════════════════════
   BOTTOM 3-COLUMN GRID
═══════════════════════════════════════════ */
.bottom-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  background: var(--paper-b);
  margin-bottom: 2rem;
}

.grid-card {
  padding: 1rem;
  border-right: 1px solid var(--border);
}
.grid-card:last-child { border-right: none; }

.grid-card__img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 2px;
  background: var(--border);
  display: block;
  margin-bottom: 0.75rem;
  transition: opacity var(--trans);
}
.grid-card:hover .grid-card__img { opacity: 0.9; }

.grid-card__title {
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 0.4rem;
  transition: color var(--trans);
}
.grid-card:hover .grid-card__title { color: var(--espresso); }

.grid-card__meta { font-size: 0.72rem; color: var(--ink-f); }

/* Section label */
.section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--espresso);
  border-left: 3px solid var(--espresso);
  padding-left: 0.6rem;
  margin-bottom: 1rem;
  display: block;
}

/* ═══════════════════════════════════════════
   SINGLE POST
═══════════════════════════════════════════ */
.single-wrap {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
  padding: 1.5rem 0;
}

.single-main { padding-right: 2rem; }

.single-cat {
  display: inline-block;
  background: var(--espresso-pale);
  color: var(--espresso);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
  margin-bottom: 0.75rem;
}

.single-title {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.single-deck {
  font-size: 1.05rem;
  color: var(--ink-m);
  line-height: 1.6;
  margin-bottom: 0.875rem;
}

.single-meta-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--ink-f);
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.single-feat-img {
  width: 100%;
  aspect-ratio: 16/8;
  object-fit: cover;
  border-radius: 3px;
  background: var(--border);
  display: block;
  margin-bottom: 1.5rem;
}

/* Post content */
.post-content { line-height: 1.85; font-size: 1rem; }
.post-content p { margin-bottom: 1.25rem; color: var(--ink-m); }
.post-content h2 { font-family: var(--serif); font-size: 1.4rem; margin: 2rem 0 0.75rem; color: var(--ink); }
.post-content h3 { font-family: var(--serif); font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
.post-content a { color: var(--espresso); text-decoration: underline; text-underline-offset: 3px; }
.post-content ul, .post-content ol { margin: 0 0 1.25rem 1.5rem; color: var(--ink-m); }
.post-content li { margin-bottom: 0.35rem; }

.post-content blockquote {
  border-left: 3px solid var(--espresso);
  padding: 0.4rem 0 0.4rem 1rem;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--ink-m);
  margin: 1.5rem 0;
}

.post-content code {
  font-family: monospace;
  font-size: 0.875em;
  background: var(--espresso-pale);
  padding: 0.1em 0.4em;
  border-radius: 2px;
  color: var(--espresso);
}

.post-content pre {
  background: var(--espresso-d);
  color: #e8d5bb;
  padding: 1.25rem;
  border-radius: 3px;
  overflow-x: auto;
  margin: 1.5rem 0;
}
.post-content pre code { background: none; color: inherit; padding: 0; }

.post-content img { border-radius: 3px; margin: 1.5rem 0; }

/* Tags */
.post-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1.5rem 0; }
.post-tags a {
  font-size: 0.72rem;
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  border-radius: 2px;
  color: var(--ink-m);
  transition: all var(--trans);
}
.post-tags a:hover { border-color: var(--espresso); color: var(--espresso); }

/* Author box */
.author-box {
  display: flex;
  gap: 0.875rem;
  align-items: center;
  background: var(--espresso-pale);
  padding: 1rem 1.25rem;
  border-radius: 3px;
  margin-top: 1.5rem;
}

.author-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--espresso-l);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--serif);
}

.author-name { font-size: 0.9rem; font-weight: 600; color: var(--ink); margin-bottom: 0.2rem; }
.author-bio { font-size: 0.8rem; color: var(--ink-m); line-height: 1.5; }

/* Post nav */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
}
.post-nav__label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-f); margin-bottom: 0.3rem; }
.post-nav__title { font-family: var(--serif); font-size: 0.9rem; color: var(--ink); line-height: 1.3; transition: color var(--trans); }
.post-nav a:hover .post-nav__title { color: var(--espresso); }
.post-nav__next { text-align: right; }

/* ═══════════════════════════════════════════
   ARCHIVE / CATEGORY PAGE
═══════════════════════════════════════════ */
.archive-head {
  background: var(--espresso-pale);
  padding: 1.25rem var(--gutter);
  border-bottom: 2px solid var(--espresso);
  margin-bottom: 1.5rem;
}
.archive-head__type {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--espresso-l);
  margin-bottom: 0.25rem;
  display: block;
}
.archive-head h1 { font-family: var(--serif); font-size: 1.75rem; color: var(--espresso); }
.archive-head p { font-size: 0.875rem; color: var(--espresso-l); margin-top: 0.25rem; }

.archive-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
  padding-bottom: 2rem;
}

.archive-main { padding-right: 1.5rem; border-right: 1px solid var(--border); }

/* Cat row */
.cat-row {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
  transition: opacity var(--trans);
}
.cat-row:hover { opacity: 0.85; }
.cat-row:first-child { padding-top: 0; }

.cat-row__img {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  background: var(--border);
}

.cat-row__title {
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 0.35rem;
  transition: color var(--trans);
}
.cat-row:hover .cat-row__title { color: var(--espresso); }
.cat-row__meta { font-size: 0.72rem; color: var(--ink-f); }

/* ═══════════════════════════════════════════
   SEARCH
═══════════════════════════════════════════ */
.search-bar {
  background: var(--espresso-d);
  padding: 1.5rem var(--gutter);
}
.search-form-wrap {
  display: flex;
  max-width: 560px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 2px;
  overflow: hidden;
}
.search-form-wrap input {
  flex: 1;
  padding: 0.625rem 1rem;
  border: none;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-family: var(--sans);
  font-size: 0.9rem;
  outline: none;
}
.search-form-wrap input::placeholder { color: rgba(255,255,255,0.4); }
.search-form-wrap button {
  background: var(--espresso);
  border: none;
  padding: 0.625rem 1rem;
  color: #fff;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background var(--trans);
}
.search-form-wrap button:hover { background: var(--espresso-l); }

/* ═══════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  padding: 2rem 0;
}
.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--ink-m);
  transition: all var(--trans);
  border-radius: 2px;
}
.page-numbers:hover, .page-numbers.current {
  background: var(--espresso);
  border-color: var(--espresso);
  color: #fff;
}

/* ═══════════════════════════════════════════
   COMMENTS
═══════════════════════════════════════════ */
.comments-section { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.comments-title { font-family: var(--serif); font-size: 1.25rem; margin-bottom: 1.25rem; }
.comment-list { list-style: none; padding: 0; }
.comment { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.comment__author { font-weight: 600; font-size: 0.875rem; }
.comment__date { font-size: 0.75rem; color: var(--ink-f); margin-left: 0.5rem; }
.comment__text { font-size: 0.9rem; color: var(--ink-m); margin-top: 0.5rem; line-height: 1.65; }

/* ═══════════════════════════════════════════
   404 / NO RESULTS
═══════════════════════════════════════════ */
.not-found {
  text-align: center;
  padding: 6rem 0;
  color: var(--ink-f);
}
.not-found__code {
  font-family: var(--serif);
  font-size: 6rem;
  color: var(--border);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.not-found h1 { font-family: var(--serif); font-size: 1.75rem; color: var(--ink); margin-bottom: 0.75rem; }
.not-found p { color: var(--ink-m); max-width: 380px; margin: 0 auto 1.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--espresso);
  color: #fff;
  padding: 0.625rem 1.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 2px;
  border: none;
  cursor: pointer;
  transition: background var(--trans);
}
.btn:hover { background: var(--espresso-l); }

/* ═══════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════ */
.site-footer { background: var(--espresso-d); border-top: 2px solid var(--espresso); margin-top: 3rem; }

.footer-main {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
  padding: 2rem 0 1.5rem;
}

.footer-brand__logo {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.6rem;
}
.footer-brand__logo span { color: var(--espresso-gold); }

.footer-brand__desc {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.65;
  max-width: 280px;
}

/* Newsletter placeholder (wired for future) */
.newsletter-placeholder {
  margin-top: 1.25rem;
  padding: 0.875rem;
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 2px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  font-style: italic;
}

.footer-col-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.35);
  font-weight: 700;
  margin-bottom: 0.875rem;
}

.footer-links { list-style: none; padding: 0; }
.footer-links li { border-bottom: 1px solid rgba(255,255,255,0.06); }
.footer-links a {
  display: block;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
  padding: 0.4rem 0;
  transition: color var(--trans);
}
.footer-links a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 0.875rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.footer-copy, .footer-tagline {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
}

/* ═══════════════════════════════════════════
   DARK MODE TOGGLE (future-ready, hidden now)
═══════════════════════════════════════════ */
.dark-mode-toggle { display: none; }

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 900px) {
  .hero-grid,
  .single-wrap,
  .archive-layout { grid-template-columns: 1fr; }

  .hero-main { border-right: none; border-bottom: 1px solid var(--border); }
  .single-main { padding-right: 0; border-right: none; margin-bottom: 1.5rem; }
  .archive-main { padding-right: 0; border-right: none; }
  .bottom-grid { grid-template-columns: 1fr 1fr; }
  .footer-main { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .primary-nav { display: none; }
  .primary-nav.is-open {
    display: block;
    position: absolute;
    top: 52px;
    left: 0; right: 0;
    background: var(--espresso-d);
    border-top: 1px solid rgba(255,255,255,0.08);
    z-index: 300;
  }
  .primary-nav.is-open ul { flex-direction: column; }
  .primary-nav.is-open li a { height: auto; line-height: 1; padding: 0.75rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .nav-toggle { display: block; }
  .bottom-grid { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════
   SEARCH OVERLAY
═══════════════════════════════════════════ */
#search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 10, 3, 0.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

#search-overlay.is-open { display: flex; }

.search-overlay__inner {
  width: 100%;
  max-width: 640px;
  padding: 0 1.5rem;
  position: relative;
}

.search-overlay__form {
  display: flex;
  border-bottom: 2px solid var(--espresso-gold);
  align-items: center;
  gap: 0.5rem;
}

.search-overlay__input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: #fff;
  padding: 0.75rem 0;
}

.search-overlay__input::placeholder { color: rgba(255,255,255,0.3); }

.search-overlay__btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  transition: color var(--trans);
  padding: 0.5rem;
}
.search-overlay__btn:hover { color: var(--espresso-gold); }

.search-overlay__close {
  position: absolute;
  top: -3rem;
  right: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  transition: color var(--trans);
  padding: 0.25rem;
}
.search-overlay__close:hover { color: #fff; }

/* ═══════════════════════════════════════════
   HEADER INLINE SEARCH
═══════════════════════════════════════════ */
.header-search-form {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 3px;
  overflow: hidden;
  flex: 1;
  max-width: 260px;
  min-width: 160px;
  margin: 0 0.75rem 0 auto;
  transition: border-color var(--trans), background var(--trans);
}

.header-search-form:focus-within {
  border-color: var(--espresso-gold);
  background: rgba(255,255,255,0.12);
}

.header-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--sans);
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
  min-width: 0;
}

.header-search-input::placeholder { color: rgba(255,255,255,0.35); }

.header-search-submit {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  padding: 0.5rem 0.625rem;
  transition: color var(--trans);
  flex-shrink: 0;
}

.header-search-submit:hover { color: var(--espresso-gold); }

@media (max-width: 768px) {
  .header-search-form { display: none; }
}
