/*
Theme Name: AI Insight Pro
Theme URI: https://aiinsightpro.com/
Author: AI Insight Pro Editorial Team
Author URI: https://aiinsightpro.com/
Description: A fast, SEO-friendly magazine theme for AI, SEO, website and digital-marketing publishers. Lightweight (Astra-like performance), responsive, dark-mode ready, and fully compatible with RankMath and Elementor. Ported from the AI Insight Pro static design.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ai-insight-pro
Tags: blog, news, two-columns, right-sidebar, custom-menu, custom-logo, featured-images, full-width-template, theme-options, threaded-comments, translation-ready, block-styles, wide-blocks
*/

/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-muted: #f1f5f2;
  --ink: #16211f;
  --muted: #66736f;
  --line: #dde6e0;
  --header-bg: rgba(251, 250, 247, 0.9);
  --nav-ink: #334340;
  --teal: #006b5f;
  --teal-dark: #07483f;
  --lime: #c4e86b;
  --coral: #f86f4c;
  --blue: #3366ff;
  --gold: #f5b84b;
  --shadow: 0 18px 45px rgba(17, 36, 33, 0.1);
  --hero-wash: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(251, 250, 247, 0));
  --footer-bg: #111916;
  --footer-copy: #aebbb5;
  --radius: 8px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1513;
  --surface: #17201d;
  --surface-muted: #202b27;
  --ink: #eef5ef;
  --muted: #aab7b1;
  --line: #2b3833;
  --header-bg: rgba(15, 21, 19, 0.9);
  --nav-ink: #d9e5df;
  --teal: #50d1bd;
  --teal-dark: #78ead7;
  --lime: #d6f978;
  --coral: #ff886b;
  --blue: #7fa1ff;
  --gold: #ffd078;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  --hero-wash: linear-gradient(180deg, rgba(80, 209, 189, 0.08), rgba(15, 21, 19, 0));
  --footer-bg: #090d0c;
  --footer-copy: #9eaaa5;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body.nav-open,
body.search-open {
  overflow: hidden;
}

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

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

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.sr-only,
.screen-reader-text {
  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 {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 300;
  padding: 12px 18px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 800;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* ==========================================================================
   2. Reading progress
   ========================================================================== */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: 3px;
  background: transparent;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--lime), var(--coral));
  transition: width 100ms linear;
}

/* ==========================================================================
   3. Header / navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(221, 230, 224, 0.82);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transition: box-shadow 180ms ease, border-color 180ms ease;
}

.site-header.is-scrolled {
  box-shadow: 0 12px 34px rgba(19, 35, 32, 0.09);
  border-color: transparent;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--lime);
  font-size: 0.88rem;
  line-height: 1;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--nav-ink);
  font-size: 0.96rem;
  font-weight: 700;
}

/* WordPress menu structure reset (wp_nav_menu outputs ul > li > a) */
.nav-menu ul {
  display: flex;
  align-items: center;
  gap: 26px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-menu li {
  position: relative;
}

.nav-menu a {
  position: relative;
  display: block;
  padding: 26px 0;
}

.nav-menu a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 20px;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--teal);
  transition: transform 180ms ease;
}

.nav-menu a:hover::after,
.nav-menu a:focus-visible::after,
.nav-menu .current-menu-item > a::after,
.nav-menu .current_page_item > a::after {
  transform: scaleX(1);
}

