/* =========================================================
   MOAPA VALLEY TV MAINTENANCE DISTRICT — GLOBAL STYLESHEET
   One shared design system. All pages link to this file.
   Sections: 1 Tokens 2 Base 3 Layout 4 Header 5 Footer
             6 Components 7 Page Helpers 8 Responsive
   ========================================================= */

/* ---------------------------------------------------------
   1. DESIGN TOKENS
   Design direction: "Desert Public Service" — a rural Nevada
   canyon-country palette (rock rust, sage scrub, sandstone,
   desert-dusk indigo, sunset gold) paired with a characterful
   serif for headlines and a clean humanist sans for body copy,
   so the site reads as local and scenic rather than corporate.
--------------------------------------------------------- */
:root {
  /* Color — refreshed to be more vibrant and pulled directly from the
     client's own site photos: the burnt-orange dish/tower sunsets, the
     vivid blue desert sky over the valley, and the olive scrub brush
     on the hillsides, for a more outdoorsy, natural feel. */
  --color-rust: #C1440E;        /* primary — sunset-lit canyon rock */
  --color-rust-dark: #8A2F0A;   /* deeper rust for hover/text-on-light */
  --color-dusk: #163C53;        /* desert-twilight blue — header/footer */
  --color-dusk-light: #21587A;
  --color-sky: #3E8FC4;         /* vivid daytime sky blue — decorative accent only, not for text */
  --color-sage: #5C7A32;        /* desert scrub green — secondary accent */
  --color-sage-dark: #435821;
  --color-gold: #E3A320;        /* sunset gold — highlight accent */
  --color-sand: #F5E7C9;        /* warm sand — light background */
  --color-sand-deep: #EAD5A8;   /* deeper sand for cards/stripes */
  --color-charcoal: #241C15;    /* warm near-black — body text */
  --color-white: #FFFFFF;
  --color-line: rgba(36, 28, 21, 0.16);

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --fs-body: 1.125rem;      /* 18px base — generous for readability */
  --fs-small: 0.95rem;
  --fs-h1: clamp(2.4rem, 5vw + 1rem, 4.2rem);
  --fs-h2: clamp(1.8rem, 3vw + 0.8rem, 2.7rem);
  --fs-h3: clamp(1.3rem, 1.4vw + 0.8rem, 1.7rem);
  --lh-body: 1.65;

  /* Space */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 7rem;

  /* Layout */
  --container-width: 1180px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 10px 30px -12px rgba(43, 36, 31, 0.25);
}

/* ---------------------------------------------------------
   2. BASE STYLES
--------------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-charcoal);
  background: var(--color-sand);
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  margin: 0 0 var(--space-sm);
  font-weight: 600;
  color: var(--color-dusk);
}
h1 { font-size: var(--fs-h1); font-weight: 500; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { margin: 0 0 var(--space-sm); }
p:last-child { margin-bottom: 0; }

a { color: var(--color-rust-dark); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--color-rust); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-sage-dark);
  margin-bottom: var(--space-xs);
}

/* Small logo badge used inline within page content (e.g. next to a
   trust/governance message), rather than as primary site navigation. */
.section-seal {
  height: 96px;
  width: auto;
  display: block;
  margin-bottom: var(--space-sm);
}

/* Visible keyboard focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------------------------------------------------------
   3. LAYOUT
--------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section {
  padding: var(--space-xl) 0;
}
.section--compact { padding: var(--space-lg) 0; }
.section--sand { background: var(--color-sand); }
.section--sand-deep { background: var(--color-sand-deep); }
.section--dusk { background: var(--color-dusk); color: var(--color-white); }
.section--dusk h2, .section--dusk h3 { color: var(--color-white); }
.section--rust { background: var(--color-rust); color: var(--color-white); }
.section--rust h2, .section--rust h3 { color: var(--color-white); }

.grid { display: grid; gap: var(--space-md); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* Named two-column layouts (narrow label/wide content, and the contact
   page's info/form split) — used instead of inline grid-template-columns
   so they pick up the same responsive collapse as the other grids. */
