/*
Theme Name:  Coreflame
Theme URI:   https://github.com/your-handle/coreflame
Author:      You
Description: A minimalist, ethereal fanlisting collective theme with light/dark mode, sidebar, and widget support.
Version:     1.0.0
License:     GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: coreflame
Tags:        blog, custom-header, custom-logo, custom-menu, featured-images, footer-widgets, full-width-template, sticky-post, theme-options, threaded-comments, translation-ready, two-columns, right-sidebar, wide-blocks
*/

/* ============================================================
   CSS VARIABLES — LIGHT MODE
   ============================================================ */
:root {
  --color-bg:           #f0f2f7;
  --color-surface:      #ffffff;
  --color-surface-2:    #f7f8fc;
  --color-border:       #e2e6f0;
  --color-text:         #2d3048;
  --color-text-muted:   #7a7f9a;
  --color-heading:      #1e2140;
  --color-accent:       #6b9fd4;
  --color-accent-soft:  #c3d9f0;
  --color-accent-2:     #a78bca;
  --color-accent-2-soft:#e5d8f5;
  --color-link:         #5e91c8;
  --color-link-hover:   #a78bca;
  --color-tag-bg:       #edf3fb;
  --color-tag-text:     #5e91c8;
  --color-nav-bg:       rgba(255,255,255,0.88);
  --color-nav-border:   rgba(107,159,212,0.18);
  --color-shadow:       rgba(107,159,212,0.12);
  --color-shadow-strong:rgba(107,159,212,0.22);
  --color-glow:         rgba(107,159,212,0.15);
  --color-scrollbar:    #c3d9f0;

  --font-display:  'Cormorant Garamond', 'Georgia', serif;
  --font-ui:       'DM Sans', sans-serif;
  --font-body:     'DM Sans', sans-serif;
  --font-mono:     'JetBrains Mono', monospace;

  --radius-sm:   6px;
  --radius:      12px;
  --radius-lg:   20px;
  --radius-pill: 999px;

  --width-site:    1160px;
  --width-content: 720px;
  --sidebar-width: 280px;
  --gap:           28px;

  --transition: 0.22s ease;
}

/* ============================================================
   DARK MODE
   ============================================================ */
[data-theme="dark"] {
  --color-bg:           #0f1120;
  --color-surface:      #181b30;
  --color-surface-2:    #1e2240;
  --color-border:       #2a2f52;
  --color-text:         #d4d8f0;
  --color-text-muted:   #6b72a0;
  --color-heading:      #e8eaf6;
  --color-accent:       #7fb3e8;
  --color-accent-soft:  #1e3558;
  --color-accent-2:     #c4a0e8;
  --color-accent-2-soft:#2a1e45;
  --color-link:         #7fb3e8;
  --color-link-hover:   #c4a0e8;
  --color-tag-bg:       #1e2f48;
  --color-tag-text:     #7fb3e8;
  --color-nav-bg:       rgba(18,20,42,0.92);
  --color-nav-border:   rgba(127,179,232,0.15);
  --color-shadow:       rgba(0,0,0,0.35);
  --color-shadow-strong:rgba(0,0,0,0.55);
  --color-glow:         rgba(127,179,232,0.08);
  --color-scrollbar:    #2a2f52;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--color-scrollbar) transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.75;
  min-height: 100vh;
  transition: background-color var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 10%, var(--color-glow) 0%, transparent 70%),
    radial-gradient(ellipse 50% 35% at 85% 80%, rgba(167,139,202,0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transition: var(--transition);
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--color-heading);
  line-height: 1.3;
  font-weight: 600;
}

h1 { font-size: clamp(1.75rem, 3vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }

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

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--color-link-hover); }

img { max-width: 100%; height: auto; display: block; }

ul, ol { padding-left: 1.5em; }
li { margin-bottom: 0.3em; }

code, pre {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
code { padding: 0.15em 0.45em; }
pre { padding: 1.25em; overflow-x: auto; }
pre code { background: none; border: none; padding: 0; }

blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 0.75em 1.25em;
  margin: 1.5em 0;
  background: var(--color-accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--color-text-muted);
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2em 0;
}

/* ============================================================
   LAYOUT SHELL
   ============================================================ */