/* Dropdown sub-menus */
.nav-menu ul ul {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  display: block;
  flex-direction: column;
  align-items: stretch;
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.nav-menu li:hover > ul,
.nav-menu li:focus-within > ul {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-menu ul ul a {
  padding: 10px 12px;
  border-radius: 6px;
}

.nav-menu ul ul a::after {
  display: none;
}

.nav-menu ul ul a:hover {
  background: var(--surface-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.menu-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.icon-button {
  display: grid;
  place-items: center;
}

.icon-search {
  width: 17px;
  height: 17px;
  display: block;
  border: 2px solid currentColor;
  border-radius: 50%;
  position: relative;
}

.icon-search::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 2px;
  right: -6px;
  bottom: -3px;
  background: currentColor;
  transform: rotate(45deg);
  border-radius: 999px;
}

.icon-theme {
  position: relative;
  width: 18px;
  height: 18px;
  display: block;
  border-radius: 50%;
  background: currentColor;
  box-shadow: inset -6px -6px 0 var(--surface);
}

.theme-toggle.is-dark .icon-theme {
  box-shadow: inset -2px -2px 0 var(--surface);
}

.theme-toggle.is-dark .icon-theme::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  top: -1px;
  right: -1px;
  border-radius: 50%;
  background: var(--lime);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 999px;
  transition: transform 180ms ease, opacity 180ms ease;
}

.menu-toggle.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   4. Search panel
   ========================================================================== */
.search-panel {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: none;
  place-items: start center;
  padding: 96px 20px 28px;
}

.search-panel.is-open {
  display: grid;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 17, 0.58);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.search-card {
  position: relative;
  z-index: 1;
  width: min(780px, 100%);
  max-height: calc(100vh - 126px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.search-card-header h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.close-button {
  flex: 0 0 auto;
  font-size: 1.55rem;
  line-height: 1;
}

.search-card .search-field,
.search-card input[type="search"],
.search-card input[type="text"] {
  width: 100%;
  min-width: 0;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 16px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
}

.search-card input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 107, 95, 0.12);
}

.search-card form {
  position: relative;
}

.search-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 18px;
}

.search-suggestions a,
.search-suggestions span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.search-suggestions a:hover {
  border-color: rgba(0, 107, 95, 0.36);
  color: var(--teal);
}

.search-results {
  display: grid;
  gap: 10px;
}

.search-results a {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  background: var(--bg);
}

.search-results a:hover {
  border-color: rgba(0, 107, 95, 0.36);
}

.search-results span {
  color: var(--teal);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.search-empty {
  display: none;
  margin: 14px 0 0;
}

.search-empty.is-visible {
  display: block;
}

.text-button {
  border: 0;
  border-radius: var(--radius);
  padding: 0 18px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

/* ==========================================================================
   5. Hero
   ========================================================================== */
.section-offset {
  padding-top: 64px;
}

.hero {
  padding-bottom: 74px;
  border-bottom: 1px solid var(--line);
  background: var(--hero-wash), var(--bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(340px, 1.04fr);
  gap: 44px;
  align-items: center;
}

.hero-content {
  max-width: 620px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  font-size: clamp(2.35rem, 5.4vw, 4.1rem);
  line-height: 1.03;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: clamp(1.08rem, 2vw, 1.45rem);
  line-height: 1.18;
  letter-spacing: 0;
}

p {
  color: var(--muted);
}

.hero-content p {
  max-width: 560px;
  margin-bottom: 22px;
  font-size: 1.12rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 16px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.article-meta span {
  position: relative;
}

.article-meta span:not(:last-child)::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  top: 50%;
  right: -11px;
  border-radius: 999px;
  background: var(--line);
  transform: translateY(-50%);
}

.primary-link,
.section-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin-top: 28px;
  color: var(--teal-dark);
  font-weight: 900;
}

.primary-link::after,
.section-link::after {
  content: "\2192";
  transition: transform 180ms ease;
}

.primary-link:hover::after,
.section-link:hover::after {
  transform: translateX(4px);
}

.hero-image-wrap {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--surface-muted);
}

.hero-image {
  height: 100%;
  min-height: 520px;
  object-fit: cover;
}

.hero-badge {
  position: absolute;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 3px;
  width: 118px;
  min-height: 92px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: var(--radius);
  background: rgba(22, 33, 31, 0.78);
  color: #fff;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.hero-badge span {
  color: var(--lime);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-badge strong {
  font-size: 1.7rem;
  line-height: 1;
}

/* ==========================================================================
   6. Sections, cards & grids
   ========================================================================== */
.section {
  padding: 80px 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

.segmented-control {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.segment {
  border: 0;
  border-radius: 6px;
  padding: 9px 14px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.segment.is-active {
  background: var(--ink);
  color: #fff;
}

.trending-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.85fr) minmax(260px, 0.85fr);
  gap: 20px;
}

.post-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 107, 95, 0.32);
  box-shadow: 0 18px 38px rgba(17, 36, 33, 0.1);
}

.post-card.is-hidden {
  display: none;
}

.post-card-large {
  grid-row: span 2;
}

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

.post-card-large .post-image {
  aspect-ratio: 16 / 12;
}

.post-image img,
.feature-post img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.post-card:hover .post-image img,
.feature-post:hover img {
  transform: scale(1.04);
}

.post-body {
  padding: 20px;
}

.post-body p {
  margin-bottom: 18px;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 13px;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--ink);
  background: var(--surface-muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.category-pill.ai {
  background: #dff5ec;
  color: #075f52;
}

.category-pill.seo {
  background: #e3edff;
  color: #214ecb;
}

.category-pill.marketing {
  background: #ffe9df;
  color: #b63c20;
}

.category-pill.website {
  background: #fff2ca;
  color: #8a5a00;
}

.category-band {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.category-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 28px;
}

.feature-post {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--bg);
}

.feature-post img {
  aspect-ratio: 4 / 3;
  border-radius: 6px;
}

.feature-post p {
  margin-bottom: 20px;
}

.article-list {
  display: grid;
  gap: 12px;
}

.list-item {
  display: grid;
  gap: 6px;
  min-height: 105px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--bg);
  transition: border-color 180ms ease, transform 180ms ease;
}

.list-item:hover {
  border-color: rgba(0, 107, 95, 0.32);
  transform: translateX(4px);
}

.list-item span,
.mini-card small {
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.list-item strong {
  font-size: 1.06rem;
  line-height: 1.25;
}

.post-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  gap: 26px;
}

.feature-post.compact {
  grid-template-columns: 1fr;
}

.feature-post.compact img {
  aspect-ratio: 16 / 9;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.mini-card {
  display: flex;
  min-height: 168px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--bg);
  transition: transform 180ms ease, border-color 180ms ease;
}

.mini-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 107, 95, 0.32);
}

