/*
Theme Name: AVECC
Theme URI: https://www.avecc.com
Author: Flex360
Description: Custom theme for Arkansas Valley Electric Cooperative Corporation. Migrated from Laravel/Pilot CMS, modern 2026 redesign.
Version: 1.1.0
License: Proprietary
Text Domain: avecc
*/

/* Brand tokens — used by inline Tailwind config in header.php */
:root {
  --avecc-gold:        #FFC702;
  --avecc-gold-dark:   #C29904;
  --avecc-gold-light:  #FFD84E;
  --avecc-green:       #002407;
  --avecc-green-dark:  #011204;
  --avecc-green-light: #1F752E;
  --avecc-cream:       #FAF7EC;
  --avecc-ink:         #0A0F08;
  --avecc-bone:        #F5F1E6;
  --avecc-fog:         #E8E5D8;
}

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body { background: var(--avecc-cream); color: var(--avecc-ink); font-feature-settings: "ss01", "cv11"; overflow-x: hidden; max-width: 100vw; }

/* Typography refinements that Tailwind utilities can't fully express */
.font-display { font-family: "Fraunces", Georgia, "Times New Roman", serif; font-optical-sizing: auto; font-variation-settings: "SOFT" 50, "WONK" 0; letter-spacing: -0.015em; }
.font-body    { font-family: "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif; font-feature-settings: "cv11", "ss01"; }

/* Headlines */
.headline-xl { font-family: "Fraunces", Georgia, serif; font-weight: 600; line-height: 0.95; letter-spacing: -0.025em; }
.headline-lg { font-family: "Fraunces", Georgia, serif; font-weight: 500; line-height: 1.05; letter-spacing: -0.02em; }

/* Skip link */
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; padding: 0.5rem 1rem; background: var(--avecc-gold); color: var(--avecc-green); z-index: 9999; border-radius: 0.5rem; }

/* Sidebar nav scrollbar */
.site-sidebar { scrollbar-width: thin; scrollbar-color: rgba(255,199,2,.4) transparent; }
.site-sidebar::-webkit-scrollbar { width: 6px; }
.site-sidebar::-webkit-scrollbar-track { background: transparent; }
.site-sidebar::-webkit-scrollbar-thumb { background: rgba(255,199,2,.4); border-radius: 3px; }

/* Hero gradient overlay */
.hero-overlay { background: linear-gradient(135deg, rgba(1,18,4,0.78) 0%, rgba(0,36,7,0.5) 50%, rgba(31,117,46,0.25) 100%); }
.hero-overlay-bottom { background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(1,18,4,0.85) 100%); }

/* Card hover lift */
.card-lift { transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s cubic-bezier(.2,.8,.2,1); }
.card-lift:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -20px rgba(0,36,7,.25), 0 18px 36px -18px rgba(0,36,7,.18); }
.card-image-zoom { transition: transform .9s cubic-bezier(.2,.8,.2,1); }
.card-lift:hover .card-image-zoom { transform: scale(1.06); }

/* Modern accordion (overrides browser <details>) */
details.accordion-item { border: 1px solid rgba(0,36,7,.08); border-radius: 14px; background: white; transition: border-color .2s, box-shadow .2s; }
details.accordion-item[open] { border-color: rgba(255,199,2,.6); box-shadow: 0 8px 24px -12px rgba(0,36,7,.12); }
details.accordion-item summary { padding: 1.25rem 1.5rem; cursor: pointer; font-weight: 600; color: var(--avecc-green); list-style: none; display: flex; align-items: center; gap: 1rem; }
details.accordion-item summary::-webkit-details-marker { display: none; }
details.accordion-item summary::after { content: ''; width: 12px; height: 12px; border-right: 2px solid var(--avecc-gold-dark); border-bottom: 2px solid var(--avecc-gold-dark); transform: rotate(45deg); margin-left: auto; transition: transform .25s; flex-shrink: 0; }
details.accordion-item[open] summary::after { transform: rotate(-135deg); }
details.accordion-item .answer { padding: 0 1.5rem 1.5rem; color: rgba(10,15,8,.75); line-height: 1.7; }
details.accordion-item .answer p:first-child { margin-top: 0; }

