/*
Theme Name: HTC Blog
Theme URI: https://blog.helptochoose.com
Author: Help To Choose
Description: Editorial theme for blog.helptochoose.com. Design tokens are taken from the
  marketing site (home-v3.css) so the blog reads as the same brand.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: htc-blog
Tags: blog, three-columns, custom-menu, featured-images, translation-ready
*/

/* ---------------------------------------------------------------- Tokens */

:root {
  --color-bg: #ffffff;
  --color-text: #000000;
  --color-muted: #666666;
  --color-nav: #4b4b4b;
  --color-nav-active: #0a0a0a;
  --color-muted-light: #8a8a8a;
  --color-accent: #c6ff00;
  --color-accent-hover: #b8eb00;
  --color-accent-deep: #cdfe00;
  --color-dark: #232a2f;
  --color-darker: #0a1217;
  --color-olive: #455910;
  --color-mint: #e8f7c8;
  --color-border: #e8e8e8;
  --color-card-border: #e2e8f0;
  --color-card-eyebrow: #6b7280;
  --color-card-body: #4b5563;
  --color-surface: #f7f8f7;

  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;

  --text-display: clamp(40px, 5.2vw, 64px);
  --text-h2: clamp(28px, 3.4vw, 40px);
  --text-h3: clamp(20px, 2.2vw, 24px);
  --text-body-lg: clamp(15px, 1.4vw, 17px);
  --text-body: 16px;
  --text-body-sm: 15px;
  --text-ui: 14px;
  --text-card-label: 13px;
  --text-legal: 12px;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --layout-max: 1200px;
  --article-max: 1120px;
  --reading-max: 680px;
  --toc-width: 200px;
  --share-rail-width: 44px;
  --container-pad: clamp(20px, 5vw, 48px);
  --section-space: clamp(56px, 8vw, 104px);

  --radius-pill: 9999px;
  --radius-card: 24px;
  --radius-media: 16px;
  --radius-cta: 40px;

  --header-height: 72px;
}

/* ------------------------------------------------------------- Elements */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  background: none;
  border: none;
}

figure {
  margin: 0;
}

ul[role="list"] {
  list-style: none;
  margin: 0;
  padding: 0;
}

ul[role="list"].blog-menu__list,
ul.blog-menu__list {
  margin: 0;
  padding: 12px;
  list-style: none;
  border: 1px solid var(--color-card-border);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(10, 18, 23, 0.12);
  box-sizing: border-box;
  overflow: hidden;
}

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

/* -------------------------------------------------------------- Helpers */

.container {
  width: 100%;
  max-width: var(--layout-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
  box-sizing: border-box;
}

.container--reading {
  width: 100%;
  max-width: var(--layout-max);
  padding-inline: var(--container-pad);
  box-sizing: border-box;
}

.container--article {
  width: 100%;
  max-width: var(--article-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
  box-sizing: border-box;
}

.screen-reader-text,
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: auto;
  height: auto;
  clip: auto;
  padding: 12px 20px;
  background: var(--color-accent);
  border-radius: 8px;
  font-weight: var(--weight-semibold);
}

/* -------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 28px;
  border-radius: var(--radius-pill);
  font-size: var(--text-body-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn--accent {
  background: var(--color-accent);
  color: var(--color-text);
  border: 1px solid var(--color-accent);
}

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

.btn--outline {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-text);
}

.btn--outline:hover {
  background: var(--color-text);
  color: var(--color-bg);
}

.btn--dark {
  background: var(--color-dark);
  color: #ffffff;
  border: 1px solid var(--color-dark);
}

.btn--dark:hover {
  background: #2f383f;
  border-color: #2f383f;
}

/* --------------------------------------------------------------- Header */

.header {
  position: sticky;
  top: 0;
  z-index: 300;
  overflow: visible;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid transparent;
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.header.is-scrolled {
  border-bottom-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(20px) saturate(1.55);
  -webkit-backdrop-filter: blur(20px) saturate(1.55);
}

.header__inner {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 24px 40px;
  min-height: var(--header-height);
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--color-text);
}

.logo__suffix {
  font-family: var(--font-sans);
  font-size: var(--text-card-label);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-olive);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px 40px;
  min-width: 0;
  overflow: visible;
}

.nav__list {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 8px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: visible;
}

