/*
Theme Name: EducationDunia
Theme URI: https://educationdunia.com
Author: EducationDunia
Author URI: https://educationdunia.com
Description: A lightweight, customizer-driven education blog theme with Astra-level flexibility. Features multiple header layouts, sidebar control, blog grid/list options, full typography & color controls, and per-page meta settings.
Version: 3.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: educationdunia
Tags: blog, education, two-columns, right-sidebar, left-sidebar, custom-menu, featured-images, translation-ready, theme-options, custom-colors, custom-logo
*/

/* ===========================================
   1. CSS CUSTOM PROPERTIES (Customizer-driven)
   =========================================== */
:root {
  --ed-color-primary: #F97316;
  --ed-color-primary-hover: #EA580C;
  --ed-color-primary-light: #FFF7ED;
  --ed-color-secondary: #1A1A2E;
  --ed-color-heading: #212529;
  --ed-color-text: #495057;
  --ed-color-text-light: #6C757D;
  --ed-color-link: #F97316;
  --ed-color-link-hover: #EA580C;
  --ed-color-border: #E9ECEF;
  --ed-color-bg: #FFFFFF;
  --ed-color-bg-alt: #F8F9FA;
  --ed-color-surface: #FFFFFF;

  --ed-font-body: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ed-font-heading: 'Poppins', sans-serif;
  --ed-font-size-base: 16px;
  --ed-line-height: 1.7;

  --ed-container-width: 1200px;
  --ed-sidebar-width: 320px;

  --ed-radius-sm: 4px;
  --ed-radius-md: 8px;
  --ed-radius-lg: 12px;
  --ed-radius-xl: 16px;
  --ed-radius-full: 9999px;

  --ed-shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --ed-shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --ed-shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --ed-shadow-hover: 0 12px 40px rgba(249,115,22,0.15);

  --ed-transition-fast: 0.2s ease;
  --ed-transition-base: 0.3s ease;
  --ed-transition-spring: 0.4s cubic-bezier(0.175,0.885,0.32,1.275);

  --ed-header-height: 70px;
  --ed-topbar-height: 40px;
}

/* ===========================================
   2. RESET & BASE
   =========================================== */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--ed-font-body);
  font-size: var(--ed-font-size-base);
  line-height: var(--ed-line-height);
  color: var(--ed-color-text);
  background-color: var(--ed-color-bg);
  overflow-x: hidden;
  overflow-wrap: break-word;
  word-wrap: break-word;
  -webkit-tap-highlight-color: transparent;
}

a { text-decoration: none; color: var(--ed-color-link); transition: color var(--ed-transition-fast); }
a:hover { color: var(--ed-color-link-hover); }
img { max-width: 100%; height: auto; display: block; }
ul,ol { list-style: none; }

h1,h2,h3,h4,h5,h6 {
  font-family: var(--ed-font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ed-color-heading);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

a,button,input,select,textarea { touch-action: manipulation; }

/* Screen reader text */
.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;
}
.screen-reader-text:focus {
  background:#f1f1f1; clip:auto !important; clip-path:none;
  color:#21759b; display:block; font-size:0.875rem; font-weight:600;
  height:auto; left:5px; line-height:normal; padding:15px 23px;
  text-decoration:none; top:5px; width:auto; z-index:100000;
}

/* ===========================================
   3. LAYOUT UTILITIES
   =========================================== */
