/*
Theme Name:   Ballot Yard
Theme URI:    https://ballotyard.com
Description:  Custom child theme for Ballot Yard marketing site. Child of Astra.
Author:       Ballot Yard
Template:     astra
Version:      1.0.0
Text Domain:  ballotyard
*/

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --by-navy:          #0A2540;
  --by-navy-light:    #0d2f4e;
  --by-off-white:     #FAFAF7;
  --by-accent:        #0F6E56;
  --by-accent-dark:   #0a5542;
  --by-text-primary:  #111111;
  --by-text-secondary:#5F5E5A;
  --by-border:        #E5E5E0;
  --by-white:         #FFFFFF;
  --by-bg-alt:        #F4F4F0;

  --by-font:          "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --by-mono:          "JetBrains Mono", "IBM Plex Mono", "Courier New", monospace;

  --by-r-sm:          4px;
  --by-r-md:          8px;

  --by-transition:    180ms ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family:  var(--by-font);
  font-size:    1rem;
  line-height:  1.65;
  color:        var(--by-text-primary);
  background:   var(--by-white);
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; height: auto; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family:  var(--by-font);
  font-weight:  600;
  line-height:  1.2;
  color:        var(--by-navy);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 4vw, 3rem);   margin-bottom: 1.25rem; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 1rem;    }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); margin-bottom: 0.75rem; }
h4 { font-size: 1.05rem; font-weight: 500; margin-bottom: 0.5rem; }

p  { margin-bottom: 1rem; }

code, pre, .mono {
  font-family: var(--by-mono);
  font-size:   0.875em;
}

a {
  color: var(--by-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--by-transition);
}
a:hover { color: var(--by-accent-dark); }

.text-secondary { color: var(--by-text-secondary); }
.text-small     { font-size: 0.875rem; }
.text-mono      { font-family: var(--by-mono); }

/* ============================================================
   LAYOUT
   ============================================================ */
.by-container {
  width:       100%;
  max-width:   1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left:  1.5rem;
  padding-right: 1.5rem;
}

.by-container--narrow {
  max-width: 780px;
}

.by-section {
  padding-top:    5rem;
  padding-bottom: 5rem;
}

.by-section--sm {
  padding-top:    3rem;
  padding-bottom: 3rem;
}

.by-section--dark {
  background: var(--by-navy);
  color:      var(--by-off-white);
}
.by-section--dark h1,
.by-section--dark h2,
.by-section--dark h3,
.by-section--dark h4 {
  color: var(--by-off-white);
}

.by-section--alt {
  background: var(--by-off-white);
}

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

