/* ==========================================================================
   Hamelin Community Focus
   Description: Global styles, layout rules, and shared UI components
   Developed by: Mercury Filmworks
   Created: 2026‑09‑09
   ========================================================================== */


@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
  --navy: #3f5169;
  --navy-dark: #2f3e52;
  --navy-darker: #27333f;
  --gold: #dcb255;
  --gold-dark: #c99a3a;
  --ink: #1c1c1c;
  --muted: #5b6472;
  --paper: #ffffff;
  --paper-dim: #f4f5f7;
  --line: #e2e5ea;
  --danger: #c0392b;
  --radius: 10px;
  --maxw: 1180px;
  --site-maxw: 1440px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: #dde1e7;
}

body {
  margin: 0 auto;
  max-width: var(--site-maxw);
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  border-left: 1px solid #c7ccd4;
  border-right: 1px solid #c7ccd4;
  box-shadow: 0 0 40px rgba(20, 28, 38, 0.08);
}

h1, h2, h3, h4 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  margin: 0 0 0.5em;
  color: var(--ink);
  letter-spacing: 0.2px;
}

a { color: inherit; text-decoration: none; }

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

p { text-align: justify; margin: 0 0 1.2em; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------------- Top bar ---------------- */
.top-bar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.top-bar-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 10px 28px 10px;
  gap: 24px;
}

.brand h1 {
  font-size: clamp(1.5rem, 3vw, 2.35rem);
  text-transform: uppercase;
  margin: 0;
  line-height: 1.05;
}

.brand p {
  margin: 6px 0 0;
  font-size: 20px;
  color: #2b2b2b;
}

.shield-logo {
  width: 180px;
  min-width: 68px;
  height: auto;
  flex-shrink: 0;
}

/* ---------------- Nav ---------------- */
.main-nav {
  background: var(--navy);
  position: relative;
}

.main-nav .nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

.main-nav li.sep {
  color: rgba(255,255,255,0.35);
  padding: 0 4px;
}

.main-nav a {
  display: inline-block;
  color: #fff;
  text-transform: uppercase;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  padding: 16px 26px;
  border-radius: 999px;
  /* Adding a transition might be too much for an older website. */
  /* transition: background 0.15s ease, color 0.15s ease; */
}

.main-nav a:hover {
  background: rgba(255,255,255,0.08);
  padding: 8px 26px;
}

.main-nav a.active {
  background: var(--gold);
  color: #2b2205;
  padding: 8px 22px;
}

/* Burger toggle — hidden until the phone breakpoint kicks in */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
}

.burger-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.open .burger-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open .burger-bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .burger-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 760px) {
  .top-bar-inner {
    padding: 12px 20px;
    gap: 14px;
    align-items: center;
  }

  .brand h1 {
    font-size: 1.05rem;
    line-height: 1.25;
  }

  .brand p {
    font-size: 0.68rem;
    margin-top: 4px;
  }

  .shield-logo {
    width: 54px;
    min-width: 54px;
  }

  .main-nav .nav-inner {
    justify-content: space-between;
    padding: 8px 28px;
  }

  .nav-toggle { display: flex; }

  .main-nav ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--navy-dark);
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    z-index: 60;
    box-shadow: 0 12px 24px rgba(0,0,0,0.25);
  }

  .main-nav ul.open { display: flex; }

  .main-nav li.sep { display: none; }

  .main-nav li { width: 100%; }

  .main-nav a {
    width: 100%;
    padding: 15px 28px;
    border-radius: 0;
  }

  .main-nav a.active {
    width: 100%;
    padding: 15px 28px;
  }
}

/* ---------------- hamelin ---------------- */
.hamelin {
  width: 100%;
  overflow: hidden;
  line-height: 0;
  background: var(--navy-dark);
}

.hamelin img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.hamelin.dim { position: relative; }
.hamelin.dim img { filter: brightness(0.55) saturate(0.9); }

/* ---------------- Generic layout ---------------- */
main { padding: 48px 0 70px; }

/* Section titles with gold underlines as requested */
.section-title {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  text-transform: uppercase;
  border-bottom: 3px solid var(--gold);
  padding-bottom: 5px;
  margin-bottom: 14px;
}

.lede {
  max-width: 100%;
  color: #2a2a2a;
  font-size: 1.05rem;
}

