/*
Theme Name: RippleStat Light
Theme URI: https://ripplestat.com
Author: RippleStat
Author URI: https://ripplestat.com
Description: High-performance, lightweight financial & crypto news theme for RippleStat. Clean, eye-friendly light theme featuring soft off-white background (#f8fafc), elegant slate typography, refined emerald green accents, unified Inter font, compact 62px header with 50px sharp square logo, inline search, dynamic customizable navigation with parent/child dropdowns, compact overlay hero card, and clean single-line category headers.
Version: 2.2.0
Tested up to: 6.7
Requires at least: 5.8
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: ripplestat
Tags: blog, news, finance, cryptocurrency, light-mode, custom-colors, responsive-layout, translation-ready
*/

/* ==========================================================================
   CSS Variables & Design Tokens (Eye-Friendly Light Palette)
   ========================================================================== */
:root {
  /* Eye-friendly off-white backgrounds */
  --bg-main: #f8fafc;            /* Soft slate off-white */
  --bg-header: #ffffff;          /* Clean white header */
  --bg-card: #ffffff;            /* Crisp white cards */
  --bg-card-hover: #ffffff;      /* Pure white on hover */
  --bg-card-muted: #f1f5f9;      /* Light neutral slate for ad slots and fallbacks */

  /* Slate typography tokens (optimal readability & contrast) */
  --text-primary: #0f172a;       /* Slate-900: deep authoritative charcoal */
  --text-secondary: #475569;     /* Slate-600: balanced secondary text & meta */
  --text-muted: #94a3b8;         /* Slate-400: subtle hints, dates, placeholders */

  /* Mature, prestigious financial emerald green */
  --accent-green: #047857;       /* Emerald-700: deep financial green (6.1:1 contrast) */
  --accent-green-hover: #065f46; /* Emerald-800: deep hover state */
  --accent-green-soft: #ecfdf5;  /* Emerald-50: elegant light badge background */
  --accent-green-border: #a7f3d0;/* Emerald-200: subtle badge border */

  /* Hairline borders & subtle elevation shadows */
  --border-color: #e2e8f0;       /* Slate-200: hairline border */
  --border-subtle: #cbd5e1;      /* Slate-300: hover border & dividers */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-hover: 0 4px 14px rgba(15, 23, 42, 0.07);
  --shadow-dropdown: 0 10px 25px rgba(15, 23, 42, 0.08), 0 4px 6px rgba(15, 23, 42, 0.04);

  /* Unified typography & sizing */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius-sm: 6px;
  --radius-md: 8px;
  --container-width: 1220px;
  --transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, width 0.2s ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html,
body,
body.custom-background {
  background-color: var(--bg-main) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-main);
  font-size: 0.95rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

ul, ol {
  list-style: none;
}

button, input, textarea, select {
  font-family: var(--font-main);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-family: var(--font-main);
  font-weight: 700;
  line-height: 1.3;
}

/* Screen reader text accessibility helper */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.site-container {
  width: 100%;
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.site-main-wrap {
  flex: 1;
  padding: 1.25rem 0 2.5rem;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}

.site-main-column {
  min-width: 0;
}

/* Full Width Article & Page Layout (Expanded across sidebar space) */
.content-full-layout {
  width: 100%;
}

.content-full-layout .article-detail-wrap {
  width: 100%;
  box-sizing: border-box;
}

.content-full-layout .article-featured-image {
  margin-bottom: 2rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.content-full-layout .article-featured-image img {
  width: 100%;
  max-height: 540px;
  object-fit: cover;
}

.content-full-layout .article-body-content {
  font-size: 1.05rem;
  line-height: 1.85;
}

.content-full-layout .related-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .content-full-layout .related-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Header & Navigation Bar (62px Height, 50px Logo)
   ========================================================================== */
.site-header {
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}

/* RippleStat Logo (50px Square, Closer to RippleStat Text) */
.site-branding {
  display: flex;
  align-items: center;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.45rem; /* Noticeably closer to the RippleStat title */
  text-decoration: none;
  line-height: 1;
}

.brand-badge,
.custom-logo,
.custom-logo-svg,
.site-branding img,
.site-branding svg,
.footer-brand .custom-logo-svg,
.footer-brand .brand-badge {
  width: 50px;
  height: 50px;
  max-width: 50px;
  max-height: 50px;
  object-fit: contain;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  shape-rendering: geometricPrecision;
  flex-shrink: 0;
}

.brand-badge {
  background-color: var(--accent-green);
  color: #ffffff;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Two-tone Brand Title: Ripple (Slate-900), Stat (Emerald Green) */
.brand-title {
  font-family: var(--font-main);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.brand-ripple {
  color: var(--text-primary);
  transition: var(--transition);
}

.brand-stat {
  color: var(--accent-green);
  transition: var(--transition);
}

.brand-link:hover .brand-ripple {
  color: var(--accent-green);
}

.brand-link:hover .brand-stat {
  color: var(--accent-green-hover);
}

/* ==========================================================================
   Primary Navigation Menu & Dropdown (Sub-menu) Support
   ========================================================================== */
.main-navigation {
  display: flex;
  align-items: center;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  margin: 0;
  padding: 0;
}

.nav-menu li {
  position: relative;
}

.nav-menu a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.4rem 0.15rem;
  display: inline-flex;
  align-items: center;
  transition: var(--transition);
}

.nav-menu a:hover {
  color: var(--text-primary);
}

/* Active Menu Item with refined emerald indicator line */
.nav-menu > li.current-menu-item > a,
.nav-menu > li.current_page_item > a,
.nav-menu > li.active > a {
  color: var(--text-primary);
  font-weight: 600;
}

.nav-menu > li.current-menu-item > a::after,
.nav-menu > li.current_page_item > a::after,
.nav-menu > li.active > a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--accent-green);
  border-radius: 2px;
}

/* Dropdown Arrow Indicator for Parent Items */
.nav-menu .menu-item-has-children > a {
  gap: 0.35rem;
}

.nav-menu .menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-top: -2px;
  transition: transform 0.2s ease;
}

.nav-menu .menu-item-has-children:hover > a::after,
.nav-menu .menu-item-has-children:focus-within > a::after {
  transform: rotate(-135deg);
  margin-top: 2px;
}

/* Elegant Floating Dropdown Card */
.nav-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  padding: 0.45rem 0;
  margin-top: 0.4rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 250;
  list-style: none;
}