@media (max-width: 768px) {
  .by-grid-2, .by-grid-3, .by-grid-4 { grid-template-columns: 1fr; }
  .by-section { padding-top: 3.5rem; padding-bottom: 3.5rem; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .by-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .by-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.by-btn {
  display:          inline-flex;
  align-items:      center;
  gap:              0.5rem;
  padding:          0.75rem 1.5rem;
  font-family:      var(--by-font);
  font-size:        0.9375rem;
  font-weight:      500;
  line-height:      1;
  border-radius:    var(--by-r-sm);
  border:           1.5px solid transparent;
  cursor:           pointer;
  text-decoration:  none;
  transition:       background var(--by-transition), border-color var(--by-transition), color var(--by-transition);
  white-space:      nowrap;
}

.by-btn--primary {
  background:   var(--by-navy);
  border-color: var(--by-navy);
  color:        var(--by-white);
}
.by-btn--primary:hover {
  background:   var(--by-navy-light);
  border-color: var(--by-navy-light);
  color:        var(--by-white);
}

.by-btn--accent {
  background:   var(--by-accent);
  border-color: var(--by-accent);
  color:        var(--by-white);
}
.by-btn--accent:hover {
  background:   var(--by-accent-dark);
  border-color: var(--by-accent-dark);
  color:        var(--by-white);
}

.by-btn--outline {
  background:   transparent;
  border-color: var(--by-navy);
  color:        var(--by-navy);
}
.by-btn--outline:hover {
  background:   var(--by-navy);
  color:        var(--by-white);
}

.by-btn--outline-light {
  background:   transparent;
  border-color: rgba(255,255,255,0.5);
  color:        var(--by-white);
}
.by-btn--outline-light:hover {
  background:   rgba(255,255,255,0.1);
  border-color: var(--by-white);
}

.by-btn--lg {
  padding:   0.875rem 2rem;
  font-size: 1rem;
}

/* ============================================================
   CARDS
   ============================================================ */
.by-card {
  background:    var(--by-white);
  border:        1px solid var(--by-border);
  border-radius: var(--by-r-md);
  padding:       1.75rem;
}

.by-card--raised {
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.by-card__label {
  font-size:      0.75rem;
  font-weight:    600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color:          var(--by-text-secondary);
  margin-bottom:  0.75rem;
}

.by-card__icon {
  width:         2.5rem;
  height:        2.5rem;
  border-radius: var(--by-r-sm);
  background:    var(--by-off-white);
  display:       flex;
  align-items:   center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

/* ============================================================
   DOMAIN INVENTORY TILES
   ============================================================ */
.by-domain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.by-domain-tile {
  background:    var(--by-navy);
  color:         var(--by-off-white);
  border-radius: var(--by-r-md);
  padding:       1.5rem;
  position:      relative;
  overflow:      hidden;
}

.by-domain-tile__name {
  font-family:   var(--by-mono);
  font-size:     0.875rem;
  font-weight:   500;
  color:         var(--by-off-white);
  margin-bottom: 0.5rem;
  word-break:    break-all;
}

.by-domain-tile__category {
  font-size:   0.75rem;
  color:       rgba(250,250,247,0.6);
  line-height: 1.4;
}

.by-domain-tile__status {
  display:         flex;
  align-items:     center;
  gap:             0.4rem;
  font-size:       0.7rem;
  font-weight:     500;
  letter-spacing:  0.06em;
  text-transform:  uppercase;
  margin-top:      1.25rem;
  color:           rgba(250,250,247,0.5);
}

.by-domain-tile__status-dot {
  width:         6px;
  height:        6px;
  border-radius: 50%;
  background:    var(--by-accent);
  flex-shrink:   0;
}

/* ============================================================
   PROCESS STEPS
   ============================================================ */
.by-steps {
  display:        grid;
  grid-template-columns: repeat(4, 1fr);
  gap:            0;
  position:       relative;
}

.by-steps::before {
  content:    "";
  position:   absolute;
  top:        1.25rem;
  left:       12.5%;
  width:      75%;
  height:     1px;
  background: var(--by-border);
  z-index:    0;
}

.by-step {
  padding:    1.5rem 1rem;
  text-align: center;
  position:   relative;
  z-index:    1;
}

.by-step__num {
  width:            2.5rem;
  height:           2.5rem;
  background:       var(--by-navy);
  color:            var(--by-white);
  border-radius:    50%;
  display:          flex;
  align-items:      center;
  justify-content:  center;
  font-size:        0.875rem;
  font-weight:      600;
  margin:           0 auto 1rem;
}

.by-step__title {
  font-size:   0.9375rem;
  font-weight: 600;
  color:       var(--by-navy);
  margin-bottom: 0.5rem;
}

.by-step__desc {
  font-size: 0.875rem;
  color:     var(--by-text-secondary);
}

@media (max-width: 768px) {
  .by-steps { grid-template-columns: repeat(2, 1fr); }
  .by-steps::before { display: none; }
}
@media (max-width: 480px) {
  .by-steps { grid-template-columns: 1fr; }
}

/* ============================================================
   TRUST SIGNALS BAR
   ============================================================ */
.by-trust-bar {
  display:          flex;
  flex-wrap:        wrap;
  gap:              2rem;
  padding:          2rem 0;
  border-top:       1px solid var(--by-border);
  border-bottom:    1px solid var(--by-border);
}

.by-trust-item {
  display:     flex;
  align-items: center;
  gap:         0.625rem;
  font-size:   0.875rem;
  font-weight: 500;
  color:       var(--by-text-secondary);
}

.by-trust-item svg {
  color:      var(--by-accent);
  flex-shrink: 0;
}

/* ============================================================
   HEADER / NAV (Astra overrides)
   ============================================================ */
.site-header,
#masthead {
  border-bottom: 1px solid var(--by-border);
  background:    var(--by-white) !important;
}

.ast-primary-header-bar {
  padding: 0 1rem;
}

.ast-site-identity .site-title a,
.ast-site-identity .site-title {
  font-family:    var(--by-font);
  font-weight:    700;
  font-size:      1.25rem;
  color:          var(--by-navy) !important;
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space:    nowrap;
}

/* Single-row nav: prevent wrapping */
#ast-hf-menu-1.main-header-menu,
ul.main-header-menu.ast-nav-menu {
  flex-wrap:   nowrap !important;
  align-items: center;
}

.main-header-menu .menu-item > a,
.main-navigation .menu-item > a {
  font-family: var(--by-font);
  font-size:   0.85rem;
  font-weight: 500;
  color:       var(--by-text-primary) !important;
  padding:     0.5rem 0.75rem;
  white-space: nowrap;
  transition:  color var(--by-transition);
}
.main-header-menu .menu-item > a:hover { color: var(--by-teal) !important; }

/* Active / current page */
.main-header-menu .current-menu-item > a,
.main-header-menu .current-menu-parent > a {
  color: var(--by-teal) !important;
}

/* CTA nav button */
.menu-item.by-nav-cta > a,
.menu-item.by-nav-cta > a.menu-link {
  background:    var(--by-teal) !important;
  color:         var(--by-white) !important;
  border-radius: var(--by-r-sm);
  padding:       0.45rem 1.1rem !important;
  font-weight:   600;
  margin-left:   0.5rem;
}
.menu-item.by-nav-cta > a:hover {
  background: #0a5c47 !important;
}

/* Dropdown sub-menus */
.main-header-menu .sub-menu {
  border-top: 2px solid var(--by-teal);
  min-width:  220px;
}
.main-header-menu .sub-menu .menu-item > a {
  font-size: 0.85rem;
  padding:   0.6rem 1.25rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer,
#colophon {
  background:  var(--by-navy);
  color:       rgba(250,250,247,0.7);
  font-size:   0.875rem;
  padding-top: 4rem;
}

.by-footer-grid {
  display:               grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap:                   3rem;
  padding-bottom:        3rem;
  border-bottom:         1px solid rgba(255,255,255,0.1);
}

.by-footer-brand .site-title {
  font-size:   1.1rem;
  font-weight: 700;
  color:       var(--by-white);
  margin-bottom: 0.75rem;
}

.by-footer-col h4 {
  font-size:     0.75rem;
  font-weight:   600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color:         rgba(250,250,247,0.45);
  margin-bottom: 1rem;
}

.by-footer-col ul {
  list-style: none;
  margin:     0;
  padding:    0;
}

.by-footer-col ul li { margin-bottom: 0.5rem; }

.by-footer-col ul li a {
  color:          rgba(250,250,247,0.65);
  text-decoration: none;
  transition:     color var(--by-transition);
}
.by-footer-col ul li a:hover { color: var(--by-white); }

.by-footer-bottom {
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  padding:         1.5rem 0;
  font-size:       0.8125rem;
  color:           rgba(250,250,247,0.4);
}

@media (max-width: 1024px) {
  .by-footer-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .by-footer-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
  .by-footer-bottom { flex-direction: column; gap: 0.75rem; text-align: center; }
}

/* ============================================================
   HERO
   ============================================================ */
.by-hero {
  background:  var(--by-navy);
  padding:     6rem 0 5rem;
  position:    relative;
  overflow:    hidden;
}

.by-hero::before {
  content:  "";
  position: absolute;
  inset:    0;
  background: url("data:image/svg+xml,%3Csvg width=60 height=60 viewBox=0 0 60 60 xmlns=http://www.w3.org/2000/svg%3E%3Cg fill=none fill-rule=evenodd%3E%3Cg fill=%23ffffff fill-opacity=0.025%3E%3Cpath d=M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.by-hero__inner {
  position: relative;
  z-index:  1;
  max-width: 760px;
}

.by-hero__eyebrow {
  font-size:      0.75rem;
  font-weight:    600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:          var(--by-accent);
  margin-bottom:  1.25rem;
  display:        flex;
  align-items:    center;
  gap:            0.5rem;
}

.by-hero h1 {
  color:         var(--by-off-white);
  font-size:     clamp(2.25rem, 5vw, 3.5rem);
  font-weight:   600;
  line-height:   1.1;
  margin-bottom: 1.5rem;
}

.by-hero__sub {
  font-size:     1.125rem;
  color:         rgba(250,250,247,0.75);
  line-height:   1.6;
  margin-bottom: 2.5rem;
  max-width:     580px;
}

.by-hero__ctas {
  display:     flex;
  flex-wrap:   wrap;
  gap:         1rem;
  align-items: center;
}

/* ============================================================
   SECTION LABELS
   ============================================================ */
.by-section-label {
  font-size:      0.75rem;
  font-weight:    600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:          var(--by-accent);
  margin-bottom:  0.75rem;
}

/* ============================================================
   FORMS
   ============================================================ */
.by-form label {
  display:       block;
  font-size:     0.875rem;
  font-weight:   500;
  color:         var(--by-text-primary);
  margin-bottom: 0.375rem;
}

.by-form input[type="text"],
.by-form input[type="email"],
.by-form input[type="tel"],
.by-form select,
.by-form textarea {
  width:         100%;
  padding:       0.625rem 0.875rem;
  font-family:   var(--by-font);
  font-size:     0.9375rem;
  color:         var(--by-text-primary);
  background:    var(--by-white);
  border:        1px solid var(--by-border);
  border-radius: var(--by-r-sm);
  transition:    border-color var(--by-transition), box-shadow var(--by-transition);
  outline:       none;
}

.by-form input:focus,
.by-form select:focus,
.by-form textarea:focus {
  border-color: var(--by-accent);
  box-shadow:   0 0 0 3px rgba(15,110,86,0.12);
}

.by-form .form-row { margin-bottom: 1.25rem; }
.by-form .form-row-2 {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   1rem;
}

@media (max-width: 600px) {
  .by-form .form-row-2 { grid-template-columns: 1fr; }
}

/* ============================================================
   TABLES
   ============================================================ */
.by-table {
  width:           100%;
  border-collapse: collapse;
  font-size:       0.9375rem;
}

.by-table th {
  text-align:   left;
  padding:      0.75rem 1rem;
  font-size:    0.75rem;
  font-weight:  600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color:        var(--by-text-secondary);
  border-bottom: 1px solid var(--by-border);
}

.by-table td {
  padding:      0.875rem 1rem;
  border-bottom: 1px solid var(--by-border);
  vertical-align: top;
}

.by-table tr:nth-child(even) td { background: var(--by-off-white); }

/* ============================================================
   FAQ ACCORDION
   ============================================================ */
.by-faq-list { list-style: none; margin: 0; padding: 0; }

.by-faq-item {
  border-bottom: 1px solid var(--by-border);
}

.by-faq-item:first-child { border-top: 1px solid var(--by-border); }

.by-faq-question {
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  gap:             1rem;
  padding:         1.25rem 0;
  font-size:       1rem;
  font-weight:     500;
  color:           var(--by-navy);
  cursor:          pointer;
  list-style:      none;
  user-select:     none;
}

.by-faq-question::after {
  content:     "+";
  font-size:   1.25rem;
  font-weight: 300;
  color:       var(--by-text-secondary);
  flex-shrink: 0;
  transition:  transform var(--by-transition);
}

.by-faq-item.open .by-faq-question::after {
  content:   "−";
}

.by-faq-answer {
  display:    none;
  padding:    0 0 1.25rem;
  color:      var(--by-text-secondary);
  line-height: 1.65;
  font-size:  0.9375rem;
}

.by-faq-item.open .by-faq-answer { display: block; }

/* ============================================================
   BADGES / TAGS
   ============================================================ */
.by-badge {
  display:          inline-flex;
  align-items:      center;
  padding:          0.25rem 0.625rem;
  font-size:        0.7rem;
  font-weight:      600;
  letter-spacing:   0.06em;
  text-transform:   uppercase;
  border-radius:    var(--by-r-sm);
  background:       var(--by-off-white);
  color:            var(--by-text-secondary);
  border:           1px solid var(--by-border);
}

.by-badge--accent {
  background: rgba(15,110,86,0.08);
  color:      var(--by-accent);
  border-color: rgba(15,110,86,0.2);
}

/* ============================================================
   CALLOUT / NOTICE
   ============================================================ */
.by-notice {
  background:    var(--by-off-white);
  border-left:   3px solid var(--by-accent);
  border-radius: 0 var(--by-r-sm) var(--by-r-sm) 0;
  padding:       1rem 1.25rem;
  font-size:     0.9rem;
  color:         var(--by-text-secondary);
}

.by-notice--draft {
  background:  #fff8e1;
  border-color: #f59e0b;
  color:       #6b5a00;
  font-weight: 500;
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
.skip-link {
  position:   absolute;
  top:        -999px;
  left:       1rem;
  background: var(--by-navy);
  color:      var(--by-white);
  padding:    0.5rem 1rem;
  border-radius: var(--by-r-sm);
  font-size:  0.875rem;
  z-index:    9999;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

*:focus-visible {
  outline:        2px solid var(--by-accent);
  outline-offset: 3px;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.by-divider {
  border: none;
  border-top: 1px solid var(--by-border);
  margin: 3rem 0;
}

.by-text-center { text-align: center; }
.by-mt-sm  { margin-top: 1rem; }
.by-mt-md  { margin-top: 2rem; }
.by-mt-lg  { margin-top: 4rem; }
.by-mb-sm  { margin-bottom: 1rem; }
.by-mb-md  { margin-bottom: 2rem; }
.by-flex   { display: flex; }
.by-gap-1  { gap: 1rem; }
.by-items-center { align-items: center; }

/* Gutenberg / block editor overrides */
.wp-block-group { margin-bottom: 0; }
.entry-content > *:last-child { margin-bottom: 0; }

/* ============================================================
   HERO SPLIT LAYOUT
   ============================================================ */
.by-hero-split {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   3rem;
  align-items:           center;
  min-height:            340px;
}

.by-hero-split__text {
  position: relative;
  z-index:  1;
}

.by-hero-split__visual {
  display:         flex;
  align-items:     center;
  justify-content: flex-end;
  opacity:         0.9;
}

.by-geo-grid {
  width:     100%;
  max-width: 460px;
  height:    auto;
  display:   block;
}

@media (max-width: 900px) {
  .by-hero-split {
    grid-template-columns: 1fr;
  }
  .by-hero-split__visual {
    display: none;
  }
}

/* ============================================================
   PAGE VISUAL HEADER (auto-prepended SVG strip)
   ============================================================ */
.by-page-visual {
  width:         100%;
  background:    var(--by-off-white);
  border-bottom: 1px solid var(--by-border);
  padding:       1.5rem 0 0;
  margin-bottom: 0;
  overflow:      hidden;
}

.by-page-svg {
  display:   block;
  width:     100%;
  max-width: 100%;
  height:    auto;
}

/* ============================================================
   PAGE HERO HEADER (dark bar for non-template pages)
   ============================================================ */
.ast-page-header,
.ast-breadcrumbs-wrapper {
  display: none !important;
}

/* Astra content area padding reset for our custom sections */
.ast-single-post-order .entry-content {
  padding: 0;
}
