/*
Theme Name: D come Dieta
Theme URI: https://dcomedieta.com
Author: D come Dieta
Description: Tema editoriale moderno e professionale per D come Dieta — nutrizione, diete e benessere.
Version: 2.0
License: GNU General Public License v2 or later
Text Domain: dcomedieta
*/

/* ============================================
   GOOGLE FONTS IMPORT
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300;1,9..40,400&display=swap');

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  --bg:          #FAFAF7;
  --bg-warm:     #F4F1EB;
  --bg-card:     #FFFFFF;
  --text:        #1C1C18;
  --text-muted:  #6B6B60;
  --text-light:  #9E9E92;
  --accent:      #4A6741;
  --accent-light:#EAF0E8;
  --accent-dark: #354B2E;
  --gold:        #A8844A;
  --gold-light:  #F5EDD8;
  --border:      #E3E0D6;
  --border-light:#EEECE6;
  --red:         #C0392B;
  --font-serif:  'Cormorant Garamond', Georgia, serif;
  --font-sans:   'DM Sans', -apple-system, sans-serif;
  --max-w:       1200px;
  --content-w:   720px;
  --radius:      4px;
  --radius-lg:   8px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.06);
  --shadow:      0 4px 16px rgba(0,0,0,0.07);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.10);
  --transition:  0.22s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { padding: 0; list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.2rem; }

p { margin-bottom: 1.4em; }
p:last-child { margin-bottom: 0; }

.serif { font-family: var(--font-serif); }

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ============================================
   SKIP LINK
   ============================================ */
.skip-link {
  position: absolute;
  top: -40px; left: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  z-index: 9999;
  transition: top var(--transition);
}
.skip-link:focus { top: 0; }

/* ============================================
   HEADER
   ============================================ */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 32px;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-shrink: 0;
}

.logo-d {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 300;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.02em;
}

.logo-tagline {
  display: none;
  font-size: 0.68rem;
  font-family: var(--font-sans);
  font-weight: 300;
  color: var(--text-light);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-left: 4px;
  align-self: center;
}

/* Nav */
.main-nav { flex: 1; }

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

.nav-menu > li {
  position: relative;
}

.nav-menu > li > a {
  display: block;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--transition);
  white-space: nowrap;
}

.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a,
.nav-menu > li.current-menu-ancestor > a {
  color: var(--accent);
}

/* Dropdown */
.nav-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  min-width: 220px;
  padding: 8px 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: var(--shadow);
  z-index: 200;
}

.nav-menu > li:hover > .sub-menu {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.nav-menu .sub-menu li a {
  display: block;
  padding: 9px 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
}

.nav-menu .sub-menu li a:hover {
  color: var(--accent);
  background: var(--accent-light);
}

/* Header search & actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-search-form {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  padding: 0 12px;
  gap: 6px;
  height: 36px;
  transition: border-color var(--transition);
}

.header-search-form:focus-within {
  border-color: var(--accent);
}

.header-search-form input {
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text);
  width: 160px;
  outline: none;
}

.header-search-form input::placeholder { color: var(--text-light); }

.header-search-form button {
  color: var(--text-muted);
  padding: 0;
  display: flex;
  align-items: center;
}

.header-search-form button:hover { color: var(--accent); }

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ============================================
   CATEGORY LABEL / TAG
   ============================================ */
.cat-label {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 3px 10px;
  background: var(--accent-light);
  border-radius: 2px;
  transition: background var(--transition), color var(--transition);
}

.cat-label:hover {
  background: var(--accent);
  color: #fff;
}

.cat-label--gold {
  color: var(--gold);
  background: var(--gold-light);
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
  font-size: 0.78rem;
  color: var(--text-light);
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-muted); transition: color var(--transition); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: 0.4; }

/* ============================================
   HOMEPAGE HERO — FEATURED ARTICLE
   ============================================ */
.home-hero {
  border-bottom: 1px solid var(--border);
  margin-bottom: 56px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 0;
  min-height: 480px;
}

