/*
Theme Name: WhereToVoteIdaho
Theme URI: https://wheretovoteidaho.org
Author: Idaho News Network
Author URI: https://idahonewsnetwork.com
Description: Nonpartisan voter resource and polling place lookup for Idaho. Part of the Idaho News Network.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wtvi
*/

:root {
  --navy: #1a3a5c;
  --navy-light: #2a4a6c;
  --red: #b91c1c;
  --cream: #FAFAF8;
  --white: #fff;
  --border: #e5e5e0;
  --text: #1a1a1a;
  --text-mid: #666;
  --text-light: #999;
  --text-faint: #bbb;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
  --max-w: 900px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--cream); color: var(--text); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--red); }
::selection { background: var(--navy); color: #fff; }
img { max-width: 100%; height: auto; }
input, select, button, textarea { font-family: inherit; }
input:focus, select:focus { outline: none; border-color: var(--navy) !important; box-shadow: 0 0 0 3px rgba(26,58,92,0.1); }

/* Disclaimer */
.wtvi-disclaimer { background: #fefce8; border-bottom: 1px solid #fde68a; padding: 7px 24px; font-size: 12px; color: #854d0e; text-align: center; line-height: 1.4; }
.wtvi-disclaimer a { color: #92400e; font-weight: 700; text-decoration: underline; }

/* Flag */
.wtvi-flag { height: 3px; background: linear-gradient(90deg, var(--red) 33%, #fff 33%, #fff 66%, var(--navy) 66%); }

/* Header */
.wtvi-header { background: var(--white); border-bottom: 1px solid var(--border); padding: 16px 24px; }
.wtvi-header-inner { max-width: var(--max-w); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.wtvi-logo { font-family: var(--font-display); font-size: 24px; font-weight: 800; color: var(--text); text-decoration: none; }
.wtvi-logo:hover { color: var(--text); }
.wtvi-logo-sub { font-size: 12px; color: var(--text-light); margin-top: 1px; font-family: var(--font-body); font-weight: 400; }
.wtvi-nav { display: flex; gap: 8px; align-items: center; }
.wtvi-nav a { font-size: 12px; color: var(--text-mid); padding: 6px 12px; }
.wtvi-nav-btn { border: 1px solid var(--border) !important; border-radius: 6px; color: #888 !important; }

/* Main */
.wtvi-main { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* Hero */
.wtvi-hero { text-align: center; padding: 40px 0 28px; }
.wtvi-badge { display: inline-block; background: var(--navy); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; padding: 4px 14px; border-radius: 4px; margin-bottom: 14px; }
.wtvi-hero h2 { font-family: var(--font-display); font-size: 38px; font-weight: 800; color: var(--text); line-height: 1.15; letter-spacing: -1px; max-width: 560px; margin: 0 auto 10px; }
.wtvi-hero p { font-size: 16px; color: var(--text-mid); max-width: 480px; margin: 0 auto; }

/* Election cards */
.wtvi-elections { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 28px; }
.wtvi-el-card { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; }
.wtvi-el-type { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 3px; }
.wtvi-el-type.primary { color: var(--red); }
.wtvi-el-type.general { color: var(--navy); }
.wtvi-el-date { font-size: 14px; font-weight: 600; }
.wtvi-el-reg { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.wtvi-countdown { text-align: center; }
.wtvi-countdown .num { font-size: 26px; font-weight: 800; color: var(--navy); font-family: var(--font-display); }
.wtvi-countdown .lbl { font-size: 9px; font-weight: 700; color: var(--text-light); text-transform: uppercase; }

/* Form */
.wtvi-form-card { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 28px 32px; margin-bottom: 36px; }
.wtvi-form-card h3 { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.wtvi-form-sub { font-size: 13px; color: #888; margin-bottom: 20px; }
.wtvi-grid { display: grid; gap: 12px; margin-bottom: 12px; }
.wtvi-grid.c2 { grid-template-columns: 1fr 1fr; }
.wtvi-grid.c21 { grid-template-columns: 2fr 1fr; }
.wtvi-field label { display: block; font-size: 12px; font-weight: 600; color: #555; margin-bottom: 4px; letter-spacing: 0.3px; }
.wtvi-field input, .wtvi-field select { width: 100%; padding: 10px 14px; font-size: 14px; border: 1px solid #ddd; border-radius: 8px; background: var(--cream); color: var(--text); transition: all 0.15s; }
.wtvi-field select { color: #aaa; }
.wtvi-field select.has-val { color: var(--text); }
.wtvi-field .err { font-size: 11px; color: #ef4444; margin-top: 3px; display: none; }
.wtvi-field input.invalid, .wtvi-field select.invalid { border-color: #ef4444; }
.wtvi-field input.invalid + .err, .wtvi-field select.invalid + .err { display: block; }

/* Consent checkboxes */
.wtvi-consent { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; cursor: pointer; }
.wtvi-consent input[type="checkbox"] { margin-top: 3px; accent-color: var(--navy); flex-shrink: 0; width: 16px; height: 16px; }
.wtvi-consent span { font-size: 13px; color: var(--text-mid); line-height: 1.5; }
.wtvi-consent a { color: var(--navy); font-weight: 600; text-decoration: underline; }
.wtvi-consent-error { font-size: 11px; color: #ef4444; margin: -6px 0 10px 26px; display: none; }

.wtvi-submit { width: 100%; padding: 13px; background: var(--navy); color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; transition: background 0.15s; }
.wtvi-submit:hover { background: var(--navy-light); }
.wtvi-submit:disabled { background: #94a3b8; cursor: default; }
.wtvi-fine { font-size: 10px; color: #ccc; text-align: center; margin-top: 10px; line-height: 1.5; }
.wtvi-fine a { color: #aaa; }

/* Results */
.wtvi-results { margin-bottom: 36px; display: none; }
.wtvi-success { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 18px 22px; margin-bottom: 16px; display: flex; align-items: center; gap: 12px; }
.wtvi-success .chk { font-size: 24px; color: #16a34a; }
.wtvi-success h4 { font-size: 15px; font-weight: 700; color: #166534; }
.wtvi-success p { font-size: 12px; color: #4abe80; }
.wtvi-warn { background: #fef3c7; border: 1px solid #fde68a; border-radius: 8px; padding: 10px 16px; margin-bottom: 16px; }
.wtvi-warn p { font-size: 12px; color: #92400e; line-height: 1.5; }
.wtvi-warn a { color: #92400e; font-weight: 700; }
.wtvi-card { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 24px 28px; margin-bottom: 16px; }
.wtvi-card.live { border: 2px solid #16a34a; }
.wtvi-card h4 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.wtvi-card p { font-size: 14px; color: var(--text-mid); line-height: 1.6; }
.wtvi-card-lbl { font-size: 12px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.wtvi-live-badge { display: inline-block; background: #dcfce7; color: #166534; font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 4px; text-transform: uppercase; }
.wtvi-btn { display: inline-block; padding: 11px 24px; border-radius: 8px; font-size: 14px; font-weight: 700; text-decoration: none; }
.wtvi-btn.primary { background: var(--navy); color: #fff; }
.wtvi-btn.secondary { background: #f5f5f0; color: var(--navy); border: 1px solid #ddd; }
.wtvi-btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.wtvi-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.wtvi-county-cta { background: linear-gradient(135deg, var(--navy), var(--navy-light)); border-radius: 14px; padding: 22px 28px; margin-bottom: 16px; color: #fff; }
.wtvi-county-cta h4 { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.wtvi-county-cta p { font-size: 14px; color: rgba(255,255,255,0.8); margin-bottom: 12px; }
.wtvi-county-cta a { display: inline-block; padding: 9px 18px; background: rgba(255,255,255,0.15); color: #fff; border-radius: 6px; font-size: 13px; font-weight: 600; border: 1px solid rgba(255,255,255,0.2); }
.wtvi-back { display: block; margin: 16px auto 0; padding: 9px 20px; background: transparent; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; color: #888; cursor: pointer; font-family: inherit; }

/* FAQ */
.wtvi-faq { margin-bottom: 48px; }
.wtvi-faq > h3 { font-family: var(--font-display); font-size: 26px; font-weight: 800; margin-bottom: 4px; padding-top: 24px; }
.wtvi-faq > p { font-size: 14px; color: #888; margin-bottom: 24px; }
.wtvi-faq-cat { font-size: 11px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 1.5px; border-top: 2px solid var(--text); padding-top: 10px; margin: 24px 0 10px; }
.wtvi-faq-item { border-bottom: 1px solid #eee; }
.wtvi-faq-item summary { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; cursor: pointer; list-style: none; }
.wtvi-faq-item summary::-webkit-details-marker { display: none; }
.wtvi-faq-item summary .q { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.3; padding-right: 20px; }
.wtvi-faq-item summary .t { font-size: 18px; color: var(--text-light); font-weight: 300; flex-shrink: 0; }
.wtvi-faq-item[open] summary .q { color: var(--red); }
.wtvi-faq-answer { font-size: 14px; color: var(--text-mid); line-height: 1.65; padding: 0 0 16px; }
.wtvi-faq-res { background: #f5f5f0; border: 1px solid var(--border); border-radius: 8px; padding: 14px 18px; margin-top: 16px; }
.wtvi-faq-res p { font-size: 12px; color: #888; line-height: 1.5; }
.wtvi-faq-res a { color: #666; font-weight: 600; }

/* Network */
.wtvi-network { margin-bottom: 48px; }
.wtvi-network h4 { font-size: 11px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 1.5px; border-top: 2px solid var(--text); padding-top: 10px; margin-bottom: 14px; }
.wtvi-net-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 8px; }
.wtvi-net-card { display: block; padding: 10px 12px; background: var(--white); border: 1px solid var(--border); border-radius: 8px; transition: border-color 0.15s; }
.wtvi-net-card:hover { border-color: var(--navy); }
.wtvi-net-card .nm { font-size: 13px; font-weight: 600; color: var(--text); }
.wtvi-net-card .dm { font-size: 10px; color: var(--text-light); }

/* Footer */
.wtvi-footer { border-top: 1px solid var(--border); padding: 20px 24px; background: var(--white); }
.wtvi-footer-inner { max-width: var(--max-w); margin: 0 auto; }
.wtvi-footer-copy { font-size: 11px; color: var(--text-faint); }
.wtvi-footer-copy a { color: var(--text-light); }
.wtvi-footer-legal { font-size: 10px; color: #ddd; margin-top: 4px; line-height: 1.5; }
.wtvi-footer-legal a { color: var(--text-faint); }
.wtvi-footer-links { display: flex; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
.wtvi-footer-links a { font-size: 11px; color: var(--text-light); }

/* Legal pages */
.wtvi-legal { max-width: 700px; margin: 0 auto; padding: 40px 24px 60px; }
.wtvi-legal h1 { font-family: var(--font-display); font-size: 32px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 6px; }
.wtvi-legal .updated { font-size: 13px; color: var(--text-light); margin-bottom: 32px; }
.wtvi-legal h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-light); border-top: 2px solid var(--text); padding-top: 12px; margin-top: 32px; margin-bottom: 12px; }
.wtvi-legal p { font-size: 15px; color: var(--text-mid); line-height: 1.7; margin-bottom: 12px; }
.wtvi-legal ul { padding-left: 24px; margin-bottom: 12px; }
.wtvi-legal li { font-size: 15px; color: var(--text-mid); line-height: 1.7; margin-bottom: 6px; }
.wtvi-legal a { color: var(--navy); text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
  .wtvi-hero h2 { font-size: 28px; }
  .wtvi-elections { grid-template-columns: 1fr; }
  .wtvi-form-card { padding: 20px 18px; }
  .wtvi-grid.c2, .wtvi-grid.c21 { grid-template-columns: 1fr; }
  .wtvi-2col { grid-template-columns: 1fr; }
  .wtvi-nav a:not(.wtvi-nav-btn) { display: none; }
  .wtvi-legal { padding: 24px 16px 40px; }
  .wtvi-legal h1 { font-size: 26px; }
}
