/* Gilbertown Police Department - shared site styles.
   Used by every page. Page-only styles stay in each page's <style> block. */

:root {
  --navy: #163a57;
  --navy-dark: #0d263b;
  --navy-deep: #081c2d;
  --navy-menu: #1c4666;
  --yellow: #ffd400;
  --yellow-dark: #bc8b00;
  --ivory: #fbfaf5;
  --ink: #172735;
  --muted: #46525e;
  --gold-text: #6f5200;
  --red: #8e1f26;
  --line: rgba(22, 58, 87, 0.24);
  --shadow: 0 16px 42px rgba(8, 28, 45, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
}

.wrap {
  width: min(96vw, 1920px);
  margin: 0 auto;
}

.section-rule {
  position: relative;
  margin-bottom: 30px;
  padding-top: 25px;
  border-top: 2px solid var(--navy);
}

.section-rule::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 105px;
  height: 5px;
  background: var(--yellow-dark);
}

.section-kicker {
  margin: 0 0 7px;
  color: var(--navy);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-title {
  margin: 0;
  color: var(--navy-dark);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.03;
  letter-spacing: -0.04em;
}

.section-link {
  display: inline-block;
  padding-bottom: 5px;
  color: var(--navy-dark);
  border-bottom: 2px solid var(--navy-dark);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.section-link:hover, .section-link:focus {
  color: var(--yellow-dark);
  border-color: var(--yellow-dark);
  transform: translateX(3px);
  outline: none;
}

.emergency-strip {
  width: 100%;
  padding: 9px 18px;
  color: #ffffff;
  background: var(--red);
  text-align: center;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.emergency-strip a:hover, .emergency-strip a:focus {
  color: var(--yellow);
  outline: none;
}

.site-header {
  position: relative;
  z-index: 20;
  width: 100%;
  color: #ffffff;
  background: var(--navy);
  border-bottom: 10px solid var(--yellow);
}

.masthead {
  min-height: 124px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 8px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
  color: #ffffff;
  text-decoration: none;
}

.brand:hover .brand-badge, .brand:focus .brand-badge {
  transform: scale(1.04);
}

.brand-badge {
  width: 112px;
  height: 112px;
  max-width: none;
  object-fit: contain;
  flex: 0 0 auto;
  transition: transform 0.25s ease;
}

.brand-text {
  min-width: 0;
  line-height: 1;
}

.brand-town {
  display: block;
  color: var(--yellow);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.1rem, 4.9vw, 3.7rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.brand-department {
  display: block;
  margin-top: 9px;
  color: #e6eef4;
  font-size: clamp(0.75rem, 1.9vw, 1.02rem);
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.explore-button {
  justify-self: end;
  min-width: 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 13px 17px;
  color: var(--navy-dark);
  background: var(--yellow);
  border: 0;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.28s ease, transform 0.28s ease, box-shadow 0.28s ease;
}

.explore-button:hover, .explore-button:focus {
  background: #fff17c;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  outline: none;
}

.menu-icon {
  width: 20px;
  display: grid;
  gap: 4px;
}

.menu-icon span {
  display: block;
  height: 2px;
  background: var(--navy-dark);
}

.site-menu {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  background: var(--navy-menu);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  transition: grid-template-rows 1.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease;
}

.site-menu.open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.site-menu > .wrap {
  min-height: 0;
  overflow: hidden;
  transform: translateY(-24px);
  transition: transform 1.15s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-menu.open > .wrap {
  transform: translateY(0);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 20px 0 24px;
}

.site-menu a {
  display: block;
  padding: 15px 17px;
  color: #ffffff;
  opacity: 0;
  transform: translateY(-12px);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
  border-left: 3px solid transparent;
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease, padding-left 0.22s ease, opacity 0.65s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-menu.open a {
  opacity: 1;
  transform: translateY(0);
}

.site-menu.open a:nth-child(1) {
  transition-delay: 0.16s;
}

.site-menu.open a:nth-child(2) {
  transition-delay: 0.22s;
}

.site-menu.open a:nth-child(3) {
  transition-delay: 0.28s;
}

.site-menu.open a:nth-child(4) {
  transition-delay: 0.34s;
}

.site-menu.open a:nth-child(5) {
  transition-delay: 0.40s;
}

.site-menu.open a:nth-child(6) {
  transition-delay: 0.46s;
}

.site-menu.open a:nth-child(7) {
  transition-delay: 0.52s;
}

.site-menu.open a:nth-child(8) {
  transition-delay: 0.58s;
}

.site-menu.open a:nth-child(9) {
  transition-delay: 0.64s;
}

.site-menu.open a:nth-child(10) {
  transition-delay: 0.70s;
}

.site-menu a:hover,
.site-menu a:focus,
.site-menu a[aria-current="page"] {
  padding-left: 22px;
  color: var(--yellow);
  background: rgba(255, 255, 255, 0.08);
  border-left-color: var(--yellow);
  outline: none;
}

main {
  padding: 65px 0 76px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 23px;
}

footer {
  width: 100%;
  padding: 12px 0;
  color: #dce8f2;
  background: var(--navy-deep);
  border-top: 8px solid var(--yellow);
}

.footer-content {
  display: flex;
  align-items: center;
  gap: 18px;
}

.footer-badge {
  width: 86px;
  height: 86px;
  max-width: none;
  object-fit: contain;
  flex: 0 0 auto;
  transition: transform 0.25s ease;
}

.footer-badge:hover {
  transform: scale(1.04);
}

.footer-contacts {
  margin-top: 8px;
  color: #aebfcb;
  font-size: 0.8rem;
}

footer a {
  color: #dce8f2;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  font-weight: 700;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

footer a:hover, footer a:focus {
  color: var(--yellow);
  text-decoration-color: currentColor;
  outline: none;
}

footer strong {
  color: #ffffff;
}

footer p {
  margin: 4px 0;
}

.small {
  font-size: 0.87rem;
}

@media (max-width: 560px) {
  .masthead {
    min-height: 112px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
  }

  .brand {
    gap: 10px;
  }

  .brand {
    min-width: 0;
  }

  .brand-badge {
    width: 74px;
    height: 74px;
  }

  .brand-town {
    font-size: clamp(1.45rem, 7vw, 2.1rem);
    white-space: nowrap;
  }

  .brand-department {
    margin-top: 7px;
    font-size: 0.61rem;
    letter-spacing: 0.15em;
  }

  .explore-button {
    flex: 0 0 auto;
    min-width: 0;
    gap: 8px;
    padding: 11px 12px;
    font-size: 0.7rem;
  }

  .menu-grid {
    grid-template-columns: 1fr;
    padding: 10px 0 18px;
  }

  .site-menu a {
    padding: 12px 13px;
  }

  main {
    padding: 52px 0 60px;
  }

  .section-heading {
    display: block;
  }

  .section-link {
    margin-top: 12px;
  }

  .section-rule {
    margin-bottom: 24px;
  }

  .footer-content {
    align-items: center;
  }

  .footer-badge {
    width: 66px;
    height: 66px;
  }

  .footer-contacts {
    line-height: 1.55;
  }
}

@media (max-width: 380px) {
  .brand {
    gap: 8px;
  }

  .brand-badge {
    width: 60px;
    height: 60px;
  }

  .brand-town {
    font-size: 1.38rem;
  }

  .brand-department {
    font-size: 0.54rem;
    letter-spacing: 0.12em;
  }

  .explore-button {
    gap: 6px;
    padding: 10px 10px;
    font-size: 0.66rem;
  }
}

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

/* Closed Explore menu takes no space (previously left an empty navy strip). */
.site-menu:not(.open) {
  border-top-color: transparent;
}

.site-menu:not(.open) .menu-grid {
  padding-top: 0;
  padding-bottom: 0;
}

/* Side panels size to their content instead of stretching. */
.emergency-panel,
.event-panel,
.office-panel {
  align-self: start;
}

/* Footer separators: shown on wide screens, become line breaks on phones. */
.sep {
  margin: 0 0.55em;
  color: #6f8597;
}

/* Quick-call bar: pinned to the bottom of the screen on phones only. */
.call-bar {
  display: none;
}

@media (max-width: 700px) {
  body {
    padding-bottom: 68px;
  }

  .call-bar {
    position: fixed;
    z-index: 40;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--navy-deep);
    border-top: 3px solid var(--yellow);
    box-shadow: 0 -6px 18px rgba(8, 28, 45, 0.25);
  }

  .call-bar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 62px;
    padding: 8px 6px;
    color: #ffffff;
    background: var(--navy);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
  }

  .call-bar a:first-child {
    color: var(--navy-dark);
    background: var(--yellow);
  }

  .call-bar a span {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .call-bar a:active {
    filter: brightness(0.92);
  }

  footer {
    padding: 22px 0 18px;
  }

  .footer-content {
    align-items: flex-start;
  }

  footer .small {
    font-size: 0.92rem;
  }

  .footer-contacts {
    margin-top: 12px;
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .sep {
    display: block;
    height: 0;
    overflow: hidden;
  }
}
