/*
  Liberty Systems website styles.
  Colors and fonts follow the old WordPress (Avada) theme: Liberty red #cf202f, navy #2a317e,
  Volkhov headings, Crimson Text body, faded-flag background, translucent colored panels.
  Change a color once here in :root and it changes everywhere.
*/

/* ---- Fonts (hosted on this site; SIL Open Font License) ---- */
@font-face { font-family: "Volkhov"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/volkhov-400.woff2") format("woff2"); }
@font-face { font-family: "Volkhov"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/volkhov-700.woff2") format("woff2"); }
@font-face { font-family: "Crimson Text"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/crimson-text-400.woff2") format("woff2"); }
@font-face { font-family: "Crimson Text"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/crimson-text-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Crimson Text"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/crimson-text-700.woff2") format("woff2"); }

:root {
  --red: #cf202f;
  --navy: #2a317e;
  --text-dark: #333333;
  --menu-text: #494949;
  --header-border: #e5e5e5;
  --footer-bg: #363636;

  /* Panel backgrounds (translucent over the flag background). Red and gray are a little more solid than
     on the old site so white text meets the WCAG 4.5:1 contrast minimum. */
  --panel-navy: rgba(42, 49, 126, 0.80);
  --panel-red: rgba(190, 26, 40, 0.92);
  --panel-gray: rgba(80, 80, 80, 0.85);

  --font-heading: "Volkhov", Georgia, "Times New Roman", serif;
  --font-body: "Crimson Text", Georgia, "Times New Roman", serif;
  --site-width: 1250px;
  --gap: 24px;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  color: var(--text-dark);
  font-family: var(--font-body);
  font-size: 1.1875rem;   /* 19px: Crimson Text runs small */
  line-height: 1.5;
  background: #ffffff url("../images/site/background.jpg") center top / cover fixed no-repeat;
}
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--font-heading); font-weight: 400; line-height: 1.25; margin: 0 0 0.6em; }
p { margin: 0 0 1em; }
a { color: inherit; }
a:focus-visible, button:focus-visible, main:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }
main:focus { outline: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 10; padding: 8px 16px; background: var(--navy); color: #fff; }
.skip-link:focus { top: 8px; }

/* ---- Header ---- */
.site-header { background: #fff; border-bottom: 1px solid var(--header-border); }
.site-header__inner {
  max-width: var(--site-width); margin: 0 auto; padding: 12px 16px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px;
}
.site-logo img { display: block; width: 265px; max-width: 70vw; height: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 28px; align-items: center; }
.site-nav a {
  display: inline-block; padding: 6px 0; text-decoration: none; color: var(--menu-text);
  font-family: var(--font-heading); font-size: 1.1875rem; border-bottom: 3px solid transparent;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--red); border-bottom-color: var(--red); }
.site-nav__facebook { display: inline-flex !important; align-items: center; }
.site-nav__facebook:hover { border-bottom-color: transparent !important; }

/* ---- Main area ---- */
.site-main { flex: 1; width: 100%; max-width: var(--site-width); margin: 0 auto; padding: 32px 16px 48px; }
.page-title { margin: 0 0 var(--gap); text-align: center; }
.page-title img { width: 100%; max-width: 820px; }

.columns { display: grid; gap: var(--gap); margin-bottom: var(--gap); align-items: start; }
@media (min-width: 900px) {
  .columns--1-2 { grid-template-columns: 1fr 2fr; }
  .columns--1-1 { grid-template-columns: 1fr 1fr; }
}

/* Translucent colored boxes with white text. */
.panel { color: #fff; padding: 28px; margin-bottom: var(--gap); border-radius: 2px; }
.columns > .panel { margin-bottom: 0; }
.panel--navy { background: var(--panel-navy); }
.panel--red { background: var(--panel-red); }
.panel--gray { background: var(--panel-gray); }
.panel__title { font-size: 1.75rem; color: #fff; padding-bottom: 0.4em; border-bottom: 1px solid rgba(255, 255, 255, 0.45); }
.panel h3 { font-size: 1.25rem; color: #fff; margin-top: 1em; }
.panel a { color: #fff; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.panel a:hover { text-decoration-thickness: 2px; }
.narrow { max-width: 720px; margin-left: auto; margin-right: auto; }

/* ---- Testimonials (Home) ---- */
.band { margin-bottom: var(--gap); }
.testimonial { margin: 0; }
.testimonial blockquote {
  position: relative; margin: 0 0 18px; padding: 24px 28px;
  background: rgba(255, 255, 255, 0.94); color: var(--text-dark);
  border: 1px solid #e2e2e2; border-radius: 4px; font-size: 1.25rem; font-style: italic;
}
.testimonial blockquote p { margin: 0; }
/* Speech-bubble tail, as on the old site. */
.testimonial blockquote::after {
  content: ""; position: absolute; left: 32px; bottom: -11px; width: 20px; height: 20px;
  background: inherit; border-right: 1px solid #e2e2e2; border-bottom: 1px solid #e2e2e2; transform: rotate(45deg);
}
.testimonial figcaption { padding-left: 24px; color: #1a191c; font-size: 1.125rem; }
.no-js .testimonial + .testimonial { margin-top: var(--gap); }

/* ---- Carousel (testimonials and photo slideshow; behavior in site.js) ---- */
.js .carousel__slide:not(.is-active) { display: none; }
.carousel__controls { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.carousel__controls button {
  min-width: 44px; min-height: 44px; padding: 6px 14px; cursor: pointer;
  font: inherit; font-size: 1rem; color: #fff; background: var(--navy);
  border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 3px;
}
.carousel__controls button:hover { background: var(--red); }
.carousel__status { align-self: center; min-width: 5em; text-align: center; font-size: 1rem; }
.testimonials .carousel__status { color: var(--text-dark); background: rgba(255, 255, 255, 0.85); padding: 2px 8px; border-radius: 3px; }

.gallery { margin-top: 20px; }
.gallery .carousel__slide img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: rgba(0, 0, 0, 0.2); }
.no-js .gallery .carousel__slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.gallery .carousel__controls button { background: rgba(0, 0, 0, 0.35); }
.gallery .carousel__controls button:hover { background: var(--navy); }

/* ---- County grid (Home, Election Results) ---- */
.county-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.county-grid a {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; height: 100%;
  padding: 12px 8px; text-align: center; text-decoration: none;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 3px;
}
.county-grid a:hover { background: rgba(255, 255, 255, 0.2); }
.county-grid img { width: 100px; height: 100px; object-fit: contain; margin-bottom: 8px; }
.county-grid__name { font-family: var(--font-heading); font-size: 1.0625rem; line-height: 1.3; }

/* ---- Products & Services ---- */
.state-maps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.state-maps a { display: block; text-align: center; text-decoration: none; }
.state-maps__map { display: block; width: 100%; max-width: 260px; margin: 0 auto 10px; }
.state-maps__label { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-heading); text-decoration: underline; text-underline-offset: 3px; }

.offering { padding: 20px 0; border-top: 1px solid rgba(255, 255, 255, 0.3); }
.offering:first-of-type { border-top: 0; padding-top: 4px; }
.offering::after { content: ""; display: table; clear: both; }
.offering h3 { margin-top: 0; }
.offering__image { float: right; width: 150px; max-width: 40%; margin: 0 0 10px 16px; background: #fff; padding: 6px; border-radius: 3px; }
.checklist { margin: 0 0 1em; padding-left: 1.4em; }
.checklist li { margin-bottom: 0.35em; }
.checklist li::marker { content: "✓  "; }
.offering__links { display: flex; flex-wrap: wrap; gap: 10px; clear: both; margin: 0; }
.button {
  display: inline-block; padding: 8px 22px; text-decoration: none !important;
  font-family: var(--font-heading); font-size: 1rem; color: #fff;
  background: var(--navy); border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 3px;
}
.panel--navy .button { background: var(--red); }
.button:hover { background: #fff !important; color: var(--text-dark) !important; }

/* ---- Footer ---- */
.site-footer { background: var(--footer-bg); color: #fff; font-size: 1rem; }
.site-footer__inner { max-width: var(--site-width); margin: 0 auto; padding: 20px 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; }
.site-footer p { margin: 0; }
.site-footer a { color: #fff; }
/* Small and muted, on its own line under the contact and copyright lines (like the Portal's). */
.site-footer__version { flex-basis: 100%; color: #c8c8c8; font-size: 0.75rem; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
@media print {
  body { background: #fff; }
  .panel { color: #000; background: none !important; border: 1px solid #999; }
  .panel__title, .panel h3, .panel a { color: #000; }
  .carousel__controls, .site-nav, .skip-link { display: none; }
}