.ed-container {
  max-width: var(--ed-container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.ed-container-full { width: 100%; padding: 0; }
.ed-container-boxed { max-width: var(--ed-container-width); margin: 0 auto; }

/* ===========================================
   4. TOPBAR
   =========================================== */
.ed-topbar {
  background-color: var(--ed-color-primary);
  color: #fff;
  font-size: 0.8125rem;
  min-height: var(--ed-topbar-height);
  display: flex;
  align-items: center;
}

.ed-topbar .ed-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ed-topbar-left,
.ed-topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.ed-topbar a { color: #fff; }
.ed-topbar a:hover { opacity: 0.85; color: #fff; }

.ed-topbar-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
}

.ed-topbar-item svg { width: 14px; height: 14px; flex-shrink: 0; }

.ed-topbar-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}

/* ===========================================
   5. SITE HEADER
   =========================================== */
.ed-header {
  background-color: var(--ed-color-surface);
  box-shadow: var(--ed-shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow var(--ed-transition-base), background-color var(--ed-transition-base);
  min-height: var(--ed-header-height);
}

.ed-header.ed-header-scrolled { box-shadow: var(--ed-shadow-lg); }

/* Transparent header */
.ed-header-transparent .ed-header {
  background-color: transparent;
  box-shadow: none;
  position: absolute;
  width: 100%;
}
.ed-header-transparent .ed-header.ed-header-scrolled {
  background-color: var(--ed-color-surface);
  box-shadow: var(--ed-shadow-lg);
  position: sticky;
}

.ed-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: var(--ed-header-height);
}

/* --- Layout 1: Logo Left, Nav Right (default) --- */
.ed-header-layout-1 .ed-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- Layout 2: Logo Center, Nav Below --- */
.ed-header-layout-2 .ed-header-inner {
  flex-direction: column;
  gap: 0;
  padding: 12px 0 0;
}
.ed-header-layout-2 .ed-logo { margin: 0 auto 8px; }
.ed-header-layout-2 .ed-nav {
  width: 100%;
  justify-content: center;
  border-top: 1px solid var(--ed-color-border);
  padding-top: 4px;
}

/* --- Layout 3: Nav Left, Logo Right --- */
.ed-header-layout-3 .ed-header-inner {
  flex-direction: row-reverse;
}

/* Logo */
.ed-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  transition: transform var(--ed-transition-base);
}
.ed-logo:hover { transform: scale(1.02); color: inherit; }
.ed-logo img { height: 50px; width: auto; }
.ed-logo-text {
  font-family: var(--ed-font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ed-color-primary);
}
.ed-logo-text span { color: var(--ed-color-heading); }
.ed-logo-fallback {
  width: 42px; height: 42px;
  background: var(--ed-color-primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ed-logo-fallback svg { width: 24px; height: 24px; }

/* Navigation */
.ed-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ed-nav-menu {
  display: flex;
  align-items: center;
  gap: 0;
}

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

.ed-nav-menu li a {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ed-color-text);
  position: relative;
  transition: color var(--ed-transition-fast);
  white-space: nowrap;
}

.ed-nav-menu li a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%; height: 2px;
  background-color: var(--ed-color-primary);
  transition: transform var(--ed-transition-base);
  transform-origin: center;
}

.ed-nav-menu li a:hover,
.ed-nav-menu li.current-menu-item > a,
.ed-nav-menu li.current_page_item > a {
  color: var(--ed-color-primary);
}

.ed-nav-menu li a:hover::after,
.ed-nav-menu li.current-menu-item > a::after,
.ed-nav-menu li.current_page_item > a::after {
  transform: translateX(-50%) scaleX(1);
}

/* Dropdown sub-menu */
.ed-nav-menu li ul.sub-menu {
  position: absolute;
  top: 100%; left: 0;
  min-width: 220px;
  background: var(--ed-color-surface);
  box-shadow: var(--ed-shadow-lg);
  border-radius: var(--ed-radius-md);
  opacity: 0; visibility: hidden;
  transform: translateY(10px);
  transition: all var(--ed-transition-base);
  z-index: 100;
  padding: 8px 0;
}

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

.ed-nav-menu li ul.sub-menu li a {
  padding: 8px 20px;
  font-size: 0.875rem;
}
.ed-nav-menu li ul.sub-menu li a::after { display: none; }
.ed-nav-menu li ul.sub-menu li a:hover {
  background-color: var(--ed-color-primary-light);
  color: var(--ed-color-primary);
}

/* Sub-menu arrow indicator */
.ed-nav-menu > li.menu-item-has-children > a::before {
  content: '';
  display: inline-block;
  width: 0; height: 0;
  margin-left: 5px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  vertical-align: middle;
  order: 1;
}

/* Search toggle */
.ed-search-toggle {
  background: none; border: none; cursor: pointer;
  padding: 10px;
  color: var(--ed-color-text-light);
  transition: color var(--ed-transition-fast);
  display: flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px;
}
.ed-search-toggle:hover { color: var(--ed-color-primary); }
.ed-search-toggle svg { width: 20px; height: 20px; }

/* Header CTA */
.ed-header-cta {
  margin-left: 8px;
}

/* Mobile menu toggle */
.ed-menu-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 10px;
  flex-direction: column;
  gap: 5px;
  min-width: 44px; min-height: 44px;
  align-items: center; justify-content: center;
}
.ed-menu-toggle span {
  display: block; width: 22px; height: 2px;
  background-color: var(--ed-color-heading);
  transition: all var(--ed-transition-base);
  border-radius: 2px;
}
.ed-menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.ed-menu-toggle.active span:nth-child(2) { opacity: 0; }
.ed-menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* Buttons */
.ed-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  font-family: var(--ed-font-body);
  font-size: 0.875rem; font-weight: 600;
  border: none; border-radius: var(--ed-radius-md);
  cursor: pointer;
  transition: all var(--ed-transition-base);
  text-decoration: none;
  line-height: 1.4;
  min-height: 44px;
}
.ed-btn-primary {
  background-color: var(--ed-color-primary); color: #fff;
}
.ed-btn-primary:hover {
  background-color: var(--ed-color-primary-hover); color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(249,115,22,0.35);
}
.ed-btn-outline {
  background-color: transparent;
  color: var(--ed-color-primary);
  border: 2px solid var(--ed-color-primary);
}
.ed-btn-outline:hover {
  background-color: var(--ed-color-primary); color: #fff;
  transform: translateY(-2px);
}

/* ===========================================
   6. SEARCH OVERLAY
   =========================================== */
.ed-search-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: all var(--ed-transition-base);
  backdrop-filter: blur(4px);
}
.ed-search-overlay.active { opacity: 1; visibility: visible; }

.ed-search-overlay-inner {
  width: 90%; max-width: 600px;
  transform: translateY(20px);
  transition: transform var(--ed-transition-base);
}
.ed-search-overlay.active .ed-search-overlay-inner { transform: translateY(0); }