.nav__list > li > a,
.nav__list > li > .nav__dropdown > .nav__link,
.nav__link {
  font-size: var(--text-ui);
  text-decoration: none;
  color: var(--color-nav);
  transition: color 0.2s ease;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.nav__list > li > a:hover,
.nav__link:hover,
.nav__list .current-menu-item > a,
.nav__list .is-active,
.nav__item--dropdown.is-open .nav__link--trigger {
  color: var(--color-nav-active);
  font-weight: var(--weight-semibold);
}

.nav__link--trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nav__chevron {
  transition: transform 0.2s ease;
}

.nav__item--dropdown.is-open .nav__chevron {
  transform: rotate(180deg);
}

.nav__item--dropdown {
  position: static;
  overflow: visible;
}

.nav__dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Blog dropdown — flush under the Blog label, no floating gap */

.blog-menu {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  z-index: 320;
  width: 300px;
  margin-top: 0;
  padding-top: 6px;
  border: none;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.blog-menu::before {
  display: none;
}

.blog-menu[hidden] {
  display: none;
}

.blog-menu__list > li + li {
  margin-top: 4px;
}

.blog-menu__list .blog-menu__item,
.blog-menu__list a.blog-menu__item,
.blog-menu__list span.blog-menu__item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: var(--weight-semibold);
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
  color: var(--color-text);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.blog-menu__list .blog-menu__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--color-mint);
  color: var(--color-olive);
  opacity: 1;
  overflow: hidden;
}

.blog-menu__list .blog-menu__label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: var(--weight-semibold);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: inherit;
}

.blog-menu__list .blog-menu__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-left: auto;
  color: var(--color-muted-light);
  transition: color 0.15s ease, transform 0.15s ease;
}

.blog-menu__list a.blog-menu__item {
  cursor: pointer;
}

.blog-menu__list a.blog-menu__item:hover {
  background: var(--color-mint);
  color: var(--color-olive);
  text-decoration: none;
  font-weight: var(--weight-semibold);
}

.blog-menu__list a.blog-menu__item:hover .blog-menu__icon {
  background: var(--color-accent);
  color: #000000;
}

.blog-menu__list a.blog-menu__item:hover .blog-menu__arrow {
  color: var(--color-olive);
  transform: translateX(2px);
}

.blog-menu__list .blog-menu__item--disabled {
  color: var(--color-muted);
  cursor: default;
  pointer-events: none;
}

.blog-menu__list .blog-menu__item--disabled .blog-menu__label {
  color: var(--color-muted);
}

.blog-menu__list .blog-menu__item--disabled .blog-menu__icon {
  background: var(--color-mint);
  color: var(--color-olive);
}

.nav__item--dropdown.is-open .nav__link--trigger {
  color: var(--color-nav-active);
}

.header__cta {
  min-height: 38px;
  padding-inline: 20px;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  justify-self: end;
}

.nav-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  margin-inline: auto;
  background: var(--color-text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav__search-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--color-nav);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav__search-link:hover {
  background: var(--color-surface);
  color: var(--color-text);
}

.nav__search-label {
  display: none;
  font-size: var(--text-body);
}

/* The admin toolbar is fixed over the top of the page for logged-in users, so
   anything else pinned to the viewport has to start below it. */
body.admin-bar .header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar .header {
    top: 46px;
  }
}

.nav-close {
  display: none;
  align-self: flex-end;
  padding: 8px;
  color: var(--color-text);
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(10, 18, 23, 0.45);
}

body.has-drawer-open {
  overflow: hidden;
}