/* Article body styling — for single posts and pages */
.prose-avecc { max-width: 70ch; }
.prose-avecc h2 { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 2rem; line-height: 1.15; letter-spacing: -0.02em; margin: 2.5rem 0 1rem; color: var(--avecc-green); }
.prose-avecc h3 { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.5rem; line-height: 1.2; margin: 2rem 0 0.75rem; color: var(--avecc-green); }
.prose-avecc p  { margin: 0 0 1.25rem; line-height: 1.75; font-size: 1.0625rem; color: rgba(10,15,8,.85); }
.prose-avecc a  { color: var(--avecc-green-light); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; transition: color .15s; }
.prose-avecc a:hover { color: var(--avecc-gold-dark); }
.prose-avecc img { border-radius: 12px; margin: 1.75rem auto; max-width: 100%; height: auto; box-shadow: 0 18px 40px -20px rgba(0,36,7,.25); display: block; }
.prose-avecc strong { color: var(--avecc-green); font-weight: 600; }
.prose-avecc ul, .prose-avecc ol { margin: 0 0 1.25rem 1.5rem; line-height: 1.7; }
.prose-avecc li { margin-bottom: 0.5rem; }
.prose-avecc blockquote { border-left: 4px solid var(--avecc-gold); padding-left: 1.5rem; font-family: "Fraunces", Georgia, serif; font-size: 1.25rem; font-style: italic; color: rgba(0,36,7,.85); margin: 2rem 0; }

/* Fade-in on scroll */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* Marquee for the announcement */
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Mobile drawer */
.mobile-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 100%; max-width: 380px; background: var(--avecc-green); z-index: 100; transform: translateX(100%); transition: transform .35s cubic-bezier(.2,.8,.2,1); overflow-y: auto; box-shadow: -20px 0 60px -10px rgba(0,0,0,0.5); }
.mobile-drawer.is-open { transform: translateX(0); }
.mobile-drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: 99; pointer-events: none; transition: background .3s; }
.mobile-drawer-overlay.is-open { background: rgba(0,0,0,0.5); pointer-events: auto; }

/* Top-level wp_nav_menu items inside the mobile drawer — match the hardcoded items above */
.mobile-drawer nav > ul,
.mobile-drawer nav .menu { list-style: none; padding: 0; margin: 0; }
.mobile-drawer nav > ul > li,
.mobile-drawer nav .menu > li { margin: 0.125rem 0; }
.mobile-drawer nav > ul > li > a,
.mobile-drawer nav .menu > li > a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  color: white;
  font-weight: 500;
  transition: background .2s, color .2s;
}
.mobile-drawer nav > ul > li > a:hover,
.mobile-drawer nav .menu > li > a:hover { background: rgba(255,199,2,0.1); color: var(--avecc-gold); }

/* Submenu styling inside the mobile drawer */
.mobile-drawer .menu-item-has-children > a::after { content: '▾'; margin-left: 0.4rem; opacity: 0.6; }
.mobile-drawer .sub-menu { list-style: none; padding: 0.25rem 0 0.5rem 1.5rem; margin: 0.25rem 0 0.5rem 0.5rem; border-left: 2px solid rgba(255,199,2,0.25); }
.mobile-drawer .sub-menu li { margin: 0; }
.mobile-drawer .sub-menu li a { display: block; padding: 0.5rem 0.75rem; font-size: 0.85rem; color: rgba(255,255,255,0.7); border-radius: 0.5rem; }
.mobile-drawer .sub-menu li a:hover { background: rgba(255,199,2,0.1); color: var(--avecc-gold); }

/* Print/legacy support */
.tag-pill { display: inline-flex; align-items: center; padding: 0.375rem 0.875rem; background: rgba(255,199,2,.15); color: var(--avecc-green); border-radius: 999px; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.02em; transition: background .2s; }
.tag-pill:hover { background: rgba(255,199,2,.35); }

/* ──────────────────────────────────────────────────────────
   LEGACY CONTENT NORMALIZATION
   The migrated body HTML from Pilot CMS uses inline tables
   for layout, fixed-pixel button widths, Impact headings,
   etc. Override aggressively to make it modern + responsive.
   ────────────────────────────────────────────────────────── */

/* Tables-as-layout: keep 2-column grouping on all screen sizes so
   "Residential | Business" stays paired even on mobile. We use real
   table layout (not grid) so cells align by row. Buttons inside cells
   become full-width blocks via the .btn override below. */
