/*
Theme Name: Slovenia SI Theme
Theme URI: https://slovenia.si
Author: Slovenia SI
Author URI: https://slovenia.si
Description: A WordPress theme inspired by the slovenia.si national brand website. Features a full-width hero header with background image, smart search with WP REST API, responsive navigation, and Slovenian green branding.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
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: slovenia-si
Tags: custom-header, custom-menu, featured-images, threaded-comments, translation-ready, responsive-layout

Slovenia SI Theme — National Brand Style WordPress Theme
*/

/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
  /* Brand Colors */
  --color-primary: #1B7A3D;
  --color-primary-hover: #1B7A3D;
  --color-primary-light: #E8F5EC;
  --color-primary-foreground: #FFFFFF;

  /* Neutral Colors */
  --color-bg: #FFFFFF;
  --color-surface: #F5F8F6;
  --color-text: #333333;
  --color-text-muted: #777777;
  --color-border: #E5E5E5;

  /* Navigation */
  --header-overlay: rgba(0, 0, 0, 0.55);
  --nav-text: #FFFFFF;
  --nav-hover-line: #1B7A3D;

  /* Footer */
  --footer-bg: #1A1A1A;
  --footer-text: #CCCCCC;
  --footer-text-muted: #999999;

  /* Search */
  --search-bg: rgba(255, 255, 255, 0.95);
  --search-border: rgba(255, 255, 255, 0.3);
  --search-focus-border: #1B7A3D;
  --search-result-hover: #F0F7F3;
  --search-result-active: #E8F5EC;

  /* Typography */
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Spacing */
  --container-max: 1200px;
  --container-padding: 1.5rem;

  /* Shadows */
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-search: 0 4px 20px rgba(0, 0, 0, 0.15);

  /* Border Radius */
  --radius-card: 8px;
  --radius-button: 6px;
  --radius-search: 24px;
  --radius-tag: 4px;

  /* Transitions */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 200ms;
  --duration-normal: 300ms;
}

/* ============================================================
   Font Import
   ============================================================ */
@import url('https://miaoda.feishu.cn/fonts/css2?family=Playfair+Display:wght@400;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

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

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

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-smooth);
}

a:hover {
  color: var(--color-primary-hover);
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* ============================================================
   Skip to Content (Accessibility)
   ============================================================ */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: var(--color-primary-foreground);
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 var(--radius-button) var(--radius-button);
  z-index: 10000;
  font-weight: 600;
  font-size: 0.875rem;
  transition: top var(--duration-fast) var(--ease-smooth);
}

.skip-link:focus {
  top: 0;
  color: var(--color-primary-foreground);
}

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text);
  margin-bottom: 0.75em;
}

h1 { font-size: 2.75rem; letter-spacing: -0.02em; }
h2 { font-size: 2.25rem; letter-spacing: -0.015em; }
h3 { font-size: 1.75rem; letter-spacing: -0.01em; }
h4 { font-size: 1.375rem; }
h5 { font-size: 1.125rem; font-family: var(--font-body); font-weight: 600; }
h6 { font-size: 1rem; font-family: var(--font-body); font-weight: 600; }

p {
  margin-bottom: 1.25em;
  line-height: 1.7;
}

.text-muted {
  color: var(--color-text-muted);
}

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

.site-content {
  padding-top: 4rem;
  padding-bottom: 5rem;
  min-height: calc(100vh - 400px);
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: relative;
  width: 100%;
  background-color: #1A2E1A;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--header-overlay);
  z-index: 1;
  pointer-events: none;
}

.site-header > * {
  position: relative;
  z-index: 2;
}

/* ============================================================
   Header Inner — Navigation Bar
   ============================================================ */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem var(--container-padding);
  max-width: var(--container-max);
  margin: 0 auto;
  gap: 2rem;
  z-index: 3;
}

/* Logo */
.site-logo a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--nav-text);
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: opacity var(--duration-normal) var(--ease-smooth);
}

.site-logo a:hover {
  opacity: 0.85;
  color: var(--nav-text);
}

.site-logo img,
.site-logo svg {
  height: 36px;
  width: auto;
}

/* ============================================================
   Primary Navigation
   ============================================================ */
.primary-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.primary-nav .menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

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

.primary-nav .menu li a {
  display: inline-block;
  padding: 0.5rem 1rem;
  color: var(--nav-text);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  position: relative;
  transition: color var(--duration-normal) var(--ease-smooth);
}