.ed-search-overlay form {
  display: flex;
  background: var(--ed-color-surface);
  border-radius: var(--ed-radius-lg);
  overflow: hidden;
  box-shadow: var(--ed-shadow-lg);
}
.ed-search-overlay input[type="search"] {
  flex: 1; padding: 16px 24px; border: none;
  font-size: 16px;
  font-family: var(--ed-font-body); outline: none;
}
.ed-search-overlay button[type="submit"] {
  padding: 16px 24px;
  background: var(--ed-color-primary); border: none;
  color: #fff; cursor: pointer;
  transition: background var(--ed-transition-fast);
  min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.ed-search-overlay button[type="submit"]:hover { background: var(--ed-color-primary-hover); }
.ed-search-close {
  position: absolute; top: 20px; right: 20px;
  background: none; border: none; color: #fff;
  font-size: 2rem; cursor: pointer; padding: 8px; line-height: 1;
  min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
}

/* Mobile overlay */
.ed-mobile-overlay {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  opacity: 0; visibility: hidden;
  transition: all var(--ed-transition-base);
}
.ed-mobile-overlay.active { opacity: 1; visibility: visible; }

/* ===========================================
   7. PAGE HERO / BREADCRUMB
   =========================================== */
.ed-page-hero {
  background: linear-gradient(135deg, var(--ed-color-bg-alt) 0%, var(--ed-color-bg) 100%);
  padding: 48px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.ed-page-hero h1 {
  font-size: 2.25rem; font-weight: 700;
  color: var(--ed-color-heading);
  margin-bottom: 12px;
}

.ed-breadcrumb {
  display: inline-flex; align-items: center;
  flex-wrap: wrap; gap: 4px;
  justify-content: center;
  max-width: 100%;
  font-size: 0.8125rem;
}
.ed-breadcrumb a {
  display: inline-flex; align-items: center;
  padding: 4px 14px;
  background-color: var(--ed-color-primary);
  color: #fff; border-radius: var(--ed-radius-full);
  font-weight: 500;
  min-height: 28px;
}
.ed-breadcrumb a:hover { background-color: var(--ed-color-primary-hover); color: #fff; }
.ed-breadcrumb-sep { color: var(--ed-color-text-light); padding: 0 2px; }
.ed-breadcrumb-current {
  display: inline-flex; align-items: center;
  padding: 4px 14px;
  background-color: var(--ed-color-primary);
  color: #fff; border-radius: var(--ed-radius-full);
  font-weight: 500;
  min-height: 28px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 300px;
}

/* ===========================================
   8. CONTENT LAYOUT
   =========================================== */
.ed-content-area { padding: 48px 0; }

.ed-content-wrapper {
  display: grid;
  gap: 40px;
  align-items: start;
}

/* Sidebar position variations (Astra-like) */
.ed-sidebar-right .ed-content-wrapper {
  grid-template-columns: 1fr var(--ed-sidebar-width);
}
.ed-sidebar-left .ed-content-wrapper {
  grid-template-columns: var(--ed-sidebar-width) 1fr;
}
.ed-sidebar-left .ed-sidebar { order: -1; }
.ed-sidebar-none .ed-content-wrapper {
  grid-template-columns: 1fr;
}
.ed-sidebar-none .ed-sidebar { display: none; }

.ed-content-wrapper > * { min-width: 0; }
.ed-main-content { min-width: 0; overflow-wrap: break-word; word-break: break-word; }

/* ===========================================
   9. BLOG POST CARDS
   =========================================== */
.ed-posts-grid {
  display: grid;
  gap: 24px;
}

/* Grid columns via body class (Astra-like Customizer) */
.ed-blog-grid-1 .ed-posts-grid { grid-template-columns: 1fr; }
.ed-blog-grid-2 .ed-posts-grid { grid-template-columns: repeat(2, 1fr); }
.ed-blog-grid-3 .ed-posts-grid { grid-template-columns: repeat(3, 1fr); }

/* List layout */
.ed-blog-list .ed-posts-grid { grid-template-columns: 1fr; }
.ed-blog-list .ed-post-card { display: grid; grid-template-columns: 280px 1fr; }
.ed-blog-list .ed-post-card-thumb { aspect-ratio: auto; height: 100%; }

.ed-post-card {
  background: var(--ed-color-surface);
  border-radius: var(--ed-radius-lg);
  overflow: hidden;
  box-shadow: var(--ed-shadow-sm);
  border: 1px solid var(--ed-color-border);
  transition: all var(--ed-transition-base);
}
.ed-post-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--ed-shadow-hover);
}

.ed-post-card-thumb {
  position: relative; overflow: hidden;
  aspect-ratio: 16/10;
}
.ed-post-card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.ed-post-card:hover .ed-post-card-thumb img { transform: scale(1.06); }

.ed-post-category {
  position: absolute; top: 12px; left: 12px;
  background: var(--ed-color-primary); color: #fff;
  padding: 4px 12px; border-radius: var(--ed-radius-full);
  font-size: 0.6875rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  z-index: 2;
}

.ed-post-card-body { padding: 20px; }

.ed-post-meta {
  display: flex; align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 0.8125rem;
  color: var(--ed-color-text-light);
  flex-wrap: wrap;
  line-height: 1.6;
}
.ed-post-meta-item {
  display: inline-flex; align-items: center;
  gap: 4px; min-height: 24px;
}
.ed-post-meta-item svg { width: 14px; height: 14px; color: var(--ed-color-primary); flex-shrink: 0; }
.ed-post-meta-separator { color: var(--ed-color-border); }

.ed-post-card-title {
  font-size: 1.125rem; font-weight: 600;
  margin-bottom: 8px; line-height: 1.4;
}
.ed-post-card-title a { color: var(--ed-color-heading); }
.ed-post-card-title a:hover { color: var(--ed-color-primary); }

.ed-post-card-excerpt {
  font-size: 0.875rem; color: var(--ed-color-text-light);
  margin-bottom: 16px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

.ed-read-more {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 20px;
  background: var(--ed-color-primary); color: #fff;
  border-radius: var(--ed-radius-md);
  font-size: 0.8125rem; font-weight: 600;
  transition: all var(--ed-transition-base);
  min-height: 40px;
}
.ed-read-more:hover {
  background: var(--ed-color-primary-hover);
  transform: translateX(4px); color: #fff;
}
.ed-read-more svg { width: 14px; height: 14px; transition: transform var(--ed-transition-fast); }
.ed-read-more:hover svg { transform: translateX(3px); }

/* No posts */
.ed-no-posts {
  text-align: center; padding: 48px 24px;
  background: var(--ed-color-bg-alt);
  border-radius: var(--ed-radius-lg);
}
.ed-no-posts h2 { margin-bottom: 8px; }
.ed-no-posts p { color: var(--ed-color-text-light); margin-bottom: 20px; }

/* ===========================================
   10. PAGINATION
   =========================================== */
.ed-pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 6px; margin-top: 48px; flex-wrap: wrap;
}
.ed-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 44px; padding: 0 12px;
  border-radius: var(--ed-radius-md);
  font-size: 0.875rem; font-weight: 500;
  color: var(--ed-color-text-light);
  background: var(--ed-color-surface);
  border: 1px solid var(--ed-color-border);
  transition: all var(--ed-transition-fast);
}
.ed-pagination .page-numbers:hover {
  background: var(--ed-color-primary-light);
  border-color: var(--ed-color-primary);
  color: var(--ed-color-primary);
}
.ed-pagination .page-numbers.current {
  background: var(--ed-color-primary); color: #fff;
  border-color: var(--ed-color-primary);
}
.ed-pagination .page-numbers.dots { border: none; background: none; cursor: default; }