.grid--faq { grid-template-columns: 1fr 1.6fr; gap: var(--space-lg); }
.grid--contact { grid-template-columns: 1fr 1.3fr; gap: var(--space-lg); align-items: flex-start; }

.text-center { text-align: center; }
.max-prose { max-width: 62ch; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Mesa-skyline divider — the site's signature motif, echoing the
   valley's own butte silhouettes at section transitions. */
.mesa-divider {
  width: 100%;
  height: 46px;
  -webkit-mask-image: url("../img/mesa-divider.svg");
  mask-image: url("../img/mesa-divider.svg");
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
  -webkit-mask-size: 200px 46px;
  mask-size: 200px 46px;
  -webkit-mask-position: bottom;
  mask-position: bottom;
}
.mesa-divider--flip { transform: scaleY(-1); }
.mesa-divider--sand { background-color: var(--color-sand); }
.mesa-divider--sand-deep { background-color: var(--color-sand-deep); }
.mesa-divider--dusk { background-color: var(--color-dusk); }
.mesa-divider--rust { background-color: var(--color-rust); }

/* ---------------------------------------------------------
   4. HEADER
--------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 233, 214, 0.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--color-line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--color-dusk);
  flex-shrink: 0; /* never let flex layout compress/distort the logo */
}
.site-brand img { height: 68px; width: auto; display: block; }

.site-nav__list {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
}
.site-nav__link {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--color-charcoal);
  text-decoration: none;
  padding: 0.4rem 0.1rem;
  border-bottom: 2px solid transparent;
}
.site-nav__link:hover,
.site-nav__link[aria-current="page"] {
  color: var(--color-rust-dark);
  border-bottom-color: var(--color-rust);
}

.site-header__actions { display: flex; align-items: center; gap: 1rem; }
.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--color-dusk);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
}
.nav-toggle span, .nav-toggle::before, .nav-toggle::after {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-dusk);
  margin: 4px 0;
}

/* ---------------------------------------------------------
   5. FOOTER
--------------------------------------------------------- */
.site-footer {
  background: var(--color-dusk);
  color: rgba(255,255,255,0.88);
  padding: var(--space-lg) 0 var(--space-md);
}
.site-footer a { color: var(--color-white); }
.site-footer a:hover { color: var(--color-gold); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid rgba(255,255,255,0.16);
}
.footer-brand { display: flex; align-items: center; margin-bottom: var(--space-sm); }
.footer-brand img {
  height: 150px;
  width: auto;
  display: block;
}
.footer-col h4 {
  color: var(--color-gold);
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.55rem; }
.footer-col a { text-decoration: none; }
.footer-col a:hover { text-decoration: underline; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-sm);
  font-size: var(--fs-small);
  color: rgba(255,255,255,0.65);
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ---------------------------------------------------------
   6. COMPONENTS
--------------------------------------------------------- */

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.button--primary { background: var(--color-rust); color: var(--color-white); }
.button--primary:hover { background: var(--color-rust-dark); color: var(--color-white); transform: translateY(-1px); }
.button--secondary { background: transparent; border-color: currentColor; color: inherit; }
.button--secondary:hover { background: rgba(255,255,255,0.14); transform: translateY(-1px); }
.button--gold { background: var(--color-gold); color: var(--color-dusk); }
.button--gold:hover { background: #e0b358; transform: translateY(-1px); }
.button--large { padding: 1.1rem 2.1rem; font-size: 1.1rem; }
.button-row { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Cards */
.card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: var(--space-md);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-line);
}
.card__icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-sand-deep);
  color: var(--color-rust-dark);
  border-radius: 50%;
  margin-bottom: var(--space-sm);
  font-size: 1.5rem;
}
.card__title { font-size: 1.2rem; margin-bottom: 0.4rem; }
.card__text { color: var(--color-charcoal); opacity: 0.85; margin-bottom: var(--space-sm); }
.card__link { font-weight: 700; font-size: 0.95rem; }