.primary-nav .menu li a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background-color: var(--color-primary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--duration-normal) var(--ease-smooth);
}

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

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

/* =====================
   Sub-Menu Dropdowns
   ===================== */

/* Submenus — visibility:hidden keeps element in layout; hover trigger */
.primary-nav .sub-menu {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  visibility: hidden;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

/* Show submenu on hover */
.primary-nav .menu li:hover > .sub-menu {
  visibility: visible;
  opacity: 1;
  z-index: 1000;
}

/* Submenu items */
.primary-nav .sub-menu li {
  display: block;
  margin: 0;
}

.primary-nav .sub-menu li a {
  display: block;
  padding: 0.35rem 1.25rem;
  color: #333;
  font-size: 0.875rem;
  font-weight: 400;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

.primary-nav .sub-menu li a:hover {
  background: #f5f5f5;
  color: var(--color-primary);
}

/* Third-level (nested submenu) */
.primary-nav .sub-menu .sub-menu {
  top: -0.5rem;
  left: 100%;
  margin-top: 0;
  margin-left: 0;
}

/* Right-edge: open submenus to the left */
.primary-nav .sub-menu .sub-menu {
  left: auto;
  right: 100%;
  margin-right: 0;
}

/* Menu item has children indicator — removed, cleaner look */

/* Submenu toggle: hidden by default, shown on mobile */
.submenu-toggle {
  display: none;
}

/* ============================================================
   Search Box (Header)
   ============================================================ */
.header-search {
  position: relative;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: rgba(0, 0, 0, 0.4);
  pointer-events: none;
  transition: color var(--duration-fast) var(--ease-smooth);
}

.search-input {
  width: 220px;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  background: var(--search-bg);
  border: 1px solid var(--search-border);
  border-radius: var(--radius-search);
  color: var(--color-text);
  font-size: 0.875rem;
  outline: none;
  transition: all var(--duration-normal) var(--ease-smooth);
}

.search-input::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

.search-input:focus {
  width: 280px;
  background: #FFFFFF;
  border-color: var(--search-focus-border);
  box-shadow: 0 0 0 3px rgba(0, 109, 58, 0.15);
}

.search-input:focus ~ .search-icon {
  color: var(--color-primary);
}

/* Search Results Dropdown */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: 320px;
  background: #FFFFFF;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-search);
  border: 1px solid var(--color-border);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--duration-fast) var(--ease-smooth);
  max-height: 360px;
  overflow-y: auto;
}

.search-results-dropdown.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.search-results-dropdown .search-result-item {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--color-text);
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-smooth);
}

.search-results-dropdown .search-result-item:last-child {
  border-bottom: none;
}

.search-results-dropdown .search-result-item:hover,
.search-results-dropdown .search-result-item.is-active {
  background-color: var(--search-result-hover);
}

.search-results-dropdown .search-result-item.is-active {
  background-color: var(--search-result-active);
}

.search-results-dropdown .search-result-item .result-title {
  font-weight: 500;
  color: var(--color-text);
}

.search-results-dropdown .search-no-results {
  padding: 1rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.search-results-dropdown .search-loading {
  padding: 1rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* ============================================================
   Mobile Menu Toggle (Hamburger)
   ============================================================ */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  gap: 5px;
  z-index: 100;
}

.mobile-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--nav-text);
  border-radius: 1px;
  transition: all var(--duration-normal) var(--ease-smooth);
  transform-origin: center;
}

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

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

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

/* Mobile search toggle */
.mobile-search-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--nav-text);
}

.mobile-search-toggle svg {
  width: 20px;
  height: 20px;
}

/* ============================================================
   Hero Section (Homepage)
   ============================================================ */
.hero-section {
  position: relative;
  text-align: center;
  padding: 5rem var(--container-padding) 6rem;
  max-width: 800px;
  margin: 0 auto;
  z-index: 1;
}

.hero-section > * {
  position: relative;
}

.hero-section .hero-title {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--nav-text);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero-section .hero-subtitle {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-button);
  border: none;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-smooth);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-primary-foreground);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  color: var(--color-primary-foreground);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 109, 58, 0.25);
}

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

.btn-secondary:hover {
  background-color: var(--color-primary);
  color: var(--color-primary-foreground);
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-text);
  padding: 0.5rem 1rem;
}

.btn-ghost:hover {
  color: var(--color-primary);
}