/* ===========================================
   11. SIDEBAR
   =========================================== */
.ed-sidebar { position: sticky; top: calc(var(--ed-header-height) + 24px); }

.ed-widget {
  background: var(--ed-color-surface);
  border-radius: var(--ed-radius-lg);
  padding: 24px; margin-bottom: 24px;
  box-shadow: var(--ed-shadow-sm);
  border: 1px solid var(--ed-color-border);
  transition: box-shadow var(--ed-transition-base);
}
.ed-widget:hover { box-shadow: var(--ed-shadow-md); }

.ed-widget-title {
  font-size: 1.125rem; font-weight: 700;
  color: var(--ed-color-heading);
  margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 3px solid var(--ed-color-primary);
  display: inline-block;
}

/* Search widget */
.ed-search-widget form {
  display: flex;
  border-radius: var(--ed-radius-md);
  overflow: hidden;
  border: 2px solid var(--ed-color-border);
  transition: border-color var(--ed-transition-fast);
}
.ed-search-widget form:focus-within { border-color: var(--ed-color-primary); }
.ed-search-widget input[type="search"] {
  flex: 1; padding: 10px 16px; border: none;
  font-family: var(--ed-font-body);
  font-size: 16px; outline: none;
  background: transparent; color: var(--ed-color-text);
}
.ed-search-widget button {
  padding: 10px 16px;
  background: var(--ed-color-primary); border: none;
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px;
  transition: background var(--ed-transition-fast);
}
.ed-search-widget button:hover { background: var(--ed-color-primary-hover); }
.ed-search-widget button svg { width: 18px; height: 18px; }

/* Recent posts widget */
.ed-recent-posts-list { display: flex; flex-direction: column; gap: 16px; }
.ed-recent-post-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ed-color-border);
  transition: transform var(--ed-transition-fast);
}
.ed-recent-post-item:hover { transform: translateX(4px); }
.ed-recent-post-item:last-child { border-bottom: none; padding-bottom: 0; }
.ed-recent-post-thumb {
  width: 70px; height: 55px;
  border-radius: var(--ed-radius-sm);
  overflow: hidden; flex-shrink: 0;
}
.ed-recent-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ed-recent-post-info { flex: 1; min-width: 0; }
.ed-recent-post-info h4 { font-size: 0.8125rem; font-weight: 600; line-height: 1.4; margin-bottom: 4px; }
.ed-recent-post-info h4 a { color: var(--ed-color-text); }
.ed-recent-post-info h4 a:hover { color: var(--ed-color-primary); }
.ed-recent-post-date { font-size: 0.75rem; color: var(--ed-color-primary); font-weight: 500; }

