/*
Theme Name: RunElection Theme
Theme URI: https://runelection.com/
Author: RunElection
Author URI: https://runelection.com/
Description: Custom editorial WordPress theme for the RunElection resource center and blog. Built on the RunElection design system: purple #5B21B6, Plus Jakarta Sans headings, Source Sans 3 body, card-based article grids and a 760px reading measure.
Version: 1.0.0
Requires at least: 6.2
Tested up to: 6.6
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: runelection
Tags: blog, news, custom-logo, custom-menu, featured-images, translation-ready, accessibility-ready
*/

/* ==========================================================================
   1. Tokens
   ========================================================================== */
:root {
  --re-primary: #5B21B6;
  --re-primary-dark: #4C1D95;
  --re-deep: #2E1065;
  --re-tint: #F1ECFC;
  --re-tint-soft: #F5F1FE;
  --re-tint-border: #E4DAF8;
  --re-ink: #14121A;
  --re-body: #2A2733;
  --re-muted: #5C5670;
  --re-meta: #7A7488;
  --re-border: #E7E4EE;
  --re-border-soft: #F0EDF6;
  --re-border-hover: #C9BCE8;
  --re-surface: #F8F7FB;
  --re-surface-alt: #FBFAFE;
  --re-white: #ffffff;

  --re-font-head: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --re-font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --re-font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --re-wrap: 1280px;
  --re-measure: 760px;
  --re-gutter: clamp(20px, 4vw, 48px);

  --re-radius-sm: 8px;
  --re-radius: 12px;
  --re-radius-lg: 18px;
  --re-radius-xl: 20px;

  --re-shadow-sm: 0 1px 3px rgba(20, 18, 26, 0.05);
  --re-shadow-lg: 0 12px 30px rgba(46, 16, 101, 0.08);

  --re-transition: 0.18s ease;
}

/* ==========================================================================
   2. Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--re-white);
  color: var(--re-ink);
  font-family: var(--re-font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--re-font-head); margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--re-primary); text-decoration: none; transition: color var(--re-transition); }
a:hover { color: var(--re-primary-dark); }
input, button, textarea, select { font: inherit; }
ul, ol { margin: 0; }

:focus-visible {
  outline: 2px solid var(--re-primary);
  outline-offset: 2px;
  border-radius: 6px;
}

.screen-reader-text {
  position: absolute !important;
  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: 999;
  width: auto; height: auto;
  clip: auto;
  background: var(--re-primary);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--re-radius);
  font-family: var(--re-font-head);
  font-weight: 600;
}

.re-wrap { max-width: var(--re-wrap); margin: 0 auto; padding-left: var(--re-gutter); padding-right: var(--re-gutter); }
.re-wrap--narrow { max-width: 900px; }
.re-wrap--reading { max-width: 820px; }

.re-eyebrow {
  font-family: var(--re-font-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--re-primary);
}

/* ==========================================================================
   3. Buttons, badges, forms
   ========================================================================== */