.prose-avecc table { width: 100% !important; border-collapse: separate; border-spacing: 0.5rem 0.25rem; margin: 1.5rem 0; table-layout: fixed; }
.prose-avecc table.button-table,
.prose-avecc table[class*="button"] { border-spacing: 0.5rem 0.25rem; }
.prose-avecc table.button-table td,
.prose-avecc table[class*="button"] td { padding: 0.25rem; width: 50% !important; vertical-align: top; text-align: center; }

/* Buttons inside legacy content */
.prose-avecc .btn,
.prose-avecc a.btn-primary,
.prose-avecc a[class*="btn-"] {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0.375rem auto !important;
  padding: 0.75rem 1rem !important;
  background: var(--avecc-green) !important;
  color: var(--avecc-gold) !important;
  border-radius: 999px !important;
  text-align: center !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: all 0.2s !important;
  font-size: 0.85rem !important;
  line-height: 1.2 !important;
  word-break: break-word;
}
@media (min-width: 640px) {
  .prose-avecc .btn,
  .prose-avecc a.btn-primary,
  .prose-avecc a[class*="btn-"] { font-size: 0.95rem !important; padding: 0.875rem 1.5rem !important; max-width: 320px !important; }
}

/* Buttons inside list items: side-by-side with description text.
   Source pattern: <ul><li><a class="btn-primary">Label</a> – <span>Description</span></li></ul> */
