/* ==========================================================================
   Cedar Hollow Township — cedarhollow.town
   Classic municipal theme: navy & gold, serif headings
   ========================================================================== */

:root {
  --navy: #1b2f4b;
  --navy-dark: #12213a;
  --navy-light: #2c4568;
  --gold: #c9a227;
  --gold-light: #e6c95c;
  --cream: #f7f4ec;
  --white: #ffffff;
  --ink: #24272b;
  --gray: #5f6670;
  --gray-light: #e3e1da;
  --alert-red: #9b2226;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", Tahoma, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
}

h1, h2, h3, h4 { font-family: var(--serif); color: var(--navy); line-height: 1.25; }

a { color: var(--navy-light); }
a:hover { color: var(--gold); }

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

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

/* --------------------------------------------------------------------------
   Alert banner
   -------------------------------------------------------------------------- */
.alert-bar {
  background: var(--alert-red);
  color: #fff;
  font-size: 0.95rem;
  padding: 0.5rem 0;
}
.alert-bar .container { display: flex; gap: 0.75rem; align-items: center; }
.alert-bar strong { text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.alert-bar a { color: var(--gold-light); }

/* --------------------------------------------------------------------------
   Header & navigation
   -------------------------------------------------------------------------- */
.site-header {
  background: var(--navy);
  color: var(--white);
  border-bottom: 4px solid var(--gold);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}
.seal-placeholder {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 50%;
  background: var(--navy-light);
  border: 2px solid var(--gold);
  color: var(--gold-light);
  font-size: 0.55rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
}
.seal-img {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
  background: var(--navy-light);
}
.site-title h1 { color: var(--white); font-size: 1.6rem; }
.site-title p { color: var(--gold-light); font-size: 0.85rem; font-style: italic; }

.main-nav { background: var(--navy-dark); }
.nav-toggle { display: none; }
.nav-toggle-label {
  display: none;
  color: var(--white);
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}
.nav-toggle-label::before { content: "☰  "; color: var(--gold); }

.nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 0.5rem;
}
.nav-list a {
  display: block;
  padding: 0.75rem 0.9rem;
  color: var(--white);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.nav-list a:hover, .nav-list a.active {
  background: var(--gold);
  color: var(--navy-dark);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  background:
    linear-gradient(rgba(27, 47, 75, 0.72), rgba(27, 47, 75, 0.72)),
    url("../__images/hero.jpg") center / cover no-repeat,
    var(--navy-light);
  color: var(--white);
  text-align: center;
  padding: 4.5rem 1.25rem;
}
.hero h2 { color: var(--white); font-size: 2.4rem; margin-bottom: 0.5rem; }
.hero p { font-size: 1.15rem; color: var(--gold-light); max-width: 640px; margin: 0 auto 1.5rem; }
.hero .btn { margin: 0 0.4rem; }

/* Page banner (interior pages) */
.page-banner {
  background: var(--navy-light);
  color: var(--white);
  padding: 2.25rem 0;
  border-bottom: 4px solid var(--gold);
}
.page-banner h2 { color: var(--white); font-size: 2rem; }
.page-banner p { color: var(--gold-light); font-style: italic; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  background: var(--gold);
  color: var(--navy-dark);
  font-family: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  padding: 0.65rem 1.4rem;
  border: none;
  border-radius: 3px;
  font-size: 1rem;
  cursor: pointer;
  vertical-align: middle;
  box-sizing: border-box;
}
.btn:hover { background: var(--gold-light); color: var(--navy-dark); }
.btn.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--gold);
}
.btn.btn-outline:hover { background: var(--gold); color: var(--navy-dark); }

/* --------------------------------------------------------------------------
   Layout sections
   -------------------------------------------------------------------------- */
.section { padding: 2.75rem 0; }
.section-alt { background: var(--white); }
.section h3 {
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--gold);
  display: inline-block;
}

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

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-top: 4px solid var(--navy);
  padding: 1.25rem;
  border-radius: 3px;
}
.section-alt .card { background: var(--cream); }
.card h4 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.card p { font-size: 0.93rem; color: var(--gray); margin-bottom: 0.6rem; }
.card .card-link { font-weight: 700; font-size: 0.9rem; text-decoration: none; }

