/*
Theme Name:  EasyWorkflows Child
Theme URI:   https://easyworkflows.net
Description: EasyWorkflows child theme for GeneratePress.
Author:      Zouhair Rhaddou
Author URI:  https://easyworkflows.net
Template:    generatepress
Version:     1.2.0
Text Domain: easyworkflows-child
*/

/* =============================================================
   BRAND TOKENS — edit colours here only
   ============================================================= */
:root {
  --ew-dark:       #355872;
  --ew-mid:        #7aaace;
  --ew-light:      #9cd5ff;
  --ew-bg:         #f7f8f0;
  --ew-white:      #ffffff;
  --ew-text:       #2a3d4a;
  --ew-border:     #c8dde9;
  --ew-code-bg:    #ddeef7;
  --ew-pre-bg:     #0d2535;
  --ew-pre-text:   #d6eaf5;
  --ew-radius:     10px;
  --ew-shadow:     0 4px 24px rgba(53,88,114,0.13);
  --ew-shadow-lg:  0 8px 40px rgba(53,88,114,0.20);
}

/* =============================================================
   GLOBAL
   ============================================================= */
html, body {
  background-color: var(--ew-bg) !important;
  color: var(--ew-text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a                   { color: var(--ew-mid); text-decoration: none; transition: color .2s; }
a:hover             { color: var(--ew-dark); }
*, *::before, *::after { box-sizing: border-box; }

/* =============================================================
   TYPOGRAPHY
   ============================================================= */
h1, h2, h3, h4, h5, h6,
.entry-title, .page-title {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ew-dark);
  font-weight: 700;
  line-height: 1.2;
}
h1, .entry-title { font-size: 2.4rem; }
h2               { font-size: 1.6rem; margin-top: 2rem; }
h3               { font-size: 1.2rem; }

/* =============================================================
   HEADER — 3-column: logo | nav | CTA button
   GeneratePress structure:
   <header .site-header>
     <div .inside-header>
       <div .site-branding> ... </div>
       <nav .main-navigation .nav-primary> ... </nav>
       <!-- we inject .ew-header-cta via hook -->
     </div>
   </header>
   ============================================================= */
.site-header {
  background-color: var(--ew-white) !important;
  border-bottom: 1px solid var(--ew-border);
  padding: 0;
}

/* Make the inner header a flex row */
.inside-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 64px;
  gap: 24px;
}

/* Logo / site title */
.site-branding       { flex: 0 0 auto; }
.site-title          { margin: 0; padding: 0; font-size: 1.1rem; }
.site-title a,
.site-title a:hover  { color: var(--ew-dark) !important; font-weight: 700; }
.site-description    { display: none; }

/* nav takes remaining middle space */
.main-navigation,
.nav-primary {
  flex: 1 1 auto;
  background: transparent !important;
}

/* =============================================================
   NAVIGATION
   ============================================================= */
.inside-navigation {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  background: transparent !important;
}

/* Hide hamburger on desktop */
.menu-toggle { display: none !important; }

/* Top-level menu */
#primary-menu,
.main-navigation ul,
.nav-primary ul {
  display: flex !important;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
}

.main-navigation ul li a,
.nav-primary ul li a {
  color: var(--ew-text) !important;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 14px !important;
  display: block;
  border-radius: 6px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}

.main-navigation ul li a:hover,
.nav-primary ul li a:hover {
  color: var(--ew-dark) !important;
  background: rgba(53,88,114,0.07) !important;
}

/* Active item */
.main-navigation ul .current-menu-item > a,
.nav-primary ul .current-menu-item > a {
  color: var(--ew-dark) !important;
  background: rgba(53,88,114,0.07) !important;
  position: relative;
}
.main-navigation ul .current-menu-item > a::after,
.nav-primary ul .current-menu-item > a::after {
  content: '';
  position: absolute;
  bottom: 2px; left: 14px; right: 14px;
  height: 2px;
  background: var(--ew-mid);
  border-radius: 2px;
}

/* Dropdown arrows */
.main-navigation .menu-item-has-children > a::after,
.nav-primary .menu-item-has-children > a::after {
  content: ' ↓';
  font-size: 0.7em;
  opacity: 0.5;
}

/* Dropdown sub-menu */
.main-navigation ul .sub-menu,
.nav-primary ul .sub-menu {
  position: absolute !important;
  top: 100%;
  left: 0;
  background: var(--ew-white) !important;
  border: 1px solid var(--ew-border);
  border-top: 2px solid var(--ew-mid);
  border-radius: 0 0 var(--ew-radius) var(--ew-radius);
  box-shadow: var(--ew-shadow);
  min-width: 200px;
  z-index: 999;
  flex-direction: column;
  display: none;
  padding: 6px 0;
}

.main-navigation ul li:hover > .sub-menu,
.nav-primary ul li:hover > .sub-menu { display: flex; }

.main-navigation ul .sub-menu li a,
.nav-primary ul .sub-menu li a {
  color: var(--ew-text) !important;
  border-radius: 0 !important;
  padding: 9px 18px !important;
  border-bottom: 1px solid var(--ew-border);
}
.main-navigation ul .sub-menu li a:hover,
.nav-primary ul .sub-menu li a:hover {
  background: rgba(53,88,114,0.06) !important;
  color: var(--ew-dark) !important;
}

.main-navigation ul .sub-menu li:last-child a,
.nav-primary ul .sub-menu li:last-child a { border-bottom: none; }

/* "Get Started" CTA injected by functions.php */
.ew-header-cta {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.ew-header-btn {
  background: var(--ew-dark) !important;
  color: var(--ew-white) !important;
  padding: 9px 22px !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  text-decoration: none !important;
  transition: background .2s, transform .15s !important;
  white-space: nowrap;
  display: inline-block;
}
.ew-header-btn:hover {
  background: var(--ew-mid) !important;
  color: var(--ew-white) !important;
  transform: translateY(-1px);
}

/* Cart icon */
.ew-cart-icon {
  position: relative;
  color: var(--ew-dark);
  font-size: 1.2rem;
  text-decoration: none !important;
}
.ew-cart-icon:hover { color: var(--ew-mid); }
.ew-cart-badge {
  position: absolute;
  top: -8px; right: -8px;
  background: var(--ew-mid);
  color: var(--ew-white);
  font-size: 0.6rem;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* =============================================================
   HERO SECTION  (front-page.php)
   ============================================================= */
.ew-hero {
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(154,213,255,0.30) 0%, transparent 70%), var(--ew-bg);
  padding: 90px 24px 70px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Subtle dot-grid texture */
.ew-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(53,88,114,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.ew-hero-inner {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
}

/* "Now with AI-powered workflows" badge */
.ew-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ew-white);
  border: 1px solid var(--ew-border);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ew-text);
  margin-bottom: 28px;
  box-shadow: 0 2px 8px rgba(53,88,114,0.08);
}
.ew-hero-badge-dot {
  width: 8px; height: 8px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
  animation: ew-pulse 2s ease-in-out infinite;
}
@keyframes ew-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .4; }
}