.number {
  color: var(--coral);
  font-size: 0.86rem;
  font-weight: 900;
}

.mini-card strong {
  margin: 12px 0 18px;
  font-size: 1.04rem;
  line-height: 1.25;
}

.marketing-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.post-card.horizontal {
  display: grid;
  grid-template-columns: minmax(210px, 0.82fr) minmax(0, 1fr);
}

.post-card.horizontal .post-image {
  height: 100%;
  aspect-ratio: auto;
}

/* ==========================================================================
   7. Newsletter
   ========================================================================== */
.newsletter-section {
  padding: 70px 0;
  background: var(--teal-dark);
  color: #fff;
}

.newsletter-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: 34px;
  align-items: center;
}

.newsletter-inner .eyebrow {
  color: var(--lime);
}

.newsletter-inner h2 {
  max-width: 680px;
}

.newsletter-inner p {
  max-width: 600px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.78);
}

.newsletter-form {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
}

.newsletter-form input {
  min-width: 0;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  padding: 0 15px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  outline: none;
}

.newsletter-form input:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(196, 232, 107, 0.18);
}

.newsletter-form button {
  height: 52px;
  border: 0;
  border-radius: var(--radius);
  background: var(--lime);
  color: var(--ink);
  font-weight: 900;
}

.mailchimp-field {
  position: absolute;
  left: -5000px;
}

.form-message {
  min-height: 20px;
  font-size: 0.88rem;
}

/* ==========================================================================
   8. Related / editor's pick
   ========================================================================== */
.related-section {
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.related-card {
  display: grid;
  align-content: space-between;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, border-color 180ms ease;
}

.related-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 107, 95, 0.32);
}

.related-card strong {
  margin: 14px 0 22px;
  font-size: 1.26rem;
  line-height: 1.22;
}

.related-card small {
  color: var(--muted);
  font-weight: 800;
}

/* ==========================================================================
   9. Footer
   ========================================================================== */
.site-footer {
  padding: 58px 0 28px;
  background: var(--footer-bg);
  color: #e8eee9;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.25fr) repeat(3, minmax(150px, 0.5fr));
  gap: 34px;
  padding-bottom: 34px;
}

.footer-brand {
  margin-bottom: 18px;
  color: #fff;
}