/* Quick-answer action tiles (homepage) */
.action-tile {
  display: block;
  background: var(--color-white);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-sm);
  text-align: center;
  text-decoration: none;
  color: var(--color-charcoal);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-line);
  border-top: 4px solid var(--color-rust);
  transition: transform 0.15s ease;
}
.action-tile:hover { transform: translateY(-4px); color: var(--color-charcoal); }
.action-tile__icon { font-size: 2rem; margin-bottom: 0.6rem; }
.action-tile__title { font-family: var(--font-display); font-size: 1.2rem; color: var(--color-dusk); margin-bottom: 0.3rem; }
.action-tile__text { font-size: 0.95rem; opacity: 0.8; }

/* Hero */
.hero {
  position: relative;
  min-height: 86vh;
  display: flex;
  align-items: flex-end;
  color: var(--color-white);
  background-size: cover;
  background-position: center 42%;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(35,56,74,0.32) 0%, rgba(25,19,14,0.5) 45%, rgba(16,12,9,0.9) 100%);
  z-index: -1;
}
.hero__content { padding: var(--space-xl) 0 var(--space-lg); max-width: 760px; }
.hero__content h1 { color: var(--color-white); text-shadow: 0 2px 12px rgba(0,0,0,0.35); }
.hero__lede { font-size: 1.25rem; max-width: 46ch; margin-bottom: var(--space-md); opacity: 0.95; text-shadow: 0 1px 8px rgba(0,0,0,0.3); }

/* Full-bleed photo bands used to disperse imagery through the page */
.photo-band {
  position: relative;
  min-height: 340px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  isolation: isolate;
}
.photo-band::before {
  content: "";
  position: absolute; inset: 0;
  background: rgba(35, 56, 74, 0.55);
  z-index: -1;
}
.photo-band--rust::before { background: rgba(46, 20, 10, 0.8); }
.photo-band__content { color: var(--color-white); max-width: 640px; }
.photo-band blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.2vw + 0.8rem, 2.1rem);
  font-style: italic;
  margin: 0 0 var(--space-sm);
  line-height: 1.35;
}
.photo-band cite { font-style: normal; font-weight: 700; font-size: 0.95rem; opacity: 0.85; }

/* Split image/content section */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); align-items: center; }
.split__media img { border-radius: var(--radius); box-shadow: var(--shadow-card); width: 100%; height: 100%; object-fit: cover; }
.split__media { aspect-ratio: 4/3; overflow: hidden; border-radius: var(--radius); }
.split--reverse .split__media { order: 2; }

/* FAQ accordion */
.faq-item {
  border-bottom: 1px solid var(--color-line);
}
.faq-item summary {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--color-dusk);
  padding: var(--space-sm) 0;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--color-rust);
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { padding-bottom: var(--space-sm); max-width: 68ch; opacity: 0.88; }

/* Alerts / notices */
.notice {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  background: var(--color-white);
  border-left: 5px solid var(--color-gold);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  box-shadow: var(--shadow-card);
}
.notice--outage { border-left-color: var(--color-rust); }
.notice__date { font-size: 0.85rem; font-weight: 700; color: var(--color-sage-dark); letter-spacing: 0.05em; text-transform: uppercase; }

/* Stat strip — wrapped in its own translucent panel so text stays
   readable regardless of how bright the background photo is. */
.stat {
  text-align: center;
  background: rgba(20, 12, 8, 0.55);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius);
  padding: 1.6rem 1.25rem;
}
.stat__num {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 2.8rem);
  color: #FFFFFF;
  text-shadow: 0 2px 10px rgba(0,0,0,0.55);
}
.stat__label {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.95);
  text-shadow: 0 1px 6px rgba(0,0,0,0.55);
}

/* Bar chart (homepage "Why residents call us") */
.bar-chart { display: flex; flex-direction: column; gap: 1.15rem; max-width: 760px; margin: 0 auto; }
.bar-chart__row {
  display: grid;
  grid-template-columns: 230px 1fr 56px;
  align-items: center;
  gap: 1rem;
}
.bar-chart__label { font-weight: 700; color: var(--color-dusk); font-size: 0.98rem; }
.bar-chart__track {
  background: var(--color-sand-deep);
  border: 1px solid var(--color-line);
  border-radius: 999px;
  height: 22px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(43,36,31,0.18);
}
.bar-chart__fill { height: 100%; border-radius: 999px 0 0 999px; }
.bar-chart__value { font-family: var(--font-display); font-weight: 600; color: var(--color-dusk); text-align: right; }
.bar-chart__note { font-size: 0.85rem; opacity: 0.7; margin-top: var(--space-sm); }