/* Hover Bridge: Prevents dropdown from closing when moving mouse across margin gap */
.nav-menu .sub-menu::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

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

.nav-menu .sub-menu li {
  width: 100%;
  position: relative;
}

.nav-menu .sub-menu a {
  display: block;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: var(--transition);
}

.nav-menu .sub-menu a:hover,
.nav-menu .sub-menu li.current-menu-item > a {
  background-color: var(--accent-green-soft);
  color: var(--accent-green);
  font-weight: 600;
}

/* Multi-level Dropdowns (Sub-sub-menus) */
.nav-menu .sub-menu .sub-menu {
  top: 0;
  left: 100%;
  margin-top: -0.45rem;
  margin-left: 2px;
}

/* ==========================================================================
   Header Right: Search Bar & Mobile Toggle
   ========================================================================== */
.header-right-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-compact-search {
  display: flex;
  align-items: center;
  background-color: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 0.5rem 0 0.7rem;
  height: 33px;
  width: 175px;
  transition: var(--transition);
}

.header-compact-search:focus-within {
  background-color: #ffffff;
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.12);
  width: 215px;
}

.header-compact-search input[type="search"] {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
  width: 100%;
}

.header-compact-search input[type="search"]::placeholder {
  color: var(--text-muted);
}

.header-compact-search button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0;
  transition: var(--transition);
}

.header-compact-search button:hover {
  color: var(--accent-green);
}

.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.mobile-nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background-color: var(--text-primary);
  position: relative;
}

.mobile-nav-toggle span::before,
.mobile-nav-toggle span::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 2px;
  background-color: var(--text-primary);
  left: 0;
}

.mobile-nav-toggle span::before { top: -5px; }
.mobile-nav-toggle span::after { bottom: -5px; }

/* Mobile Drawer & Nested Accordion */
.mobile-drawer {
  display: none;
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.25rem 1.25rem;
}

.mobile-drawer.is-open {
  display: block;
}

.mobile-nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-nav-menu li {
  position: relative;
}

.mobile-nav-menu a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  font-weight: 500;
  border-radius: var(--radius-sm);
}