/* Quick links strip */
.quick-links {
  background: var(--navy);
  padding: 1.5rem 0;
}
.quick-links .grid-4 a {
  display: block;
  text-align: center;
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  padding: 0.9rem 0.5rem;
  border: 1px solid var(--navy-light);
  border-radius: 3px;
  font-size: 0.92rem;
}
.quick-links .grid-4 a:hover { background: var(--gold); color: var(--navy-dark); }

/* --------------------------------------------------------------------------
   Image placeholders
   -------------------------------------------------------------------------- */
.img-placeholder {
  background: repeating-linear-gradient(
    45deg, #d8d4c8, #d8d4c8 12px, #cfcabc 12px, #cfcabc 24px
  );
  border: 2px dashed var(--gray);
  color: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  font-size: 0.85rem;
  min-height: 220px;
  border-radius: 3px;
}
.img-placeholder .img-id {
  font-weight: 800;
  font-family: var(--serif);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}
.img-placeholder.tall { min-height: 320px; }
.img-placeholder.wide { min-height: 260px; }
.img-placeholder.thumb { min-height: 150px; }

/* Real site images (replace placeholders) */
.site-img {
  width: 100%;
  border-radius: 3px;
  border: 1px solid var(--gray-light);
  object-fit: cover;
}
.site-img.thumb { height: 160px; margin-bottom: 0.6rem; }
.site-img.wide { min-height: 260px; height: 100%; }
.site-img.tall { min-height: 320px; height: 100%; }
.staff-card .site-img {
  flex: 0 0 90px;
  width: 90px;
  height: 110px;
}

/* --------------------------------------------------------------------------
   News & events
   -------------------------------------------------------------------------- */
.news-item {
  border-bottom: 1px solid var(--gray-light);
  padding: 1rem 0;
}
.news-item:last-child { border-bottom: none; }
.news-item .news-date {
  font-size: 0.8rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.news-item h4 { margin: 0.15rem 0 0.35rem; }
.news-item p { font-size: 0.93rem; color: var(--gray); }

.event-row {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-left: 5px solid var(--gold);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border-radius: 3px;
}
.event-date-block {
  flex: 0 0 70px;
  background: var(--navy);
  color: var(--white);
  text-align: center;
  border-radius: 3px;
  padding: 0.5rem 0.25rem;
}
.event-date-block .month {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-light);
}
.event-date-block .day { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.event-details h4 { margin-bottom: 0.2rem; }
.event-details .event-meta { font-size: 0.85rem; color: var(--gray); margin-bottom: 0.35rem; }
.event-details p { font-size: 0.93rem; }

/* --------------------------------------------------------------------------
   Tables (hours, fees, contacts)
   -------------------------------------------------------------------------- */
.info-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: 0.93rem;
  margin: 1rem 0 1.5rem;
}
.info-table th {
  background: var(--navy);
  color: var(--white);
  text-align: left;
  padding: 0.6rem 0.9rem;
  font-weight: 600;
}
.info-table td {
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--gray-light);
}
.info-table tr:nth-child(even) td { background: var(--cream); }

/* Notice / callout boxes */
.callout {
  background: var(--white);
  border-left: 5px solid var(--gold);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.callout.emergency {
  border-left-color: var(--alert-red);
  background: #fdf1f1;
}
.callout h4 { margin-bottom: 0.3rem; }

/* Staff / contact blocks */
.staff-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--gray-light);
  padding: 1rem;
  border-radius: 3px;
}
.staff-card .img-placeholder {
  flex: 0 0 90px;
  min-height: 110px;
  font-size: 0.6rem;
  padding: 0.4rem;
}
.staff-card h4 { font-size: 1.05rem; }
.staff-card .title { color: var(--gold); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.staff-card p { font-size: 0.88rem; color: var(--gray); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-field { display: flex; flex-direction: column; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.3rem; color: var(--navy); }
.form-field input,
.form-field select,
.form-field textarea {
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--gray);
  border-radius: 3px;
  font-family: var(--sans);
  font-size: 0.95rem;
  background: var(--white);
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: 2px solid var(--gold);
  border-color: var(--gold);
}
.form-note { font-size: 0.82rem; color: var(--gray); margin-top: 0.75rem; }
.reg-invalid { color: var(--alert-red); font-weight: 700; font-size: 0.85rem; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--navy-dark);
  color: #c9d2e0;
  padding: 2.5rem 0 1rem;
  margin-top: 2rem;
  border-top: 4px solid var(--gold);
  font-size: 0.9rem;
}
.site-footer h4 { color: var(--gold-light); margin-bottom: 0.6rem; font-size: 1.05rem; }
.site-footer a { color: #c9d2e0; text-decoration: none; }
.site-footer a:hover { color: var(--gold-light); }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 0.35rem; }
.footer-bottom {
  text-align: center;
  border-top: 1px solid var(--navy-light);
  margin-top: 2rem;
  padding-top: 1rem;
  font-size: 0.8rem;
  color: #8a97ab;
}