/* Simple table (channel lineup) */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow-card); }
table.data-table { width: 100%; border-collapse: collapse; background: var(--color-white); }
.data-table th, .data-table td { text-align: left; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--color-line); }
.data-table th { background: var(--color-dusk); color: var(--color-white); font-family: var(--font-display); font-weight: 500; }
.data-table tr:last-child td { border-bottom: none; }

/* Forms */
.form-field { margin-bottom: var(--space-sm); }
.form-field label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%;
  font: inherit;
  padding: 0.75rem 0.9rem;
  border: 2px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-charcoal);
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--color-rust); outline: none; }

/* Step list (rescan instructions) */
.step-list { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step-list li {
  counter-increment: step;
  position: relative;
  padding: 0 0 var(--space-md) 3.4rem;
  margin-bottom: var(--space-sm);
}
.step-list li::before {
  content: counter(step);
  position: absolute; left: 0; top: -0.1rem;
  width: 2.5rem; height: 2.5rem;
  background: var(--color-rust);
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: 1.2rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.step-list li:not(:last-child)::after {
  content: "";
  position: absolute; left: 1.25rem; top: 2.5rem; bottom: 0;
  width: 2px; background: var(--color-line);
}

/* Skip link */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--color-gold); color: var(--color-dusk);
  padding: 0.75rem 1.25rem; z-index: 100; font-weight: 700;
}
.skip-link:focus { left: var(--space-sm); top: var(--space-sm); }

/* ---------------------------------------------------------
   7. PAGE HELPERS
--------------------------------------------------------- */
.page-hero {
  background: var(--color-dusk);
  color: var(--color-white);
  padding: var(--space-lg) 0 var(--space-md);
  position: relative;
  background-size: cover;
  background-position: center;
}
.page-hero::before { content:""; position:absolute; inset:0; background: rgba(23,34,44,0.72); }
.page-hero .container { position: relative; }
.page-hero h1 { color: var(--color-white); margin-bottom: 0.5rem; }
.breadcrumb { font-size: 0.9rem; opacity: 0.85; margin-bottom: var(--space-sm); }
.breadcrumb a { color: var(--color-gold); }

/* ---------------------------------------------------------
   8. RESPONSIVE
--------------------------------------------------------- */

/* Nav collapses to the hamburger menu earlier than the general content
   breakpoints below — the full-size horizontal logo plus five nav links
   plus the Contact button need more room than a typical two-column
   layout, so this gets its own threshold to avoid squeezing the logo. */
@media (max-width: 1100px) {
  .site-nav, .site-header__actions .button { display: none; }
  .nav-toggle { display: block; }
  .site-header.is-open .site-nav {
    display: block;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--color-sand); border-bottom: 1px solid var(--color-line);
    padding: var(--space-sm) var(--space-md);
  }
  .site-header.is-open .site-nav__list { flex-direction: column; gap: 0.25rem; }
}

@media (max-width: 900px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .split, .split--reverse { grid-template-columns: 1fr; }
  .split--reverse .split__media { order: 0; }
}

@media (max-width: 700px) {
  .footer-brand img { height: 110px; }
  .grid--2, .grid--3, .grid--4, .grid--faq, .grid--contact { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .hero { min-height: 92vh; }
  .hero__content { padding-top: var(--space-lg); }
  .bar-chart__row { grid-template-columns: 1fr; gap: 0.4rem; }
  .bar-chart__value { text-align: left; }
}

/* Below this width, the full-size horizontal logo (with nav already
   hidden behind the hamburger) starts crowding the menu button. */
@media (max-width: 480px) {
  .site-brand img { height: 52px; }
}