.site-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-container {
  width: 100%;
  max-width: var(--width-site);
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================================
   SITE HEADER — floating pill nav
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  /* No background — the pill itself carries the surface */
  background: transparent;
  pointer-events: none; /* let clicks pass through the gap around the pill */
}

/* Inner wrapper: full site width, centers the pill */
.site-header-inner {
  max-width: var(--width-site);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  pointer-events: none;
}

/* ── The pill itself ── */
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--color-nav-bg);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--color-nav-border);
  border-radius: var(--radius-pill);
  padding: 5px 8px;
  box-shadow:
    0 2px 12px var(--color-shadow),
    0 1px 2px rgba(0,0,0,0.04);
  transition: box-shadow var(--transition), background var(--transition);
  pointer-events: auto; /* re-enable clicks on the pill */
}

.nav-pill:hover {
  box-shadow:
    0 4px 24px var(--color-shadow-strong),
    0 1px 2px rgba(0,0,0,0.06);
}

/* Optional small logo inside the pill */
.nav-pill-logo {
  display: flex;
  align-items: center;
  margin-right: 4px;
  padding-right: 8px;
  border-right: 1px solid var(--color-border);
}
.nav-pill-logo .custom-logo {
  height: 26px;
  width: auto;
  border-radius: var(--radius-sm);
}

/* Thin vertical divider before the theme toggle */
.nav-pill-divider {
  display: block;
  width: 1px;
  height: 18px;
  background: var(--color-border);
  margin: 0 4px;
  flex-shrink: 0;
}

/* ── Nav items inside the pill ── */
.primary-navigation {
  display: flex;
  align-items: center;
}

.primary-navigation ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 1px;
}

.primary-navigation li { margin: 0; }

.primary-navigation a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.primary-navigation a i {
  font-size: 0.92em;
  opacity: 0.75;
  transition: opacity var(--transition);
}

.primary-navigation a:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}
.primary-navigation a:hover i { opacity: 1; }

.primary-navigation .current-menu-item > a,
.primary-navigation .current-page-ancestor > a {
  color: var(--color-accent);
  background: var(--color-accent-soft);
}
.primary-navigation .current-menu-item > a i,
.primary-navigation .current-page-ancestor > a i {
  opacity: 1;
}

/* Dropdown */
.primary-navigation .menu-item-has-children { position: relative; }
.primary-navigation .sub-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 170px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px var(--color-shadow-strong);
  padding: 6px;
  display: none;
  flex-direction: column;
  z-index: 200;
}
.primary-navigation .menu-item-has-children:hover > .sub-menu { display: flex; }
.primary-navigation .sub-menu li { margin: 0; }
.primary-navigation .sub-menu a {
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 0.82rem;
}

/* ── Theme Toggle (inside pill) ── */
.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
  flex-shrink: 0;
  margin-left: 2px;
}
.theme-toggle:hover {
  background: var(--color-surface-2);
  color: var(--color-accent);
}
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun  { display: flex; }
[data-theme="dark"] .theme-toggle .icon-moon { display: flex; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: none; }

/* ── Mobile menu toggle (outside pill, visible only on small screens) ── */
.menu-toggle {
  display: none;
  position: absolute;
  right: 20px;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-nav-bg);
  backdrop-filter: blur(12px);
  color: var(--color-text-muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition);
  pointer-events: auto;
}
.menu-toggle:hover {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

/* ============================================================
   BANNER / HERO IMAGE
   ============================================================ */
.site-banner {
  width: 100%;
  max-width: var(--width-site);
  margin: 24px auto 0;
  padding: 0 20px;
}

.site-banner-inner {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 32px var(--color-shadow-strong);
  position: relative;
}

.site-banner-inner img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 420px;
  object-fit: cover;
  object-position: center top;
}