.hero-content {
  padding: 56px 56px 56px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.hero-date {
  font-size: 0.75rem;
  color: var(--text-light);
  letter-spacing: 0.06em;
}

.hero-title {
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  line-height: 1.15;
  margin-bottom: 18px;
  font-weight: 400;
}

.hero-title a { transition: color var(--transition); }
.hero-title a:hover { color: var(--accent); }

.hero-excerpt {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 520px;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  transition: gap var(--transition), color var(--transition);
}

.hero-link:hover { gap: 14px; }

.hero-image {
  position: relative;
  overflow: hidden;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.hero-image:hover img { transform: scale(1.03); }

/* ============================================
   SECTION HEADING
   ============================================ */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.section-heading h2 {
  font-size: 1rem;
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-heading a {
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity var(--transition);
}

.section-heading a:hover { opacity: 0.7; }

/* ============================================
   ARTICLE CARD
   ============================================ */
.article-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

.article-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.article-card__thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-warm);
}

.article-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.article-card:hover .article-card__thumb img {
  transform: scale(1.05);
}

.article-card__body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card__cats {
  margin-bottom: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.article-card__title {
  font-size: 1.15rem;
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 10px;
}

.article-card__title a { transition: color var(--transition); }
.article-card__title a:hover { color: var(--accent); }

.article-card__excerpt {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-light);
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
}

.article-card__author {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Article card — horizontal variant */
.article-card--horizontal {
  flex-direction: row;
  align-items: center;
}

.article-card--horizontal .article-card__thumb {
  width: 120px;
  min-width: 120px;
  aspect-ratio: 1;
  border-radius: 0;
  flex-shrink: 0;
}

.article-card--horizontal .article-card__body {
  padding: 16px 18px;
}

.article-card--horizontal .article-card__title {
  font-size: 0.95rem;
}

/* Article card — large variant (2-col layout) */
.article-card--large .article-card__title {
  font-size: 1.35rem;
}

.article-card--large .article-card__thumb {
  aspect-ratio: 4/3;
}

/* ============================================
   HOME LAYOUT
   ============================================ */
.home-content {
  padding-bottom: 80px;
}

.home-main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 56px;
  align-items: start;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  margin-bottom: 40px;
}

.posts-pagination {
  text-align: center;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

/* paginate_links() con type='list' genera <ul class="page-numbers"> */
.page-numbers,
.pagination {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.page-numbers li { display: contents; }

.page-numbers a,
.page-numbers span,
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 6px;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: all var(--transition);
  text-decoration: none;
}

.page-numbers a:hover,
.page-numbers .current,
.pagination a:hover,
.pagination .current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.page-numbers .dots,
.pagination .dots {
  border: none;
  pointer-events: none;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
}

.widget-title {
  font-size: 0.72rem;
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

/* Popular posts widget */
.popular-posts-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.popular-post-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: start;
}

.popular-post-item__thumb {
  width: 72px;
  height: 56px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-warm);
  flex-shrink: 0;
}

.popular-post-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.popular-post-item__title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 500;
}

.popular-post-item__title a:hover { color: var(--accent); }

.popular-post-item__date {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* Categories widget */
.categories-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.categories-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  transition: color var(--transition);
}

.categories-list a:last-child { border-bottom: none; }
.categories-list a:hover { color: var(--accent); }

.categories-list .count {
  font-size: 0.75rem;
  color: var(--text-light);
  background: var(--bg);
  padding: 2px 7px;
  border-radius: 10px;
}

/* Newsletter widget */
.newsletter-widget {
  background: var(--accent);
  border-color: var(--accent-dark);
}

.newsletter-widget .widget-title {
  color: rgba(255,255,255,0.7);
  border-color: rgba(255,255,255,0.15);
}

.newsletter-widget p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 14px;
  line-height: 1.6;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.newsletter-form input[type="email"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  outline: none;
  transition: border-color var(--transition);
}

.newsletter-form input[type="email"]::placeholder { color: rgba(255,255,255,0.5); }
.newsletter-form input[type="email"]:focus { border-color: rgba(255,255,255,0.6); }

.newsletter-form button {
  width: 100%;
  padding: 10px;
  background: #fff;
  color: var(--accent-dark);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: background var(--transition);
  cursor: pointer;
}