@media (min-width: 1024px) {
  .nav__list {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 1023px) {
  .header__inner {
    grid-template-columns: 1fr auto;
  }

  .nav-toggle {
    display: flex;
  }

  /* Slide-in drawer */
  .nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    width: min(360px, 86vw);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    padding: 20px 24px 32px;
    overflow-y: auto;
    background: #ffffff;
    box-shadow: -20px 0 60px rgba(10, 18, 23, 0.12);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.28s ease, visibility 0.28s ease;
  }

  .nav.is-open {
    transform: translateX(0);
    visibility: visible;
  }

  .nav-close {
    display: block;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav__list > li {
    border-bottom: 1px solid var(--color-border);
  }

  .nav__list a,
  .nav__link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 14px 0;
    font-size: var(--text-body);
    text-align: left;
  }

  .nav__item--dropdown {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }

  .nav__dropdown {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }

  .nav__item--dropdown .nav__link--trigger {
    flex: 1;
  }

  .blog-menu {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    z-index: auto;
    width: 100%;
    min-width: 0;
    margin: 0 0 12px;
    padding-top: 0;
    transform: none;
  }

  .blog-menu[hidden] {
    display: none;
  }

  .nav__item--dropdown.is-open .blog-menu {
    display: block;
  }

  ul.blog-menu__list,
  ul[role="list"].blog-menu__list {
    padding: 16px;
    border: none;
    border-radius: 16px;
    background: var(--color-surface);
    box-shadow: none;
  }

  .blog-menu__list .blog-menu__item,
  .blog-menu__list a.blog-menu__item,
  .blog-menu__list span.blog-menu__item {
    padding: 12px 14px;
  }

  .blog-menu__list .blog-menu__icon {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
    border-radius: 11px;
  }

  .nav__actions {
    margin-top: 24px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .nav__actions .nav__search-link {
    order: -1;
  }

  body.admin-bar .nav {
    top: 32px;
  }

  .nav__search-link {
    width: auto;
    justify-content: flex-start;
    gap: 10px;
    padding: 12px 0;
  }

  .nav__search-label {
    display: inline;
  }
}

/* Below this width the admin toolbar is taller, so the drawer starts lower. */
@media screen and (max-width: 782px) {
  body.admin-bar .nav {
    top: 46px;
  }
}

/* ----------------------------------------------------------- Page hero */

.page-hero {
  padding-block: clamp(48px, 7vw, 80px) clamp(28px, 3.5vw, 44px);
  text-align: center;
}

.page-hero__eyebrow {
  display: inline-block;
  margin: 0 0 20px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: var(--color-mint);
  font-size: var(--text-card-label);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-olive);
}

.page-hero__title {
  margin: 0 auto 20px;
  max-width: 16ch;
  font-family: var(--font-serif);
  font-size: var(--text-display);
  font-weight: var(--weight-bold);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.page-hero__lead {
  margin: 0 auto;
  max-width: 54ch;
  font-size: var(--text-body-lg);
  line-height: 1.55;
  color: var(--color-muted);
}

.page-hero__search {
  margin-top: 28px;
  max-width: 420px;
  margin-inline: auto;
}

/* -------------------------------------------------------------- Filters */

.filters {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  justify-content: safe center;
  gap: 10px;
  width: 100%;
  margin: 28px 0 0;
  padding: 4px 2px 8px;
  list-style: none;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filters::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.filters > li {
  flex: 0 0 auto;
}

.filters__link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-pill);
  font-size: var(--text-ui);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  text-decoration: none;
  color: var(--color-card-body);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.filters__link:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

.filters__link.is-active {
  background: var(--color-text);
  border-color: var(--color-text);
  color: #ffffff;
}

/* --------------------------------------------------------------- Chips */

.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-mint);
  font-size: var(--text-card-label);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--color-olive);
  white-space: nowrap;
}

a.chip:hover {
  background: var(--color-accent);
  color: var(--color-text);
}

.meta-dot {
  color: var(--color-muted-light);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--text-ui);
  color: var(--color-muted);
}

/* ------------------------------------------------------------- Featured */

.featured {
  padding-block: clamp(8px, 2vw, 16px) var(--section-space);
}

.featured__card {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: stretch;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-card);
  background: #ffffff;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.featured__card:hover {
  box-shadow: 0 18px 48px rgba(10, 18, 23, 0.08);
  transform: translateY(-2px);
}

.featured__media {
  position: relative;
  min-height: 320px;
  overflow: hidden;
}

.featured__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* WP 6.7+ auto-sizes sets a huge contain-intrinsic-size and opens a white gap. */
  contain-intrinsic-size: auto none;
}

.featured__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: clamp(28px, 4vw, 48px);
}

.featured__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: var(--weight-bold);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.featured__title a {
  text-decoration: none;
}

.featured__title a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.featured__card .chip {
  position: relative;
  z-index: 2;
}

.featured__title a:hover {
  color: var(--color-olive);
}

.featured__excerpt {
  margin: 0;
  font-size: var(--text-body-lg);
  color: var(--color-card-body);
}

.featured__link {
  margin-top: 8px;
}

@media (max-width: 899px) {
  .featured__card {
    grid-template-columns: 1fr;
  }

  .featured__media {
    min-height: 220px;
  }
}

/* --------------------------------------------------------- Section head */

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: clamp(24px, 3vw, 40px);
}