/* Hero heading */
.ew-hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  line-height: 1.15;
}
.ew-hero h1 .ew-accent { color: var(--ew-mid); }

/* Hero sub-text */
.ew-hero-sub {
  font-size: 1.05rem;
  color: var(--ew-text);
  opacity: .75;
  max-width: 560px;
  margin: 0 auto 36px;
}

/* CTA buttons */
.ew-hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.ew-btn-primary {
  background: var(--ew-dark) !important;
  color: var(--ew-bg) !important;
  padding: 14px 28px !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  transition: background .2s, transform .15s, box-shadow .2s !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ew-btn-primary:hover {
  background: #2a4760 !important;
  transform: translateY(-2px);
  box-shadow: var(--ew-shadow);
}

.ew-btn-outline {
  background: transparent !important;
  color: var(--ew-dark) !important;
  border: 1.5px solid var(--ew-dark) !important;
  padding: 13px 28px !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  transition: background .2s, color .2s !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ew-btn-outline:hover {
  background: rgba(53,88,114,0.06) !important;
}

/* Workflow strip */
.ew-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ew-white);
  border: 1px solid var(--ew-border);
  border-radius: var(--ew-radius);
  padding: 22px 32px;
  max-width: 680px;
  margin: 0 auto;
  box-shadow: var(--ew-shadow);
  gap: 8px;
}

.ew-strip-stat strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ew-dark);
  line-height: 1;
}
.ew-strip-stat span {
  font-size: 0.78rem;
  color: var(--ew-text);
  opacity: .6;
}

.ew-strip-steps {
  display: flex;
  align-items: center;
  gap: 0;
}

.ew-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 0.73rem;
  color: var(--ew-text);
  opacity: .7;
  font-weight: 500;
}
.ew-step-icon {
  width: 44px; height: 44px;
  background: rgba(154,213,255,0.18);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.ew-step.is-done .ew-step-icon {
  background: #4ade80;
  color: var(--ew-white);
}
.ew-step.is-done { opacity: 1; }

.ew-step-arrow {
  width: 36px;
  height: 2px;
  background: var(--ew-border);
  position: relative;
  margin: 0 2px;
  margin-bottom: 18px;
}
.ew-step-arrow::after {
  content: '';
  position: absolute;
  right: -4px; top: -3px;
  border: 4px solid transparent;
  border-left-color: var(--ew-border);
}
.ew-step-arrow.is-done {
  background: #4ade80;
}
.ew-step-arrow.is-done::after {
  border-left-color: #4ade80;
}

/* Scroll hint */
.ew-scroll-hint {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--ew-text);
  opacity: .45;
}
.ew-scroll-mouse {
  width: 22px; height: 36px;
  border: 2px solid currentColor;
  border-radius: 11px;
  position: relative;
}
.ew-scroll-mouse::after {
  content: '';
  position: absolute;
  left: 50%; top: 6px;
  transform: translateX(-50%);
  width: 4px; height: 8px;
  background: currentColor;
  border-radius: 2px;
  animation: ew-scroll 1.6s ease-in-out infinite;
}
@keyframes ew-scroll {
  0%   { opacity: 1; top: 6px; }
  100% { opacity: 0; top: 18px; }
}

/* =============================================================
   PAGE CONTENT AREA
   ============================================================= */
.site-content, .content-area { background: transparent; }

.entry-content {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ew-text);
}
.entry-content p { margin-bottom: 1.4em; }

/* Inline code */
.entry-content code, code {
  background: var(--ew-code-bg);
  color: var(--ew-dark);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.875em;
  font-family: 'JetBrains Mono','Fira Code','Courier New',monospace;
}

/* Code blocks */
.entry-content pre, pre {
  background: var(--ew-pre-bg);
  color: var(--ew-pre-text);
  border-radius: var(--ew-radius);
  padding: 22px 24px;
  overflow-x: auto;
  font-size: 0.875em;
  line-height: 1.65;
  margin: 1.75em 0;
}
pre code { background: transparent; color: inherit; padding: 0; font-size: 1em; }

/* Blockquote — default style */
.entry-content blockquote, blockquote {
  border-left: 4px solid var(--ew-mid);
  background: rgba(154,213,255,0.09);
  padding: 16px 22px;
  margin: 1.75em 0;
  border-radius: 0 var(--ew-radius) var(--ew-radius) 0;
  font-style: italic;
  color: var(--ew-dark);
}
blockquote p:last-child { margin-bottom: 0; }

/* ── Intro CTA blockquote (first blockquote in article)
   Matches blueprint: "Prefer to skip the setup? Grab the ready-made template."
   Add class="ew-intro-cta" to the blockquote block in the editor.
   ── */
.ew-article-body blockquote.ew-intro-cta,
.entry-content blockquote.ew-intro-cta {
  font-style: normal;
  background: linear-gradient(135deg, rgba(53,88,114,0.06), rgba(154,213,255,0.12));
  border-left: 4px solid var(--ew-mid);
  border-radius: 0 var(--ew-radius) var(--ew-radius) 0;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.ew-article-body blockquote.ew-intro-cta p,
.entry-content blockquote.ew-intro-cta p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ew-dark);
  flex: 1;
  min-width: 200px;
}
.ew-article-body blockquote.ew-intro-cta a.ew-cta-inline-btn,
.entry-content blockquote.ew-intro-cta a.ew-cta-inline-btn {
  display: inline-block;
  background: var(--ew-dark);
  color: var(--ew-bg) !important;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none !important;
  transition: background .2s;
  flex-shrink: 0;
}
.ew-article-body blockquote.ew-intro-cta a.ew-cta-inline-btn:hover {
  background: var(--ew-mid);
}

/* ── Mid-article callout box
   Add class="ew-callout" to a paragraph or group block.
   ── */
.ew-callout {
  background: rgba(154,213,255,0.12);
  border: 1px solid var(--ew-border);
  border-left: 4px solid var(--ew-mid);
  border-radius: 0 var(--ew-radius) var(--ew-radius) 0;
  padding: 14px 18px;
  font-size: 0.9rem;
  color: var(--ew-dark);
  margin: 1.5em 0;
}
.ew-callout strong { color: var(--ew-dark); }