.newsletter-form button:hover { background: var(--gold-light); }

/* ============================================
   SINGLE ARTICLE
   ============================================ */
.single-article {
  padding: 48px 0 80px;
}

.article-header {
  margin-bottom: 36px;
}

.article-header .article-cats {
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.article-header .article-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.15;
  margin-bottom: 20px;
  font-weight: 400;
}

.article-header .article-intro {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 300;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 28px;
  padding-left: 20px;
  border-left: 3px solid var(--accent-light);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.article-meta__author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.article-meta__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--accent);
  font-weight: 500;
  overflow: hidden;
  flex-shrink: 0;
}

.article-meta__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-meta__name {
  font-size: 0.9rem;
  font-weight: 500;
}

.article-meta__date {
  font-size: 0.82rem;
  color: var(--text-light);
}

.article-meta__sep {
  color: var(--border);
}

.article-meta__time {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-left: auto;
}

/* Featured image */
.article-featured-image {
  margin-bottom: 40px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-warm);
}

.article-featured-image img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
}

.article-featured-image figcaption {
  padding: 10px 14px;
  font-size: 0.78rem;
  color: var(--text-light);
  font-style: italic;
  text-align: center;
  background: var(--bg-warm);
}

/* Article body */
.article-body {
  font-size: 1.06rem;
  line-height: 1.85;
  color: var(--text);
}

.article-body h2 {
  font-size: 1.6rem;
  margin-top: 2.5em;
  margin-bottom: 0.7em;
  font-weight: 500;
  color: var(--text);
}

.article-body h3 {
  font-size: 1.25rem;
  margin-top: 2em;
  margin-bottom: 0.6em;
  font-weight: 500;
}

.article-body h4 {
  font-size: 1.05rem;
  margin-top: 1.8em;
  margin-bottom: 0.5em;
  font-weight: 500;
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.article-body p {
  margin-bottom: 1.5em;
}

.article-body a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-light);
  transition: border-color var(--transition);
}

.article-body a:hover {
  border-color: var(--accent);
}

.article-body strong { font-weight: 500; }

.article-body em { font-style: italic; }

.article-body ul,
.article-body ol {
  padding-left: 24px;
  margin-bottom: 1.5em;
}

.article-body ul { list-style: none; padding-left: 0; }

.article-body ul li {
  padding-left: 20px;
  position: relative;
  margin-bottom: 0.6em;
}

.article-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.article-body ol { list-style: decimal; }
.article-body ol li { margin-bottom: 0.6em; }

.article-body blockquote {
  margin: 2em 0;
  padding: 24px 28px;
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.article-body blockquote p {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--accent-dark);
  margin: 0;
  line-height: 1.6;
}

/* Highlight box */
.article-body .highlight-box,
.article-body .info-box {
  background: var(--gold-light);
  border: 1px solid #DEC99A;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin: 2em 0;
}

.article-body .highlight-box p,
.article-body .info-box p {
  margin: 0;
  font-size: 0.95rem;
  color: #5A4220;
}

/* Article table */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 0.92rem;
}

.article-body table th {
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

.article-body table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.article-body table tr:last-child td { border-bottom: none; }
.article-body table tr:nth-child(even) td { background: var(--bg); }

/* Article footer */
.article-footer {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.tag-pill {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: all var(--transition);
}

.tag-pill:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Author box */
.author-box {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 20px;
  padding: 28px;
  background: var(--bg-warm);
  border-radius: var(--radius-lg);
  margin-bottom: 40px;
}

.author-box__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--accent);
}

.author-box__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-box__name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.author-box__title {
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.author-box__bio {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

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

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 24px;
}

/* ============================================
   SINGLE ARTICLE LAYOUT
   ============================================ */
.single-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 64px;
  align-items: start;
}

/* ============================================
   ARCHIVE / CATEGORY PAGE
   ============================================ */