/* If no header image, show a gradient placeholder */
.site-banner-inner.no-image {
  height: 220px;
  background: linear-gradient(135deg,
    var(--color-accent-soft) 0%,
    var(--color-accent-2-soft) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   CONTENT AREA
   ============================================================ */
.content-area {
  flex: 1;
  width: 100%;
  max-width: var(--width-site);
  margin: var(--gap) auto;
  padding: 0 20px;
}

.content-inner {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--gap);
  align-items: start;
}

/* No sidebar layout */
.no-sidebar .content-inner {
  grid-template-columns: 1fr;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
#main { min-width: 0; }

/* ============================================================
   CARDS / POSTS
   ============================================================ */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 16px var(--color-shadow);
  transition: box-shadow var(--transition), transform var(--transition);
  margin-bottom: var(--gap);
}
.card:hover {
  box-shadow: 0 6px 32px var(--color-shadow-strong);
  transform: translateY(-2px);
}

.card-thumb {
  width: 100%;
  aspect-ratio: 16/8;
  overflow: hidden;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card-thumb img { transform: scale(1.03); }

.card-body { padding: 24px; }
.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}
.card-meta a { color: inherit; }
.card-meta a:hover { color: var(--color-accent); }
.card-meta i, .card-meta .ph { font-size: 0.9em; margin-right: 3px; }

.card-title {
  font-size: 1.2rem;
  margin-bottom: 10px;
}
.card-title a { color: var(--color-heading); }
.card-title a:hover { color: var(--color-accent); }

.card-excerpt {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 16px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ============================================================
   SINGLE POST
   ============================================================ */
.post-header { margin-bottom: 2rem; }

.post-thumbnail {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: 0 4px 24px var(--color-shadow);
}
.post-thumbnail img { width: 100%; }

.post-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  box-shadow: 0 2px 16px var(--color-shadow);
}

.post-content h2 { margin: 1.8em 0 0.6em; }
.post-content h3 { margin: 1.5em 0 0.5em; }
.post-content h4 { margin: 1.25em 0 0.4em; }

.post-content ul,
.post-content ol { margin: 0.75em 0 1em 1.5em; }
.post-content li { margin-bottom: 0.25em; }

.post-content img {
  border-radius: var(--radius);
  margin: 1.5em auto;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}
.entry-meta span { display: flex; align-items: center; gap: 5px; }
.entry-meta a { color: inherit; }
.entry-meta a:hover { color: var(--color-accent); }

/* Post Nav */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 2rem;
}
.post-nav-link {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.post-nav-link:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px var(--color-shadow);
}
.post-nav-link .nav-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.post-nav-link .nav-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--color-heading);
  line-height: 1.4;
}
.post-nav-link.next { text-align: right; }

/* ============================================================
   PAGE HERO SECTION BLOCK
   ============================================================ */
.section-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: 0 2px 16px var(--color-shadow);
  margin-bottom: var(--gap);
}

.section-block-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}

.section-block-header .block-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--color-accent-soft);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.section-block-header h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  font-family: var(--font-ui);
  font-weight: 600;
  margin: 0;
}

/* ============================================================
   TAGS & CATEGORIES
   ============================================================ */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  font-size: 0.78rem;
  font-weight: 500;
  transition: all var(--transition);
  border: 1px solid transparent;
}
.tag:hover {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn-primary:hover {
  filter: brightness(1.1);
  color: #fff;
  box-shadow: 0 4px 14px var(--color-shadow-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent-soft);
}
.btn-ghost:hover {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
}

.btn-sm { padding: 6px 14px; font-size: 0.78rem; }

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

/* ── Widget shell ── */
.widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 14px var(--color-shadow);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.widget:hover {
  border-color: var(--color-accent-soft);
  box-shadow: 0 4px 28px var(--color-shadow-strong);
}

/* ── Widget header: accent left-bar style ── */
.widget-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px 12px;
  border-bottom: 1px solid var(--color-border);
  position: relative;
}
/* The coloured left bar */
.widget-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(to bottom, var(--color-accent), var(--color-accent-2));
}

.widget-header .widget-icon {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--color-accent-soft);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.widget-title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--color-heading);
  margin: 0;
  line-height: 1;
}

/* ── Widget body ── */
.widget-body { padding: 14px 16px 16px; }

/* Text widgets */
.widget p {
  font-size: 0.86rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  margin-bottom: 0.65em;
}
.widget p:last-child { margin-bottom: 0; }

/* ── Widget: Recent Posts ── */
.widget-post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.widget-post-list li {
  margin: 0;
  border-bottom: 1px solid var(--color-border);
}
.widget-post-list li:last-child { border-bottom: none; }

.widget-post-item {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 10px 0;
  transition: background var(--transition);
}
.widget-post-item:hover { background: transparent; }

.widget-post-thumb {
  width: 54px;
  height: 54px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
}
.widget-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.widget-post-item:hover .widget-post-thumb img { transform: scale(1.06); }

.widget-post-info { flex: 1; min-width: 0; }