.re-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: var(--re-radius);
  font-family: var(--re-font-head);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--re-transition), border-color var(--re-transition), color var(--re-transition);
}
.re-btn--primary { background: var(--re-primary); color: #fff; }
.re-btn--primary:hover { background: var(--re-primary-dark); color: #fff; }
.re-btn--ghost { background: #fff; color: var(--re-ink); border-color: var(--re-border); }
.re-btn--ghost:hover { background: var(--re-surface); border-color: var(--re-border-hover); color: var(--re-ink); }
.re-btn--light { background: #fff; color: var(--re-deep); font-weight: 700; }
.re-btn--light:hover { background: var(--re-tint); color: var(--re-deep); }
.re-btn--sm { min-height: 44px; padding: 11px 22px; font-size: 15px; }

.re-link-underline {
  color: #fff;
  font-family: var(--re-font-head);
  font-weight: 600;
  font-size: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  padding-bottom: 2px;
}
.re-link-underline:hover { color: #fff; border-bottom-color: #fff; }

.re-badge {
  display: inline-block;
  font-family: var(--re-font-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--re-primary);
  background: var(--re-tint);
  padding: 7px 12px;
  border-radius: var(--re-radius-sm);
}
.re-badge--plain {
  background: none;
  padding: 0;
  font-size: 11px;
  letter-spacing: 0.09em;
}
.re-badge--plain:hover { color: var(--re-primary-dark); }

.re-field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 16px;
  background: #fff;
  border: 1px solid var(--re-border);
  border-radius: 14px;
}
.re-field:focus-within { border-color: var(--re-primary); }
.re-field input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
  color: var(--re-ink);
}
.re-field__icon {
  width: 13px; height: 13px;
  border: 2px solid var(--re-meta);
  border-radius: 50%;
  flex: none;
}
.re-searchform { display: flex; gap: 10px; flex-wrap: wrap; max-width: 560px; }
.re-searchform .re-field { flex: 1 1 240px; }
.re-searchform .re-btn { height: 54px; }
.re-searchform--lg .re-field { height: 60px; border-radius: 16px; border-color: #DCD4EE; box-shadow: var(--re-shadow-sm); }
.re-searchform--lg .re-field input { font-size: 17px; }
.re-searchform--lg .re-btn { height: 60px; border-radius: 16px; font-size: 17px; }

/* ==========================================================================
   4. Header
   ========================================================================== */
.re-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--re-border);
}
.re-header__bar {
  max-width: var(--re-wrap);
  margin: 0 auto;
  padding: 0 var(--re-gutter);
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.re-logo { display: flex; align-items: center; gap: 10px; color: var(--re-ink); }
.re-logo:hover { color: var(--re-ink); }
.re-logo__mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--re-primary);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.re-logo__mark::after {
  content: "";
  width: 10px; height: 10px;
  border-radius: 2px;
  background: #fff;
  transform: rotate(45deg);
}
.re-logo__text { font-family: var(--re-font-head); font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.re-logo img { max-height: 34px; width: auto; }

.re-nav { flex: none; }
.re-nav ul { display: flex; align-items: center; gap: 26px; list-style: none; padding: 0; margin: 0; }
.re-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--re-muted);
  white-space: nowrap;
}
.re-nav a:hover { color: var(--re-ink); }
.re-nav .current-menu-item > a,
.re-nav .current_page_item > a,
.re-nav .current-menu-ancestor > a {
  color: var(--re-ink);
  font-weight: 600;
  border-bottom: 2px solid var(--re-primary);
  padding-bottom: 3px;
}

.re-header__actions { display: flex; align-items: center; gap: 14px; flex: none; }
.re-iconbtn {
  width: 44px; height: 44px;
  border: 1px solid var(--re-border);
  border-radius: var(--re-radius);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--re-muted);
  transition: border-color var(--re-transition), background var(--re-transition);
}
.re-iconbtn:hover { border-color: var(--re-border-hover); background: var(--re-surface); }
.re-iconbtn__search { width: 13px; height: 13px; border: 2px solid currentColor; border-radius: 50%; position: relative; }
.re-iconbtn__search::after {
  content: "";
  position: absolute;
  right: -6px; bottom: -4px;
  width: 7px; height: 2px;
  background: currentColor;
  transform: rotate(45deg);
}
.re-burger { flex-direction: column; gap: 5px; }
.re-burger span { width: 18px; height: 2px; background: var(--re-ink); border-radius: 2px; display: block; }

.re-mobile-nav { display: none; border-top: 1px solid var(--re-border); background: #fff; padding: 12px var(--re-gutter) 24px; }
.re-mobile-nav.is-open { display: block; }
.re-mobile-nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.re-mobile-nav a {
  display: block;
  padding: 13px 0;
  min-height: 44px;
  font-size: 16px;
  font-weight: 500;
  color: var(--re-ink);
}
.re-mobile-nav .re-btn { width: 100%; margin-top: 12px; }
.re-mobile-search { margin-top: 14px; display: none; }
.re-mobile-search.is-open { display: block; }

.re-header__desktop { display: flex; align-items: center; gap: 24px; }
.re-header__mobile { display: none; align-items: center; gap: 8px; }

@media (max-width: 1079px) {
  .re-header__desktop { display: none; }
  .re-header__mobile { display: flex; }
}

/* ==========================================================================
   5. Cards & grids
   ========================================================================== */
.re-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.5vw, 30px); }
@media (max-width: 1023px) { .re-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .re-grid { grid-template-columns: minmax(0, 1fr); } }

.re-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--re-border);
  border-radius: var(--re-radius-lg);
  overflow: hidden;
  transition: transform var(--re-transition), box-shadow var(--re-transition), border-color var(--re-transition);
}
.re-card:hover { transform: translateY(-3px); box-shadow: var(--re-shadow-lg); border-color: #DCD4EE; }
.re-card__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--re-tint-soft); }
.re-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.re-card:hover .re-card__media img { transform: scale(1.045); }
.re-card__body { padding: 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.re-card__title { font-size: 20px; line-height: 1.26; font-weight: 700; letter-spacing: -0.015em; text-wrap: pretty; }
.re-card__title a { color: var(--re-ink); }
.re-card:hover .re-card__title a { color: var(--re-primary); }
.re-card__excerpt { font-size: 15px; line-height: 1.6; color: var(--re-muted); text-wrap: pretty; }
.re-card__meta {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--re-border-soft);
  font-size: 13px;
  color: var(--re-meta);
}