.section-head__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--text-h2);
  font-weight: var(--weight-bold);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.section-head__lead {
  margin: 0;
  max-width: 52ch;
  font-size: var(--text-body-sm);
  color: var(--color-muted);
}

/* ---------------------------------------------------------------- Cards */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 2.4vw, 32px);
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
}

@media (max-width: 1023px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 639px) {
  .card-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-card);
  background: #ffffff;
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  border-color: #d6dee8;
  box-shadow: 0 16px 40px rgba(10, 18, 23, 0.08);
  transform: translateY(-3px);
}

.card__media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-surface);
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  contain-intrinsic-size: auto none;
}

.card:hover .card__media img {
  transform: scale(1.03);
}

.card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 24px;
}

.card__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--text-h3);
  font-weight: var(--weight-bold);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.card__title a {
  text-decoration: none;
}

/* Stretch the title link so the whole card is clickable. */
.card__title a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.card .chip {
  position: relative;
  z-index: 2;
}

.card__title a:hover {
  color: var(--color-olive);
}

.card__excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  margin: 0;
  font-size: var(--text-body-sm);
  color: var(--color-card-body);
}

.card__link {
  margin-top: auto;
  padding-top: 8px;
  font-size: var(--text-ui);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}

/* Placeholder art for posts without a featured image. */

.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--font-serif);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: var(--weight-bold);
  letter-spacing: -0.03em;
}

.placeholder--1 {
  background: linear-gradient(135deg, #0a1217 0%, #2f383f 100%);
  color: var(--color-accent-deep);
}

.placeholder--2 {
  background: linear-gradient(135deg, #c6ff00 0%, #e8f7c8 100%);
  color: #0a1217;
}

.placeholder--3 {
  background: linear-gradient(135deg, #e8f7c8 0%, #ffffff 100%);
  color: var(--color-olive);
}

.placeholder--4 {
  background: linear-gradient(135deg, #455910 0%, #c6ff00 100%);
  color: #ffffff;
}

.placeholder--5 {
  background: linear-gradient(135deg, #232a2f 0%, #455910 100%);
  color: var(--color-accent);
}

.placeholder--6 {
  background: linear-gradient(135deg, #e4eff7 0%, #ffffff 100%);
  color: var(--color-dark);
}

/* --------------------------------------------------------- Posts region */

.posts {
  padding-bottom: clamp(24px, 3vw, 40px);
}

.empty {
  padding: clamp(40px, 6vw, 72px);
  border: 1px dashed var(--color-card-border);
  border-radius: var(--radius-card);
  text-align: left;
  color: var(--color-muted);
}

/* ----------------------------------------------------------- Pagination */

.pagination {
  display: flex;
  justify-content: center;
  margin-top: clamp(32px, 4vw, 56px);
}

.pagination ul.page-numbers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-pill);
  background: #ffffff;
}

.pagination ul.page-numbers > li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pagination a.page-numbers,
.pagination span.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 14px;
  border: none;
  border-radius: var(--radius-pill);
  font-size: var(--text-ui);
  font-weight: var(--weight-medium);
  line-height: 1;
  text-decoration: none;
  color: var(--color-card-body);
  background: transparent;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pagination a.page-numbers:hover {
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
}

.pagination span.page-numbers.current {
  background: var(--color-text);
  color: #ffffff;
  font-weight: var(--weight-semibold);
}

.pagination span.page-numbers.dots {
  min-width: 28px;
  padding: 0 4px;
  color: var(--color-muted-light);
}

.pagination a.prev,
.pagination a.next,
.pagination span.prev,
.pagination span.next {
  padding-inline: 16px;
}

/* ----------------------------------------------------------- Single post */

/* Single/page article only — not related/home cards (WP also adds .post via post_class). */
.single article.post:not(.card):not(.featured__card),
.page article.post:not(.card):not(.featured__card) {
  padding-top: clamp(28px, 4vw, 48px);
}

.post-hero {
  padding-block: 0 28px;
  text-align: left;
}

.post-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 0 0 20px;
  font-size: var(--text-ui);
  color: var(--color-muted);
  line-height: 1.4;
}

.post-hero__meta .chip {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
}

.post-hero__author {
  color: var(--color-muted);
}

.post-hero__author strong {
  color: var(--color-text);
  font-weight: var(--weight-semibold);
}

.post-hero__category {
  color: var(--color-olive);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}

.post-hero__category:hover {
  color: var(--color-text);
  text-decoration: none;
}

.post-hero__sep {
  color: var(--color-muted-light);
}

.post-hero__title {
  margin: 0 0 12px;
  max-width: none;
  font-family: var(--font-sans);
  font-size: clamp(28px, 3.8vw, 42px);
  font-weight: var(--weight-bold);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.post-hero__lead {
  margin: 0 0 16px;
  max-width: none;
  font-size: var(--text-body-lg);
  color: var(--color-muted);
}

/* Quiz Kit–style framed images: thin border + offset shadow. */

.post__media {
  margin: 0 0 32px;
  overflow: visible;
  border-radius: 0;
  padding: 0 8px 8px 0;
}

.post__media img,
.post__content img,
.post__content .wp-block-image img,
.post__content figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1.5px solid var(--color-darker);
  border-radius: 2px;
  box-shadow: 8px 8px 0 var(--color-darker);
  background: #fff;
}

.post__content .wp-block-image,
.post__content figure {
  margin-inline: 0;
  padding: 0 8px 8px 0;
}

/* Article grid: TOC | compact column | share rail */

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding-bottom: clamp(40px, 6vw, 72px);
}

.post-layout__sidebar,
.post-layout__main,
.post-layout__rail {
  min-width: 0;
}

.post-layout__main {
  max-width: var(--reading-max);
  width: 100%;
  margin-inline: auto;
}

.post-layout__rail {
  display: none;
}

@media (min-width: 900px) {
  .post-layout,
  .post-layout--with-toc {
    grid-template-columns: var(--toc-width) minmax(0, var(--reading-max)) var(--share-rail-width);
    column-gap: clamp(28px, 4vw, 48px);
    justify-content: center;
  }

  .post-layout__main {
    margin-inline: 0;
    max-width: none;
  }

  .post-layout__sidebar {
    align-self: stretch;
  }

  .post-layout__rail {
    display: block;
  }
}

.post-toc {
  padding: 0;
}

@media (min-width: 900px) {
  .post-toc {
    position: sticky;
    top: calc(var(--header-height) + 24px);
    max-height: calc(100vh - var(--header-height) - 48px);
    overflow-y: auto;
    scrollbar-width: none;
  }

  .post-toc::-webkit-scrollbar {
    display: none;
  }

  body.admin-bar .post-toc {
    top: calc(var(--header-height) + 32px + 24px);
    max-height: calc(100vh - var(--header-height) - 32px - 48px);
  }
}

@media screen and (max-width: 782px) {
  body.admin-bar .post-toc {
    top: calc(var(--header-height) + 46px + 24px);
    max-height: calc(100vh - var(--header-height) - 46px - 48px);
  }
}

.post-toc__title {
  margin: 0 0 16px;
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: var(--weight-bold);
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--color-text);
}

.post-toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid #d8d8d8;
}

