/* Selectable header & footer layouts (Anova Core → Header / Footer). */
.anova-hx {
  --hx-border: var(--border-color, #e5e7eb);
  --hx-soft: #f1f5f9;
  --hx-muted: #64748b;
  --hx-accent: var(--accent-primary, #2563eb);
  position: relative;
  border-bottom: 1px solid var(--hx-border);
}
.anova-hx .container { max-width: var(--container-width, 1200px); }
.anova-hx-row {
  display: flex;
  align-items: center;
  gap: clamp(0.6rem, 1.6vw, 1.25rem);
}
.anova-hx-row--3 {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
}
.anova-hx-left, .anova-hx-right {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.4vw, 1rem);
  min-width: 0;
}
.anova-hx-right { justify-content: flex-end; }
.anova-hx-row:not(.anova-hx-row--3) > .anova-hx-right { margin-left: auto; }
.anova-hx-grow { flex: 1; }
.anova-hx-main { padding: 0.9rem 0; }
.anova-hx .site-branding { flex: 0 0 auto; margin: 0; }
.anova-hx .site-branding img { max-height: 2.75rem; width: auto; }
.anova-hx .site-title { font-size: 1.35rem; font-weight: 800; text-decoration: none; color: inherit; }

/* Topbar */
.anova-hx-topbar { background: #0f172a; color: #e2e8f0; font-size: 0.8rem; }
.anova-hx-topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; flex-wrap: wrap; }
.anova-hx-topbar-info { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.anova-hx-topbar a { color: inherit; text-decoration: none; }
.anova-hx-topbar-promo { color: #fbbf24; font-weight: 600; }
.anova-hx-topbar .bi { margin-right: 0.15rem; }

/* Search */
.anova-hx-searchwrap { flex: 1; min-width: 0; max-width: 720px; margin: 0 auto; }
.anova-hx-search {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  border: 1.5px solid var(--hx-border);
  border-radius: 999px;
  background: var(--bg-primary, #fff);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.anova-hx-search:focus-within { border-color: var(--hx-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hx-accent) 18%, transparent); }
.anova-hx-search select {
  flex: 0 0 auto;
  max-width: 11rem;
  padding: 0 0.9rem;
  border: 0;
  border-right: 1px solid var(--hx-border);
  border-radius: 0;
  background: var(--hx-soft);
  color: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.anova-hx-search input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 1rem;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 0.92rem;
  outline: none;
  box-shadow: none;
}
.anova-hx-search button {
  flex: 0 0 auto;
  margin: 0.25rem;
  padding: 0 1.1rem;
  border: 0;
  border-radius: 999px;
  background: var(--hx-accent);
  color: #fff;
  cursor: pointer;
}
.anova-hx-searchpanel { border-top: 1px solid var(--hx-border); padding: 0.75rem 0; }
.anova-hx-searchpanel[hidden] { display: none; }
.anova-hx-searchpanel .anova-hx-search { max-width: 720px; margin: 0 auto; }

/* Icons, account and cart */
.anova-hx-icons { display: flex; align-items: center; gap: clamp(0.5rem, 1.4vw, 1.1rem); flex: 0 0 auto; }
.anova-hx-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 1.2rem;
  text-decoration: none;
  cursor: pointer;
}
.anova-hx-icon:hover { background: var(--hx-soft); }
.anova-hx-account, .anova-hx-cart { display: inline-flex; align-items: center; gap: 0.55rem; color: inherit; text-decoration: none; }
.anova-hx-account > .bi, .anova-hx-cart-icon > .bi { font-size: 1.35rem; }
.anova-hx-label { display: flex; flex-direction: column; line-height: 1.15; }
.anova-hx-label small { color: var(--hx-muted); font-size: 0.72rem; }
.anova-hx-label strong { font-size: 0.85rem; white-space: nowrap; }
.anova-hx-cart-icon { position: relative; display: inline-flex; }
.anova-hx-badge {
  position: absolute;
  top: -0.45rem;
  right: -0.55rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15rem;
  text-align: center;
}

/* Navigation row & categories */
.anova-hx-nav { border-top: 1px solid var(--hx-border); }
.anova-hx-nav .anova-hx-row { min-height: 3.1rem; }
.anova-hx-nav--center .anova-hx-row { justify-content: center; }
.anova-hx-nav .header-actions { margin-left: auto; }
.anova-hx-nav--center .header-actions { margin-left: 0; }
.anova-hx .main-navigation { flex: 0 1 auto; }
.anova-hx-nav .main-navigation a, .anova-hx-main .main-navigation a { font-weight: 600; font-size: 0.92rem; }
.anova-hx-cats { position: relative; flex: 0 0 auto; }
.anova-hx-cats-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: 0.6rem;
  background: var(--hx-accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
}
.anova-hx-caret { font-size: 0.75rem; transition: transform 0.15s ease; }
.anova-hx-cats-toggle[aria-expanded="true"] .anova-hx-caret { transform: rotate(180deg); }
.anova-hx-cats-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 1200;
  min-width: 250px;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  border: 1px solid var(--hx-border);
  border-radius: 0.8rem;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #0f172a);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
}
.anova-hx-cats-menu[hidden] { display: none; }
.anova-hx-cats-menu a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  color: inherit;
  font-size: 0.9rem;
  text-decoration: none;
}
.anova-hx-cats-menu a:hover { background: var(--hx-soft); color: var(--hx-accent); }
.anova-hx-cats-menu a span { color: var(--hx-muted); font-size: 0.78rem; }
.anova-hx-cats-all { margin-top: 0.25rem; padding-top: 0.25rem; border-top: 1px solid var(--hx-border); }
.anova-hx-cats-all a { color: var(--hx-accent); font-weight: 600; justify-content: flex-start; }
.anova-hx .header-actions { display: flex; align-items: center; gap: 0.5rem; }
.anova-hx .menu-toggle { display: none; }

/* Header backgrounds for the new layouts */
.anova-hx.header-background-dark { --hx-border: rgba(148, 163, 184, 0.22); --hx-soft: rgba(148, 163, 184, 0.12); --hx-muted: #94a3b8; }
.anova-hx.header-background-dark .anova-hx-search { background: rgba(255, 255, 255, 0.06); }
.anova-hx.header-background-dark .anova-hx-search select { background: rgba(255, 255, 255, 0.08); }
html.dark .anova-hx { --hx-border: #1f2937; --hx-soft: rgba(148, 163, 184, 0.12); --hx-muted: #94a3b8; }
html.dark .anova-hx-search { background: #0b1220; }
html.dark .anova-hx-search select { background: #111827; }
html.dark .anova-hx-cats-menu { background: var(--dark-surface, #111827); color: var(--dark-text, #f8fafc); }

/* Responsive */
@media (max-width: 1024px) {
  .anova-hx-nav .main-navigation, .anova-hx-main .main-navigation { flex: 0 0 auto; }
  .anova-hx .menu-toggle { display: inline-flex; }
  .anova-hx .anova-hx-label, .anova-hx .header-actions .anova-header-cta { display: none !important; }
  .anova-hx-nav .anova-hx-row { min-height: 2.9rem; }
  .anova-hx--classic .anova-hx-main .anova-hx-row { flex-wrap: wrap; }
  .anova-hx--classic .anova-hx-searchwrap { order: 5; flex: 1 0 100%; max-width: none; }
  .anova-hx--centered .anova-hx-row--3 { grid-template-columns: auto 1fr; }
  .anova-hx--centered .anova-hx-left { grid-column: 1 / -1; order: 3; }
  .anova-hx--centered .anova-hx-main .site-branding { justify-self: start; }
  .anova-hx--logo-center .anova-hx-row--3, .anova-hx--logo-center-search .anova-hx-row--3 { grid-template-columns: auto 1fr auto; }
  .anova-hx-cats-toggle span { display: none; }
  .anova-hx-cats-menu { min-width: 220px; }
  #masthead.anova-hx #site-navigation.main-navigation { top: calc(100% + 0.55rem); }
}
@media (max-width: 600px) {
  .anova-hx-topbar-info { display: none; }
  .anova-hx-topbar-inner { justify-content: center; }
  .anova-hx-search select { max-width: 6.5rem; padding: 0 0.5rem; font-size: 0.78rem; }
}

/* ---------------------------------------------------------------- Footer */
.anova-fx {
  --fx-bg: #0f172a;
  --fx-text: #cbd5e1;
  --fx-head: #f8fafc;
  --fx-border: rgba(148, 163, 184, 0.2);
  --fx-soft: rgba(148, 163, 184, 0.1);
  --fx-accent: var(--accent-primary, #2563eb);
  background: var(--fx-bg);
  color: var(--fx-text);
  font-size: 0.92rem;
}
.anova-fx-scheme-light { --fx-bg: #f8fafc; --fx-text: #475569; --fx-head: #0f172a; --fx-border: #e2e8f0; --fx-soft: #fff; }
.anova-fx-scheme-custom { --fx-bg: var(--footer-bg, #f8fafc); --fx-text: var(--footer-text, #475569); --fx-head: var(--footer-text, #0f172a); --fx-border: color-mix(in srgb, var(--footer-text, #475569) 20%, transparent); --fx-soft: color-mix(in srgb, var(--footer-text, #475569) 8%, transparent); }
html.dark .anova-fx-scheme-light, html.dark .anova-fx-scheme-custom { --fx-bg: #0b1220; --fx-text: #cbd5e1; --fx-head: #f8fafc; --fx-border: rgba(148, 163, 184, 0.2); --fx-soft: rgba(148, 163, 184, 0.1); }
.anova-fx a { color: inherit; text-decoration: none; }
.anova-fx a:hover { color: var(--fx-head); }
.anova-fx .container { max-width: var(--container-width, 1200px); }
.anova-fx-main { padding: clamp(2.5rem, 5vw, 4rem) 0; }

/* Newsletter band & card */
.anova-fx-news { border-bottom: 1px solid var(--fx-border); background: var(--fx-soft); }
.anova-fx-news-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.75rem 0; flex-wrap: wrap; }
.anova-fx-news-copy { display: flex; align-items: center; gap: 1rem; }
.anova-fx-news-copy strong { display: block; color: var(--fx-head); font-size: 1.1rem; }
.anova-fx-news-copy p { margin: 0.2rem 0 0; }
.anova-fx-news-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 3rem; width: 3rem; height: 3rem; border-radius: 0.9rem; background: var(--fx-accent); color: #fff; font-size: 1.25rem; }
.anova-fx-form { display: flex; gap: 0.5rem; flex: 1 1 320px; max-width: 460px; }
.anova-fx-form input[type="email"] { flex: 1; min-width: 0; padding: 0.7rem 1rem; border: 1px solid var(--fx-border); border-radius: 0.6rem; background: var(--bg-primary, #fff); color: #0f172a; }
.anova-fx-form button { padding: 0.7rem 1.25rem; border: 0; border-radius: 0.6rem; background: var(--fx-accent); color: #fff; font-weight: 600; cursor: pointer; }
.anova-fx-form--shortcode { display: block; }
.anova-fx-news-card { display: flex; flex-direction: column; gap: 1rem; padding: 1.5rem; border: 1px solid var(--fx-border); border-radius: 1rem; background: var(--fx-soft); }
.anova-fx-news-card .anova-fx-form { max-width: none; flex: 0 0 auto; }

/* Brand */
.anova-fx-brand { max-width: 340px; }
.anova-fx-brand--center { max-width: 560px; margin: 0 auto; text-align: center; }
.anova-fx-brand .anova-footer-logo img { max-height: 3rem; width: auto; }
.anova-fx-name { color: var(--fx-head) !important; font-size: 1.35rem; font-weight: 800; }
.anova-fx-tagline { margin: 0.75rem 0 0; line-height: 1.6; }
.anova-fx-phone { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 0.85rem; color: var(--fx-head) !important; font-weight: 600; }

/* Columns */
.anova-fx-grid { display: grid; grid-template-columns: minmax(220px, 1.2fr) 3fr; gap: clamp(2rem, 5vw, 4rem); }
.anova-fx-cols { display: grid; grid-template-columns: repeat(var(--fx-cols, 4), minmax(0, 1fr)); gap: clamp(1.25rem, 3vw, 2.5rem); }
.anova-fx-col h2 { margin: 0 0 0.9rem; color: var(--fx-head); font-size: 0.95rem; font-weight: 700; }
.anova-fx-col ul, .anova-fx-links { margin: 0; padding: 0; list-style: none; }
.anova-fx-col li { margin: 0 0 0.55rem; }
.anova-fx-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.anova-fx-center { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; text-align: center; }
.anova-fx-center .anova-fx-links { justify-content: center; }
.anova-fx-compact { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.anova-fx--compact .anova-fx-main { padding: 1.75rem 0; }
.anova-fx--compact .anova-fx-tagline { display: none; }
.anova-fx-cardrow { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; margin-bottom: clamp(2rem, 4vw, 3rem); }
.anova-fx-cardrow + .anova-fx-cols { padding-top: clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--fx-border); }

/* Bottom bar */
.anova-fx-bottom { border-top: 1px solid var(--fx-border); font-size: 0.82rem; }
.anova-fx-bottom-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 0; flex-wrap: wrap; }
.anova-fx-bottom.is-centered .anova-fx-bottom-inner { flex-direction: column; justify-content: center; text-align: center; }
.anova-fx-bottom p { margin: 0; }
.anova-fx-bottom-end { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.anova-fx-badges { display: flex; gap: 0.4rem; margin: 0; padding: 0; list-style: none; flex-wrap: wrap; }
.anova-fx-badges li { padding: 0.25rem 0.6rem; border: 1px solid var(--fx-border); border-radius: 0.4rem; background: var(--fx-soft); color: var(--fx-head); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; }
.anova-fx .anova-footer-socials, .anova-fx .anova-footer-social-links { margin: 0; }

@media (max-width: 900px) {
  .anova-fx-grid, .anova-fx-cardrow { grid-template-columns: 1fr; }
  .anova-fx-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .anova-fx-cols { grid-template-columns: 1fr; }
  .anova-fx-form { flex-direction: column; }
  .anova-fx-bottom-inner { flex-direction: column; text-align: center; }
}
.anova-hx .anova-header-cta { min-height: 0; padding: 0.55rem 1.1rem; font-size: 0.88rem; line-height: 1.2; border-radius: 0.6rem; white-space: nowrap; }
.anova-fx .anova-footer-menu { display: block; margin: 0; padding: 0; list-style: none; }
.anova-fx .anova-footer-menu a, .anova-fx .anova-fx-links a { font-family: inherit; font-size: 0.9rem; font-weight: 400; line-height: 1.5; color: var(--fx-text); }
.anova-fx .anova-footer-menu a:hover, .anova-fx .anova-fx-links a:hover { color: var(--fx-head); }
.anova-fx-col li { margin: 0 0 0.6rem; }
.anova-fx--compact .anova-fx-brand { display: flex; align-items: center; gap: 1.25rem; max-width: none; flex-wrap: wrap; }
.anova-fx--compact .anova-fx-phone { margin-top: 0; font-weight: 500; }

/* Sticky share: bottom bar when there is no room beside the post content (set by main.js). */
@media (min-width: 901px) {
  .anova-sticky-share.anova-sticky-share--bottom { top: auto !important; bottom: max(12px, env(safe-area-inset-bottom)) !important; left: 50% !important; width: max-content !important; max-width: calc(100vw - 20px); transform: translateX(-50%) !important; z-index: 80; }
  .anova-sticky-share--bottom .anova-share-section { width: auto !important; }
  .anova-sticky-share--bottom .anova-share-heading { display: none !important; }
  .anova-sticky-share--bottom .anova-share-buttons { width: auto !important; flex-direction: row !important; flex-wrap: nowrap !important; gap: 6px !important; }
  .anova-sticky-share--bottom .anova-share-btn { flex: 0 0 38px !important; width: 38px !important; height: 38px !important; }
}
@media (min-width: 901px) {
  .anova-sticky-share:not(.anova-sticky-share--bottom) .anova-share-heading { width: max-content !important; align-self: center; }
}

/* ---------------------------------------------------------------- Single post: tablet & mobile */
@media (max-width: 900px) {
  /* Meta under the title: author + category + date + reading time on one line (wraps only when needed). */
  .anova-single-post .anova-single-meta {
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem !important;
    padding-top: 1rem;
  }
  .anova-single-post .anova-single-author { gap: 0.45rem; }
  .anova-single-post .anova-single-author-avatar img { width: 28px; height: 28px; }
  .anova-single-post .anova-single-author-role { display: none; }
  .anova-single-post .anova-single-author-name { font-size: 0.875rem; }
  /* Let the detail items flow on the same line as the author instead of dropping as one block. */
  .anova-single-post .anova-single-meta-details { display: contents; font-size: 0.8125rem; }
  .anova-single-post .anova-single-meta-details > * { font-size: 0.8125rem; color: var(--text-muted, #6b7280); }
  .anova-single-post .anova-single-meta-details > span,
  .anova-single-post .anova-single-meta-details > a { gap: 0.3rem; white-space: nowrap; }

  /* Share buttons after the post: fit the width, no scroll bar, less empty space. */
  .anova-single-post .anova-share-section:not(.anova-sticky-share *) { margin-block: 1.5rem !important; padding-block: 0 !important; gap: 0.6rem !important; }
  .anova-single-post .anova-share-section:not(.anova-sticky-share *) .anova-share-heading { margin: 0 !important; font-size: 1rem !important; }
  .anova-single-post .anova-share-section:not(.anova-sticky-share *) .anova-share-buttons {
    flex-wrap: wrap !important;
    overflow: visible !important;
    gap: 8px !important;
  }

  /* Author box: compact, avatar beside the text. */
  .anova-author-box {
    flex-direction: row !important;
    align-items: center !important;
    text-align: left !important;
    gap: 1rem !important;
    padding: 1rem 1.125rem !important;
    margin-top: 1.75rem !important;
    border-radius: 14px !important;
  }
  .anova-author-box-avatar { flex: 0 0 auto; }
  .anova-author-box-avatar img { width: 56px; height: 56px; }
  .anova-author-box-name { margin: 0.1rem 0 0.35rem !important; font-size: 1.1rem !important; }
  .anova-author-box-bio { margin-bottom: 0.5rem !important; font-size: 0.875rem !important; }

  /* Sticky share bar (tablet & mobile): solid card, 10px padding, 10px radius. */
  .anova-sticky-share,
  .anova-sticky-share.anova-sticky-share--bottom {
    padding: 10px !important;
    border: 1px solid var(--border-color, #e5e7eb) !important;
    border-radius: 10px !important;
    background: var(--bg-card, #fff) !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14) !important;
  }
  .anova-sticky-share .anova-share-btn { box-shadow: none !important; }
  html.dark .anova-sticky-share { border-color: #334155 !important; background: var(--dark-surface, #1e293b) !important; }
}
@media (max-width: 420px) {
  .anova-author-box-avatar img { width: 44px; height: 44px; }
}
/* Same solid card for the desktop fallback bottom bar. */
@media (min-width: 901px) {
  .anova-sticky-share.anova-sticky-share--bottom { padding: 10px !important; border: 1px solid var(--border-color, #e5e7eb) !important; border-radius: 10px !important; background: var(--bg-card, #fff) !important; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14) !important; }
  html.dark .anova-sticky-share.anova-sticky-share--bottom { border-color: #334155 !important; background: var(--dark-surface, #1e293b) !important; }
}
/* Never let a wide child (comment textarea, embeds) push the post column past the screen. */
.anova-single-container > *, .anova-single-main { min-width: 0; }
.anova-comments textarea, .anova-comments input[type="text"], .anova-comments input[type="email"], .anova-comments input[type="url"] { max-width: 100%; box-sizing: border-box; }
/* Sticky share card: the same 10px on all four sides (no extra margin above/below the buttons). */
@media (max-width: 900px) {
  .anova-sticky-share .anova-share-section,
  .anova-sticky-share .anova-share-buttons { margin: 0 !important; padding: 0 !important; min-height: 0 !important; }
}
.anova-sticky-share.anova-sticky-share--bottom .anova-share-section,
.anova-sticky-share.anova-sticky-share--bottom .anova-share-buttons { margin: 0 !important; padding: 0 !important; min-height: 0 !important; }

/* Sidebar widgets as cards with small uppercase headings. */
.anova-sidebar .widget { margin: 0 0 20px; padding: 20px; border: 1px solid var(--border-color, #e5e7eb); border-radius: 14px; background: var(--bg-card, #fff); }
.anova-sidebar .widget:last-child { margin-bottom: 0; }
.anova-sidebar .widget-title,
.anova-sidebar .widget :is(h2, h3).wp-block-heading { margin: 0 0 14px !important; color: var(--text-muted, #6b7280); font-size: 12px !important; font-weight: 700; letter-spacing: .1em; line-height: 1.3; text-transform: uppercase; }
.anova-sidebar .widget ul:not(.anova-pl), .anova-sidebar .widget ol:not(.anova-pl) { margin: 0; padding-left: 0; list-style: none; }
.anova-sidebar .widget ul:not(.anova-pl) li { padding: 7px 0; border-bottom: 1px solid var(--border-color, #e5e7eb); }
.anova-sidebar .widget ul:not(.anova-pl) li:last-child { border-bottom: 0; }
html.dark .anova-sidebar .widget { border-color: #1f2937; background: var(--dark-surface, #111827); }
html.dark .anova-sidebar .widget ul:not(.anova-pl) li { border-color: #1f2937; }
@media (min-width: 1025px) {
  .anova-sidebar { align-self: start; }
}