.site-footer p {
  max-width: 420px;
  color: var(--footer-copy);
}

.site-footer h2,
.site-footer .widget-title,
.site-footer .widgettitle {
  margin: 0 0 14px;
  font-size: 0.84rem;
  text-transform: uppercase;
  color: var(--lime);
}

.site-footer a:not(.brand) {
  display: block;
  margin-bottom: 9px;
  color: #d9e2dd;
}

.site-footer a:hover {
  color: var(--lime);
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--footer-copy);
  font-size: 0.9rem;
}

/* ==========================================================================
   10. Cookie consent & back-to-top
   ========================================================================== */
.cookie-consent {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 140;
  display: none;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  width: min(560px, calc(100% - 40px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.cookie-consent.is-visible {
  display: grid;
}

.cookie-consent strong {
  display: block;
  margin-bottom: 4px;
}

.cookie-consent p {
  margin: 0;
  font-size: 0.9rem;
}

.cookie-consent button {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 18px;
  background: var(--ink);
  color: var(--surface);
  font-weight: 900;
}

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  box-shadow: 0 16px 32px rgba(17, 36, 33, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

:focus-visible {
  outline: 3px solid rgba(0, 107, 95, 0.35);
  outline-offset: 3px;
}

/* ==========================================================================
   11. WordPress content, single posts & comments
   ========================================================================== */
.site-main {
  display: block;
}

.content-area {
  padding: 64px 0;
}

.content-with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 44px;
  align-items: start;
}

.content-with-sidebar .posts-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-with-sidebar .content-main {
  min-width: 0;
}

.entry-header {
  margin-bottom: 26px;
}

.entry-title {
  margin-bottom: 16px;
}

.single-featured {
  margin: 0 0 30px;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.single-featured img {
  width: 100%;
  height: auto;
}

.entry-content {
  font-size: 1.06rem;
  color: var(--ink);
}

.entry-content > * {
  margin-top: 0;
  margin-bottom: 1.4em;
}

.entry-content p,
.entry-content li {
  color: var(--ink);
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin-top: 1.6em;
}

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

.entry-content img,
.entry-content figure {
  border-radius: var(--radius);
}

.entry-content blockquote {
  margin: 1.6em 0;
  padding: 8px 22px;
  border-left: 4px solid var(--teal);
  background: var(--surface-muted);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.entry-content pre {
  padding: 18px;
  overflow: auto;
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.entry-content code {
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 0.92em;
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.4em;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
}

.entry-content th,
.entry-content td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
}

.entry-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.entry-footer a {
  color: var(--teal);
}

.tags-links a {
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
}

/* Alignments (Gutenberg + Elementor) */
.alignleft {
  float: left;
  margin: 0.4em 1.6em 1.2em 0;
}

.alignright {
  float: right;
  margin: 0.4em 0 1.2em 1.6em;
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.entry-content .alignwide {
  width: min(1100px, 96vw);
  margin-left: calc(50% - min(550px, 48vw));
}

.entry-content .alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.wp-caption,
.wp-caption-text,
figcaption {
  font-size: 0.86rem;
  color: var(--muted);
}

.sticky-badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

/* Author box */
.author-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  margin-top: 36px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.author-box img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}

.author-box h3 {
  margin-bottom: 4px;
}

.author-box p {
  margin: 0;
}

/* Post navigation */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 36px;
}

.post-navigation a {
  display: block;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.post-navigation .nav-next {
  text-align: right;
}

.post-navigation .meta-nav {
  display: block;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

/* Comments */
.comments-area {
  margin-top: 44px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

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

.comment-list .children {
  margin-left: 28px;
  list-style: none;
}

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

.comment-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.comment-author img {
  border-radius: 50%;
}

.comment-respond {
  margin-top: 30px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
}

.comment-form label {
  display: block;
  margin-top: 14px;
  font-weight: 700;
}

.comment-form .submit,
.btn-primary {
  margin-top: 16px;
  padding: 12px 22px;
  border: 0;
  border-radius: var(--radius);
  background: var(--teal);
  color: #fff;
  font-weight: 900;
}

/* ==========================================================================
   12. Archive header, pagination & widgets
   ========================================================================== */
.page-header {
  margin-bottom: 38px;
}

.page-title {
  margin-bottom: 10px;
}

.archive-description {
  max-width: 720px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.pagination {
  margin-top: 46px;
}

.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.pagination .page-numbers {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 800;
}

.pagination .page-numbers.current {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.pagination .page-numbers:hover {
  border-color: var(--teal);
}

.widget-area {
  display: grid;
  gap: 26px;
}

.widget {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.widget-title,
.widget .widgettitle {
  margin-bottom: 14px;
  font-size: 1.05rem;
}

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

.widget ul li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.widget ul li:last-child {
  border-bottom: 0;
}

.widget a:hover {
  color: var(--teal);
}

.widget select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
}

/* ==========================================================================
   13. 404
   ========================================================================== */
.error-404 {
  text-align: center;
  padding: 80px 0;
}

.error-404 .big {
  font-size: clamp(4rem, 14vw, 9rem);
  line-height: 1;
  color: var(--teal);
}

/* ==========================================================================
   14. Admin bar offset
   ========================================================================== */
.admin-bar .site-header {
  top: 32px;
}

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

/* ==========================================================================
   15. Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .content-with-sidebar {
    grid-template-columns: 1fr;
  }

  .posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .container {
    width: min(100% - 32px, 760px);
  }

  .menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    display: grid;
    gap: 0;
    padding: 10px 16px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 22px 40px rgba(19, 35, 32, 0.08);
    transform: translateY(-130%);
    visibility: hidden;
    transition: transform 200ms ease, visibility 200ms ease;
    max-height: calc(100vh - 76px);
    overflow-y: auto;
  }

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

  .nav-menu ul {
    display: grid;
    gap: 0;
  }

  .nav-menu a {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-menu a::after {
    display: none;
  }

  .nav-menu ul ul {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    padding: 0 0 0 14px;
  }

  .hero-grid,
  .category-layout,
  .split-section,
  .newsletter-inner {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    gap: 30px;
  }

  .hero-image-wrap,
  .hero-image {
    min-height: 400px;
  }

  .trending-grid,
  .post-row,
  .marketing-layout,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .post-card-large {
    grid-row: auto;
    grid-column: span 2;
  }

  .feature-post {
    grid-template-columns: 1fr;
  }

  .feature-post img {
    aspect-ratio: 16 / 9;
  }

  .post-card.horizontal {
    grid-template-columns: 1fr;
  }

  .post-card.horizontal .post-image {
    aspect-ratio: 16 / 10;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .container {
    width: calc(100% - 28px);
  }

  .header-inner {
    min-height: 68px;
  }

  .brand {
    font-size: 0.96rem;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .nav-menu,
  .search-panel {
    top: 68px;
  }

  .search-panel {
    inset: 0;
    padding: 86px 14px 18px;
  }

  .search-card {
    max-height: calc(100vh - 104px);
    padding: 18px;
  }

  .search-card-header {
    gap: 12px;
  }

  .section-offset {
    padding-top: 42px;
  }

  .hero {
    padding-bottom: 52px;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .hero-image-wrap,
  .hero-image {
    min-height: 318px;
  }

  .hero-badge {
    right: 14px;
    bottom: 14px;
    width: 104px;
    min-height: 82px;
    padding: 13px;
  }

  .section {
    padding: 58px 0;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented-control {
    width: 100%;
    overflow-x: auto;
  }

  .segment {
    flex: 1;
    white-space: nowrap;
  }

  .trending-grid,
  .post-row,
  .marketing-layout,
  .mini-grid,
  .related-grid,
  .posts-grid {
    grid-template-columns: 1fr;
  }

  .post-card-large {
    grid-column: auto;
  }

  .post-body {
    padding: 18px;
  }

  .text-button {
    min-height: 46px;
  }

  .newsletter-section {
    padding: 54px 0;
  }

  .newsletter-form {
    padding: 14px;
  }

  .cookie-consent {
    left: 14px;
    right: 14px;
    bottom: 14px;
    grid-template-columns: 1fr;
    width: auto;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
  }

  .post-navigation {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