/* Categories widget */
.ed-categories-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--ed-color-border);
  transition: all var(--ed-transition-fast);
  min-height: 44px;
}
.ed-categories-list li:hover { padding-left: 8px; }
.ed-categories-list li:last-child { border-bottom: none; }
.ed-categories-list li a {
  display: flex; align-items: center; gap: 8px;
  color: var(--ed-color-text-light);
  font-size: 0.875rem;
}
.ed-categories-list li a::before {
  content: '›'; color: var(--ed-color-primary);
  font-weight: 700; font-size: 1.1em;
}
.ed-categories-list li a:hover { color: var(--ed-color-primary); }
.ed-cat-count {
  background: var(--ed-color-bg-alt);
  color: var(--ed-color-text-light);
  font-size: 0.75rem; padding: 2px 10px;
  border-radius: var(--ed-radius-full);
  font-weight: 600; min-width: 32px; text-align: center;
}

/* Tags widget */
.ed-tags-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ed-tags-list a {
  display: inline-flex; align-items: center;
  padding: 6px 14px;
  background: var(--ed-color-bg-alt);
  color: var(--ed-color-text-light);
  border-radius: var(--ed-radius-full);
  font-size: 0.75rem; font-weight: 500;
  transition: all var(--ed-transition-fast);
  border: 1px solid transparent;
  min-height: 32px;
}
.ed-tags-list a:hover {
  background: var(--ed-color-primary-light);
  color: var(--ed-color-primary);
  border-color: var(--ed-color-primary);
}

.ed-no-tags { font-size: 0.875rem; color: var(--ed-color-text-light); font-style: italic; }

/* ===========================================
   12. SINGLE POST
   =========================================== */
.ed-single-post {
  background: var(--ed-color-surface);
  border-radius: var(--ed-radius-lg);
  overflow: hidden;
  box-shadow: var(--ed-shadow-sm);
  border: 1px solid var(--ed-color-border);
}
.ed-single-thumb { width: 100%; aspect-ratio: 16/7; overflow: hidden; }
.ed-single-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ed-single-content { padding: 32px; }
.ed-single-content h1 { font-size: 1.875rem; margin-bottom: 12px; }
.ed-single-content .ed-post-meta {
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 1px solid var(--ed-color-border);
}

/* Entry content prose */
.ed-single-content .entry-content {
  font-size: 1rem; line-height: 1.8;
  color: var(--ed-color-text);
}
.ed-single-content .entry-content h2,
.ed-single-content .entry-content h3,
.ed-single-content .entry-content h4 {
  margin-top: 32px; margin-bottom: 12px;
}
.ed-single-content .entry-content p { margin-bottom: 20px; }
.ed-single-content .entry-content a { color: var(--ed-color-primary); text-decoration: underline; }
.ed-single-content .entry-content img { border-radius: var(--ed-radius-md); margin: 24px 0; }
.ed-single-content .entry-content ul,
.ed-single-content .entry-content ol { margin-bottom: 20px; padding-left: 28px; }
.ed-single-content .entry-content ul { list-style: disc; }
.ed-single-content .entry-content ol { list-style: decimal; }
.ed-single-content .entry-content li { margin-bottom: 6px; }
.ed-single-content .entry-content blockquote {
  border-left: 4px solid var(--ed-color-primary);
  padding: 20px; margin: 24px 0;
  background: var(--ed-color-primary-light);
  border-radius: 0 var(--ed-radius-md) var(--ed-radius-md) 0;
  font-style: italic;
}
.ed-single-content .entry-content table {
  display: block; overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%; border-collapse: collapse;
}
.ed-single-content .entry-content iframe,
.ed-single-content .entry-content video,
.ed-single-content .entry-content embed { max-width: 100%; height: auto; }
.ed-single-content .entry-content pre {
  overflow-x: auto; max-width: 100%;
  white-space: pre-wrap; word-wrap: break-word;
  background: var(--ed-color-bg-alt);
  padding: 16px; border-radius: var(--ed-radius-md);
  font-size: 0.875rem;
}

/* Post tags */
.ed-post-tags {
  margin-top: 24px; padding-top: 16px;
  border-top: 1px solid var(--ed-color-border);
  display: flex; align-items: center;
  gap: 8px; flex-wrap: wrap;
}
.ed-post-tags-label { font-weight: 600; color: var(--ed-color-heading); font-size: 0.875rem; }

/* Post navigation */
.ed-post-nav {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-top: 32px;
}
.ed-post-nav a {
  display: block; padding: 16px;
  background: var(--ed-color-bg-alt);
  border-radius: var(--ed-radius-md);
  transition: all var(--ed-transition-base);
}
.ed-post-nav a:hover { background: var(--ed-color-primary-light); transform: translateY(-3px); }
.ed-post-nav-label {
  font-size: 0.75rem; color: var(--ed-color-text-light);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px;
  display: block;
}
.ed-post-nav-title {
  font-size: 0.875rem; font-weight: 600; color: var(--ed-color-heading);
}