.post-toc__list > li + li {
  margin-top: 2px;
}

.post-toc__link {
  display: block;
  padding: 7px 0 7px 14px;
  border-left: 2px solid transparent;
  margin-left: -1px;
  font-size: 14px;
  font-weight: var(--weight-medium);
  line-height: 1.4;
  color: #555555;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.post-toc__link:hover {
  color: var(--color-text);
  text-decoration: none;
}

.post-toc__link.is-active {
  border-left-color: var(--color-darker);
  color: var(--color-text);
  font-weight: var(--weight-semibold);
}

.post-toc__link--sub {
  padding-left: 26px;
  font-size: 13px;
  font-weight: var(--weight-regular);
}

@media (max-width: 899px) {
  .post-toc {
    padding: 16px 18px;
    border: 1px solid var(--color-card-border);
    border-radius: 12px;
    background: var(--color-surface);
  }

  .post-toc__list {
    border-left: 1px solid #d8d8d8;
  }

  .post-layout__rail {
    display: flex;
    justify-content: center;
    order: 3;
  }
}

.share-rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 900px) {
  .post-layout__rail {
    display: flex;
    position: sticky;
    top: 0;
    height: 100vh;
    align-items: center;
    justify-content: center;
    align-self: start;
  }
}

@media (max-width: 899px) {
  .share-rail {
    flex-direction: row;
  }
}

.share-rail__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.5px solid var(--color-darker);
  border-radius: 50%;
  background: #ffffff;
  color: var(--color-darker);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.share-rail__btn:hover {
  background: var(--color-darker);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
}