/* ============================================================
   Post Cards — Blog Grid
   ============================================================ */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.post-card {
  background: var(--color-bg);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-smooth);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.post-card .card-thumbnail {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

.post-card .card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-normal) var(--ease-smooth);
}

.post-card:hover .card-thumbnail img {
  transform: scale(1.05);
}

.post-card .card-thumbnail .card-category {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--color-primary);
  color: var(--color-primary-foreground);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-tag);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-card .card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card .card-date {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.post-card .card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
  margin-bottom: 0.75rem;
}

.post-card .card-title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-smooth);
}

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

.post-card .card-excerpt {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  flex: 1;
}

.post-card .card-read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
  transition: gap var(--duration-normal) var(--ease-smooth);
}

.post-card .card-read-more:hover {
  gap: 0.625rem;
}

.post-card .card-read-more svg {
  width: 16px;
  height: 16px;
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3.5rem;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  text-decoration: none;
  transition: all var(--duration-normal) var(--ease-smooth);
}

.pagination .page-numbers:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background-color: var(--color-primary-light);
}

.pagination .page-numbers.current {
  background-color: var(--color-primary);
  color: var(--color-primary-foreground);
  border-color: var(--color-primary);
}

.pagination .page-numbers.dots {
  border: none;
  min-width: auto;
  padding: 0 0.25rem;
  color: var(--color-text-muted);
}

/* ============================================================
   Page Content
   ============================================================ */
.page-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.page-header .page-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.page-content {
  max-width: 800px;
  font-size: 1.0625rem;
  line-height: 1.8;
}

.page-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.page-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.page-content p {
  margin-bottom: 1.5rem;
}

.page-content ul,
.page-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.page-content ul {
  list-style: disc;
}

.page-content ol {
  list-style: decimal;
}

.page-content li {
  margin-bottom: 0.5rem;
}

.page-content blockquote {
  border-left: 3px solid var(--color-primary);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--color-surface);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  font-style: italic;
  color: var(--color-text-muted);
}

.page-content img {
  border-radius: var(--radius-card);
  margin: 1.5rem 0;
}

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

.page-content a:hover {
  color: var(--color-primary-hover);
}

/* ============================================================
   Single Post
   ============================================================ */
.single-post-header {
  margin-bottom: 2.5rem;
  text-align: center;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.single-post-header .post-category {
  display: inline-block;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-tag);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.single-post-header .post-title {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.single-post-header .post-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.single-post-header .post-meta .meta-separator {
  width: 4px;
  height: 4px;
  background: var(--color-text-muted);
  border-radius: 50%;
}

.single-post-featured-image {
  margin-bottom: 3rem;
  border-radius: var(--radius-card);
  overflow: hidden;
}

.single-post-featured-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 21 / 9;
  object-fit: cover;
}

.single-post-content {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.85;
}

.single-post-content h2 {
  margin-top: 3rem;
  margin-bottom: 1.25rem;
}

.single-post-content h3 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.single-post-content p {
  margin-bottom: 1.5rem;
}

.single-post-content ul,
.single-post-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.single-post-content ul { list-style: disc; }
.single-post-content ol { list-style: decimal; }

.single-post-content li {
  margin-bottom: 0.5rem;
}

.single-post-content blockquote {
  border-left: 3px solid var(--color-primary);
  padding: 1.25rem 1.75rem;
  margin: 2.5rem 0;
  background: var(--color-surface);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--color-text);
  line-height: 1.6;
}

.single-post-content img {
  border-radius: var(--radius-card);
  margin: 2rem 0;
}

.single-post-content a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.single-post-content a:hover {
  color: var(--color-primary-hover);
}

/* Post Tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.post-tags a {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border-radius: var(--radius-tag);
  transition: all var(--duration-normal) var(--ease-smooth);
}

.post-tags a:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* Related Posts */
.related-posts {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--color-border);
}

.related-posts .section-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.related-post-card {
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--color-bg);
  box-shadow: var(--shadow-card);
  transition: all var(--duration-normal) var(--ease-smooth);
}

.related-post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

.related-post-card .related-thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.related-post-card .related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-normal) var(--ease-smooth);
}

.related-post-card:hover .related-thumb img {
  transform: scale(1.05);
}

.related-post-card .related-info {
  padding: 1rem 1.25rem;
}

.related-post-card .related-info .related-date {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 0.375rem;
}

.related-post-card .related-info .related-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.related-post-card .related-info .related-title a {
  color: var(--color-text);
}

.related-post-card .related-info .related-title a:hover {
  color: var(--color-primary);
}