.widget-post-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--color-heading);
  line-height: 1.4;
  display: block;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.widget-post-title a { color: inherit; }
.widget-post-title a:hover { color: var(--color-accent); }

.widget-post-date {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.widget-post-date i { color: var(--color-accent); opacity: 0.7; }

/* ── Widget: Categories / nav lists ── */
.widget-category-list,
.widget_categories ul,
.widget_archive ul,
.widget_pages ul,
.widget_meta ul,
.widget_nav_menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.widget-category-list li,
.widget_categories ul li,
.widget_archive ul li,
.widget_pages ul li,
.widget_meta ul li,
.widget_nav_menu ul li { margin: 0; }

.widget-category-list a,
.widget_categories ul a,
.widget_archive ul a,
.widget_pages ul a,
.widget_meta ul a,
.widget_nav_menu ul a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 0.84rem;
  color: var(--color-text);
  transition: all var(--transition);
  position: relative;
}
.widget-category-list a::before,
.widget_categories ul a::before,
.widget_archive ul a::before,
.widget_pages ul a::before,
.widget_meta ul a::before,
.widget_nav_menu ul a::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-border);
  flex-shrink: 0;
  transition: background var(--transition), transform var(--transition);
}
.widget-category-list a:hover,
.widget_categories ul a:hover,
.widget_archive ul a:hover,
.widget_pages ul a:hover,
.widget_meta ul a:hover,
.widget_nav_menu ul a:hover {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}
.widget-category-list a:hover::before,
.widget_categories ul a:hover::before,
.widget_archive ul a:hover::before,
.widget_pages ul a:hover::before,
.widget_meta ul a:hover::before,
.widget_nav_menu ul a:hover::before {
  background: var(--color-accent);
  transform: scale(1.4);
}

.cat-count,
.widget_categories .post-count,
.widget_archive .post-count {
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Widget: Tag Cloud ── */
.wp-block-tag-cloud,
.widget_tag_cloud .tagcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wp-block-tag-cloud a,
.widget_tag_cloud .tagcloud a {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  font-size: 0.76rem !important;
  font-weight: 500;
  border: 1px solid var(--color-accent-soft);
  transition: all var(--transition);
}
.wp-block-tag-cloud a:hover,
.widget_tag_cloud .tagcloud a:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px var(--color-shadow-strong);
}

/* ── Widget: Search ── */
.widget-search-form,
.search-form {
  display: flex;
  gap: 7px;
}
.widget-search-input,
.search-form .search-field {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  color: var(--color-text);
  font-size: 0.84rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.widget-search-input:focus,
.search-form .search-field:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}
.widget-search-input::placeholder,
.search-form .search-field::placeholder { color: var(--color-text-muted); }

.widget-search-btn,
.search-form .search-submit {
  width: 37px;
  height: 37px;
  border-radius: var(--radius-pill);
  border: none;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: opacity var(--transition), transform var(--transition);
  flex-shrink: 0;
  box-shadow: 0 2px 10px var(--color-shadow);
}
.widget-search-btn:hover,
.search-form .search-submit:hover {
  opacity: 0.9;
  transform: scale(1.06);
}

/* ── Widget: Calendar ── */
.wp-calendar-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.81rem;
}
.wp-calendar-table caption {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 8px;
  text-align: center;
}
.wp-calendar-table th {
  text-align: center;
  padding: 4px 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
}
.wp-calendar-table td {
  text-align: center;
  padding: 3px 2px;
  color: var(--color-text-muted);
}
.wp-calendar-table td a {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-weight: 600;
  transition: all var(--transition);
}
.wp-calendar-table td a:hover {
  background: var(--color-accent);
  color: #fff;
  transform: scale(1.1);
}
#today {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px var(--color-shadow-strong);
}
.wp-calendar-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 0.78rem;
}
.wp-calendar-nav a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-accent);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-accent-soft);
  transition: all var(--transition);
}
.wp-calendar-nav a:hover {
  background: var(--color-accent-soft);
}

/* ── Widget: Recent Comments ── */
.widget_recent_comments ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.widget_recent_comments li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.83rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}
.widget_recent_comments li:last-child { border-bottom: none; }
.widget_recent_comments li::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  margin-top: 6px;
  flex-shrink: 0;
  opacity: 0.6;
}
.widget_recent_comments a { color: var(--color-link); font-weight: 500; }
.widget_recent_comments a:hover { color: var(--color-link-hover); }