.share-rail__btn.is-copied {
  background: var(--color-mint);
  color: var(--color-olive);
}

.post__content {
  max-width: none;
  font-size: 16px;
  line-height: 1.7;
  color: #1a1a1a;
}

.post__content > * + * {
  margin-top: 1.1em;
}

.post__content h2 {
  margin-top: 1.75em;
  font-family: var(--font-sans);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: var(--weight-bold);
  line-height: 1.2;
  letter-spacing: -0.02em;
  scroll-margin-top: calc(var(--header-height) + 16px);
}

.post__content h3 {
  margin-top: 1.45em;
  font-family: var(--font-sans);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: var(--weight-bold);
  line-height: 1.3;
  scroll-margin-top: calc(var(--header-height) + 16px);
}

.post__content h4,
.post__content h5,
.post__content h6 {
  margin-top: 1.3em;
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
}

.post__content a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post__content a:hover {
  color: var(--color-olive);
}

.post__content ul,
.post__content ol {
  padding-left: 1.35em;
}

.post__content li + li {
  margin-top: 0.4em;
}

.post__content blockquote {
  margin-inline: 0;
  padding: 4px 0 4px 20px;
  border-left: 4px solid var(--color-accent);
  font-family: var(--font-serif);
  font-size: clamp(18px, 1.9vw, 21px);
  font-style: italic;
  line-height: 1.45;
}

.post__content blockquote p {
  margin: 0;
}

.post__content .alignwide,
.post__content .alignfull,
.post__content .wp-block-image.alignwide,
.post__content .wp-block-image.alignfull {
  max-width: 100%;
  margin-inline: 0;
  width: 100%;
}

.post__content figcaption,
.wp-caption-text {
  margin-top: 10px;
  font-size: var(--text-ui);
  color: var(--color-muted);
  text-align: left;
}

.post__content code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--color-surface);
  font-size: 0.9em;
}

.post__content pre {
  padding: 18px;
  overflow-x: auto;
  border-radius: 8px;
  background: var(--color-darker);
  color: #e8e8e8;
  font-size: var(--text-body-sm);
  line-height: 1.55;
  box-shadow: none;
  border: 0;
}

.post__content pre img {
  box-shadow: none;
  border: 0;
}

.post__content pre code {
  padding: 0;
  background: none;
  color: inherit;
}

.post__content table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-body-sm);
}

.post__content th,
.post__content td {
  padding: 10px 14px;
  border: 1px solid var(--color-card-border);
  text-align: left;
}

.post__content th {
  background: var(--color-surface);
  font-weight: var(--weight-semibold);
}

.post__content hr {
  margin-block: 1.6em;
  border: 0;
  border-top: 1px solid var(--color-border);
}

.post__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: clamp(28px, 4vw, 40px);
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.post__tags-label {
  font-size: var(--text-ui);
  font-weight: var(--weight-semibold);
  color: var(--color-muted);
}

.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: clamp(28px, 4vw, 40px);
}

@media (max-width: 639px) {
  .post-nav {
    grid-template-columns: minmax(0, 1fr);
  }
}

.post-nav__item {
  padding: 18px 20px;
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-media);
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.post-nav__item:hover {
  border-color: var(--color-text);
}

.post-nav__item--next {
  text-align: left;
}

.post-nav__label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--text-card-label);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted-light);
}

.post-nav__title {
  font-family: var(--font-sans);
  font-size: var(--text-body-lg);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
}

.related {
  padding-block: var(--section-space) 0;
}

/* Alignment classes WordPress expects from a theme. */

.alignleft {
  float: left;
  margin: 0 24px 16px 0;
}

.alignright {
  float: right;
  margin: 0 0 16px 24px;
}

.aligncenter {
  margin-inline: auto;
}

.alignwide {
  width: min(100vw - var(--container-pad) * 2, 1000px);
  margin-inline: calc(50% - min(50vw - var(--container-pad), 500px));
}

.alignfull {
  width: calc(100vw - var(--container-pad) * 2);
  margin-inline: calc(50% - (100vw - var(--container-pad) * 2) / 2);
  max-width: none;
}

.sticky .card__title::before {
  content: "\2605\00a0";
  color: var(--color-olive);
}

/* ----------------------------------------------------------- Newsletter */

.newsletter {
  padding-block: clamp(24px, 3vw, 40px) var(--section-space);
}