/* Tables */
.entry-content table { width: 100%; border-collapse: collapse; font-size: 0.92em; margin: 1.75em 0; }
.entry-content th    { background: var(--ew-dark); color: var(--ew-bg); padding: 12px 16px; text-align: left; font-weight: 600; }
.entry-content td    { padding: 11px 16px; border-bottom: 1px solid var(--ew-border); }
.entry-content tr:nth-child(even) td { background: rgba(154,213,255,0.06); }
.entry-content tr:hover td           { background: rgba(122,170,206,0.10); }

/* =============================================================
   CTA BOX  (class="ew-cta-box" on a group block)
   ============================================================= */
.ew-cta-box {
  background: linear-gradient(135deg, var(--ew-dark) 0%, var(--ew-mid) 100%);
  color: var(--ew-bg) !important;
  border-radius: var(--ew-radius);
  padding: 36px 40px;
  margin: 2.5em 0;
  text-align: center;
}
.ew-cta-box h2, .ew-cta-box h3, .ew-cta-box p { color: var(--ew-bg) !important; }
.ew-cta-box .button, .ew-cta-box a.button {
  background: var(--ew-bg); color: var(--ew-dark) !important; margin-top: 16px;
}
.ew-cta-box .button:hover { background: var(--ew-light); }

/* =============================================================
   EASY DIGITAL DOWNLOADS
   ============================================================= */
.edd-submit,
.edd-add-to-cart,
#edd_purchase_submit input[type="submit"] {
  background: var(--ew-dark) !important;
  color: var(--ew-bg) !important;
  border: none !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  padding: 13px 28px !important;
  transition: background .2s !important;
}
.edd-submit:hover, .edd-add-to-cart:hover { background: var(--ew-mid) !important; }

/* Product cards */
.edd_download {
  border: 1px solid var(--ew-border);
  border-radius: var(--ew-radius);
  padding: 24px;
  background: var(--ew-white);
  transition: box-shadow .2s, transform .2s;
}
.edd_download:hover { box-shadow: var(--ew-shadow-lg); transform: translateY(-3px); }
.edd_download .edd_download_title a { color: var(--ew-dark); font-weight: 700; }
.edd_download .edd_download_title a:hover { color: var(--ew-mid); }
.edd_download .edd_price { color: var(--ew-dark); font-weight: 700; font-size: 1.1em; }

/* =============================================================
   FORMS — WPForms
   ============================================================= */
.wpforms-container .wpforms-submit-container button,
.wpforms-container input[type="submit"] {
  background: var(--ew-dark) !important; color: var(--ew-bg) !important;
  border-radius: 8px !important; font-weight: 600 !important;
}
.wpforms-container .wpforms-submit-container button:hover { background: var(--ew-mid) !important; }
.wpforms-field input, .wpforms-field textarea {
  border: 1px solid var(--ew-border) !important; border-radius: 6px !important;
}
.wpforms-field input:focus, .wpforms-field textarea:focus {
  border-color: var(--ew-mid) !important;
  box-shadow: 0 0 0 3px rgba(122,170,206,0.20) !important;
  outline: none !important;
}

/* =============================================================
   SIDEBAR (global widgets)
   ============================================================= */
.widget-title {
  color: var(--ew-dark); font-weight: 700; font-size: 0.95rem;
  text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 2px solid var(--ew-light); padding-bottom: 8px; margin-bottom: 14px;
}

/* =============================================================
   ARTICLE PAGE LAYOUT  (single.php)
   Two-column: main content (left) + sticky sidebar (right)
   ============================================================= */

/* Override GeneratePress defaults on single posts and all custom page templates */
.single .site-main,
.single .content-area,
body.ew-custom-page .site-main,
body.ew-custom-page .content-area  { width: 100% !important; max-width: 100% !important; float: none !important; padding: 0 !important; }
.single .widget-area,
body.ew-custom-page .widget-area   { display: none !important; }

/* ── Article outer wrapper ── */
.ew-article-wrap {
  background: var(--ew-bg);
  padding-bottom: 80px;
}

/* ── Centred header (above the two-column split) ── */
.ew-article-header {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 24px 32px;
  text-align: center;
}

.ew-article-cat {
  display: inline-block;
  background: rgba(154,213,255,0.20);
  color: var(--ew-dark);
  border: 1px solid var(--ew-border);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none !important;
  margin-bottom: 16px;
}
.ew-article-cat:hover { background: rgba(154,213,255,0.35); color: var(--ew-dark) !important; }

.ew-article-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}

.ew-article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.83rem;
  color: var(--ew-text);
  opacity: 0.6;
}
.ew-article-meta span { display: flex; align-items: center; gap: 5px; }
.ew-article-meta svg  { opacity: 0.7; }

/* ── Featured image — full width strip ── */
.ew-article-hero-img {
  max-width: 900px;
  margin: 0 auto 40px;
  padding: 0 24px;
}
.ew-article-hero-img img {
  width: 100%;
  border-radius: var(--ew-radius);
  display: block;
  box-shadow: var(--ew-shadow);
}

/* ── Two-column container ── */
.ew-article-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 56px;
  align-items: start;
}

/* ── Main content column ── */
.ew-article-main {
  min-width: 0; /* prevent grid blowout */
}

/* ── H2/H3 rhythm inside article body ── */
.ew-article-body h2 {
  font-size: 1.5rem;
  margin-top: 2.8rem;
  margin-bottom: 0.9rem;
  padding-left: 16px;
  border-left: 3px solid var(--ew-mid);
  line-height: 1.25;
}

.ew-article-body h3 {
  font-size: 1.1rem;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
  color: var(--ew-dark);
}

/* Part label above a major section heading (e.g. "Part 1") */
.ew-article-body .ew-section-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ew-mid);
  margin-bottom: 6px;
}

/* Horizontal rule between major sections */
.ew-article-body hr {
  border: none;
  border-top: 1px solid var(--ew-border);
  margin: 2.5rem 0;
}