/* ============================================================
   Search Results Page
   ============================================================ */
.search-page-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.search-page-header .search-page-title {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.search-page-header .search-page-title span {
  color: var(--color-primary);
}

.search-page-header .search-result-count {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.search-result-entry {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--color-bg);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: all var(--duration-normal) var(--ease-smooth);
}

.search-result-entry:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.search-result-entry .result-thumb {
  flex-shrink: 0;
  width: 160px;
  height: 120px;
  border-radius: var(--radius-card);
  overflow: hidden;
}

.search-result-entry .result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-result-entry .result-content {
  flex: 1;
  min-width: 0;
}

.search-result-entry .result-content .result-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.search-result-entry .result-content .result-title a {
  color: var(--color-text);
}

.search-result-entry .result-content .result-title a:hover {
  color: var(--color-primary);
}

.search-result-entry .result-content .result-excerpt {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-entry .result-content .result-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
}

/* No results */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
}

.no-results .no-results-icon {
  width: 64px;
  height: 64px;
  color: var(--color-text-muted);
  margin: 0 auto 1.5rem;
  opacity: 0.5;
}

.no-results .no-results-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.no-results .no-results-text {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* Search form on search page */
.search-page-form {
  max-width: 560px;
  margin: 0 auto 3rem;
}

.search-page-form .search-form-group {
  display: flex;
  gap: 0.75rem;
}

.search-page-form .search-field {
  flex: 1;
  padding: 0.875rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  font-size: 1rem;
  color: var(--color-text);
  outline: none;
  transition: all var(--duration-normal) var(--ease-smooth);
}

.search-page-form .search-field::placeholder {
  color: #999;
}

.search-page-form .search-field:focus {
  border-color: var(--color-primary);
  background: var(--color-bg);
  box-shadow: 0 0 0 3px rgba(0, 109, 58, 0.1);
}

.search-page-form .search-submit {
  padding: 0.875rem 1.75rem;
  background: var(--color-primary);
  color: var(--color-primary-foreground);
  border: none;
  border-radius: var(--radius-button);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-smooth);
}

.search-page-form .search-submit:hover {
  background: var(--color-primary-hover);
}

/* ============================================================
   404 Page
   ============================================================ */
.error-404 {
  text-align: center;
  padding: 5rem 2rem;
}

.error-404 .error-code {
  font-family: var(--font-heading);
  font-size: 8rem;
  font-weight: 800;
  color: var(--color-primary-light);
  line-height: 1;
  margin-bottom: 1rem;
  letter-spacing: -0.04em;
}

.error-404 .error-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.error-404 .error-message {
  font-size: 1.0625rem;
  color: var(--color-text-muted);
  max-width: 480px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.error-404 .error-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 3rem 0;
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

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

.footer-nav .footer-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-nav .footer-menu li a {
  font-size: 0.875rem;
  color: var(--footer-text);
  transition: color var(--duration-normal) var(--ease-smooth);
}

.footer-nav .footer-menu li a:hover {
  color: var(--color-primary-foreground);
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--footer-text);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  transition: all var(--duration-normal) var(--ease-smooth);
}

.footer-social a:hover {
  color: var(--color-primary-foreground);
  border-color: var(--color-primary);
  background: var(--color-primary);
}

.footer-social a svg {
  width: 16px;
  height: 16px;
}

.footer-production {
  width: 100%;
  text-align: center;
  padding-top: 2rem;
  margin-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  color: var(--footer-text-muted);
}

/* ============================================================
   WordPress Core Styles
   ============================================================ */

/* Alignments */
.alignleft {
  float: left;
  margin-right: 1.5rem;
  margin-bottom: 1rem;
}

.alignright {
  float: right;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

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

.alignwide {
  max-width: calc(var(--container-max) + 2rem);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

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

/* Captions */
.wp-caption {
  max-width: 100%;
  margin-bottom: 1.5rem;
}

.wp-caption-text {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  padding-top: 0.5rem;
  text-align: center;
}

/* Galleries */
.gallery {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }
.gallery-columns-5 { grid-template-columns: repeat(5, 1fr); }

.gallery-item {
  margin: 0;
}

.gallery-item img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-card);
}

.gallery-caption {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  padding-top: 0.375rem;
}

/* Screen reader text */
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: #f1f1f1;
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  color: #21759b;
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* ============================================================
   Responsive — Tablet (max-width: 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  :root {
    --container-padding: 2rem;
  }

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

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

  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.875rem; }

  .hero-section .hero-title {
    font-size: 2.75rem;
  }
}