.btn {
  display: inline-block;
  background: var(--gold);
  color: #2b2205;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 30px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn:hover { background: var(--gold-dark); }

.readmore {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.4px;
  border-bottom: 2px solid currentColor;
  padding-bottom: 2px;
}

/* ---------------- Home: chief + board ---------------- */
.home-top {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr 340px;
  gap: 36px;
  align-items: start;
  margin-bottom: 40px;
}

.chief-photo img {
  border-radius: 4px;
  width: 100%;
}

.chief-quote p {
  margin: 0 0 14px;
  font-size: 1.05rem;
}

.chief-quote .attribution {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.92rem;
  letter-spacing: 0.3px;
}

.board {
  background: var(--paper-dim);
  
  /* Added as requested with light gray background */
  background-color: rgb(245, 245, 245);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 20px;
}

.board h3 {
  text-transform: uppercase;
  font-size: 1.15rem;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.board-msg {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.board-msg:last-of-type { border-bottom: none; }

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #cfd4da;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar svg { width: 24px; height: 24px; fill: #8b93a1; }

.board-msg p {
  margin: 0;
  font-size: 0.93rem;
  color: #2a2a2a;
}

.board-msg b { font-weight: 800; }

.board .btn { margin-top: 14px; width: 100%; text-align: center; }

/* ---------------- Latest updates box ---------------- */
.latest-updates {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 34px 40px;
  text-align: center;
  margin-bottom: 50px;
}

.latest-updates .icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
}

.latest-updates h3 {
  color: #fff;
  text-transform: uppercase;
  font-size: 1.15rem;
  margin-bottom: 14px;
}

.latest-updates p {
  max-width: 760px;
  margin: 0 auto 16px;
  color: #e7eaee;
}

.latest-updates a.readmore { color: #fff; }

/* ---------------- Tips grid ---------------- */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 26px;
}

.tip-card { border-radius: 4px; overflow: hidden; background: var(--gold); }

.tip-card img { width: 100%; height: 190px; object-fit: cover; }

.tip-card .cap {
  /*background: var(--gold);*/
  padding: 18px 20px 22px;
}

.tip-card h4 {
  text-transform: uppercase;
  font-size: 1.02rem;
  margin-bottom: 8px;
}

.tip-card p { margin: 0; font-size: 0.92rem; color: #241d05; }

/* ---------------- About page ---------------- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 26px;
  margin-top: 34px;
}

.about-grid img { border-radius: 4px; width: 100%; height: 210px; object-fit: cover; }

/* ---------------- Lists (alerts / news) ---------------- */
.plain-list { list-style: none; margin: 26px 0; padding: 0; }
.plain-list li { padding: 10px 0; font-size: 1.02rem; border-bottom: 1px solid var(--line); }
.plain-list li::marker { content: ""; }
.plain-list a.readmore { margin-left: 6px; }

.archive-note { 
  margin-top: 26px;
  font-size: 1rem; 
  color: gray;
}
.archive-note a { border-bottom: 1px solid currentColor; }

.articles-panel {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 34px 40px 40px;
  margin-top: 34px;
}

.articles-panel h3 {
  color: #fff;
  text-transform: uppercase;
  font-size: 1.3rem;
}

.article-item { padding: 20px 0; border-bottom: 1px solid rgba(255,255,255,0.18); }
.article-item:last-of-type { border-bottom: none; }
.article-item h4 { color: #fff; text-transform: uppercase; font-size: 1rem; margin-bottom: 6px; }
.article-item p { margin: 0 0 6px; color: #dfe3e8; font-size: 0.95rem; }
.article-item a.readmore { color: #fff; }

.older-archives { 
  display: inline-block; 
  margin-top: 25px; 
  font-family: 'Montserrat', sans-serif; 
  font-weight: 700;
  cursor: pointer;
}

/* ---------------- Article / detail pages ---------------- */
.article-header h3 {
  text-transform: uppercase;
  font-size: clamp(1.3rem, 1.9vw, 1.7rem);
  /* margin-bottom: 18px; */
  border-bottom: 2px solid var(--gold);
  padding-bottom: 5px;
  margin-bottom: 14px;
}

@media(min-width:901px){
  .article-header h3 {
    font-size: clamp(1rem, 1.2vw, 1.4rem);
    white-space:nowrap;
  }
}

.article-body p { margin: 0 0 16px; max-width: 100%; }

.article-with-photo {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 30px;
  align-items: start;
  margin-top: 10px;
}

.article-with-photo figure { margin: 0; }
.article-with-photo img { border-radius: 2px; width: 100%; }
.article-with-photo figcaption {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.82rem;
  margin-top: 8px;
}

/* ---------------- Alert detail (missing person) ---------------- */
.alert-grid {
  align-items: center;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 30px;
  margin-top: 22px;
}

.alert-grid figure { margin: 0; }
.alert-grid img { border-radius: 2px; width: 100%; }

.facts dt { font-family: 'Montserrat', sans-serif; font-weight: 700; display: inline; text-transform: uppercase; font-size: 0.92rem; }
.facts dd { display: inline; margin: 0; font-size: 0.95rem; }
.facts .row { margin-bottom: 12px; }

.alert-desc { margin-top: 24px; max-width: 100%; font-size: 1rem; }

.notice-icon-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 30px;
  align-items: center;
  margin-top: 22px;
}

.notice-icon-row .icon-wrap { width: 170px; }

/* 
  Renamed from back-to-alerts to back-to-tips
  Will be used on both alerts and news articles
 */
.back-to-tips {
  text-align: right;
  margin-top: 34px;
}

.back-to-tips a {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  border-bottom: 2px solid currentColor;
  padding-bottom: 2px;
}

.back-to-tips a:hover { color: var(--gold-dark); }

/* ---------------- Forum ---------------- */
.forum-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 34px;
  align-items: start;
}

.forum-thread {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 26px 10px;
}

.f-post { margin-bottom: 16px; }
.f-bubble {
  display: inline-block;
  background: #dde2e8;
  border-radius: 14px;
  padding: 10px 16px;
  font-size: 0.92rem;
  max-width: 100%;
}
.f-bubble b { font-weight: 800; }
.f-bubble.removed { font-style: italic; color: #5a626d; }
.f-reply { margin-left: 34px; position: relative; margin-top: 10px; }
.f-reply::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 14px;
  width: 14px;
  height: 14px;
  border-left: 2px solid #b9c0c9;
  border-bottom: 2px solid #b9c0c9;
  border-radius: 0 0 0 8px;
}
.f-mod {
  font-style: italic;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 14px;
  display: inline-block;
  font-size: 0.88rem;
  margin: 8px 0 8px 34px;
}

.forum-notice {
  background: var(--paper-dim);
  border-radius: var(--radius);
  padding: 26px;
}
.forum-notice h3 { text-transform: uppercase; text-align: center; font-size: 1.05rem; }
.forum-notice p { font-size: 0.92rem; color: #383e46; }
.forum-notice .pd-address { margin-top: 18px; font-size: 0.9rem; }
.forum-notice .pd-address b { display: block; margin-bottom: 4px; }

.pager { display: flex; gap: 18px; justify-content: center; margin: 34px 0 10px; align-items: center; font-family: 'Montserrat', sans-serif; font-weight: 700; }
.pager span.label { font-weight: 700; text-transform: uppercase; }
.pager button {
  background: none; border: none; cursor: pointer; font: inherit;
  width: 30px; height: 30px; border-radius: 50%; color: var(--ink);
}
.pager button.active { background: var(--paper-dim); }
.pager button:hover { background: var(--line); }

.pager button.pager-nav {
  width: auto;
  height: auto;
  border-radius: 0;
  padding: 4px 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.pager button.pager-nav:hover { background: none; text-decoration: underline; }

.pager button.pager-nav:disabled {
  color: var(--muted);
  cursor: default;
  text-decoration: none;
  opacity: 0.5;
}

#pager-prev { margin-right: 14px; }
#pager-next { margin-left: 14px; }

/* Numbered page buttons take up too much room on phones — keep just Previous/Next */
@media (max-width: 760px) {
  .pager button[data-page] { display: none; }
  #pager-prev { margin-right: 0; }
  #pager-next { margin-left: 0; }
}

/* ---------------- Footer ---------------- */
.site-footer {
  background: var(--navy);
  border-top: 6px solid var(--gold);
  color: #fff;
  padding: 36px 0;
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-inner h2 {
  color: var(--gold);
  text-transform: uppercase;
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.footer-inner p { margin: 0; color: #e7eaee; font-size: 0.92rem; }
.footer-address p { text-align: right; line-height: 1.6; }

/* ---------------- 404 / glitch ---------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;      /* force full viewport width */
  height: 100vh;     /* force full viewport height */
  max-width: none;   /* override inherited max-width */
  margin: 0;         /* override inherited margin */
  background: rgba(20, 28, 38, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}


.modal-box {
  background: #fff;
  border-radius: 6px;
  max-width: 520px;
  width: 92%;
  padding: 30px 40px 40px;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.modal-box .close-x {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  background: var(--navy);
  color: #fff;
  border: none;
  font-size: 1rem;
  cursor: pointer;
}

.modal-box .code404 {
  display: inline-block;
  background: var(--gold);
  color: #2b2205;
  font-weight: 800;
  font-size: 2rem;
  font-family: 'Montserrat', sans-serif;
  padding: 10px 46px;
  border-radius: 10px;
  margin: 6px 0 20px;
}

#modal-404 {
  display: none;
}

.glitch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 26px;
  margin-top: 30px;
  filter: saturate(0.6);
}

.glitch-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  filter: blur(6px) brightness(0.8);
  border-radius: 4px;
}

.glitch-card h4 { margin: 10px 0 6px; text-transform: uppercase; font-size: 0.95rem; }
.glitch-card p { font-size: 0.85rem; color: var(--muted); margin: 0 0 8px; }
.glitch-note {
  margin-top: 30px;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

/* ---------------- Utility ---------------- */
.warn-icon { color: #fff; }

@media (max-width: 900px) {
  .home-top { grid-template-columns: 1fr; }
  .article-with-photo, .alert-grid, .notice-icon-row { grid-template-columns: 1fr; }
  .forum-layout { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
  .footer-address p { text-align: left; }
}