/* "What You'll Build" list — styled checklist */
.ew-article-body .ew-build-list {
  list-style: none;
  margin: 0 0 1.5em;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ew-article-body .ew-build-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
  line-height: 1.5;
}
.ew-article-body .ew-build-list li::before {
  content: '✓';
  color: #4ade80;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ASCII / system flow diagram block */
.ew-article-body .ew-diagram {
  background: var(--ew-pre-bg);
  color: var(--ew-pre-text);
  border-radius: var(--ew-radius);
  padding: 22px 24px;
  font-family: 'JetBrains Mono','Fira Code','Courier New',monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-x: auto;
  margin: 1.75em 0;
}

/* Troubleshooting / testing table helper */
.ew-article-body .ew-table-wrap {
  overflow-x: auto;
  margin: 1.75em 0;
  border-radius: var(--ew-radius);
  box-shadow: 0 1px 6px rgba(53,88,114,0.07);
}

/* Breadcrumbs in article */
.ew-article-breadcrumb {
  max-width: 820px;
  margin: 0 auto;
  padding: 16px 24px 0;
  font-size: 0.82rem;
  color: var(--ew-text);
  opacity: 0.55;
}
.ew-article-breadcrumb a { color: var(--ew-mid); }
.ew-article-breadcrumb a:hover { color: var(--ew-dark); }

/* ── What's Next (related posts below article) ── */
.ew-whats-next {
  margin-top: 52px;
  padding-top: 32px;
  border-top: 2px solid var(--ew-border);
}
.ew-whats-next h3 {
  font-size: 1.1rem;
  margin-bottom: 18px;
  color: var(--ew-dark);
}
.ew-whats-next-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ew-whats-next-list li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--ew-white);
  border: 1px solid var(--ew-border);
  border-radius: var(--ew-radius);
  color: var(--ew-dark);
  font-weight: 600;
  font-size: 0.9rem;
  transition: box-shadow .2s, transform .15s;
}
.ew-whats-next-list li a:hover {
  box-shadow: var(--ew-shadow);
  transform: translateX(4px);
  color: var(--ew-dark);
}
.ew-whats-next-list li a::before {
  content: '→';
  color: var(--ew-mid);
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── Author box ── */
.ew-author-box {
  display: flex;
  gap: 18px;
  background: var(--ew-white);
  border: 1px solid var(--ew-border);
  border-radius: var(--ew-radius);
  padding: 24px;
  margin-top: 48px;
}
.ew-author-avatar img {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--ew-light);
}
.ew-author-avatar-placeholder {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ew-dark), var(--ew-mid));
  display: flex; align-items: center; justify-content: center;
  color: var(--ew-white);
  font-size: 1.4rem;
  font-weight: 700;
  flex-shrink: 0;
}
.ew-author-info strong { display: block; font-size: 0.95rem; color: var(--ew-dark); margin-bottom: 4px; }
.ew-author-info p { font-size: 0.87rem; margin: 0; opacity: .75; }

/* ── Post tags ── */
.ew-article-tags {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ew-article-tags a {
  display: inline-block;
  background: rgba(154,213,255,0.14);
  border: 1px solid var(--ew-border);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.78rem;
  color: var(--ew-dark);
  font-weight: 500;
}
.ew-article-tags a:hover { background: rgba(154,213,255,0.30); color: var(--ew-dark); }

/* ── Newsletter CTA at end of article ── */
.ew-article-newsletter {
  margin-top: 40px;
  background: linear-gradient(135deg, rgba(53,88,114,0.06), rgba(154,213,255,0.12));
  border: 1px solid var(--ew-border);
  border-radius: var(--ew-radius);
  padding: 28px 30px;
  text-align: center;
}
.ew-article-newsletter h4 { margin: 0 0 6px; font-size: 1rem; color: var(--ew-dark); }
.ew-article-newsletter p  { font-size: 0.875rem; opacity: .7; margin: 0 0 16px; }
.ew-article-newsletter form {
  display: flex; gap: 8px; max-width: 400px; margin: 0 auto;
}
.ew-article-newsletter input[type="email"] {
  flex: 1;
  border: 1px solid var(--ew-border);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.9rem;
  outline: none;
}
.ew-article-newsletter input[type="email"]:focus {
  border-color: var(--ew-mid);
  box-shadow: 0 0 0 3px rgba(122,170,206,0.20);
}
.ew-article-newsletter button {
  background: var(--ew-dark);
  color: var(--ew-white);
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
}
.ew-article-newsletter button:hover { background: var(--ew-mid); }

/* ════════════════════════════════════════════
   STICKY SIDEBAR
   The sidebar sticks to the top; when its total height exceeds
   the viewport it scrolls independently so TOC stays accessible.
   ════════════════════════════════════════════ */
.ew-article-sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overflow-x: visible;
  scrollbar-width: thin;
  scrollbar-color: var(--ew-border) transparent;
  /* Fade-out at bottom so content isn't cut off abruptly */
  -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
  padding-bottom: 24px;
}

/* ── Sidebar widget shell ── */
.ew-sidebar-widget {
  background: var(--ew-white);
  border: 1px solid var(--ew-border);
  border-radius: var(--ew-radius);
  overflow: hidden;
  flex-shrink: 0; /* don't compress widgets inside the scrolling sidebar */
}
.ew-sidebar-widget-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--ew-border);
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ew-dark);
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(53,88,114,0.03);
}
.ew-sidebar-widget-head svg { color: var(--ew-mid); flex-shrink: 0; }
.ew-sidebar-widget-body { padding: 14px 16px 18px; }

/* ── TOC widget — visually prominent ── */
#ew-toc-widget {
  border-color: var(--ew-mid);
  border-width: 1.5px;
}
#ew-toc-widget .ew-sidebar-widget-head {
  background: rgba(122,170,206,0.10);
  border-bottom-color: rgba(122,170,206,0.25);
  font-size: 0.73rem;
  color: var(--ew-dark);
}

.ew-toc-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  /* No fixed max-height — sidebar itself scrolls */
}
.ew-toc-list li a {
  display: block;
  padding: 6px 8px 6px 10px;
  font-size: 0.82rem;
  color: var(--ew-text);
  border-radius: 5px;
  line-height: 1.4;
  transition: background .15s, color .15s, border-color .15s;
  border-left: 2px solid transparent;
}
.ew-toc-list li a:hover {
  background: rgba(53,88,114,0.06);
  color: var(--ew-dark);
}
/* H3 sub-items */
.ew-toc-list li.ew-toc-h3 a {
  padding-left: 22px;
  font-size: 0.77rem;
  opacity: 0.78;
}
/* Active / in-view highlight */
.ew-toc-list li a.ew-toc-active {
  background: rgba(122,170,206,0.13);
  color: var(--ew-dark);
  border-left-color: var(--ew-mid);
  font-weight: 600;
  opacity: 1;
}