/* Author box */
.ed-author-box {
  display: flex; gap: 20px; align-items: flex-start;
  padding: 24px; margin-top: 32px;
  background: var(--ed-color-bg-alt);
  border-radius: var(--ed-radius-lg);
}
.ed-author-box img { border-radius: 50%; width: 80px; height: 80px; flex-shrink: 0; }
.ed-author-box-name { font-size: 1.125rem; font-weight: 600; margin-bottom: 4px; }
.ed-author-box-bio { font-size: 0.875rem; color: var(--ed-color-text-light); line-height: 1.6; }

/* ===========================================
   13. COMMENTS
   =========================================== */
.ed-comments-area {
  margin-top: 32px;
  background: var(--ed-color-surface);
  border-radius: var(--ed-radius-lg);
  padding: 32px;
  box-shadow: var(--ed-shadow-sm);
  border: 1px solid var(--ed-color-border);
}
.ed-comments-area h3 { font-size: 1.5rem; margin-bottom: 24px; }
.comment-list { list-style: none; }
.comment {
  padding: 16px; margin-bottom: 16px;
  background: var(--ed-color-bg-alt);
  border-radius: var(--ed-radius-md);
}
.comment-author {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.comment-author img { border-radius: 50%; }
.comment-respond { margin-top: 24px; }
.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
  width: 100%; padding: 12px 16px;
  border: 2px solid var(--ed-color-border);
  border-radius: var(--ed-radius-md);
  font-family: var(--ed-font-body);
  font-size: 16px;
  transition: border-color var(--ed-transition-fast);
  margin-bottom: 12px; outline: none;
}
.comment-respond input:focus,
.comment-respond textarea:focus { border-color: var(--ed-color-primary); }
.comment-respond .submit {
  background: var(--ed-color-primary); color: #fff;
  border: none; padding: 12px 28px;
  border-radius: var(--ed-radius-md);
  font-family: var(--ed-font-body);
  font-weight: 600; cursor: pointer;
  transition: all var(--ed-transition-base);
  min-height: 48px;
}
.comment-respond .submit:hover { background: var(--ed-color-primary-hover); }

/* ===========================================
   14. FOOTER
   =========================================== */
.ed-footer {
  background-color: var(--ed-color-secondary);
  color: rgba(255,255,255,0.7);
  padding: 48px 0 0;
}

