/* ============================================================
   Promptology Theme — Main Stylesheet
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,400&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap');

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #faf9f7;
  --white:        #ffffff;
  --surface:      #f3f1ee;
  --border:       #e5e2dc;
  --border-dark:  #ccc9c2;
  --text:         #1a1916;
  --body:         #3d3b37;
  --muted:        #8a877f;
  --accent:       #e8500a;
  --accent-light: #fff0ea;
  --accent-hover: #c43e06;
  --tag-bg:       #f0ede8;
  --tag-text:     #5a5750;
  --shadow-sm:    0 1px 4px rgba(0,0,0,0.06);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.08);
  --radius:       10px;
  --max:          1160px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--body);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
ul { list-style: none; }

/* ── Accessibility: skip link ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  top: 0; left: 0;
  width: auto; height: auto;
  background: var(--accent);
  color: #fff;
  padding: 10px 20px;
  z-index: 9999;
  font-weight: 600;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.site-topbar {
  background: var(--text);
  color: #ccc9c2;
  text-align: center;
  font-size: 12.5px;
  letter-spacing: 0.3px;
  padding: 8px 20px;
}
.site-topbar a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
}

.nav-wrap {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: 62px;
}

.site-branding {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-title {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.site-title:hover { color: var(--accent); }

.logo-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  margin-bottom: 1px;
  flex-shrink: 0;
}

.site-logo img {
  max-height: 40px;
  width: auto;
}

/* Primary Nav */
.primary-nav {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.primary-nav > ul {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-nav ul li a {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  display: block;
}
.primary-nav ul li a:hover,
.primary-nav ul li.current-menu-item > a,
.primary-nav ul li.current-menu-ancestor > a {
  color: var(--text);
  background: var(--surface);
}

/* Dropdown */
.primary-nav ul li { position: relative; }
.primary-nav ul li ul {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 180px;
  padding: 6px;
  flex-direction: column;
  gap: 2px;
  z-index: 300;
}
.primary-nav ul li:hover > ul { display: flex; }
.primary-nav ul li ul li a {
  border-radius: 6px;
  font-size: 13px;
  padding: 7px 12px;
  white-space: nowrap;
}

/* Nav Search */
.nav-search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 13px;
  width: 180px;
  flex-shrink: 0;
  transition: border-color 0.15s, width 0.2s;
}
.nav-search-form:focus-within {
  border-color: var(--accent);
  width: 220px;
}
.nav-search-form svg { flex-shrink: 0; color: var(--muted); }
.nav-search-form input {
  border: none;
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text);
  outline: none;
  width: 100%;
  min-width: 0;
}
.nav-search-form input::placeholder { color: var(--muted); }
.nav-search-form button {
  display: none;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  background: var(--accent);
  color: #fff;
  border-radius: 7px;
  padding: 8px 16px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
  text-decoration: none;
}
.nav-cta:hover { background: var(--accent-hover); color: #fff; }

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 10px;
  cursor: pointer;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  margin-left: auto;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
}
.menu-toggle:hover { border-color: var(--accent); background: var(--accent-light); }
.menu-toggle-icon { pointer-events: none; }

/* ============================================================
   HERO (homepage only)
   ============================================================ */
.site-hero {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 56px 24px 48px;
  text-align: center;
}

.hero-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 12px;
}
.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-desc {
  font-size: 16px;
  color: var(--muted);
  font-weight: 300;
  margin-bottom: 28px;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

/* Hero Search */
.hero-search-form {
  max-width: 560px;
  margin: 0 auto 28px;
  display: flex;
  background: var(--white);
  border: 1.5px solid var(--border-dark);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.hero-search-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,80,10,0.1);
}
.hero-search-form input {
  flex: 1;
  border: none; outline: none;
  padding: 14px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: transparent;
}
.hero-search-form input::placeholder { color: var(--muted); }
.hero-search-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0 22px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.hero-search-form button:hover { background: var(--accent-hover); }

/* Category pills */
.hero-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 680px;
  margin: 0 auto;
}
.hero-cats a {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--tag-bg);
  border: 1px solid var(--border);
  color: var(--tag-text);
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 100px;
  transition: all 0.15s;
}
.hero-cats a:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   CATEGORY STRIP
   ============================================================ */
.cat-strip {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
}
.cat-strip-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.cat-strip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: all 0.15s;
  text-decoration: none;
}
.cat-strip-item:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.cat-strip-item:hover .cat-label { color: var(--accent); }
.cat-strip-item .cat-emoji { font-size: 22px; }
.cat-strip-item .cat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  transition: color 0.15s;
}
.cat-strip-item .cat-count { font-size: 11px; color: var(--muted); }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
}
.breadcrumb-wrap {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.breadcrumb-wrap a { color: var(--muted); transition: color 0.15s; }
.breadcrumb-wrap a:hover { color: var(--accent); }
.breadcrumb-wrap .sep { color: var(--border-dark); }
.breadcrumb-wrap .current { color: var(--text); font-weight: 500; }

/* ============================================================
   PAGE LAYOUT (two-column)
   ============================================================ */
.site-main-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}