/* ── Template CTA widget ── */
.ew-sidebar-cta {
  border: none;
  /* Slightly softer gradient — less visually heavy than before */
  background: linear-gradient(160deg, #3d6478 0%, #5a8da8 100%);
  box-shadow: 0 4px 20px rgba(53,88,114,0.22);
}
.ew-sidebar-cta .ew-sidebar-widget-head {
  background: rgba(0,0,0,0.12);
  border-bottom-color: rgba(255,255,255,0.10);
  color: rgba(247,248,240,0.72);
  font-size: 0.71rem;
}
.ew-sidebar-cta .ew-sidebar-widget-head svg { color: rgba(247,248,240,0.55); }
.ew-sidebar-cta .ew-sidebar-widget-body { padding: 16px 16px 18px; }

.ew-cta-product-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ew-white);
  margin: 0 0 8px;
  line-height: 1.3;
}
.ew-cta-product-desc {
  font-size: 0.82rem;
  color: rgba(247,248,240,0.72);
  margin: 0 0 14px;
  line-height: 1.5;
}
.ew-cta-includes {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ew-cta-includes li {
  font-size: 0.78rem;
  color: rgba(247,248,240,0.80);
  display: flex;
  align-items: center;
  gap: 6px;
}
.ew-cta-includes li::before {
  content: '✓';
  color: #4ade80;
  font-weight: 700;
  flex-shrink: 0;
}
.ew-cta-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ew-white);
  margin: 0 0 12px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.ew-cta-price small {
  font-size: 0.8rem;
  font-weight: 400;
  opacity: 0.6;
  text-decoration: line-through;
}
.ew-cta-btn {
  display: block;
  width: 100%;
  background: var(--ew-bg) !important;
  color: var(--ew-dark) !important;
  text-align: center;
  padding: 12px 16px !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  font-size: 0.9rem !important;
  text-decoration: none !important;
  transition: background .2s, transform .15s !important;
}
.ew-cta-btn:hover {
  background: var(--ew-light) !important;
  color: var(--ew-dark) !important;
  transform: translateY(-1px);
}
.ew-cta-refund {
  font-size: 0.72rem;
  text-align: center;
  color: rgba(247,248,240,0.45);
  margin-top: 8px;
}

/* ── Related articles widget ── */
.ew-related-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ew-related-item a {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  text-decoration: none !important;
}
.ew-related-thumb {
  width: 54px; height: 54px;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(154,213,255,0.18);
}
.ew-related-thumb-placeholder {
  width: 54px; height: 54px;
  border-radius: 7px;
  background: rgba(154,213,255,0.18);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ew-related-info { flex: 1; min-width: 0; }
.ew-related-title {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--ew-dark);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .15s;
}
.ew-related-item a:hover .ew-related-title { color: var(--ew-mid); }
.ew-related-date { font-size: 0.73rem; color: var(--ew-text); opacity: .5; margin-top: 3px; }

/* ═══════════════════════════════════════════
   ARTICLE RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 960px) {
  .ew-article-container {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .ew-article-sidebar {
    position: static;
    max-height: none;
    /* Show sidebar below article on tablet/mobile */
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .ew-sidebar-cta { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .ew-article-sidebar { grid-template-columns: 1fr; }
  .ew-article-header  { padding: 28px 18px 22px; }
  .ew-article-hero-img { padding: 0 18px; }
  .ew-article-container { padding: 0 18px; }
  .ew-article-newsletter form { flex-direction: column; }
}

/* =============================================================
   SHARED SITE HEADER  (template-parts/header-main.php)
   Full-width breakout: works inside GP's .grid-container on all
   pages, and is a no-op on the homepage (parent is already full-width).
   ============================================================= */

/* Hide GP's native header/nav on every custom-template page */
body.ew-custom-page .site-header-wrap,
body.ew-custom-page .nav-primary,
body.ew-home        .site-header-wrap,
body.ew-home        .nav-primary { display: none !important; }

.ew-site-header {
  background: #ffffff !important;
  border-bottom: 1px solid #dde8ef !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 200 !important;
  /* Full-width breakout — same technique as footer */
  width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  box-sizing: border-box !important;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif !important;
}

/* Inner max-width container */
.ew-hdr-wrap {
  max-width: 1080px !important;
  margin: 0 auto !important;
  padding: 0 28px !important;
  box-sizing: border-box !important;
}
.ew-hdr-inner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: 60px !important;
  gap: 20px !important;
}