.mobile-nav-menu a:hover,
.mobile-nav-menu li.current-menu-item > a {
  color: var(--text-primary);
  background-color: var(--bg-main);
  border-left: 3px solid var(--accent-green);
}

.mobile-nav-menu .menu-item-has-children {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.mobile-nav-menu .menu-item-has-children > a {
  flex: 1;
}

.mobile-sub-toggle {
  background: transparent;
  border: none;
  padding: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.mobile-sub-toggle.is-active {
  transform: rotate(180deg);
  color: var(--accent-green);
}

.mobile-nav-menu .sub-menu {
  display: none;
  width: 100%;
  padding-left: 1rem;
  margin-top: 0.25rem;
  border-left: 2px solid var(--border-color);
}

.mobile-nav-menu .sub-menu.is-open {
  display: block;
}

.mobile-nav-menu .sub-menu a {
  font-size: 0.88rem;
  padding: 0.5rem 0.85rem;
}

.mobile-search-box {
  margin-top: 0.75rem;
}

.mobile-search-box input[type="search"] {
  width: 100%;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
}

.mobile-search-box input[type="search"]:focus {
  background-color: #ffffff;
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.12);
}

/* ==========================================================================
   Breadcrumb Navigation (Issue #16)
   ========================================================================== */
.ripplestat-breadcrumbs {
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.ripplestat-breadcrumbs ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ripplestat-breadcrumbs li {
  display: inline-flex;
  align-items: center;
}

.ripplestat-breadcrumbs a {
  color: var(--text-secondary);
}

.ripplestat-breadcrumbs a:hover {
  color: var(--accent-green);
}

.breadcrumb-separator {
  color: var(--text-muted);
  font-size: 0.95rem;
  user-select: none;
}

/* ==========================================================================
   Hero Featured Post (Compact Overlay Style on Pre-Image)
   ========================================================================== */
.featured-hero-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 1.5rem;
  position: relative;
  transition: var(--transition);
}

.featured-hero-card:hover {
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-hover);
}

.featured-media-wrap {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 2.1 / 1;
  max-height: 290px;
  background-color: #e2e8f0;
  overflow: hidden;
}

.featured-media-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.featured-hero-card:hover .featured-media-wrap img {
  transform: scale(1.02);
}

.featured-media-placeholder {
  width: 100%;
  height: 100%;
  background: var(--bg-card-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.featured-hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.04) 0%, rgba(15, 23, 42, 0.72) 48%, rgba(15, 23, 42, 0.96) 100%);
  z-index: 2;
}

.featured-hero-overlay .featured-category-tag {
  color: #34d399;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: capitalize;
  margin-bottom: 0.35rem;
  letter-spacing: 0.2px;
}

.featured-hero-overlay .featured-hero-title {
  font-size: 1.35rem;
  line-height: 1.35;
  color: #ffffff;
  margin-bottom: 0.45rem;
  font-weight: 700;
  transition: var(--transition);
}

.featured-hero-card:hover .featured-hero-title {
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.featured-hero-overlay .featured-hero-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
}

/* ==========================================================================
   Horizontal Post Stream (Homepage Feed)
   ========================================================================== */
.post-stream-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.post-horizontal-card {
  display: grid;
  grid-template-columns: 210px 1fr;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  min-height: 125px;
  transition: var(--transition);
}

.post-horizontal-card:hover {
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-hover);
}

.post-card-thumb-wrap {
  width: 100%;
  height: 100%;
  min-height: 125px;
  background-color: var(--bg-card-muted);
  overflow: hidden;
  display: block;
}

.post-card-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.post-horizontal-card:hover .post-card-thumb-wrap img {
  transform: scale(1.03);
}

.post-thumb-fallback {
  width: 100%;
  height: 100%;
  background: var(--bg-card-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.post-card-content {
  padding: 1.15rem 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.post-category-label {
  color: var(--accent-green);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: capitalize;
  margin-bottom: 0.35rem;
}

.post-category-label a {
  color: var(--accent-green);
}

.post-category-label a:hover {
  color: var(--accent-green-hover);
}

.post-card-title {
  font-size: 1.2rem;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.post-card-title a {
  color: var(--text-primary);
  transition: var(--transition);
}

.post-card-title a:hover {
  color: var(--accent-green);
}

.post-card-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ==========================================================================
   Category Archive Grid (Uniform Medium Size, 16:9, text on image)
   ========================================================================== */
.category-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.category-grid-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
  transition: var(--transition);
}

.category-grid-card:hover {
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-hover);
}

.cat-card-media-wrap {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-card-muted);
  overflow: hidden;
}

.cat-card-media-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.category-grid-card:hover .cat-card-media-wrap img {
  transform: scale(1.03);
}

.cat-card-thumb-fallback {
  width: 100%;
  height: 100%;
  background: var(--bg-card-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.cat-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.05) 0%, rgba(15, 23, 42, 0.72) 50%, rgba(15, 23, 42, 0.96) 100%);
  z-index: 2;
}