/* --------------------------------------------------------------------------
   Local business directory & advertisements
   -------------------------------------------------------------------------- */
.ad-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-top: 4px solid var(--gold);
  border-radius: 3px;
  padding: 1.25rem 1.25rem 1.1rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.section-alt .ad-card { background: var(--cream); }
.ad-monogram {
  flex: 0 0 60px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold-light);
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-body h4 { font-size: 1.15rem; margin-bottom: 0.1rem; }
.ad-body .ad-tagline { font-style: italic; color: var(--gray); font-size: 0.9rem; margin-bottom: 0.4rem; }
.ad-body .ad-offer {
  display: inline-block;
  background: #fdf6e3;
  border: 1px dashed var(--gold);
  color: var(--navy-dark);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  margin: 0.2rem 0 0.4rem;
}
.ad-body p { font-size: 0.9rem; color: var(--gray); }
.sponsored-tag {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray);
  background: var(--gray-light);
  padding: 0.1rem 0.45rem;
  border-radius: 2px;
}
.listing {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--gray-light);
}
.listing:last-child { border-bottom: none; }
.listing h4 { font-size: 1rem; margin-bottom: 0.1rem; }
.listing .listing-meta { font-size: 0.85rem; color: var(--gray); }
.card h4.cat-heading {
  border-bottom: 2px solid var(--gold);
  padding-bottom: 0.4rem;
  margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   Vehicle confirmation card (parking payment flow)
   -------------------------------------------------------------------------- */
.confirm-card {
  max-width: 560px;
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-top: 4px solid var(--gold);
  border-radius: 4px;
  padding: 1.5rem 1.5rem 1.6rem;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.07);
}
.confirm-card h3 {
  margin: 0.5rem 0 0.4rem;
  border: none;
  padding: 0;
  display: block;
}
.confirm-card > p { color: var(--gray); font-size: 0.95rem; margin-bottom: 0.25rem; }
.confirm-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy-dark);
  background: var(--gold-light);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
}
.confirm-table { margin: 0.9rem 0 1.3rem; }
.confirm-table td { padding: 0.5rem 0.9rem; }
.confirm-table td:first-child { color: var(--gray); width: 42%; }
.confirm-table td:last-child { font-weight: 600; }
.btn-block {
  display: block;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
  font-size: 1.05rem;
}
.secondary-link { margin-top: 1.1rem; font-size: 0.9rem; }
.secondary-link a { color: var(--gray); text-decoration: underline; }
.secondary-link a:hover { color: var(--gold); }

.confirm-card.wide { max-width: 680px; }
.vehicle-line { color: var(--gray); font-size: 0.95rem; margin-bottom: 0.25rem; }

/* Fines list with checkboxes + live total */
.fines-table { width: 100%; border-collapse: collapse; margin: 1rem 0 0.25rem; }
.fines-table th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray);
  border-bottom: 2px solid var(--gray-light);
  padding: 0 0.5rem 0.5rem;
}
.fines-table td { padding: 0.7rem 0.5rem; border-bottom: 1px solid var(--gray-light); vertical-align: top; }
.fines-table tr:last-child td { border-bottom: none; }
.fines-table .col-check { width: 30px; text-align: center; vertical-align: middle; }
.fines-table .col-amount { text-align: right; white-space: nowrap; font-weight: 700; }
.fines-table input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--navy); }
.fine-offence { font-weight: 700; }
.fine-sub { color: var(--gray); font-size: 0.85rem; margin-top: 0.1rem; }
.fines-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.85rem 0.5rem 1.1rem;
  border-top: 2px solid var(--navy);
  font-size: 1.05rem;
}
.fines-total .total-amount { font-family: var(--serif); font-weight: 800; font-size: 1.4rem; color: var(--navy); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.secure-hint { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--gray); margin-top: 0.75rem; }
.secure-hint::before { content: "\1F512"; }