.prose-avecc ul li:has(> a.btn-primary),
.prose-avecc ul li:has(> a[class*="btn-"]),
.prose-avecc ul li:has(> strong > a.btn-primary) {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0.5rem !important;
  list-style: none !important;
  margin: 0.75rem 0 !important;
  padding: 1rem !important;
  background: white;
  border: 1px solid var(--avecc-fog);
  border-radius: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.prose-avecc ul li:has(> a.btn-primary):hover,
.prose-avecc ul li:has(> a[class*="btn-"]):hover { border-color: var(--avecc-gold); box-shadow: 0 8px 24px -12px rgba(0,36,7,.12); }

@media (min-width: 640px) {
  .prose-avecc ul li:has(> a.btn-primary),
  .prose-avecc ul li:has(> a[class*="btn-"]) {
    flex-direction: row !important;
    align-items: center !important;
    gap: 1.25rem !important;
    padding: 0.75rem 1rem 0.75rem 0.75rem !important;
  }
}

/* Buttons inside list items override (compact pill, not full-width block) */
.prose-avecc ul li > a.btn-primary,
.prose-avecc ul li > a[class*="btn-"],
.prose-avecc ul li > strong > a.btn-primary {
  display: inline-block !important;
  width: auto !important;
  min-width: 200px !important;
  max-width: 100% !important;
  margin: 0 !important;
  flex-shrink: 0;
  white-space: normal;
}

/* Description text inside list items */
.prose-avecc ul li:has(> a.btn-primary) > span,
.prose-avecc ul li:has(> a[class*="btn-"]) > span {
  font-size: 0.95rem !important;
  color: rgba(10,15,8,.75);
  line-height: 1.5;
}

/* Strip the leading "– " separator the source uses */
.prose-avecc ul li:has(> a.btn-primary) > span:first-of-type {
  display: none;
}

/* Remove default bullets from any list containing button items */
.prose-avecc ul:has(li > a.btn-primary),
.prose-avecc ul:has(li > a[class*="btn-"]) {
  list-style: none !important;
  padding: 0 !important;
  margin: 1.5rem 0 !important;
}

/* Standalone buttons inside <h3> headers (the source nests buttons inside heading tags) */
.prose-avecc h3 > a.btn-primary,
.prose-avecc h3 > a[class*="btn-"] {
  display: inline-block !important;
  width: auto !important;
  min-width: 240px;
  max-width: 100% !important;
  margin: 0.5rem 0 !important;
  font-family: var(--font-body);
}

/* Standalone buttons inside <p> (just centered pill) */
.prose-avecc p > a.btn-primary,
.prose-avecc p > strong > a.btn-primary,
.prose-avecc p > a[class*="btn-"] {
  display: inline-block !important;
  width: auto !important;
  min-width: 240px;
}
.prose-avecc .btn:hover,
.prose-avecc a.btn-primary:hover,
.prose-avecc a[class*="btn-"]:hover {
  background: var(--avecc-gold) !important;
  color: var(--avecc-green) !important;
  transform: translateY(-1px) !important;
}

/* Inside accordion answers (FAQs/Resources), force WHITE button text by default —
   the .prose-avecc generic <a> color rule otherwise makes them dark-green-on-dark-green. */
details.accordion-item .answer a.btn,
details.accordion-item .answer a.btn-primary,
details.accordion-item .answer a[class*="btn-"],
details.accordion-item .answer a[class*="bg-avecc-green"],
details.accordion-item .answer p > a[href]:not([class]) ~ a,
.accordion-item .answer .btn,
.accordion-item .answer .btn-primary {
  color: white !important;
  text-decoration: none !important;
}
details.accordion-item .answer a.btn:hover,
details.accordion-item .answer a.btn-primary:hover,
details.accordion-item .answer a[class*="btn-"]:hover {
  color: var(--avecc-green) !important;
}

/* Legacy "Impact" headings → modern */
.prose-avecc span[style*="Impact"],
.prose-avecc span[style*="impact"] {
  font-family: "Fraunces", Georgia, serif !important;
  font-size: 1.5rem !important;
  font-weight: 600 !important;
  color: var(--avecc-green) !important;
  display: block !important;
  text-align: center !important;
  margin: 0.25rem 0 0.75rem !important;
  letter-spacing: -0.02em !important;
  border-bottom: 3px solid var(--avecc-gold);
  padding-bottom: 0.4rem;
}
@media (min-width: 640px) {
  .prose-avecc span[style*="Impact"],
  .prose-avecc span[style*="impact"] { font-size: 2rem !important; }
}

/* Make column headers in 2-col layouts feel like proper section labels */
.prose-avecc table.button-table tr:first-child td span,
.prose-avecc table[class*="button"] tr:first-child td span {
  border-bottom: 3px solid var(--avecc-gold);
  padding-bottom: 0.5rem;
  display: inline-block !important;
}

/* Inline images: don't let fixed width: NNNpx bust the container */
.prose-avecc img { max-width: 100% !important; width: auto !important; height: auto !important; }

/* Anything using Pilot's responsive utility classes */
.prose-avecc .mx-auto { margin-left: auto !important; margin-right: auto !important; }
.prose-avecc .text-center { text-align: center !important; }

/* Constant Contact: constrain width so it never busts the viewport */
.ctct-inline-form,
.ctct-form-custom,
.ctct-form-defaults,
.ctct-form-wrapper,
.ctct-embed-signup { max-width: 100% !important; width: 100% !important; box-sizing: border-box !important; }
.ctct-inline-form * { max-width: 100% !important; box-sizing: border-box !important; }
.ctct-inline-form iframe { max-width: 100% !important; width: 100% !important; }

/* Constant Contact form polish — match dark gradient background */
.ctct-form-defaults,
.ctct-inline-form .ctct-form-defaults { background: transparent !important; box-shadow: none !important; padding: 0 !important; border: 0 !important; }
.ctct-inline-form .ctct-form-text { color: rgba(255,255,255,0.8) !important; }
.ctct-inline-form input[type="text"],
.ctct-inline-form input[type="email"] { background: rgba(255,255,255,0.95) !important; border: 1px solid rgba(255,199,2,0.4) !important; border-radius: 12px !important; padding: 0.875rem 1rem !important; color: var(--avecc-ink) !important; }
.ctct-inline-form .ctct-form-label,
.ctct-inline-form label { color: rgba(255,255,255,0.9) !important; }
.ctct-inline-form button[type="submit"],
.ctct-inline-form .ctct-form-button { background: var(--avecc-gold) !important; color: var(--avecc-green) !important; border: 0 !important; border-radius: 999px !important; padding: 0.875rem 2rem !important; font-weight: 600 !important; }
.ctct-inline-form .ctct-disclosure { color: rgba(255,255,255,0.5) !important; font-size: 0.7rem !important; }

/* Hero featured image fix on single posts (in case Spatie original aspect is weird) */
section.relative.bg-avecc-green img { object-position: center; }

/* Hide Google reCAPTCHA floating badge — required attribution text is in the footer.
   Per Google's policy this is allowed when the branding text is displayed somewhere on the page. */
.grecaptcha-badge { visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; right: -300px !important; }