/* ── Widget: RSS ── */
.widget_rss ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.widget_rss li {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  margin: 0;
}
.widget_rss li:last-child { border-bottom: none; }
.widget_rss .rsswidget {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--color-heading);
  display: block;
  margin-bottom: 4px;
  line-height: 1.4;
}
.widget_rss .rsswidget:hover { color: var(--color-accent); }
.widget_rss .rss-date {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}
.widget_rss .rssSummary {
  font-size: 0.81rem;
  color: var(--color-text-muted);
  margin-top: 5px;
  line-height: 1.55;
}

/* ── Widget: Social Links ── */
.widget-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.social-link {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
}
.social-link:hover {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--color-shadow);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}
.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}
.pagination .dots {
  background: transparent;
  border-color: transparent;
}

/* ============================================================
   COMMENTS
   ============================================================ */
.comments-area {
  margin-top: 2.5rem;
}
.comments-title {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.comment-body {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px 22px;
}
.comment-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.comment-author img {
  border-radius: 50%;
  width: 36px;
  height: 36px;
}
.comment-author .fn { font-weight: 600; font-size: 0.9rem; }
.comment-metadata {
  font-size: 0.76rem;
  color: var(--color-text-muted);
  margin-top: 1px;
}
.comment-metadata a { color: inherit; }
.comment-content { font-size: 0.9rem; }
.comment-reply-link {
  font-size: 0.78rem;
  color: var(--color-accent);
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.comment-respond {
  margin-top: 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.comment-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-2);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
  margin-bottom: 14px;
}
.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--color-accent); }
.comment-form textarea { resize: vertical; min-height: 110px; }
.comment-form .form-submit .submit {
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter var(--transition);
}
.comment-form .form-submit .submit:hover { filter: brightness(1.1); }

/* ============================================================
   404 / SEARCH / ARCHIVE HEADERS
   ============================================================ */
.page-header {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: var(--gap);
  box-shadow: 0 2px 16px var(--color-shadow);
}
.page-header .page-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 8px;
}
.page-header .page-description {
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 28px 0 18px;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.footer-credit a { color: var(--color-accent); }
.footer-credit a:hover { color: var(--color-link-hover); }

.footer-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
  margin-bottom: 28px;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent); }

/* ============================================================
   WORDPRESS ALIGNMENT CLASSES
   ============================================================ */
.alignleft  { float: left; margin-right: 1.5em; margin-bottom: 1em; }
.alignright { float: right; margin-left: 1.5em; margin-bottom: 1em; }
.aligncenter { margin-left: auto; margin-right: auto; display: block; }
.alignwide  { margin-left: -2rem; margin-right: -2rem; }
.alignfull  { margin-left: calc(-40px - 2rem); margin-right: calc(-40px - 2rem); border-radius: 0 !important; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card, .section-block, .widget {
  animation: fadeInUp 0.4s ease both;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .content-inner {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 768px) {
  :root {
    --gap: 18px;
    --sidebar-width: 100%;
  }

  /* On mobile: hide the pill, show the hamburger toggle */
  .nav-pill { display: none; }
  .menu-toggle { display: flex; }

  /* When open: pill drops below as a vertical list */
  .nav-pill.is-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border-radius: var(--radius-lg);
    position: absolute;
    top: calc(100% - 8px);
    left: 20px;
    right: 20px;
    padding: 8px;
    gap: 2px;
    pointer-events: auto;
  }
  .nav-pill.is-open .primary-navigation ul {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 2px;
  }
  .nav-pill.is-open .primary-navigation a {
    padding: 10px 14px;
    border-radius: var(--radius);
  }
  .nav-pill.is-open .nav-pill-divider { display: none; }
  .nav-pill.is-open .theme-toggle {
    width: 100%;
    border-radius: var(--radius);
    justify-content: flex-start;
    padding: 10px 14px;
    gap: 8px;
    font-size: 0.82rem;
  }
  .post-content { padding: 22px 20px; }
  .post-navigation { grid-template-columns: 1fr; }
  .post-nav-link.next { text-align: left; }
  .alignfull { margin-left: -20px; margin-right: -20px; }
}

@media (max-width: 480px) {
  .site-title { font-size: 1.1rem; }
  .site-banner { margin-top: 14px; }
}