/* Logo */
.ew-hdr-logo {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  color: #2c4a5e !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
.ew-hdr-logo:hover { color: #2c4a5e !important; text-decoration: none !important; }
.ew-hdr-logo-icon {
  width: 30px !important; height: 30px !important;
  background: #2c4a5e !important;
  border-radius: 8px !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  flex-shrink: 0 !important;
}
.ew-hdr-logo-icon svg { width: 16px !important; height: 16px !important; display: block !important; }

/* Desktop nav */
.ew-hdr-nav {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  flex: 1 !important;
  justify-content: center !important;
}
.ew-hdr-nav a {
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: #7a8f9a !important;
  padding: 6px 13px !important;
  border-radius: 8px !important;
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s !important;
  white-space: nowrap !important;
}
.ew-hdr-nav a:hover { background: rgba(44,74,94,0.07) !important; color: #2c4a5e !important; }
.ew-hdr-nav a.ew-hdr-active { color: #2c4a5e !important; font-weight: 600 !important; background: rgba(44,74,94,0.06) !important; }

/* CTA button */
.ew-hdr-cta { display: flex !important; align-items: center !important; flex-shrink: 0 !important; }
.ew-hdr-btn {
  display: inline-block !important;
  font-size: 0.84rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  background: #2c4a5e !important;
  padding: 8px 18px !important;
  border-radius: 8px !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  transition: background 0.15s, transform 0.1s !important;
}
.ew-hdr-btn:hover { background: #3a5f77 !important; transform: translateY(-1px) !important; color: #ffffff !important; }

/* Hamburger button */
.ew-hdr-hamburger {
  display: none !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 5px !important;
  width: 38px !important; height: 38px !important;
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
}
.ew-hdr-hamburger span {
  display: block !important;
  width: 22px !important; height: 2px !important;
  background: #2c4a5e !important;
  border-radius: 2px !important;
  transition: transform 0.22s, opacity 0.22s !important;
}
/* X state */
.ew-hdr-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg) !important; }
.ew-hdr-hamburger.is-open span:nth-child(2) { opacity: 0 !important; }
.ew-hdr-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg) !important; }

/* Mobile nav panel */
.ew-mobile-nav {
  display: none !important;
  background: #ffffff !important;
  border-top: 1px solid #dde8ef !important;
  width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  box-sizing: border-box !important;
}
.ew-mobile-nav.is-open { display: block !important; }
.ew-mobile-nav-inner {
  max-width: 1080px !important;
  margin: 0 auto !important;
  padding: 16px 28px 24px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}
.ew-mobile-nav-inner a {
  display: block !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  color: #4a6a7e !important;
  padding: 10px 12px !important;
  border-radius: 8px !important;
  text-decoration: none !important;
  transition: background 0.15s !important;
}
.ew-mobile-nav-inner a:hover { background: #f4f8fb !important; color: #2c4a5e !important; }
.ew-mobile-nav-btn {
  margin-top: 8px !important;
  background: #2c4a5e !important;
  color: #f8f7f2 !important;
  font-weight: 700 !important;
  text-align: center !important;
  border-radius: 8px !important;
}
.ew-mobile-nav-btn:hover { background: #3a5f77 !important; color: #f8f7f2 !important; }

/* ── Responsive ── */
@media (max-width: 680px) {
  .ew-hdr-nav  { display: none !important; }
  .ew-hdr-cta  { display: none !important; }
  .ew-hdr-hamburger { display: flex !important; }
}
@media (min-width: 681px) {
  .ew-mobile-nav { display: none !important; }
  .ew-mobile-nav.is-open { display: none !important; }
}

/* =============================================================
   SHARED SITE FOOTER  (template-parts/footer-main.php)
   ============================================================= */
.ew-footer {
  background: #0d2535 !important;
  color: rgba(248,247,242,0.7) !important;
  padding: 48px 0 28px !important;
  /* Full-width breakout — escapes GP grid-container max-width on all pages */
  width: 100vw !important;
  position: relative !important;
  left: 50% !important;
  margin-left: -50vw !important;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif !important;
  box-sizing: border-box !important;
}
.ew-footer-inner {
  max-width: 1000px !important;
  margin: 0 auto !important;
  padding: 0 24px !important;
  box-sizing: border-box !important;
}
.ew-footer .footer-grid {
  display: grid !important;
  grid-template-columns: 1.4fr 1fr 1fr 1fr !important;
  gap: 40px !important;
  margin-bottom: 40px !important;
}
.ew-footer .footer-brand .footer-logo {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  color: #f8f7f2 !important;
  text-decoration: none !important;
  margin-bottom: 12px !important;
}
.ew-footer .footer-logo-icon {
  width: 30px !important;
  height: 30px !important;
  background: #1e3d52 !important;
  border-radius: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}
.ew-footer .footer-logo-icon svg { width: 16px !important; height: 16px !important; }
.ew-footer .footer-brand p {
  font-size: 0.82rem !important;
  line-height: 1.65 !important;
  color: rgba(248,247,242,0.55) !important;
  max-width: 220px !important;
  margin-top: 6px !important;
}
.ew-footer .footer-col h4 {
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: rgba(248,247,242,0.45) !important;
  margin-bottom: 14px !important;
}
.ew-footer .footer-col ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}
.ew-footer .footer-col li a {
  font-size: 0.85rem !important;
  color: rgba(248,247,242,0.65) !important;
  transition: color 0.15s !important;
  text-decoration: none !important;
}
.ew-footer .footer-col li a:hover { color: #f8f7f2 !important; }
.ew-footer .footer-bar {
  border-top: 1px solid rgba(168,212,240,0.1) !important;
  padding-top: 22px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.78rem !important;
  color: rgba(248,247,242,0.35) !important;
}
.ew-footer .footer-bar a { color: rgba(168,212,240,0.6) !important; transition: color 0.15s; }
.ew-footer .footer-bar a:hover { color: #b8d0de !important; }

/* Hide GP footer on all custom template pages */
body.ew-home .site-footer,
body.page-template-page-about-php .site-footer,
body.page-template-page-services-php .site-footer,
body.page-template-page-contact-php .site-footer,
body.page-template-page-blog-php .site-footer,
body.page-template-page-free-php .site-footer,
body.page-template-page-templates-php .site-footer,
body.single .site-footer { display: none !important; }

@media (max-width: 900px) {
  .ew-footer .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 560px) {
  .ew-footer .footer-grid { grid-template-columns: 1fr; }
  .ew-footer .footer-col:last-child { display: none; }
}

/* =============================================================
   GP FOOTER (kept for any pages without custom template)
   GeneratePress outputs: <footer .site-footer> > <div .site-info>
   ============================================================= */
.site-footer,
.site-info {
  background-color: var(--ew-dark) !important;
  color: rgba(247,248,240,0.70) !important;
  font-size: 0.88rem;
}
.site-footer .inside-site-info,
.site-info .inside-site-info {
  max-width: 1140px;
  margin: 0 auto;
  padding: 40px 24px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
/* Footer links */
.site-footer a,
.site-info a {
  color: var(--ew-light) !important;
  transition: color .2s;
}
.site-footer a:hover,
.site-info a:hover { color: var(--ew-white) !important; }

/* Copyright text */
.site-footer .copyright-bar,
.site-info .copyright-bar {
  color: rgba(247,248,240,0.55);
  font-size: 0.83rem;
}

/* Footer widget area (above copyright bar) */
.footer-widgets {
  background-color: var(--ew-dark);
  padding: 56px 24px 32px;
  border-top: 1px solid rgba(154,213,255,0.12);
}
.footer-widgets .widget-title {
  color: var(--ew-bg);
  border-bottom-color: rgba(154,213,255,0.25);
}
.footer-widgets,
.footer-widgets p,
.footer-widgets li { color: rgba(247,248,240,0.65); }
.footer-widgets a   { color: var(--ew-light) !important; }
.footer-widgets a:hover { color: var(--ew-white) !important; }

/* Divider line between footer widgets and copyright */
.site-footer .footer-bar,
.site-info .footer-bar {
  border-top: 1px solid rgba(154,213,255,0.12);
}

/* =============================================================
   TABLE OF CONTENTS (TOC Plus)
   ============================================================= */
#toc_container {
  background: rgba(154,213,255,0.08);
  border: 1px solid var(--ew-border);
  border-radius: var(--ew-radius);
  padding: 20px 24px; margin: 1.75em 0; font-size: 0.93em;
}
#toc_container .toc_title { color: var(--ew-dark); font-weight: 700; font-size: .9em; text-transform: uppercase; letter-spacing: .05em; }
#toc_container a { color: var(--ew-mid); }
#toc_container a:hover { color: var(--ew-dark); }

/* =============================================================
   RANK MATH BREADCRUMBS
   ============================================================= */
.rank-math-breadcrumb { font-size: .84rem; margin-bottom: 14px; }
.rank-math-breadcrumb a { color: var(--ew-mid); }
.rank-math-breadcrumb a:hover { color: var(--ew-dark); }

/* =============================================================
   ANNOUNCEMENT BAR  (add class "ew-announce" to GP Hook element)
   ============================================================= */
.ew-announce {
  background: var(--ew-mid); color: var(--ew-white);
  text-align: center; padding: 10px 16px; font-size: .875rem; font-weight: 500;
}
.ew-announce a { color: var(--ew-white); font-weight: 700; text-decoration: underline; }

/* =============================================================
   UTILITIES
   ============================================================= */
.ew-badge-chip { display: inline-block; background: rgba(154,213,255,.18); color: var(--ew-dark); border: 1px solid var(--ew-border); border-radius: 20px; padding: 3px 12px; font-size: .78rem; font-weight: 600; }
.ew-text-accent { color: var(--ew-mid); }
.ew-text-muted  { color: rgba(42,61,74,.5); font-size: .9em; }

/* =============================================================
   SINGLE POSTS & EDD DOWNLOADS — force GP full-width layout
   CSS fallback in case generate_sidebar_layout filter is cached
   or overridden. Hides GP's #secondary sidebar and makes
   #primary span the full content area so the footer breakout
   (left:50%; margin-left:-50vw) calculates correctly.
   ============================================================= */
body.single #secondary,
body.single-post #secondary,
body.single-download #secondary,
body.posttype-download #secondary {
  display: none !important;
}
body.single #primary,
body.single-post #primary,
body.single-download #primary,
body.posttype-download #primary {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
}
body.single .inside-site-content,
body.single-post .inside-site-content,
body.single-download .inside-site-content,
body.posttype-download .inside-site-content {
  display: block !important;
}

/* =============================================================
   HEADER CART ICON  (EDD)
   ============================================================= */
.ew-hdr-cart {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  color: var(--ew-mid);
  text-decoration: none;
  transition: background .18s, color .18s;
}
.ew-hdr-cart:hover { background: var(--ew-light); color: var(--ew-dark); }
.ew-hdr-cart-count {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #e05a2b;
  color: #fff;
  font-size: .58rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0 3px;
}

/* =============================================================
   FEATURED CARD — thumbnail image support
   ============================================================= */
.feat-icon { display: flex; align-items: center; justify-content: center; }
.feat-icon-img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

/* =============================================================
   DOWNLOAD PRODUCT PAGE  (single-download.php)
   ============================================================= */

/* badge */
.ew-dl-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e8f0f7;
  color: var(--ew-dark);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 5px 13px;
  border-radius: 50px;
  margin-bottom: 14px;
}

/* title */
.ew-dl-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--ew-dark);
  line-height: 1.2;
  margin-bottom: 12px;
}