.newsletter__panel {
  padding: clamp(40px, 7vw, 72px) clamp(28px, 6vw, 64px);
  border-radius: var(--radius-cta);
  background: var(--color-darker);
  color: #ffffff;
  text-align: left;
}

.newsletter__title {
  margin: 0 0 16px;
  max-width: 22ch;
  font-family: var(--font-serif);
  font-size: var(--text-h2);
  font-weight: var(--weight-bold);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.newsletter__text {
  margin: 0 0 32px;
  max-width: 56ch;
  font-size: var(--text-body-lg);
  color: #b9c0c4;
}

.newsletter__form {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 12px;
  margin: 0;
  max-width: 520px;
}

.newsletter__input {
  flex: 1 1 260px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font: inherit;
  font-size: var(--text-body-sm);
}

.newsletter__input::placeholder {
  color: #85898b;
}

.newsletter__input:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.newsletter__note {
  margin: 20px 0 0;
  font-size: var(--text-legal);
  color: #85898b;
}

.newsletter__message {
  margin: 16px 0 0;
  min-height: 1.4em;
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
}

.newsletter__message.is-success {
  color: var(--color-accent);
}

.newsletter__message.is-error {
  color: #ff8f7a;
}

.newsletter__form button[disabled] {
  opacity: 0.7;
  cursor: progress;
}

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ------------------------------------------------------------ Share */

.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: 0;
  width: 100%;
}

.share__label {
  font-size: var(--text-ui);
  font-weight: var(--weight-semibold);
  color: var(--color-muted);
}

.share__link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-pill);
  font-size: var(--text-ui);
  font-weight: var(--weight-medium);
  text-decoration: none;
  color: var(--color-card-body);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.share__link:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

/* --------------------------------------------------------------- Search */

.search-form {
  display: flex;
  gap: 12px;
  margin-inline: auto;
  max-width: 520px;
}

.search-form__input {
  flex: 1;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-pill);
  background: #ffffff;
  font: inherit;
  font-size: var(--text-body-sm);
}

.search-form__input:focus {
  outline: 2px solid var(--color-text);
  outline-offset: 1px;
}

/* ------------------------------------------------------------- Comments */

.comments {
  padding-block: var(--section-space) 0;
}

.comments__title {
  margin: 0 0 24px;
  font-family: var(--font-serif);
  font-size: var(--text-h3);
  font-weight: var(--weight-bold);
}

.comment-list {
  margin: 0 0 40px;
  padding: 0;
  list-style: none;
}

.comment-list ol {
  list-style: none;
  padding-left: clamp(16px, 4vw, 40px);
}

.comment-body {
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--text-body-sm);
  font-weight: var(--weight-semibold);
}

.comment-author img {
  border-radius: var(--radius-pill);
}

.comment-metadata,
.comment-metadata a {
  font-size: var(--text-legal);
  color: var(--color-muted-light);
  text-decoration: none;
}

.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-media);
  background: #ffffff;
  font: inherit;
  font-size: var(--text-body-sm);
}

.comment-respond label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--text-ui);
  font-weight: var(--weight-medium);
}

.comment-respond .form-submit input {
  min-height: 48px;
  padding: 0 28px;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}

/* --------------------------------------------------------------- Footer */

.footer {
  padding-block: 64px 32px;
  border-top: 1px solid var(--color-border);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px 32px;
  margin-bottom: 48px;
}

@media (max-width: 899px) {
  .footer__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 519px) {
  .footer__inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

.footer__logo {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: var(--weight-bold);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.footer__tagline {
  margin: 0;
  max-width: 32ch;
  font-size: var(--text-ui);
  color: var(--color-muted);
}

.footer__heading {
  margin: 0 0 16px;
  font-size: var(--text-ui);
  font-weight: var(--weight-semibold);
  color: var(--color-muted);
}

.footer__links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__links li + li {
  margin-top: 4px;
}

.footer__links a {
  display: inline-block;
  padding: 4px 0;
  font-size: var(--text-body-sm);
  text-decoration: none;
  color: var(--color-muted);
}

.footer__links a:hover {
  color: var(--color-text);
}

.footer__link-soon {
  display: inline-block;
  padding: 4px 0;
  font-size: var(--text-body-sm);
  color: var(--color-muted-light);
  cursor: default;
}

.footer__legal {
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  font-size: var(--text-legal);
  color: var(--color-muted-light);
}

/* -------------------------------------------------------- Reduced motion */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