/* Full-width layout (no sidebar) */
.site-main-wrap.no-sidebar {
  grid-template-columns: 1fr;
  max-width: 780px;
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-head h2 {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-head h2::before {
  content: '';
  display: inline-block;
  width: 4px; height: 18px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}
.section-head a {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.15s;
}
.section-head a:hover { gap: 7px; }

/* ============================================================
   POST CARDS (grid style)
   ============================================================ */
.featured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 40px;
}

.post-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, border-color 0.2s;
  position: relative; /* needed for stretched-link */
}
.post-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-dark);
}

/* Thumbnail wrapper link */
.card-thumb-link {
  display: block;
  text-decoration: none;
  flex-shrink: 0;
}

.card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Fallback thumb colours per category */
.thumb-default   { background: linear-gradient(135deg,#f3f1ee,#e5e2dc); }
.thumb-medical   { background: linear-gradient(135deg,#e8f5e9,#c8e6c9); }
.thumb-coding    { background: linear-gradient(135deg,#e3f2fd,#bbdefb); }
.thumb-education { background: linear-gradient(135deg,#fff8e1,#ffecb3); }
.thumb-science   { background: linear-gradient(135deg,#fce4ec,#f8bbd9); }
.thumb-chatgpt   { background: linear-gradient(135deg,#e8f5e9,#b2dfdb); }
.thumb-claude    { background: linear-gradient(135deg,#f3e5f5,#e1bee7); }
.thumb-gemini    { background: linear-gradient(135deg,#e3f2fd,#e8eaf6); }
.thumb-image     { background: linear-gradient(135deg,#fff3e0,#ffe0b2); }
.thumb-general   { background: linear-gradient(135deg,#f5f5f5,#e0e0e0); }

.card-body {
  padding: 18px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Category tag — above stretched link via z-index */
.card-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 3px 9px;
  border-radius: 4px;
  width: fit-content;
  text-decoration: none;
  position: relative;
  z-index: 2;
}
.card-tag:hover { background: var(--accent); color: #fff; }

/* Title link — stretched to cover whole card */
.card-title {
  font-family: 'Fraunces', serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.3px;
  margin: 0;
}
.card-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}
/* Stretched link covers entire card */
.card-title a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
.post-card:hover .card-title a { color: var(--accent); }

.card-excerpt {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.card-meta .sep { color: var(--border-dark); }

/* ============================================================
   POST LIST (compact feed)
   ============================================================ */
.post-list { display: flex; flex-direction: column; }

.post-list-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.post-list-item:last-child { border-bottom: none; }
.post-list-item:hover .list-title { color: var(--accent); }

.list-thumb {
  width: 76px;
  height: 60px;
  border-radius: 7px;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: var(--surface);
}
.list-thumb img { width: 100%; height: 100%; object-fit: cover; }

.list-content { flex: 1; min-width: 0; }

.list-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

.list-title {
  font-family: 'Fraunces', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  letter-spacing: -0.2px;
  margin-bottom: 4px;
  transition: color 0.15s;
}

.list-meta {
  font-size: 11.5px;
  color: var(--muted);
}

/* ============================================================
   PAGINATION
   WordPress generates:
   <nav class="navigation pagination pagination-wrap">
     <div class="nav-links">
       <a class="prev page-numbers">‹</a>
       <a class="page-numbers">1</a>
       <span class="page-numbers current">2</span>
       <span class="page-numbers dots">…</span>
       <a class="next page-numbers">›</a>
     </div>
   </nav>
   ============================================================ */
.pagination-wrap {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* Nav-links row */
.pagination-wrap .nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Every page-numbers element — both <a> and <span> */
.pagination-wrap .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--body);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  cursor: pointer;
  line-height: 1;
}

/* Links: hover state */
.pagination-wrap a.page-numbers:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* Current page */
.pagination-wrap .page-numbers.current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  cursor: default;
}

/* Dots ellipsis */
.pagination-wrap .page-numbers.dots {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  cursor: default;
  min-width: 24px;
  padding: 0 4px;
}

/* Prev / Next arrows — slightly wider */
.pagination-wrap .prev.page-numbers,
.pagination-wrap .next.page-numbers {
  font-size: 18px;
  padding: 0 14px;
  color: var(--muted);
}
.pagination-wrap .prev.page-numbers:hover,
.pagination-wrap .next.page-numbers:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* Screen reader text — visually hidden */
.pagination-wrap .screen-reader-text,
.pagination-wrap .meta-nav {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Mobile: smaller pagination buttons */
@media (max-width: 480px) {
  .pagination-wrap .page-numbers {
    min-width: 34px;
    height: 34px;
    font-size: 13px;
    padding: 0 10px;
  }
  .pagination-wrap .nav-links { gap: 4px; }
}

/* ============================================================
   SINGLE POST
   ============================================================ */
.single-post-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 40px 24px;
}
.single-post-header-inner {
  max-width: 760px;
  margin: 0 auto;
}

.post-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 14px;
}

.post-title-main {
  font-family: 'Fraunces', serif;
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1.2;
  margin-bottom: 16px;
}

.post-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.post-meta-row .author { font-weight: 500; color: var(--text); }
.post-meta-row .sep { color: var(--border-dark); }

.post-featured-image {
  margin-top: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.post-featured-image img { width: 100%; }

/* Post Content */
.entry-content {
  padding: 36px 0;
  max-width: 720px;
}
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  font-family: 'Fraunces', serif;
  color: var(--text);
  letter-spacing: -0.4px;
  margin: 28px 0 12px;
  line-height: 1.2;
}
.entry-content h2 { font-size: 26px; }
.entry-content h3 { font-size: 20px; }
.entry-content h4 { font-size: 17px; }

.entry-content p {
  margin-bottom: 18px;
  color: var(--body);
  line-height: 1.75;
}

.entry-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.entry-content a:hover { color: var(--accent-hover); }

.entry-content ul,
.entry-content ol {
  margin: 0 0 18px 24px;
  color: var(--body);
  line-height: 1.75;
}
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li { margin-bottom: 6px; }

.entry-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 24px 0;
  background: var(--accent-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--body);
  font-style: italic;
}

.entry-content pre,
.entry-content code {
  font-family: 'DM Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 13px;
}

.entry-content code {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

.entry-content pre {
  background: var(--text);
  color: #e2eaf4;
  padding: 20px 24px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 20px 0;
  line-height: 1.65;
}
.entry-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: #e2eaf4;
}

.entry-content img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 8px 0;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin: 20px 0;
}
.entry-content th,
.entry-content td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
}
.entry-content th {
  background: var(--surface);
  font-weight: 600;
  color: var(--text);
}

/* Prompt block shortcode style */
.prompt-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 24px 0;
}
.prompt-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.prompt-block-head span {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}
.prompt-copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--body);
  cursor: pointer;
  transition: all 0.15s;
}
.prompt-copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.prompt-block pre {
  padding: 18px;
  font-family: 'DM Mono', 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.65;
  color: var(--body);
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--white);
  margin: 0;
  border: none;
  border-radius: 0;
}

/* Tags on single post */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 24px 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.post-tag {
  background: var(--tag-bg);
  border: 1px solid var(--border);
  color: var(--tag-text);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 100px;
  transition: all 0.15s;
}
.post-tag:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* Author box */
.author-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin: 32px 0;
}
.author-avatar img {
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 2px solid var(--border);
}
.author-info h4 {
  font-family: 'Fraunces', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.author-info p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

/* Related posts */
.related-posts { margin: 40px 0; }
.related-posts h3 {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.4px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

/* ============================================================
   COMMENTS
   ============================================================ */
.comments-area {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.comments-title {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 24px;
}
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: none; }

/* Nested comments indent */
.comment .children {
  list-style: none;
  padding-left: 28px;
  margin-top: 8px;
  border-left: 2px solid var(--border);
}

.comment-meta {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.comment-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.comment-meta-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.comment-author-name { font-weight: 600; font-size: 14px; color: var(--text); }
.comment-date { font-size: 12px; color: var(--muted); }
.comment-reply-wrap { margin-left: auto; }
.comment-reply-wrap .comment-reply-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  padding: 4px 10px;
  border: 1px solid rgba(232,80,10,0.3);
  border-radius: 5px;
  transition: all 0.15s;
}
.comment-reply-wrap .comment-reply-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.comment-body p { font-size: 14px; color: var(--body); line-height: 1.65; margin-bottom: 8px; }
.comment-body p:last-child { margin-bottom: 0; }

.comment-respond {
  margin-top: 32px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.comment-reply-title {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}
.comment-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 13px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s;
  margin-bottom: 14px;
}
.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--accent); background: var(--white); }
.comment-form textarea { min-height: 120px; resize: vertical; }
.comment-form input[type="submit"] {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 10px 22px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.comment-form input[type="submit"]:hover { background: var(--accent-hover); }

/* ============================================================
   SIDEBAR / WIDGETS
   ============================================================ */
.sidebar { display: flex; flex-direction: column; gap: 24px; }

.widget-area .widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.widget-area .widget-title {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  font-family: 'Fraunces', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
  margin: 0;
}

.widget-area .widget > *:last-child { padding: 14px 18px; }

/* Category / archive widget */
.widget-area .widget ul li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--body);
  transition: all 0.15s;
}
.widget-area .widget ul li a:hover {
  background: var(--surface);
  color: var(--accent);
}
.widget-area .widget ul li a .post-count {
  font-size: 11px;
  background: var(--tag-bg);
  color: var(--muted);
  padding: 2px 7px;
  border-radius: 100px;
}

/* Tag cloud widget */
.widget_tag_cloud .tagcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 14px 18px;
}
.widget_tag_cloud .tagcloud a {
  background: var(--tag-bg);
  border: 1px solid var(--border);
  color: var(--tag-text);
  font-size: 12px !important;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: 100px;
  transition: all 0.15s;
  text-decoration: none;
}
.widget_tag_cloud .tagcloud a:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* Search widget */
.widget_search .search-form {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
  margin: 0;
}
.widget_search .search-field {
  flex: 1;
  border: none; outline: none;
  padding: 9px 13px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
}
.widget_search .search-submit {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0 14px;
  cursor: pointer;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.15s;
}
.widget_search .search-submit:hover { background: var(--accent-hover); }

/* Recent posts widget */
.widget_recent_entries ul li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.widget_recent_entries ul li:last-child { border-bottom: none; }
.widget_recent_entries ul li a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  display: block;
  margin-bottom: 3px;
  transition: color 0.15s;
  text-decoration: none;
}
.widget_recent_entries ul li a:hover { color: var(--accent); }
.widget_recent_entries ul li .post-date {
  font-size: 11.5px;
  color: var(--muted);
}

/* Newsletter widget (custom) */
.widget-newsletter p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.55;
}
.widget-newsletter input[type="email"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 13px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  margin-bottom: 8px;
  transition: border-color 0.15s;
  display: block;
}
.widget-newsletter input[type="email"]:focus {
  border-color: var(--accent);
  background: var(--white);
}
.widget-newsletter input[type="email"]::placeholder { color: var(--muted); }
.widget-newsletter button {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.widget-newsletter button:hover { background: var(--accent-hover); }

/* Cross-promo widget */
.widget-crosspromo {
  background: var(--accent-light) !important;
  border-color: rgba(232,80,10,0.2) !important;
}
.widget-crosspromo .widget-title {
  border-color: rgba(232,80,10,0.15) !important;
  color: var(--accent) !important;
  font-size: 13px !important;
  letter-spacing: 0.3px;
}
.widget-crosspromo .crosspromo-name {
  font-family: 'Fraunces', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}
.widget-crosspromo .crosspromo-desc {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.5;
}
.widget-crosspromo .crosspromo-btn {
  display: block;
  text-align: center;
  background: var(--accent);
  color: #fff;
  border-radius: 7px;
  padding: 9px;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
  text-decoration: none;
}
.widget-crosspromo .crosspromo-btn:hover { background: var(--accent-hover); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--text);
  color: #fff;
  margin-top: 60px;
}

.footer-widgets {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px 24px 40px;
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand .f-logo {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-brand .f-logo .dot { background: var(--accent); }

.footer-brand p {
  font-size: 13px;
  color: #9a9791;
  line-height: 1.7;
  max-width: 260px;
}

.footer-socials {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}
.footer-socials a {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: #2a2925;
  border-radius: 6px;
  color: #9a9791;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
}
.footer-socials a:hover { background: var(--accent); color: #fff; }

.footer-col h4 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #9a9791;
  margin-bottom: 16px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col ul li a {
  font-size: 13.5px;
  color: #ccc9c2;
  transition: color 0.15s;
  text-decoration: none;
}
.footer-col ul li a:hover { color: #fff; }

.footer-bottom-bar {
  border-top: 1px solid #2a2925;
  padding: 18px 24px;
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: #6b6860;
}
.footer-bottom-bar a { color: var(--accent); text-decoration: none; }

/* ============================================================
   UTILITY
   ============================================================ */
.text-accent { color: var(--accent); }
.new-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 4px;
}

/* ============================================================
   SEARCH RESULTS PAGE
   ============================================================ */
.search-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
}
.search-header h1 {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.search-header p { font-size: 14px; color: var(--muted); }

.no-results {
  text-align: center;
  padding: 60px 24px;
  color: var(--muted);
}
.no-results h2 {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  color: var(--text);
  margin-bottom: 8px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ── Tablet landscape: 960px–1160px ── */
@media (max-width: 1100px) {
  .nav-wrap { gap: 12px; }
  .nav-search-form { width: 150px; }
  .nav-search-form:focus-within { width: 180px; }
  .primary-nav > ul li a { padding: 5px 9px; font-size: 13px; }
}

/* ── Tablet portrait: hide sidebar into bottom section ── */
@media (max-width: 960px) {
  .site-main-wrap {
    grid-template-columns: 1fr;
  }
  /* Show sidebar below content on tablet instead of hiding */
  .sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .featured-grid { grid-template-columns: 1fr 1fr; }
  .footer-widgets { grid-template-columns: 1fr 1fr; }
  .related-grid { grid-template-columns: 1fr 1fr; }

  /* Nav: hide search on tablet to save space */
  .nav-search-form { display: none; }
}

/* ── Mobile: 680px and below ── */
@media (max-width: 680px) {
  /* Nav: hide desktop items, show toggle */
  .primary-nav { display: none; }
  .nav-search-form { display: none; }
  .nav-cta { display: none; }
  .menu-toggle { display: flex; }

  /* Layout */
  .featured-grid { grid-template-columns: 1fr; }
  .footer-widgets { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: 1fr; display: flex; }

  /* Typography */
  .hero-title { font-size: 28px; letter-spacing: -1px; }
  .hero-desc { font-size: 15px; }
  .site-hero { padding: 36px 20px 32px; }

  /* Breadcrumb */
  .breadcrumb-bar { padding: 8px 16px; }

  /* Page layout padding */
  .site-main-wrap { padding: 24px 16px; }
  section { padding: 24px 16px; }

  /* Single post */
  .single-post-header { padding: 24px 16px; }
  .entry-content { padding: 24px 0; }

  /* Footer */
  .footer-widgets { padding: 32px 16px 24px; }
  .footer-bottom-bar { padding: 16px; flex-direction: column; text-align: center; gap: 6px; }

  /* ── MOBILE MENU (fullscreen drawer) ── */
  .primary-nav.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--white);
    z-index: 500;
    padding: 0;
    overflow-y: auto;
  }

  /* Mobile menu inner scroll area */
  .primary-nav.is-open > ul {
    display: flex !important;
    flex-direction: column;
    gap: 0;
    list-style: none;
    padding: 72px 0 24px;
    margin: 0;
    width: 100%;
  }

  .primary-nav.is-open > ul > li > a {
    display: block;
    font-size: 17px;
    font-weight: 500;
    color: var(--text);
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    transition: background 0.15s;
  }

  .primary-nav.is-open > ul > li > a:hover,
  .primary-nav.is-open > ul > li.current-menu-item > a {
    background: var(--accent-light);
    color: var(--accent);
  }

  /* Mobile sub-menu */
  .primary-nav.is-open > ul > li > ul {
    display: block !important;
    position: static;
    box-shadow: none;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    padding: 0;
  }
  .primary-nav.is-open > ul > li > ul > li > a {
    font-size: 15px;
    padding: 10px 24px 10px 36px;
    color: var(--muted);
    display: block;
    border-bottom: 1px solid var(--border);
  }

  /* Mobile menu close button */
  .mobile-menu-close {
    display: flex;
    position: absolute;
    top: 14px;
    right: 16px;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    color: var(--text);
    z-index: 501;
    transition: all 0.15s;
  }
  .mobile-menu-close:hover { background: var(--accent-light); color: var(--accent); }

  /* Mobile menu header (logo inside drawer) */
  .mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 62px;
    border-bottom: 1px solid var(--border);
    position: absolute;
    top: 0; left: 0; right: 0;
    background: var(--white);
    z-index: 502;
  }

  /* Mobile search inside drawer */
  .mobile-menu-search {
    display: flex !important;
    margin: 0 16px 8px;
  }

  /* Cat strip */
  .cat-strip-inner {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  .cat-strip-item { padding: 10px 8px; }
  .cat-strip-item .cat-emoji { font-size: 18px; }
  .cat-strip-item .cat-label { font-size: 11px; }
  .cat-strip-item .cat-count { display: none; }
}

/* ── Small mobile: 420px and below ── */
@media (max-width: 420px) {
  .nav-wrap { padding: 0 12px; gap: 8px; }
  .site-title { font-size: 18px; }

  /* Hero search stacks */
  .hero-search-form {
    flex-direction: column;
    border-radius: var(--radius);
    overflow: hidden;
  }
  .hero-search-form input {
    padding: 13px 16px;
    font-size: 14px;
  }
  .hero-search-form button {
    padding: 12px;
    border-radius: 0;
    width: 100%;
    font-size: 14px;
  }

  /* Hero cats: 2 per row */
  .hero-cats a { font-size: 12px; padding: 5px 11px; }

  /* Cat strip: 3 per row */
  .cat-strip-inner { grid-template-columns: repeat(3, 1fr); }

  /* Post list thumb */
  .list-thumb { width: 60px; height: 48px; }

  /* Prompt block */
  .pb-head-left { gap: 6px; }
  .pb-format-btn { display: none; } /* hide format on very small screens */

  /* Footer */
  .site-footer { margin-top: 40px; }

  /* Subscribe popup: full width */
  .sub-popup { padding: 28px 18px 20px; }
  .sub-popup-title { font-size: 18px; }
}

/* ============================================================
   PROMPT BLOCK — enhanced with Prism + copy + format
   ============================================================ */
.prompt-block {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 24px 0;
    background: var(--white);
    font-family: 'DM Sans', sans-serif;
}

.prompt-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #1e2430;
    border-bottom: 1px solid #2d3748;
    gap: 10px;
    flex-wrap: wrap;
}

.pb-head-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.pb-dots {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}
.pb-dots span {
    width: 9px; height: 9px;
    border-radius: 50%;
    display: block;
}
.pb-dots span:nth-child(1) { background: #ff5f57; }
.pb-dots span:nth-child(2) { background: #febc2e; }
.pb-dots span:nth-child(3) { background: #28c840; }

.pb-title {
    font-size: 12px;
    font-weight: 600;
    color: #9aa5b4;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pb-ai-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
}

.pb-head-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.pb-copy-btn,
.pb-format-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #2d3748;
    border: 1px solid #3d4f63;
    border-radius: 5px;
    padding: 5px 11px;
    font-family: 'DM Sans', sans-serif;
    font-size: 11.5px;
    font-weight: 500;
    color: #9aa5b4;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.pb-copy-btn:hover   { background: #3d4f63; color: #e2eaf4; border-color: #4a6080; }
.pb-format-btn:hover { background: #3d4f63; color: #e2eaf4; border-color: #4a6080; }
.pb-copy-btn.copied  { background: #1a3a2a; color: #28c840; border-color: #28c840; }

/* Override Prism tomorrow theme inside our block */
.pb-body {
    background: #1e2430;
    overflow-x: auto;
}

.pb-pre {
    margin: 0 !important;
    padding: 20px 22px !important;
    background: #1e2430 !important;
    border: none !important;
    border-radius: 0 !important;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace !important;
    font-size: 13px !important;
    line-height: 1.7 !important;
    overflow-x: auto !important;
    tab-size: 2;
}

.pb-pre code {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    font-size: inherit !important;
    color: inherit !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
}

/* Plain (no language) prompt text colour */
.pb-pre:not([class*="language-"]),
.pb-pre:not([class*="language-"]) code {
    color: #c9d1d9 !important;
}

.pb-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    padding: 6px 14px;
    background: #181f2a;
    border-top: 1px solid #2d3748;
}

.pb-line-count,
.pb-char-count {
    font-size: 10.5px;
    color: #4a6080;
    font-family: 'JetBrains Mono', monospace;
}

/* ============================================================
   DEMO SECTION — single post output preview
   ============================================================ */
.demo-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 32px 0;
}

.demo-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.demo-section-head h3 {
    font-family: 'Fraunces', serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.demo-caption {
    font-size: 12px;
    color: var(--muted);
    font-style: italic;
    background: var(--tag-bg);
    border: 1px solid var(--border);
    padding: 3px 10px;
    border-radius: 4px;
}

.demo-body { padding: 20px; }

/* Image demo */
.demo-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: block;
    cursor: zoom-in;
    transition: transform 0.2s;
}
.demo-image:hover { transform: scale(1.01); }

/* PDF demo */
.demo-pdf-wrap { position: relative; }
.demo-pdf-iframe {
    width: 100%;
    height: 560px;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: block;
}
.demo-pdf-download {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    background: var(--accent-light);
    border: 1px solid rgba(232,80,10,0.2);
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
    padding: 7px 16px;
    border-radius: 7px;
    text-decoration: none;
    transition: background 0.15s;
}
.demo-pdf-download:hover { background: var(--accent); color: #fff; }

/* Video demo */
.demo-video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
    border: 1px solid var(--border);
}
.demo-video-embed iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
    border-radius: 8px;
}

/* Markdown demo */
.demo-md-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.demo-md-toolbar span {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--muted);
}
.demo-md-raw-btn {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-light);
    border: 1px solid rgba(232,80,10,0.2);
    border-radius: 5px;
    padding: 4px 12px;
    cursor: pointer;
    transition: all 0.15s;
}
.demo-md-raw-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Rendered markdown content styles */
.demo-md-rendered h1, .demo-md-rendered h2,
.demo-md-rendered h3, .demo-md-rendered h4 {
    font-family: 'Fraunces', serif;
    color: var(--text);
    letter-spacing: -0.3px;
    line-height: 1.25;
    margin: 20px 0 10px;
}
.demo-md-rendered h1 { font-size: 22px; }
.demo-md-rendered h2 { font-size: 18px; }
.demo-md-rendered h3 { font-size: 15px; }
.demo-md-rendered p  { font-size: 14px; color: var(--body); line-height: 1.7; margin-bottom: 12px; }
.demo-md-rendered ul, .demo-md-rendered ol { padding-left: 22px; margin-bottom: 12px; }
.demo-md-rendered li { font-size: 14px; color: var(--body); line-height: 1.65; margin-bottom: 5px; }
.demo-md-rendered ul { list-style: disc; }
.demo-md-rendered ol { list-style: decimal; }
.demo-md-rendered strong { font-weight: 600; color: var(--text); }
.demo-md-rendered em { font-style: italic; }
.demo-md-rendered a  { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.demo-md-rendered code {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12.5px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
}
.demo-md-rendered pre {
    background: #1e2430;
    color: #c9d1d9;
    padding: 14px 18px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 12.5px;
    line-height: 1.65;
    margin: 14px 0;
}
.demo-md-rendered pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}
.demo-md-rendered blockquote {
    border-left: 3px solid var(--accent);
    padding: 10px 16px;
    background: var(--accent-light);
    border-radius: 0 6px 6px 0;
    margin: 14px 0;
    font-style: italic;
    color: var(--body);
}
.demo-md-rendered table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 14px 0;
}
.demo-md-rendered th,
.demo-md-rendered td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
}
.demo-md-rendered th {
    background: var(--surface);
    font-weight: 600;
    color: var(--text);
}
.demo-md-rendered hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* Raw markdown pre */
.demo-md-raw {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--body);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Lightbox for demo image */
.demo-lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    padding: 20px;
}
.demo-lightbox-overlay.open { display: flex; }
.demo-lightbox-overlay img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    cursor: default;
}
.demo-lightbox-close {
    position: fixed;
    top: 20px; right: 24px;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    background: rgba(0,0,0,0.4);
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.demo-lightbox-close:hover { background: rgba(255,255,255,0.15); }

/* ============================================================
   SUBSCRIBE WIDGET
   ============================================================ */
.subscribe-widget {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
}

.subscribe-widget-title {
    padding: 13px 18px !important;
    border-bottom: 1px solid var(--border) !important;
    font-family: 'Fraunces', serif !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--text) !important;
    letter-spacing: -0.2px !important;
    margin: 0 !important;
}

.subscribe-widget-body {
    padding: 16px 18px 18px;
}

.subscribe-widget-desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.55;
    margin-bottom: 14px;
}

/* Recent posts in subscribe widget */
.subscribe-recent-posts {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.sub-recent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    transition: opacity 0.15s;
}
.sub-recent-item:last-child { border-bottom: none; }
.sub-recent-item:hover { opacity: 0.8; }

.sub-recent-thumb {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    overflow: hidden;
    background: var(--surface);
}
.sub-recent-thumb img { width: 100%; height: 100%; object-fit: cover; }

.sub-recent-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sub-recent-title {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sub-recent-date {
    font-size: 11px;
    color: var(--muted);
}

/* Subscribe form */
.subscribe-form { }

.subscribe-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subscribe-email-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 9px 13px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.subscribe-email-input:focus {
    border-color: var(--accent);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(232,80,10,0.1);
}
.subscribe-email-input::placeholder { color: var(--muted); }

.subscribe-submit-btn {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    letter-spacing: 0.2px;
}
.subscribe-submit-btn:hover   { background: var(--accent-hover); }
.subscribe-submit-btn:active  { transform: scale(0.98); }
.subscribe-submit-btn:disabled{
    background: #ccc;
    cursor: not-allowed;
}

.subscribe-message {
    margin-top: 8px;
    font-size: 12.5px;
    line-height: 1.5;
    min-height: 0;
    border-radius: 6px;
    padding: 0;
    transition: all 0.2s;
}
.subscribe-message.success {
    color: #28a745;
    background: #f0fff4;
    border: 1px solid #c3e6cb;
    padding: 8px 12px;
}
.subscribe-message.error {
    color: #c0392b;
    background: #fff5f5;
    border: 1px solid #f5c6cb;
    padding: 8px 12px;
}

.subscribe-privacy {
    font-size: 11px;
    color: var(--muted);
    margin: 8px 0 0;
    text-align: center;
}

/* ============================================================
   SUBSCRIBE POPUP
   ============================================================ */
.sub-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26,25,22,0.7);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.sub-popup-overlay.open { display: flex; }

.sub-popup {
    background: var(--white);
    border-radius: 20px;
    padding: 40px 36px 32px;
    max-width: 460px;
    width: 100%;
    position: relative;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0,0,0,0.22);
    animation: popupSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    border-top: 4px solid var(--accent);
}

@keyframes popupSlideIn {
    from { opacity: 0; transform: scale(0.88) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.sub-popup-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    color: var(--muted);
    transition: all 0.15s;
    line-height: 1;
}
.sub-popup-close:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

.sub-popup-icon {
    font-size: 42px;
    margin-bottom: 14px;
    animation: bounceIn 0.6s 0.3s both;
}

@keyframes bounceIn {
    from { opacity: 0; transform: scale(0.5) rotate(-10deg); }
    to   { opacity: 1; transform: scale(1) rotate(0); }
}

.sub-popup-title {
    font-family: 'Fraunces', serif;
    font-size: clamp(20px, 3vw, 26px);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin-bottom: 10px;
}

.sub-popup-desc {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 18px;
}

/* Social proof */
.sub-popup-proof {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 10px 16px;
    background: var(--surface);
    border-radius: 100px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}
.proof-avatars {
    display: flex;
    gap: -4px;
}
.proof-avatars span {
    font-size: 16px;
    display: inline-block;
    margin-left: -4px;
}
.proof-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
}

.sub-popup-email {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    margin-bottom: 10px;
    box-sizing: border-box;
    text-align: center;
}
.sub-popup-email:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(232,80,10,0.12);
}
.sub-popup-email::placeholder { color: var(--muted); }