/* meta row */
.ew-dl-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: .82rem;
  color: var(--ew-text-muted, #8a9bb0);
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.ew-dl-meta span { display: flex; align-items: center; gap: 5px; }

/* hero image */
.ew-dl-hero { margin-bottom: 28px; }
.ew-dl-hero-img {
  width: 100%;
  border-radius: 14px;
  display: block;
  object-fit: cover;
  max-height: 340px;
}

/* description */
.ew-dl-desc {
  font-size: .95rem;
  line-height: 1.78;
  color: #3a4a5a;
  margin-bottom: 26px;
}

/* section labels */
.ew-dl-section-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--ew-text-muted, #8a9bb0);
  margin-bottom: 12px;
}

/* what's included chips */
.ew-dl-includes-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.ew-dl-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #e0ddd6;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: .84rem;
  color: var(--ew-dark);
  font-weight: 500;
}

/* purchase box */
.ew-dl-purchase-box {
  background: #fff;
  border: 1.5px solid #e0ddd6;
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 28px;
}
.ew-dl-purchase-top { margin-bottom: 16px; }
.ew-dl-price {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--ew-dark);
  line-height: 1;
}
.ew-dl-price-sub {
  font-size: .76rem;
  color: var(--ew-text-muted, #8a9bb0);
  margin-top: 4px;
}

/* EDD purchase button override */
.ew-dl-purchase-btn,
.ew-dl-purchase-box .edd-add-to-cart,
.ew-dl-purchase-box .button.edd-add-to-cart {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  background: var(--ew-dark) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 11px !important;
  padding: 15px 20px !important;
  font-size: .97rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  margin-bottom: 14px !important;
  text-decoration: none !important;
  transition: background .18s !important;
  box-sizing: border-box !important;
}
.ew-dl-purchase-btn:hover,
.ew-dl-purchase-box .edd-add-to-cart:hover,
.ew-dl-purchase-box .button.edd-add-to-cart:hover { background: #2a3f50 !important; }

/* trust row */
.ew-dl-trust {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 2px;
}
.ew-dl-trust span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .75rem;
  color: #8a9bb0;
}

/* works with tags */
.ew-dl-works-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.ew-dl-works-tag {
  background: #fff;
  border: 1px solid #e0ddd6;
  border-radius: 8px;
  padding: 5px 13px;
  font-size: .81rem;
  color: var(--ew-dark);
  font-weight: 500;
  text-decoration: none;
  transition: border-color .15s, background .15s;
}
.ew-dl-works-tag:hover { border-color: var(--ew-mid); background: #f0f5fa; color: var(--ew-dark); }

/* related guides bottom */
.ew-dl-related-bottom { border-top: 1px solid var(--ew-border); padding-top: 24px; margin-top: 8px; }

/* ── NUCLEAR: hide every EDD purchase form on download pages ──
   EDD injects forms via edd_after_download_content, shortcodes,
   and GP action hooks. We kill ALL of them site-wide on single
   download pages, then re-show only our hand-placed one. */
body.single-download .edd_download_purchase_form,
body.posttype-download .edd_download_purchase_form,
body.single-download .edd_download_inner .edd_download_purchase_form { display: none !important; }

/* Re-show only the one we placed inside our purchase box */
body.single-download .ew-dl-purchase-box .edd_download_purchase_form,
body.posttype-download .ew-dl-purchase-box .edd_download_purchase_form { display: block !important; }

/* Also hide any stray purchase link button that may appear outside our box */
body.single-download .entry-content .edd-add-to-cart,
body.single-download .entry-content .edd_download_purchase_form,
body.single-download .ew-dl-desc .edd-add-to-cart,
body.single-download .ew-dl-desc .edd_download { display: none !important; }

/* ── Suppress EDD's "Checkout →" / "Go to Checkout" redirect element ── */
.ew-dl-purchase-box .edd-cart-added-notice,
.ew-dl-purchase-box .edd-go-to-checkout,
.ew-dl-purchase-box .edd_cart_item,
.ew-dl-purchase-box .edd-add-to-cart + a { display: none !important; }

/* node price in sidebar */
.ew-node-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-decoration: none;
  color: inherit;
}
.ew-node-price {
  font-size: .84rem;
  font-weight: 700;
  color: var(--ew-dark);
  flex-shrink: 0;
  margin-left: auto;
}

/* separator lines between sidebar related items on download page */
.ew-download-wrap .ew-related-item {
  padding: 10px 0;
  border-bottom: 1px solid #f5f2ec;
}
.ew-download-wrap .ew-related-item:first-child { padding-top: 0; }
.ew-download-wrap .ew-related-item:last-child  { border-bottom: none; padding-bottom: 0; }

/* node thumbnail — smaller, icon-style */
.ew-node-item .ew-related-thumb {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  object-fit: cover;
}
.ew-node-item .ew-related-thumb-placeholder {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: #e8f0f7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* =============================================================
   HIDE GP NATIVE FOOTER — replaced globally by footer-main.php
   via generate_before_footer hook
   ============================================================= */
footer#colophon,
.site-footer { display: none !important; }

/* =============================================================
   EDD CHECKOUT PAGE  (styled to match site theme)
   ============================================================= */

/* Page wrapper */
body.edd-checkout #primary,
body.edd-checkout .inside-article { max-width: 980px; margin: 0 auto; padding: 0 24px; }
body.edd-checkout h1.entry-title,
body.edd-checkout #edd_checkout_wrap > h2:first-child { font-size: 1.6rem; font-weight: 800; color: var(--ew-dark); margin-bottom: 28px; }

/* Cart table */
.edd-checkout-cart,
#edd_checkout_cart { border-collapse: collapse; width: 100%; margin-bottom: 24px;
  background: #fff; border: 1px solid var(--ew-border); border-radius: 12px; overflow: hidden; }
.edd-checkout-cart th,
#edd_checkout_cart th {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ew-text-muted, #8a9bb0);
  padding: 12px 16px;
  border-bottom: 1.5px solid var(--ew-border);
  text-align: left;
  background: var(--ew-light);
}
.edd-checkout-cart td,
#edd_checkout_cart td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--ew-border);
  font-size: .9rem;
  color: var(--ew-dark);
  vertical-align: middle;
}
.edd-checkout-cart tr:last-child td,
#edd_checkout_cart tr:last-child td { border-bottom: none; }
.edd-checkout-cart .edd_cart_item_name,
#edd_checkout_cart .edd_cart_item_name { font-weight: 600; }
.edd-checkout-cart .edd_cart_item_price,
#edd_checkout_cart .edd_cart_item_price { font-weight: 700; color: var(--ew-mid); }
.edd-cart-item-remove a { color: #e05a2b; font-size: .78rem; }

/* Totals */
#edd_final_total_wrap {
  background: var(--ew-light);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ew-dark);
  margin-bottom: 24px;
}