.re-placeholder {
  width: 100%; height: 100%;
  min-height: 160px;
  background-color: var(--re-tint-soft);
  background-image: repeating-linear-gradient(45deg, #EBE3FB 0 9px, #F7F3FE 9px 18px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  text-align: center;
  font-family: var(--re-font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6E5C94;
}

/* Featured article */
.re-featured {
  border: 1px solid var(--re-border);
  border-radius: var(--re-radius-xl);
  background: #fff;
  box-shadow: var(--re-shadow-sm);
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.re-featured__media { min-height: 340px; overflow: hidden; }
.re-featured__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.re-featured:hover .re-featured__media img { transform: scale(1.03); }
.re-featured__body {
  padding: clamp(28px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
}
.re-featured__title { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.16; font-weight: 700; letter-spacing: -0.025em; text-wrap: pretty; }
.re-featured__title a { color: var(--re-ink); }
.re-featured__title a:hover { color: var(--re-primary); }
.re-featured__excerpt { font-size: 17px; line-height: 1.65; color: var(--re-muted); text-wrap: pretty; }
@media (max-width: 900px) { .re-featured { grid-template-columns: minmax(0, 1fr); } .re-featured__media { min-height: 240px; aspect-ratio: 16 / 9; } }

.re-byline { display: flex; align-items: center; gap: 12px; }
.re-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--re-tint);
  color: var(--re-primary);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--re-font-head);
  font-size: 13px;
  font-weight: 700;
  flex: none;
  overflow: hidden;
}
.re-avatar img { border-radius: 50%; }
.re-byline__meta { font-size: 14px; color: var(--re-meta); }

/* Section headers */
.re-section { padding: clamp(44px, 6vw, 80px) 0; }
.re-section--tight { padding-top: 0; }
.re-section__intro { max-width: 640px; }
.re-section__title { font-size: clamp(26px, 3vw, 38px); line-height: 1.14; font-weight: 800; letter-spacing: -0.028em; }
.re-section__sub { margin-top: 12px; font-size: 17px; line-height: 1.65; color: var(--re-muted); text-wrap: pretty; }
.re-rule { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.re-rule h2 { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.re-rule::after { content: ""; flex: 1; height: 1px; background: var(--re-border); }

/* ==========================================================================
   6. Hero + category chips
   ========================================================================== */
.re-hero { border-bottom: 1px solid var(--re-border); background: linear-gradient(180deg, var(--re-surface-alt) 0%, #fff 100%); }
.re-hero__inner {
  padding: clamp(44px, 6vw, 88px) 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
.re-hero__title { font-size: clamp(34px, 4.6vw, 56px); line-height: 1.06; font-weight: 800; letter-spacing: -0.033em; margin-top: 18px; text-wrap: balance; }
.re-hero__text { margin-top: 20px; font-size: clamp(16px, 1.4vw, 19px); line-height: 1.65; color: var(--re-muted); max-width: 540px; text-wrap: pretty; }
.re-hero__actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.re-hero__media { aspect-ratio: 4 / 3; border: 1px solid var(--re-border); border-radius: var(--re-radius-xl); overflow: hidden; }
.re-hero__media img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) { .re-hero__inner { grid-template-columns: minmax(0, 1fr); } }

.re-page-hero { border-bottom: 1px solid var(--re-border); background: var(--re-surface-alt); padding: clamp(36px, 5vw, 72px) 0; }
.re-page-hero__title { margin-top: 18px; font-size: clamp(32px, 4.2vw, 50px); line-height: 1.08; font-weight: 800; letter-spacing: -0.03em; max-width: 760px; text-wrap: balance; }
.re-page-hero__text { margin-top: 16px; font-size: clamp(16px, 1.4vw, 19px); line-height: 1.65; color: var(--re-muted); max-width: 640px; text-wrap: pretty; }
.re-page-hero__count { margin-top: 18px; font-size: 14px; color: var(--re-meta); }
.re-page-hero .re-searchform { margin-top: 28px; }

.re-breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--re-meta); }
.re-breadcrumbs a { color: var(--re-meta); }
.re-breadcrumbs a:hover { color: var(--re-primary); }

.re-chips { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.re-chip {
  flex: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border: 1px solid var(--re-border);
  border-radius: 999px;
  background: #fff;
  font-family: var(--re-font-head);
  font-size: 14px;
  font-weight: 500;
  color: var(--re-muted);
  white-space: nowrap;
}
.re-chip:hover { border-color: var(--re-border-hover); background: var(--re-surface); color: var(--re-ink); }
.re-chip.is-active { background: var(--re-primary); border-color: var(--re-primary); color: #fff; font-weight: 600; }

/* ==========================================================================
   7. Popular resources
   ========================================================================== */
.re-popular { background: var(--re-surface); border-top: 1px solid var(--re-border); border-bottom: 1px solid var(--re-border); }
.re-popular__grid { margin-top: 36px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 3vw, 40px); align-items: start; }
@media (max-width: 900px) { .re-popular__grid { grid-template-columns: minmax(0, 1fr); } }
.re-popular__lead { border: 1px solid var(--re-border); border-radius: var(--re-radius-xl); background: #fff; overflow: hidden; }
.re-popular__lead .re-card__media { aspect-ratio: 16 / 9; }
.re-popular__lead-body { padding: clamp(22px, 3vw, 30px); display: flex; flex-direction: column; gap: 14px; }
.re-popular__lead-title { font-size: clamp(21px, 2.2vw, 27px); line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; text-wrap: pretty; }
.re-popular__lead-title a { color: var(--re-ink); }
.re-popular__lead-title a:hover { color: var(--re-primary); }
.re-popular__list { display: flex; flex-direction: column; border: 1px solid var(--re-border); border-radius: var(--re-radius-xl); background: #fff; overflow: hidden; }
.re-popular__item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--re-border-soft);
  color: var(--re-ink);
}
.re-popular__item:last-child { border-bottom: 0; }
.re-popular__item:hover { background: var(--re-surface-alt); color: var(--re-primary); }
.re-popular__item-inner { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.re-popular__item-title { font-family: var(--re-font-head); font-size: 17px; font-weight: 700; line-height: 1.32; letter-spacing: -0.012em; color: inherit; }
.re-popular__item-meta { font-size: 13px; color: var(--re-meta); }
.re-arrow { font-family: var(--re-font-head); font-size: 17px; font-weight: 600; color: var(--re-primary); flex: none; transition: transform var(--re-transition); }
.re-popular__item:hover .re-arrow, .re-card:hover .re-arrow { transform: translateX(4px); }

/* ==========================================================================
   8. Newsletter + product CTA
   ========================================================================== */
.re-newsletter { background: var(--re-tint-soft); }
.re-newsletter__inner {
  padding: clamp(48px, 6vw, 80px) 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}
@media (max-width: 900px) { .re-newsletter__inner { grid-template-columns: minmax(0, 1fr); } }
.re-newsletter__title { font-size: clamp(24px, 2.8vw, 34px); line-height: 1.16; font-weight: 800; letter-spacing: -0.025em; text-wrap: balance; }
.re-newsletter__text { margin-top: 12px; font-size: 17px; line-height: 1.65; color: var(--re-muted); max-width: 460px; text-wrap: pretty; }
.re-newsletter__form { display: flex; flex-direction: column; gap: 10px; }
.re-newsletter__row { display: flex; gap: 10px; flex-wrap: wrap; }
.re-newsletter__row .re-field { flex: 1 1 240px; border-color: #DCD4EE; }
.re-newsletter__note { font-size: 13px; color: var(--re-meta); }

.re-cta { background: var(--re-deep); color: #fff; }
.re-cta--boxed { border-radius: var(--re-radius-xl); padding: clamp(28px, 4vw, 52px); }
.re-cta__inner {
  padding: clamp(48px, 6vw, 88px) 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
.re-cta--boxed .re-cta__inner { padding: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.re-cta__title { color: #fff; font-size: clamp(26px, 3vw, 40px); line-height: 1.12; font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
.re-cta--boxed .re-cta__title { font-size: clamp(22px, 2.4vw, 30px); }
.re-cta__text { margin-top: 14px; font-size: 18px; line-height: 1.62; color: #CBBBEC; max-width: 460px; text-wrap: pretty; }
.re-cta__actions { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
.re-cta--boxed .re-cta__actions { margin-top: 0; }
.re-cta__media {
  aspect-ratio: 16 / 10;
  border: 1px solid #4A2A8A;
  border-radius: var(--re-radius-lg);
  overflow: hidden;
  background-color: #3B1780;
  background-image: repeating-linear-gradient(45deg, #43208C 0 9px, #3B1780 9px 18px);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--re-font-mono);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #C0AEE6;
  text-align: center; padding: 24px;
}
@media (max-width: 900px) { .re-cta__inner { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   9. Pagination
   ========================================================================== */
.re-pagination { margin-top: clamp(36px, 5vw, 56px); }
.re-pagination .nav-links { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.re-pagination .page-numbers {
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--re-border);
  border-radius: var(--re-radius);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--re-font-head);
  font-size: 15px;
  font-weight: 600;
  color: var(--re-ink);
  background: #fff;
}
.re-pagination .page-numbers:hover { border-color: var(--re-border-hover); background: var(--re-surface); color: var(--re-ink); }
.re-pagination .page-numbers.current { background: var(--re-primary); border-color: var(--re-primary); color: #fff; font-weight: 700; }
.re-pagination .page-numbers.dots { border-color: transparent; color: var(--re-meta); background: none; }

/* ==========================================================================
   10. Search results
   ========================================================================== */
.re-result {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px;
  border: 1px solid var(--re-border);
  border-radius: var(--re-radius-lg);
  background: #fff;
  transition: border-color var(--re-transition), box-shadow var(--re-transition);
}
.re-result:hover { border-color: #DCD4EE; box-shadow: 0 10px 26px rgba(46, 16, 101, 0.07); }
.re-result__media { flex: 0 0 200px; min-width: 180px; aspect-ratio: 16 / 10; border-radius: var(--re-radius); overflow: hidden; }
.re-result__media img { width: 100%; height: 100%; object-fit: cover; }
.re-result__body { flex: 1 1 260px; display: flex; flex-direction: column; gap: 9px; padding: 4px 4px 4px 0; }
.re-result__title { font-size: 20px; line-height: 1.26; font-weight: 700; letter-spacing: -0.015em; text-wrap: pretty; }
.re-result__title a { color: var(--re-ink); }
.re-result__title a:hover { color: var(--re-primary); }
.re-results { display: flex; flex-direction: column; gap: 20px; margin-top: 32px; }
.re-results__query { margin-top: 8px; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.2; font-weight: 800; letter-spacing: -0.025em; }
.re-results__count { margin-top: 10px; font-size: 15px; color: var(--re-muted); }
@media (max-width: 560px) { .re-result__media { flex: 1 1 100%; } }

.re-empty {
  border: 1px solid var(--re-border);
  border-radius: var(--re-radius-xl);
  background: var(--re-surface-alt);
  padding: clamp(32px, 5vw, 56px);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px;
}
.re-empty__icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--re-tint);
  display: flex; align-items: center; justify-content: center;
}
.re-empty__icon span { width: 18px; height: 18px; border: 2px solid var(--re-primary); border-radius: 50%; display: block; }
.re-empty__title { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.2; font-weight: 800; }
.re-empty__text { font-size: 17px; line-height: 1.6; color: var(--re-muted); max-width: 420px; text-wrap: pretty; }
.re-empty .re-searchform { margin-top: 10px; justify-content: center; }

/* ==========================================================================
   11. Single post
   ========================================================================== */
.re-post-hero { border-bottom: 1px solid var(--re-border); background: var(--re-surface-alt); padding: clamp(30px, 4vw, 56px) 0 clamp(32px, 4vw, 48px); }
.re-post-hero__title { margin-top: 18px; font-size: clamp(30px, 3.9vw, 46px); line-height: 1.1; font-weight: 800; letter-spacing: -0.032em; text-wrap: balance; }
.re-post-hero__excerpt { margin-top: 18px; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.6; color: var(--re-muted); text-wrap: pretty; }
.re-post-hero__byline { margin-top: 26px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.re-post-hero__byline .re-avatar { width: 46px; height: 46px; font-size: 15px; }
.re-post-hero__author { font-family: var(--re-font-head); font-size: 15px; font-weight: 600; color: var(--re-ink); }
.re-post-hero__meta { margin-top: 3px; font-size: 14px; color: var(--re-meta); }
.re-post-hero .re-badge { margin-top: 22px; }

.re-post__figure { aspect-ratio: 16 / 9; border: 1px solid var(--re-border); border-radius: var(--re-radius-xl); overflow: hidden; margin: 0 0 clamp(32px, 4vw, 56px); }
.re-post__figure img { width: 100%; height: 100%; object-fit: cover; }
.re-post__layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
@media (max-width: 1023px) { .re-post__layout { grid-template-columns: minmax(0, 1fr); } .re-post__aside { display: none; } }
.re-post__aside { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 22px; }
.re-toc__title, .re-share__title { font-family: var(--re-font-head); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--re-meta); }
.re-toc__list { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.4; border-left: 2px solid #EFEBF7; padding-left: 14px; list-style: none; }
.re-toc__list a { color: var(--re-muted); }
.re-toc__list a:hover, .re-toc__list .is-active a { color: var(--re-primary); }
.re-share { border-top: 1px solid #EFEBF7; padding-top: 20px; }
.re-share__list { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.re-share__btn {
  min-width: 44px; height: 44px;
  padding: 0 12px;
  border: 1px solid var(--re-border);
  border-radius: var(--re-radius);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--re-font-head);
  font-size: 13px; font-weight: 700;
  color: var(--re-muted);
  cursor: pointer;
}
.re-share__btn:hover { border-color: var(--re-border-hover); background: var(--re-surface); color: var(--re-primary); }
.re-share--mobile { display: none; margin-top: 28px; }
@media (max-width: 1023px) { .re-share--mobile { display: block; border-top: 1px solid var(--re-border-soft); padding-top: 20px; } }

.re-author {
  border: 1px solid var(--re-border);
  border-radius: var(--re-radius-xl);
  background: var(--re-surface-alt);
  padding: clamp(24px, 3vw, 34px);
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.re-author .re-avatar { width: 72px; height: 72px; font-size: 22px; }
.re-author__body { flex: 1 1 260px; }
.re-author__label { font-family: var(--re-font-head); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--re-meta); }
.re-author__name { margin-top: 8px; font-size: 21px; font-weight: 700; letter-spacing: -0.015em; }
.re-author__bio { margin-top: 10px; font-size: 16px; line-height: 1.65; color: var(--re-muted); text-wrap: pretty; }
.re-author__links { margin-top: 14px; display: flex; gap: 16px; font-size: 15px; font-weight: 600; }

.re-related { margin-top: clamp(40px, 5vw, 64px); }
.re-related__title { font-size: clamp(23px, 2.4vw, 30px); line-height: 1.2; font-weight: 800; letter-spacing: -0.025em; }
.re-related .re-grid { margin-top: 26px; }

/* ==========================================================================
   12. Article typography (front-end + editor)
   ========================================================================== */
.re-article-body {
  max-width: var(--re-measure);
  font-size: 19px;
  line-height: 1.75;
  color: var(--re-body);
}
.re-article-body > * { margin-block: 24px; }
.re-article-body > *:first-child { margin-top: 0; }
.re-article-body h2 { margin-top: 40px; font-size: clamp(26px, 2.6vw, 32px); line-height: 1.22; font-weight: 700; letter-spacing: -0.025em; color: var(--re-ink); }
.re-article-body h3 { margin-top: 32px; font-size: 23px; line-height: 1.3; font-weight: 700; letter-spacing: -0.015em; color: var(--re-ink); }
.re-article-body h4 { margin-top: 28px; font-size: 19px; font-weight: 700; color: var(--re-ink); }
.re-article-body a { text-decoration: underline; text-underline-offset: 3px; }
.re-article-body ul, .re-article-body ol { padding-left: 24px; display: flex; flex-direction: column; gap: 10px; }
.re-article-body li::marker { color: var(--re-primary); }
.re-article-body blockquote {
  margin: 32px 0;
  padding: 22px 26px;
  border-left: 3px solid var(--re-primary);
  background: var(--re-surface);
  border-radius: 0 16px 16px 0;
  font-size: 20px;
  line-height: 1.6;
  color: var(--re-ink);
}
.re-article-body blockquote p { margin: 0; }
.re-article-body blockquote cite { display: block; margin-top: 10px; font-size: 15px; font-style: normal; color: var(--re-meta); }
.re-article-body figure { margin: 32px 0; }
.re-article-body img { border-radius: 16px; }
.re-article-body figcaption { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--re-meta); }
.re-article-body table { width: 100%; border-collapse: collapse; font-size: 16px; border: 1px solid var(--re-border); border-radius: 16px; overflow: hidden; }
.re-article-body thead th {
  text-align: left;
  padding: 14px 18px;
  background: var(--re-surface);
  border-bottom: 1px solid var(--re-border);
  font-family: var(--re-font-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--re-muted);
}
.re-article-body tbody td { padding: 14px 18px; border-bottom: 1px solid var(--re-border-soft); color: var(--re-body); }
.re-article-body tbody tr:last-child td { border-bottom: 0; }
.re-article-body .wp-block-table { overflow-x: auto; }

/* Key Takeaway block style (register_block_style on core/group) */
.re-article-body .is-style-key-takeaway,
.editor-styles-wrapper .is-style-key-takeaway {
  background: var(--re-tint-soft);
  border: 1px solid var(--re-tint-border);
  border-radius: 16px;
  padding: 24px 26px;
}
.is-style-key-takeaway > *:first-child {
  font-family: var(--re-font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--re-primary);
}
.is-style-key-takeaway > * + * { margin-top: 10px; font-size: 19px; line-height: 1.6; color: var(--re-deep); font-weight: 500; }

/* Callout block style (core/group) */
.is-style-re-callout {
  border: 1px solid var(--re-border);
  border-left: 3px solid var(--re-primary);
  border-radius: 0 16px 16px 0;
  background: #fff;
  padding: 22px 24px;
}

.re-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.re-stat { border: 1px solid var(--re-border); border-radius: 16px; padding: 20px; }
.re-stat__value { font-family: var(--re-font-head); font-size: 34px; font-weight: 800; letter-spacing: -0.03em; color: var(--re-primary); line-height: 1; }
.re-stat__label { margin-top: 6px; font-size: 15px; line-height: 1.5; color: var(--re-muted); }

/* ==========================================================================
   13. Page / 404 / about
   ========================================================================== */
.re-page-body { padding: clamp(40px, 5vw, 72px) 0; }
.re-topics { margin-top: 26px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.re-topic { border: 1px solid var(--re-border); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 10px; background: #fff; }
.re-topic__icon { width: 38px; height: 38px; border-radius: 11px; background: var(--re-tint); display: flex; align-items: center; justify-content: center; }
.re-topic__icon span { width: 13px; height: 13px; border: 2px solid var(--re-primary); border-radius: 3px; display: block; }

.re-404 { min-height: 60vh; display: flex; align-items: center; }
.re-404__inner {
  width: 100%;
  padding: clamp(48px, 6vw, 96px) 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
@media (max-width: 800px) { .re-404__inner { grid-template-columns: minmax(0, 1fr); } }
.re-404__title { margin-top: 16px; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
.re-404__text { margin-top: 16px; font-size: 18px; line-height: 1.65; color: var(--re-muted); max-width: 440px; text-wrap: pretty; }
.re-404__actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.re-404__media { aspect-ratio: 4 / 3; border: 1px solid var(--re-border); border-radius: var(--re-radius-xl); overflow: hidden; }

/* ==========================================================================
   14. Footer
   ========================================================================== */
.re-footer { background: #fff; border-top: 1px solid var(--re-border); }
.re-footer__top {
  padding: clamp(44px, 6vw, 72px) 0 32px;
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 40px;
}
@media (max-width: 1023px) { .re-footer__top { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .re-footer__top { grid-template-columns: minmax(0, 1fr); gap: 32px; } }
.re-footer__about { max-width: 300px; }
.re-footer__text { margin-top: 14px; font-size: 15px; line-height: 1.6; color: var(--re-muted); text-wrap: pretty; }
.re-footer__social { margin-top: 18px; display: flex; gap: 8px; }
.re-footer__social a {
  width: 38px; height: 38px;
  border: 1px solid var(--re-border);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--re-font-head);
  font-size: 12px; font-weight: 700;
  color: var(--re-muted);
}
.re-footer__social a:hover { border-color: var(--re-border-hover); background: var(--re-surface); color: var(--re-primary); }
.re-footer__col h2 { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--re-ink); }
.re-footer__col ul { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; list-style: none; padding: 0; font-size: 15px; }
.re-footer__col a { color: var(--re-muted); }
.re-footer__col a:hover { color: var(--re-primary); }
.re-footer__bottom { padding: 0 0 40px; }
.re-footer__bottom-inner { border-top: 1px solid var(--re-border); padding-top: 24px; font-size: 14px; color: var(--re-meta); }

/* ==========================================================================
   15. Comments
   ========================================================================== */
.re-comments {
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: clamp(32px, 4vw, 48px);
  border-top: 1px solid var(--re-border);
}
.re-comments__title {
  font-family: var(--re-font-head);
  font-size: clamp(23px, 2.4vw, 30px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--re-ink);
}
.re-comments__title--form { margin-top: clamp(36px, 4vw, 52px); }
.re-comments__title small { font-weight: 600; }
.re-comments__title #cancel-comment-reply-link {
  margin-left: 14px;
  font-family: var(--re-font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--re-primary);
}

.re-comments__list {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.re-comments__list .children {
  list-style: none;
  margin: 14px 0 0;
  padding: 0 0 0 clamp(18px, 3vw, 34px);
  border-left: 2px solid var(--re-tint-border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.re-comment { margin: 0; }
.re-comment__body {
  display: flex;
  gap: 16px;
  padding: clamp(18px, 2vw, 24px);
  background: var(--re-white);
  border: 1px solid var(--re-border);
  border-radius: var(--re-radius-lg);
}
.re-comment.bypostauthor > .re-comment__body {
  background: var(--re-tint-soft);
  border-color: var(--re-tint-border);
}
.re-comment__avatar { flex: 0 0 auto; }
.re-comment__avatar img {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--re-surface);
}
.re-comment__main { min-width: 0; flex: 1 1 auto; }
.re-comment__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.re-comment__author {
  font-family: var(--re-font-head);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--re-ink);
}
.re-comment__author a { color: inherit; }
.re-comment__author a:hover { color: var(--re-primary); }
.re-comment__date { font-size: 13px; color: var(--re-meta); }
.re-comment__pending {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--re-primary);
}
.re-comment__content {
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--re-body);
  text-wrap: pretty;
}
.re-comment__content > *:first-child { margin-top: 0; }
.re-comment__content > *:last-child { margin-bottom: 0; }
.re-comment__content p { margin: 0 0 12px; }
.re-comment__content a { color: var(--re-primary); text-decoration: underline; text-underline-offset: 2px; }
.re-comment__actions {
  margin-top: 12px;
  display: flex;
  gap: 16px;
  font-size: 14px;
  font-weight: 600;
}
.re-comment__actions a { color: var(--re-primary); }
.re-comment__actions a:hover { color: var(--re-primary-dark); }
.re-comment--ping .re-comment__ping {
  margin: 0;
  padding: 14px 18px;
  font-size: 15px;
  color: var(--re-muted);
  background: var(--re-surface);
  border-radius: var(--re-radius);
}

.re-comments__nav {
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
  font-weight: 600;
}
.re-comments__nav .nav-links { display: flex; justify-content: space-between; width: 100%; gap: 12px; }
.re-comments__nav a { color: var(--re-primary); }
.re-comments__closed {
  margin-top: 24px;
  font-size: 15px;
  color: var(--re-meta);
}

.re-comment-form { margin-top: 20px; }
.re-comment-form__note,
.re-comment-form .comment-notes,
.re-comment-form .logged-in-as {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--re-meta);
}
.re-comment-form .logged-in-as a { color: var(--re-primary); font-weight: 600; }
.re-comment-form__row,
.re-comment-form .comment-form-cookies-consent {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0 0 16px;
}
.re-comment-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
}
.re-comment-form > * { grid-column: 1 / -1; }
.re-comment-form > .re-comment-form__row { grid-column: auto; }
.re-comment-form > .re-comment-form__row--full { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .re-comment-form { grid-template-columns: minmax(0, 1fr); }
  .re-comment-form > .re-comment-form__row { grid-column: 1 / -1; }
}
.re-comment-form label {
  font-family: var(--re-font-head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--re-ink);
}
.re-comment-form__req { color: var(--re-primary); }
.re-input,
.re-textarea {
  width: 100%;
  font-family: var(--re-font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--re-ink);
  background: var(--re-white);
  border: 1px solid var(--re-border);
  border-radius: 14px;
  padding: 13px 16px;
  transition: border-color var(--re-transition), box-shadow var(--re-transition);
}
.re-input { min-height: 48px; }
.re-textarea { min-height: 150px; resize: vertical; }
.re-input::placeholder,
.re-textarea::placeholder { color: var(--re-meta); }
.re-input:focus,
.re-textarea:focus {
  outline: none;
  border-color: var(--re-primary);
  box-shadow: 0 0 0 3px rgba(91, 33, 182, 0.14);
}
.re-comment-form .comment-form-cookies-consent {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.re-comment-form .comment-form-cookies-consent label {
  font-family: var(--re-font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--re-muted);
}
.re-comment-form .comment-form-cookies-consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--re-primary);
}
.re-comment-form__submit { margin: 8px 0 0; }

/* ==========================================================================
   16. Breakpoint refinements
   ========================================================================== */
@media (max-width: 767px) {
  body { font-size: 16px; }
  .re-article-body { font-size: 18px; }
  .re-post__aside { display: none; }
}
@media (max-width: 400px) {
  :root { --re-gutter: 20px; }
  .re-hero__title { font-size: 32px; }
  .re-card__body { padding: 18px; }
}