.ed-footer-grid {
  display: grid;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Footer columns (Customizer-driven) */
.ed-footer-cols-1 .ed-footer-grid { grid-template-columns: 1fr; }
.ed-footer-cols-2 .ed-footer-grid { grid-template-columns: repeat(2, 1fr); }
.ed-footer-cols-3 .ed-footer-grid { grid-template-columns: repeat(3, 1fr); }
.ed-footer-cols-4 .ed-footer-grid { grid-template-columns: repeat(4, 1fr); }

.ed-footer-widget-title {
  font-size: 1.125rem; font-weight: 700;
  color: #fff; margin-bottom: 16px;
}

.ed-footer-about .ed-footer-logo {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.ed-footer-about .ed-footer-logo img { height: 45px; }
.ed-footer-about .ed-footer-logo-text {
  font-size: 1.125rem; font-weight: 700;
  color: var(--ed-color-primary);
}
.ed-footer-about p { font-size: 0.875rem; line-height: 1.7; margin-bottom: 16px; }
.ed-footer-subtitle {
  font-size: 0.875rem; color: rgba(255,255,255,0.6);
  margin-bottom: 12px; font-weight: 500;
}

.ed-footer-socials { display: flex; gap: 8px; flex-wrap: wrap; }
.ed-footer-socials a {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--ed-color-primary); color: #fff;
  transition: all var(--ed-transition-base);
}
.ed-footer-socials a:hover {
  background: var(--ed-color-primary-hover);
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 4px 15px rgba(249,115,22,0.4);
  color: #fff;
}
.ed-footer-socials a svg { width: 16px; height: 16px; }

.ed-footer .ed-recent-post-item { border-bottom-color: rgba(255,255,255,0.08); }
.ed-footer .ed-recent-post-info h4 a { color: rgba(255,255,255,0.85); }
.ed-footer .ed-recent-post-info h4 a:hover { color: var(--ed-color-primary); }
.ed-footer .ed-recent-post-date { color: var(--ed-color-primary); }

.ed-footer-contact-list { display: flex; flex-direction: column; gap: 12px; }
.ed-footer-contact-item {
  display: flex; align-items: flex-start;
  gap: 8px; font-size: 0.875rem;
}
.ed-footer-contact-item svg {
  width: 18px; height: 18px;
  color: var(--ed-color-primary);
  flex-shrink: 0; margin-top: 2px;
}
.ed-footer-contact-item a { color: rgba(255,255,255,0.7); }
.ed-footer-contact-item a:hover { color: var(--ed-color-primary); }

/* Footer bottom bar */
.ed-footer-bottom {
  padding: 16px 0; text-align: center;
  font-size: 0.8125rem; color: rgba(255,255,255,0.5);
}
.ed-footer-bottom a { color: var(--ed-color-primary); font-weight: 600; }
.ed-footer-bottom a:hover { color: #fff; }

/* ===========================================
   15. 404 PAGE
   =========================================== */
.ed-404 { text-align: center; padding: 64px 0; }
.ed-404 h2 { font-size: 5rem; color: var(--ed-color-primary); margin-bottom: 12px; }
.ed-404 p { font-size: 1.125rem; color: var(--ed-color-text-light); margin-bottom: 24px; }

/* ===========================================
   16. BACK TO TOP
   =========================================== */
.ed-back-to-top {
  position: fixed; bottom: 30px; right: 30px;
  width: 44px; height: 44px;
  background: var(--ed-color-primary); color: #fff;
  border: none; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transform: translateY(20px);
  transition: all var(--ed-transition-base);
  z-index: 999;
  box-shadow: 0 4px 15px rgba(249,115,22,0.3);
}
.ed-back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.ed-back-to-top:hover { background: var(--ed-color-primary-hover); transform: translateY(-3px); }
.ed-back-to-top svg { width: 20px; height: 20px; }

/* ===========================================
   17. FRONT PAGE HERO
   =========================================== */
.ed-home-hero {
  background: linear-gradient(135deg, var(--ed-color-primary-light) 0%, #FEF3E2 50%, var(--ed-color-bg-alt) 100%);
  padding: 80px 0; text-align: center;
  position: relative; overflow: hidden;
}
.ed-home-hero-inner {
  position: relative; z-index: 1;
  max-width: 700px; margin: 0 auto;
}
.ed-home-hero-title {
  font-size: 2.75rem; font-weight: 800;
  color: var(--ed-color-heading); margin-bottom: 16px;
}
.ed-highlight { color: var(--ed-color-primary); position: relative; }
.ed-highlight::after {
  content: ''; position: absolute;
  bottom: 2px; left: 0; width: 100%; height: 8px;
  background: rgba(249,115,22,0.2);
  border-radius: 4px; z-index: -1;
}
.ed-home-hero-sub {
  font-size: 1.125rem; color: var(--ed-color-text-light); margin-bottom: 32px;
}
.ed-home-hero-search form {
  display: flex; max-width: 520px; margin: 0 auto;
  background: #fff; border-radius: var(--ed-radius-lg);
  overflow: hidden;
  box-shadow: var(--ed-shadow-lg);
  border: 2px solid transparent;
  transition: border-color var(--ed-transition-base);
}
.ed-home-hero-search form:focus-within { border-color: var(--ed-color-primary); }
.ed-home-hero-search input {
  flex: 1; padding: 14px 20px; border: none;
  font-family: var(--ed-font-body);
  font-size: 16px; outline: none;
}
.ed-home-hero-search .ed-btn {
  border-radius: 0; padding: 14px 28px; min-height: 48px;
}

/* ===========================================
   18. SCROLL ANIMATIONS
   =========================================== */
.ed-animate {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.no-js .ed-animate { opacity: 1 !important; transform: none !important; animation: none !important; }
.ed-animate.ed-visible { opacity: 1; }
.ed-animate-up { transform: translateY(30px); }
.ed-animate-up.ed-visible { transform: translateY(0); }
.ed-animate-left { transform: translateX(-30px); }
.ed-animate-left.ed-visible { transform: translateX(0); }
.ed-animate-right { transform: translateX(30px); }
.ed-animate-right.ed-visible { transform: translateX(0); }
.ed-animate-scale { transform: scale(0.9); }
.ed-animate-scale.ed-visible { transform: scale(1); }
.ed-delay-1 { transition-delay: 0.1s; }
.ed-delay-2 { transition-delay: 0.2s; }
.ed-delay-3 { transition-delay: 0.3s; }
.ed-delay-4 { transition-delay: 0.4s; }

/* ===========================================
   19. RESPONSIVE — TABLET
   =========================================== */
@media (max-width: 1024px) {
  :root { --ed-sidebar-width: 280px; }
  .ed-blog-grid-3 .ed-posts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .ed-sidebar-right .ed-content-wrapper,
  .ed-sidebar-left .ed-content-wrapper {
    grid-template-columns: 1fr;
  }
  .ed-sidebar { position: static; order: 1; }
  .ed-sidebar-left .ed-sidebar { order: 1; }
}

/* ===========================================
   20. RESPONSIVE — MOBILE
   =========================================== */
@media (max-width: 768px) {
  .ed-topbar .ed-container { justify-content: center; text-align: center; }
  .ed-topbar-left { width: 100%; justify-content: center; }
  .ed-topbar-right { display: none; }
  .ed-topbar-item span { max-width: 200px; }

  .ed-header-cta { display: none; }
  .ed-header-layout-2 .ed-header-inner { flex-direction: row; }
  .ed-header-layout-2 .ed-logo { margin: 0; }
  .ed-header-layout-2 .ed-nav { width: auto; border-top: none; padding-top: 0; justify-content: flex-end; }

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

  .ed-nav-menu {
    position: fixed; top: 0; right: -100%;
    width: 80%; max-width: 320px;
    height: 100vh; height: 100dvh;
    background: var(--ed-color-surface);
    flex-direction: column; align-items: stretch;
    padding: 80px 24px 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    transition: right var(--ed-transition-base);
    z-index: 1001;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .ed-nav-menu.active { right: 0; }
  .ed-nav-menu li a {
    padding: 14px 0;
    border-bottom: 1px solid var(--ed-color-border);
    font-size: 1rem; min-height: 48px;
    display: flex; align-items: center;
  }
  .ed-nav-menu li a::after { display: none; }
  .ed-nav-menu > li.menu-item-has-children > a::before { display: none; }
  .ed-nav-menu li ul.sub-menu {
    position: static; opacity: 1; visibility: visible;
    transform: none; box-shadow: none;
    padding-left: 16px; padding-top: 0; padding-bottom: 0;
  }
  .ed-nav-menu li ul.sub-menu li a { font-size: 0.9375rem; color: var(--ed-color-text-light); }

  .ed-blog-grid-2 .ed-posts-grid,
  .ed-blog-grid-3 .ed-posts-grid { grid-template-columns: 1fr; }
  .ed-blog-list .ed-post-card { grid-template-columns: 1fr; }
  .ed-blog-list .ed-post-card-thumb { aspect-ratio: 16/10; }

  .ed-page-hero { padding: 36px 0; }
  .ed-page-hero h1 { font-size: 1.75rem; }

  .ed-footer-grid { grid-template-columns: 1fr !important; }
  .ed-post-nav { grid-template-columns: 1fr; gap: 12px; }
  .ed-single-content { padding: 20px; }
  .ed-single-content h1 { font-size: 1.5rem; }

  .ed-back-to-top {
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    right: 20px;
  }

  .ed-search-close { top: 16px; right: 16px; font-size: 2.5rem; }

  .ed-home-hero { padding: 48px 0; }
  .ed-home-hero-title { font-size: 2rem; }
  .ed-home-hero-search form { flex-direction: column; border-radius: 12px; }
  .ed-home-hero-search input { border-bottom: 1px solid var(--ed-color-border); }
  .ed-home-hero-search .ed-btn { border-radius: 0 0 10px 10px; width: 100%; }

  .ed-author-box { flex-direction: column; align-items: center; text-align: center; }

  .ed-breadcrumb-current { max-width: 180px; }

  .comment-respond .submit { width: 100%; }
}

@media (max-width: 480px) {
  .ed-container { padding: 0 16px; }
  .ed-content-area { padding: 32px 0; }
  .ed-home-hero { padding: 36px 0; }
  .ed-home-hero-title { font-size: 1.625rem; }
  .ed-post-card-body { padding: 16px; }
  .ed-widget { padding: 16px; }
  .ed-header .ed-container { padding-top: 8px; padding-bottom: 8px; }
  .ed-logo img { height: 40px; }
  .ed-logo-text { font-size: 1.0625rem; }
  .ed-404 h2 { font-size: 4rem; }
}

@media (max-width: 360px) {
  :root {
    --ed-font-size-base: 15px;
    --ed-container-width: 100%;
  }
  .ed-container { padding: 0 12px; }
  .ed-page-hero h1 { font-size: 1.375rem; }
  .ed-home-hero-title { font-size: 1.375rem; }
  .ed-single-content { padding: 16px; }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .ed-page-hero { padding: 20px 0; }
  .ed-home-hero { padding: 24px 0; }
  .ed-nav-menu { padding-top: 60px; }
}

/* Safe area insets */
@supports (padding: env(safe-area-inset-bottom)) {
  .ed-footer-bottom {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ed-animate { opacity: 1 !important; transform: none !important; transition: none !important; }
  .ed-post-card:hover { transform: none; }
}

/* Print */
@media print {
  .ed-topbar,.ed-header,.ed-sidebar,.ed-footer,.ed-back-to-top,.ed-pagination,.ed-search-overlay {
    display: none !important;
  }
  .ed-content-wrapper { grid-template-columns: 1fr !important; }
  body { color: #000; background: #fff; }
}

/* ============================================================
   SINGLE POST — RELATED POSTS
   ============================================================ */
.ed-related-posts { margin: 3rem 0; }
.ed-related-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 1.25rem; color: var(--ed-color-heading); border-left: 4px solid var(--ed-color-primary); padding-left: .75rem; }
.ed-related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.ed-related-card { background: #fff; border-radius: .5rem; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,.08); transition: box-shadow .2s; }
.ed-related-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.13); }
.ed-related-thumb img { width: 100%; height: 150px; object-fit: cover; display: block; }
.ed-related-body { padding: .75rem; }
.ed-related-post-title { font-size: .9rem; font-weight: 600; margin: 0 0 .35rem; line-height: 1.4; }
.ed-related-post-title a { color: var(--ed-color-heading); text-decoration: none; }
.ed-related-post-title a:hover { color: var(--ed-color-primary); }
.ed-related-date { font-size: .78rem; color: #999; }

/* ============================================================
   SINGLE POST — TITLE STYLES (alternate hero modes)
   ============================================================ */
.ed-single-title-above { margin-bottom: 1.5rem; }
.ed-single-title-above h1,
.ed-single-title-inline { font-size: 2.25rem; font-weight: 800; color: var(--ed-color-heading); line-height: 1.25; margin-bottom: 1rem; }