/* Admin buttons & checklists */
.btn.btn-secondary { background: var(--navy); color: #fff; }
.btn.btn-secondary:hover { background: var(--navy-light); color: #fff; }
.btn.btn-danger { background: var(--alert-red); color: #fff; }
.btn.btn-danger:hover { background: #b5292d; color: #fff; }
.btn.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.85rem; }
.admin-check { display: block; padding: 0.3rem 0; font-size: 0.93rem; }
.admin-check code { background: var(--cream); padding: 0.05rem 0.3rem; border-radius: 2px; }

/* One-row-per-item assignment tables (role perms, user roles, user perms) */
.assign-table { margin: 0 0 1rem; }
.assign-table th, .assign-table td { vertical-align: middle; }
.assign-table .col-check { width: 36px; text-align: center; }
.assign-table .col-status { width: 1%; white-space: nowrap; }
.assign-table input[type="checkbox"] { width: 16px; height: 16px; }
.assign-table code { background: var(--cream); padding: 0.05rem 0.3rem; border-radius: 2px; }
.assign-table label { display: block; cursor: pointer; margin: 0; }
.assign-table tbody tr:hover td { background: var(--gold-pale, #f4ecd8); }
.assign-table .row-disabled td { color: var(--gray); }
.assign-table .row-disabled code { color: var(--gray); }
.pill-super {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--navy);
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  vertical-align: middle;
}

/* "Open on mobile" QR pairing modal (trigger lives in the footer Quick Links) */
.ml-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 40, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}
.ml-overlay[hidden] { display: none; }
.ml-dialog {
  position: relative;
  background: var(--white, #fff);
  border-radius: 8px;
  padding: 1.75rem 1.75rem 2rem;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.ml-dialog h3 { margin: 0 0 0.75rem; color: var(--navy); }
.ml-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: 0;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--gray);
  cursor: pointer;
}
.ml-close:hover { color: var(--navy); }
.ml-instructions { font-size: 0.9rem; color: var(--gray-dark, #555); margin: 0 0 1rem; }
.ml-qr {
  width: 220px;
  height: 220px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--gray-light);
  border-radius: 6px;
}
.ml-qr img, .ml-qr canvas, .ml-qr table { display: block; }
.ml-hint { font-size: 0.85rem; color: var(--gray); padding: 0 1rem; }
.ml-success { padding: 1rem 0 0.5rem; }
.ml-success h4 { margin: 0.5rem 0 0.4rem; color: var(--navy); }
.ml-success p { font-size: 0.9rem; color: var(--gray-dark, #555); margin: 0; }
.ml-check {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 50%;
  background: #2e7d46;
  color: #fff;
  font-size: 2rem;
  line-height: 56px;
}

/* One-time-code entry: six separate digit boxes */
.otp { display: flex; gap: 0.5rem; }
.otp-box {
  width: 48px;
  height: 56px;
  padding: 0;
  text-align: center;
  font-family: inherit;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: 6px;
  -moz-appearance: textfield;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.otp-box::-webkit-outer-spin-button,
.otp-box::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.otp-box:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 163, 78, 0.28);
}
.otp-box.filled { border-color: var(--gold); }
@media (max-width: 420px) {
  .otp { gap: 0.35rem; }
  .otp-box { width: 40px; height: 50px; font-size: 1.35rem; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  /* Hide the homepage hero CTAs and quick-links on phones/small tablets. */
  .hero .btn { display: none; }
  .quick-links { display: none; }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .hero h2 { font-size: 1.7rem; }
  .header-inner { flex-direction: column; text-align: center; }

  /* CSS-only hamburger nav */
  .nav-toggle-label { display: block; }
  .nav-list {
    display: none;
    flex-direction: column;
    padding: 0;
  }
  .nav-toggle:checked ~ .nav-list { display: flex; }
  .nav-list a { border-top: 1px solid var(--navy-light); padding: 0.85rem 1.25rem; }

  .event-row { flex-direction: column; }
  .event-date-block { flex: none; width: 70px; }
}