.sub-popup-btn {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 13px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    letter-spacing: 0.2px;
    margin-bottom: 10px;
}
.sub-popup-btn:hover  { background: var(--accent-hover); }
.sub-popup-btn:active { transform: scale(0.98); }
.sub-popup-btn:disabled { background: #28a745; cursor: default; }

.sub-popup-privacy {
    font-size: 11.5px;
    color: var(--muted);
    margin: 6px 0 14px;
}

.sub-popup-skip {
    display: block;
    width: 100%;
    background: none;
    border: none;
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    transition: color 0.15s;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.sub-popup-skip:hover { color: var(--text); }

/* ── Confirmed banner ── */
.sub-confirmed-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #28a745;
    color: #fff;
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    z-index: 8999;
    box-shadow: 0 8px 30px rgba(40,167,69,0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    animation: slideUpBanner 0.4s ease both;
}
@keyframes slideUpBanner {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.sub-confirmed-close {
    background: rgba(255,255,255,0.25);
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    color: #fff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Mobile popup ── */
@media (max-width: 480px) {
    .sub-popup {
        padding: 32px 22px 24px;
        border-radius: 16px 16px 0 0;
        position: fixed;
        bottom: 0;
        left: 0; right: 0;
        max-width: 100%;
        margin: 0;
        animation: slideUpPopup 0.3s ease both;
    }
    .sub-popup-overlay { align-items: flex-end; padding: 0; }
    @keyframes slideUpPopup {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
    .sub-confirmed-banner {
        white-space: normal;
        text-align: center;
        width: calc(100% - 40px);
    }
}

/* ============================================================
   MOBILE SUB-MENU TOGGLE
   ============================================================ */
@media (max-width: 680px) {
  /* Hide sub-menus by default on mobile */
  .primary-nav.is-open > ul > li > ul {
    display: none !important;
  }
  .primary-nav.is-open > ul > li.mobile-sub-open > ul {
    display: block !important;
  }
  /* Arrow indicator for items with children */
  .primary-nav.is-open > ul > li:has(ul) > a::after {
    content: ' ▸';
    font-size: 11px;
    color: var(--muted);
    float: right;
    margin-top: 2px;
    transition: transform 0.2s;
  }
  .primary-nav.is-open > ul > li.mobile-sub-open > a::after {
    content: ' ▾';
    color: var(--accent);
  }

  /* Mobile menu search bar spacing */
  .mobile-menu-search {
    display: flex !important;
    width: calc(100% - 32px);
    margin: 8px 16px;
    min-width: 0;
  }
}

/* ============================================================
   ADDITIONAL RESPONSIVE FIXES
   ============================================================ */

/* Prevent table overflow on mobile */
@media (max-width: 680px) {
  .entry-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
    font-size: 12.5px;
  }

  /* Prompt block: scroll horizontally */
  .pb-pre {
    font-size: 12px !important;
  }

  /* Demo PDF: reduce height on mobile */
  .demo-pdf-iframe { height: 380px; }

  /* Post card: smaller on mobile */
  .card-title { font-size: 15px; }

  /* Section headings */
  .section-head h2 { font-size: 17px; }

  /* Author box */
  .author-box { flex-direction: column; gap: 12px; }

  /* Comment form: full width labels */
  .comment-form input[type="text"],
  .comment-form input[type="email"] {
    font-size: 16px; /* prevent iOS zoom */
  }
  .comment-form textarea { font-size: 16px; }

  /* Subscribe widget input: prevent iOS zoom */
  .subscribe-email-input { font-size: 16px; }
  .sub-popup-email { font-size: 16px; }
}

/* ============================================================
   IMAGES: prevent overflow everywhere
   ============================================================ */
img, video, iframe, embed, object {
  max-width: 100%;
}

/* ============================================================
   TOUCH: improve tap targets
   ============================================================ */
@media (hover: none) and (pointer: coarse) {
  .nav-links a,
  .primary-nav ul li a,
  .cat-item,
  .post-list-item,
  .page-btn,
  .pb-copy-btn,
  .pb-format-btn {
    min-height: 44px;
  }
  .hero-cats a { padding: 8px 14px; }
  .cat-strip-item { padding: 14px 8px; }
}