.cat-card-tag {
  color: #34d399;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: capitalize;
  margin-bottom: 0.35rem;
  letter-spacing: 0.2px;
}

.cat-card-title {
  color: #ffffff;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.4rem;
  transition: var(--transition);
}

.category-grid-card:hover .cat-card-title {
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.cat-card-meta {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.78rem;
}

/* ==========================================================================
   Compact Single-Line Category Header
   ========================================================================== */
.archive-header-compact {
  margin-bottom: 1.25rem;
  padding: 0 0 0.25rem 0;
  border: none;
  background: transparent;
}

.archive-title-compact {
  font-size: 1.45rem;
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.archive-title-compact::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.15rem;
  background-color: var(--accent-green);
  border-radius: 2px;
}

/* Search Results Header Box (Issue #3) */
.archive-header-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
}

.archive-pretitle {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-green);
  display: block;
  margin-bottom: 0.35rem;
}

.archive-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

.archive-title span {
  color: var(--accent-green);
}

.search-fallback-wrap {
  margin-top: 1.25rem;
  max-width: 500px;
}

/* ==========================================================================
   Custom Search Form (Issue #5)
   ========================================================================== */
.search-form-wrap {
  width: 100%;
}

.search-form-inner {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.search-field {
  flex: 1;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 0.92rem;
  transition: var(--transition);
}

.search-field:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.12);
}