.archive-header {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.archive-eyebrow {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.archive-title {
  font-size: clamp(1.6rem, 3.5vw, 2.8rem);
  margin-bottom: 12px;
}

.archive-description {
  max-width: 600px;
  color: var(--text-muted);
  font-size: 1rem;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 48px;
}

/* ============================================
   SEARCH PAGE
   ============================================ */
.search-header {
  padding: 48px 0 36px;
}

.search-form-large {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 620px;
  margin-top: 20px;
}

.search-form-large input {
  flex: 1;
  border: none;
  padding: 14px 20px;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text);
  outline: none;
  background: transparent;
}

.search-form-large button {
  padding: 14px 24px;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background var(--transition);
}

.search-form-large button:hover { background: var(--accent-dark); }

/* ============================================
   404 PAGE
   ============================================ */
.error-404 {
  text-align: center;
  padding: 100px 24px;
}

.error-404__code {
  font-family: var(--font-serif);
  font-size: 10rem;
  font-weight: 300;
  color: var(--border);
  line-height: 1;
  margin-bottom: 8px;
}

.error-404__title {
  font-size: 1.8rem;
  margin-bottom: 16px;
}

.error-404__text {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 32px;
}

/* ============================================
   CATEGORY STRIP (homepage below hero)
   ============================================ */
.category-strip {
  background: var(--bg-warm);
  border-bottom: 1px solid var(--border);
  margin-bottom: 52px;
}

.category-strip-inner {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-strip-inner::-webkit-scrollbar { display: none; }

.cat-strip-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 28px;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  border-right: 1px solid var(--border);
  transition: color var(--transition), background var(--transition);
  gap: 6px;
}

.cat-strip-link:first-child { border-left: 1px solid var(--border); }

.cat-strip-link:hover,
.cat-strip-link.active {
  color: var(--accent);
  background: var(--bg-card);
}

.cat-strip-icon {
  font-size: 1.2rem;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,0.65);
  margin-top: 80px;
}

.footer-top {
  padding: 64px 0 48px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-grid {
  display: grid;
  grid-template-columns: 280px 1fr 1fr 1fr;
  gap: 48px;
}

.footer-brand .logo-d { color: rgba(255,255,255,0.9); }
.footer-brand .logo-text { color: rgba(255,255,255,0.9); }

.footer-brand__desc {
  margin-top: 14px;
  font-size: 0.88rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.5);
}

.footer-col-title {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.55);
  transition: color var(--transition);
}

.footer-links a:hover { color: rgba(255,255,255,0.9); }

.footer-bottom {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.3);
}

.footer-bottom a {
  color: rgba(255,255,255,0.3);
  transition: color var(--transition);
}

.footer-bottom a:hover { color: rgba(255,255,255,0.6); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn--primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn--outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn--outline:hover {
  background: var(--accent);
  color: #fff;
}

/* ============================================
   LOAD MORE
   ============================================ */
.load-more-wrap {
  text-align: center;
  margin-top: 40px;
}

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

/* ============================================
   BACK TO TOP
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--transition), transform var(--transition);
  cursor: pointer;
  z-index: 50;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent-dark);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .home-main-grid,
  .single-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .hero-inner {
    grid-template-columns: 1fr;
  }
  .hero-image {
    height: 280px;
  }
  .hero-content {
    padding: 40px 0 36px;
  }
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .posts-grid,
  .archive-grid {
    grid-template-columns: 1fr;
  }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav-menu { display: none; }
  .nav-menu.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 68px;
    left: 0; right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 16px 0;
    box-shadow: var(--shadow);
    z-index: 99;
  }
  .nav-menu.is-open > li > a { padding: 10px 24px; }
  .nav-menu .sub-menu {
    position: static;
    box-shadow: none;
    border: none;
    opacity: 1;
    pointer-events: all;
    transform: none;
    padding-left: 24px;
    display: none;
  }
  .nav-menu .sub-menu.is-open { display: block; }
  .nav-toggle { display: flex; }
  .header-search-form { display: none; }
  .logo-tagline { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .related-grid { grid-template-columns: 1fr; }
  .author-box { grid-template-columns: 1fr; text-align: center; }
  .author-box__avatar { margin: 0 auto; }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
  .site-header, .sidebar, .site-footer,
  .back-to-top, .reading-progress { display: none; }
  .single-layout { grid-template-columns: 1fr; }
  .article-body { font-size: 12pt; }
}