/* ============================================================
   Responsive — Mobile (max-width: 768px)
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --container-padding: 1.5rem;
  }

  /* Header mobile layout */
  .header-inner {
    flex-wrap: wrap;
    padding: 1rem var(--container-padding);
  }

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

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

  /* Hide desktop nav & search on mobile */
  .primary-nav {
    display: none;
    width: 100%;
    order: 10;
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--duration-normal) var(--ease-smooth);
  }

  .primary-nav.is-open {
    display: flex;
    max-height: 500px;
    padding-top: 1rem;
    padding-bottom: 0.5rem;
  }

  .primary-nav .menu {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }

  .primary-nav .menu li {
    width: 100%;
  }

  .primary-nav .menu li a {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1rem;
  }

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

  /* Mobile submenu */
  .primary-nav .sub-menu {
    display: none;
    position: static;
    min-width: auto;
    background: rgba(255,255,255,0.05);
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 0;
  }

  .primary-nav .menu-item-has-children.is-open > .sub-menu {
    display: block;
  }

  .primary-nav .sub-menu li a {
    padding-left: 1.5rem;
    font-size: 0.9375rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.8);
  }

  .primary-nav .sub-menu .sub-menu li a {
    padding-left: 2.25rem;
  }

  .primary-nav .sub-menu li a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
  }

  /* Mobile submenu toggle button */
  .submenu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    position: absolute;
    right: 0;
    top: 0;
    padding: 0;
  }

  .submenu-toggle .toggle-icon {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-right: 2px solid rgba(255,255,255,0.6);
    border-bottom: 2px solid rgba(255,255,255,0.6);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-top: -3px;
  }

  .submenu-toggle.is-open .toggle-icon {
    transform: rotate(-135deg);
  }

  /* Mobile search */
  .header-search {
    display: none;
    width: 100%;
    margin-left: 0;
    margin-top: 0.75rem;
    order: 11;
  }

  .header-search.is-open {
    display: block;
  }

  .header-search .search-input {
    width: 100%;
  }

  .header-search .search-input:focus {
    width: 100%;
  }

  .header-search .search-results-dropdown {
    min-width: 100%;
  }

  /* Post grid single column */
  .post-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .related-posts-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  /* Hero */
  .hero-section {
    padding: 3rem var(--container-padding) 4rem;
    max-width: 100%;
  }

  .hero-section .hero-title {
    font-size: 2.25rem;
  }

  .hero-section .hero-subtitle {
    font-size: 1rem;
  }

  /* Typography scale down */
  h1 { font-size: 2rem; }
  h2 { font-size: 1.625rem; }
  h3 { font-size: 1.375rem; }

  /* Page header */
  .page-header .page-title {
    font-size: 2rem;
  }

  /* Single post */
  .single-post-header .post-title {
    font-size: 2rem;
  }

  .single-post-header .post-meta {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Search results */
  .search-result-entry {
    flex-direction: column;
    gap: 1rem;
  }

  .search-result-entry .result-thumb {
    width: 100%;
    height: 180px;
  }

  .search-page-form .search-form-group {
    flex-direction: column;
  }

  /* 404 */
  .error-404 .error-code {
    font-size: 5rem;
  }

  .error-404 .error-title {
    font-size: 1.5rem;
  }

  .error-404 .error-actions {
    flex-direction: column;
  }

  /* Footer */
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 1.25rem;
  }

  .footer-nav .footer-menu {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
}

/* ============================================================
   Responsive — Small Mobile (max-width: 480px)
   ============================================================ */
@media (max-width: 480px) {
  :root {
    --container-padding: 1rem;
  }

  .site-logo a {
    font-size: 1.0625rem;
  }

  .site-logo img,
  .site-logo svg {
    height: 28px;
  }

  .hero-section .hero-title {
    font-size: 1.875rem;
  }

  .post-card .card-body {
    padding: 1.25rem;
  }

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

  .pagination .page-numbers {
    min-width: 36px;
    height: 36px;
    font-size: 0.875rem;
  }
}

/* ============================================================
   Print Styles
   ============================================================ */
@media print {
  .site-header,
  .site-footer,
  .header-search,
  .mobile-menu-toggle,
  .mobile-search-toggle,
  .pagination,
  .related-posts {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  .site-content {
    padding: 0;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .post-card,
  .search-result-entry {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