/* Discount / coupon */
#edd-discount-code-wrap { display: flex; gap: 10px; margin-bottom: 20px; }
#edd-discount-code-entry {
  flex: 1;
  border: 1.5px solid var(--ew-border);
  border-radius: 9px;
  padding: 11px 14px;
  font-size: .88rem;
  background: var(--ew-light);
  color: var(--ew-dark);
  outline: none;
  transition: border-color .18s;
}
#edd-discount-code-entry:focus { border-color: var(--ew-mid); background: #fff; }
#edd-discount-code-btn {
  background: var(--ew-light);
  color: var(--ew-mid);
  border: 1.5px solid var(--ew-border);
  border-radius: 9px;
  padding: 11px 18px;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s;
}
#edd-discount-code-btn:hover { background: var(--ew-border); }

/* Personal info fields */
#edd_checkout_form_wrap fieldset,
#edd-billing-address fieldset { border: none; padding: 0; margin: 0; }
#edd_checkout_form_wrap legend {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ew-text-muted, #8a9bb0);
  margin-bottom: 14px;
  display: block;
}
.edd-input,
#edd_checkout_form_wrap input[type="text"],
#edd_checkout_form_wrap input[type="email"],
#edd_checkout_form_wrap input[type="tel"] {
  width: 100%;
  border: 1.5px solid var(--ew-border) !important;
  border-radius: 9px !important;
  padding: 11px 14px !important;
  font-size: .88rem !important;
  background: #fafaf8 !important;
  color: var(--ew-dark) !important;
  margin-bottom: 12px !important;
  outline: none;
  transition: border-color .18s;
  box-shadow: none !important;
}
.edd-input:focus,
#edd_checkout_form_wrap input:focus { border-color: var(--ew-mid) !important; background: #fff !important; }

/* Payment gateway selection */
#edd-payment-mode-select { margin-bottom: 20px; }
#edd-payment-mode-select label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid var(--ew-border);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: .86rem;
  font-weight: 600;
  color: var(--ew-dark);
  cursor: pointer;
  margin: 0 8px 8px 0;
  transition: border-color .18s, background .18s;
}
#edd-payment-mode-select label:has(input:checked) {
  border-color: var(--ew-mid);
  background: var(--ew-light);
  color: var(--ew-mid);
}
#edd-payment-mode-select input[type="radio"] { accent-color: var(--ew-mid); }

/* Submit button */
#edd_purchase_submit .edd-submit,
#edd_purchase_submit button[type="submit"] {
  width: 100%;
  background: var(--ew-mid) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 16px 24px !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .18s !important;
}
#edd_purchase_submit .edd-submit:hover { background: var(--ew-dark) !important; }

/* Errors */
.edd_errors {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  padding: 14px 18px;
  color: #dc2626;
  font-size: .86rem;
  margin-bottom: 16px;
}
.edd_errors li { list-style: none; }

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 900px) {
  .inside-header {
    flex-wrap: wrap;
    padding: 12px 18px;
    gap: 12px;
  }
  .main-navigation, .nav-primary { order: 3; flex: 0 0 100%; }
  .inside-navigation { justify-content: flex-start; overflow-x: auto; }
  #primary-menu, .main-navigation ul, .nav-primary ul { gap: 0; }
  .ew-header-cta { order: 2; }
}

@media (max-width: 640px) {
  .ew-hero { padding: 56px 18px 44px; }
  h1, .ew-hero h1 { font-size: 1.9rem; }
  .ew-strip { padding: 16px 14px; flex-wrap: wrap; justify-content: center; gap: 16px; }
  .ew-strip-steps { display: none; }  /* simplify on mobile */
  .ew-cta-box { padding: 26px 18px; }
  .ew-btn-primary, .ew-btn-outline { padding: 12px 20px !important; }
  .menu-toggle { display: flex !important; background: transparent; border: 1px solid var(--ew-border); color: var(--ew-dark); padding: 6px 12px; border-radius: 6px; cursor: pointer; }
  .main-navigation ul, .nav-primary ul {
    display: none !important;
    flex-direction: column;
    width: 100%;
    background: var(--ew-white);
    border-top: 1px solid var(--ew-border);
    padding: 8px 0;
  }
  .main-navigation.toggled ul,
  .nav-primary.toggled ul { display: flex !important; }
}