.search-submit {
  background-color: var(--accent-green);
  color: #ffffff;
  border: none;
  padding: 0 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.search-submit:hover {
  background-color: var(--accent-green-hover);
}

/* ==========================================================================
   404 Page (Issue #4)
   ========================================================================== */
.error-404-wrap {
  text-align: center;
  padding: 3.5rem 2rem;
}

.error-404-code {
  font-size: 5.5rem;
  font-weight: 800;
  color: var(--accent-green);
  line-height: 1;
  display: block;
  margin-bottom: 0.75rem;
  letter-spacing: -2px;
}

.error-404-title {
  margin-bottom: 0.75rem;
  font-size: 1.75rem;
}

.error-404-desc {
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 1.5rem;
  font-size: 1rem;
}

.error-404-search {
  max-width: 440px;
  margin: 0 auto 2rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  background-color: var(--accent-green);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.btn-primary:hover {
  background-color: var(--accent-green-hover);
  color: #ffffff;
}

/* ==========================================================================
   Sidebar (Popular Articles & Ad Spot)
   ========================================================================== */
.site-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-card-widget {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  padding: 1.5rem 1.75rem;
}

.sidebar-widget-title {
  color: var(--accent-green);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding-bottom: 0.85rem;
  margin-bottom: 1.15rem;
  border-bottom: 1px solid var(--border-color);
}

.popular-articles-list {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.popular-article-item {
  position: relative;
}

.popular-article-link {
  display: block;
}

.popular-article-title {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.25rem;
  transition: var(--transition);
}

.popular-article-link:hover .popular-article-title {
  color: var(--accent-green);
}

.popular-article-date {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ==========================================================================
   Ad Slots
   ========================================================================== */
.ad-slot-wrapper {
  margin: 1.5rem 0;
  position: relative;
  text-align: center;
}

.ad-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  display: inline-block;
}

.ad-content-box {
  background-color: #f8fafc;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
  min-height: 85px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot-header { margin: 1rem 0; }
.ad-slot-sidebar { margin: 0; }
.ad-slot-sidebar .ad-content-box { min-height: 250px; }
.ad-slot-infeed { margin: 1.5rem 0; }

.ad-placeholder-hint {
  color: var(--text-muted);
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.ad-placeholder-hint span {
  font-weight: 600;
  color: var(--text-secondary);
}

/* ==========================================================================
   Single Article & About Us Page
   ========================================================================== */
.article-detail-wrap {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  padding: 2.25rem 2rem;
}

.page-about-wrap .article-body-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-header {
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
}

.article-header .category-badge {
  color: var(--accent-green);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.6rem;
  display: inline-block;
}

.article-main-title {
  font-size: 2rem;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.article-meta-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  flex-wrap: wrap;
}

.article-meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.article-featured-image {
  margin: 1.5rem 0 2rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.article-body-content {
  color: #334155;
  font-size: 1.05rem;
  line-height: 1.78;
}

.article-body-content p {
  margin-bottom: 1.4rem;
}

.article-body-content h2,
.article-body-content h3,
.article-body-content h4 {
  color: var(--text-primary);
  margin-top: 1.85rem;
  margin-bottom: 0.75rem;
}

.article-body-content a {
  color: var(--accent-green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body-content a:hover {
  color: var(--accent-green-hover);
}

.article-body-content blockquote {
  border-left: 3px solid var(--accent-green);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

.article-tags-wrap {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.article-tags-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.article-tag-item {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-card-muted);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: var(--transition);
}

.article-tag-item a {
  color: inherit;
  text-decoration: none;
}

.article-tag-item:hover,
.article-tag-item:hover a {
  background-color: var(--accent-green-soft);
  color: var(--accent-green);
  border-color: var(--accent-green-border);
}

/* Related Posts Section (Issue #17) */
.related-posts-section {
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-color);
}

.related-posts-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.15rem;
}

.related-cards-grid {
  margin-top: 0.5rem;
}

/* Post Navigation (Issue #6) */
.post-navigation {
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.post-navigation .nav-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
  display: flex;
  flex-direction: column;
}

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

.post-navigation a {
  display: flex;
  flex-direction: column;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-main);
  transition: var(--transition);
}

.post-navigation a:hover {
  border-color: var(--accent-green);
  background-color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.post-navigation .nav-subtitle {
  font-size: 0.78rem;
  color: var(--accent-green);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 0.25rem;
}

.post-navigation .nav-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

/* Pagination */
.pagination-nav {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
}

.pagination-nav .nav-links {
  display: flex;
  gap: 0.4rem;
}

.pagination-nav .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 0.6rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

.pagination-nav .page-numbers:hover,
.pagination-nav .page-numbers.current {
  background-color: var(--accent-green);
  color: #ffffff;
  border-color: var(--accent-green);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background-color: var(--bg-header);
  border-top: 1px solid var(--border-color);
  padding: 2.25rem 0 1.75rem;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent-green);
}

/* Back to Top Button (Issue #9) */
.back-to-top {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.15s ease, color 0.15s ease;
}

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

.back-to-top:hover {
  color: var(--accent-green);
  border-color: var(--accent-green);
}

/* ==========================================================================
   Responsive & Mobile Breakpoints
   ========================================================================== */
@media (max-width: 992px) {
  .content-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .site-sidebar {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
  }

  .header-compact-search {
    display: none;
  }
}

@media (max-width: 768px) {
  .site-main-wrap {
    padding: 1.25rem 0 2rem;
  }

  .main-navigation {
    display: none;
  }

  .mobile-nav-toggle {
    display: flex;
  }

  .featured-media-wrap {
    aspect-ratio: 16 / 9;
    max-height: 240px;
  }

  .featured-hero-overlay .featured-hero-title {
    font-size: 1.15rem;
  }

  .post-horizontal-card {
    grid-template-columns: 130px 1fr;
    min-height: 105px;
  }

  .post-card-thumb-wrap {
    min-height: 105px;
  }

  .post-card-content {
    padding: 0.75rem 0.9rem;
  }

  .post-card-title {
    font-size: 1rem;
  }

  .category-cards-grid {
    grid-template-columns: 1fr;
  }

  .article-detail-wrap {
    padding: 1.5rem 1.25rem;
  }

  .article-main-title {
    font-size: 1.6rem;
  }

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

  .post-navigation .nav-next {
    grid-column: 1;
    text-align: left;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .post-horizontal-card {
    grid-template-columns: 1fr;
  }

  .post-card-thumb-wrap {
    height: 150px;
  }

  .post-card-title {
    font-size: 1.1rem;
  }
}
