/* Groundhog Day "funk" styling: playful, warm, and a little retro. */
:root{
  --ink: #1d2b36;
  --paper: #fbf6ee;
  --paper2:#fffaf2;

  /* Accent colors (inspired by groundhog.org's warm browns + golds; used for UI, not data encoding). */
  --accent: #c07a2b;      /* warm bronze */
  --accent2:#6f3d2a;      /* cocoa */
  --accent3:#f2c14e;      /* sunshine */
  --cool:  #1d81e4;       /* blue for hog icon */
  --cool2: #00bc8c;       /* optional green */
  --shadow: 0 10px 30px rgba(0,0,0,.15);
}

*{ box-sizing:border-box; }
html,body{ height:100%; margin:0; background: var(--paper); color: var(--ink); }

body{
  font-family: "Nunito", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  overflow:hidden;
}

/* Topbar */
.topbar{
  position:fixed;
  top:0; left:0; right:0;
  z-index: 1000;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 10px 14px;
  background:
    radial-gradient(circle at 20% 10%, rgba(242,193,78,.55), transparent 55%),
    radial-gradient(circle at 80% 40%, rgba(192,122,43,.35), transparent 55%),
    linear-gradient(180deg, var(--paper2), var(--paper));
  border-bottom: 1px solid rgba(111,61,42,.18);
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
}

.brand{ display:flex; align-items:center; gap: 10px; min-width: 0; }
.brand-mark{
  width: 44px; height:44px; border-radius: 14px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(0,188,140,.18), rgba(29,129,228,.18));
  border: 1px solid rgba(29,129,228,.20);
}
.mini-hog{ width:28px; height:28px; color: var(--cool); filter: drop-shadow(0 2px 3px rgba(0,0,0,.15)); }

.brand-text{ min-width:0; }
.kicker{
  font-family: "Oswald", sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 11px;
  opacity:.85;
}
#mapTitle{
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  font-size: clamp(16px, 2.3vw, 22px);
  line-height: 1.1;
  margin:0;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}

/* Hamburger */
.hamburger{
  border: 0;
  background: rgba(255,255,255,.65);
  border: 1px solid rgba(111,61,42,.18);
  border-radius: 12px;
  padding: 10px;
  cursor:pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
}
.hamburger span{
  display:block;
  width: 22px;
  height: 2px;
  margin: 4px 0;
  background: var(--accent2);
  border-radius: 2px;
}

/* Map */
#map{
  position:absolute;
  top:64px; left:0; right:0; bottom:0;
  z-index: 1;
}

/* Panel */
.panel{
  position: fixed;
  top: 64px;
  right: 12px;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - 76px);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(111,61,42,.18);
  border-radius: 18px;
  box-shadow: var(--shadow);
  z-index: 1200;

  transform: translateX(110%);
  transition: transform .22s ease;
  overflow:hidden;
}
.panel.open{ transform: translateX(0); }

.panel-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 14px;
  background:
    linear-gradient(90deg, rgba(242,193,78,.25), rgba(0,188,140,.12));
  border-bottom: 1px dashed rgba(111,61,42,.26);
}
.panel-title{
  font-family: "Oswald", sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.panel-close{
  border:0; background: transparent;
  font-size: 26px; line-height: 1;
  cursor:pointer;
  opacity:.75;
}

.panel-section{ padding: 12px 14px; }
.panel-h2{
  font-family:"Oswald", sans-serif;
  margin: 0 0 8px 0;
  font-size: 15px;
  letter-spacing: .04em;
}
.panel-p{
  margin:0;
  font-size: 13px;
  opacity:.9;
}

.year-list{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.year-btn{
  border: 1px solid rgba(111,61,42,.22);
  background: rgba(251,246,238,.85);
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
}
.year-btn.active{
  background: linear-gradient(90deg, rgba(29,129,228,.15), rgba(0,188,140,.15));
  border-color: rgba(29,129,228,.35);
}

.btn{
  width: 100%;
  border:0;
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 800;
}
.btn-primary{
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  color: #2b1a10;
  box-shadow: 0 10px 20px rgba(192,122,43,.28);
}
.btn-secondary{
  background: rgba(111,61,42,.10);
  color: var(--accent2);
  border: 1px solid rgba(111,61,42,.22);
}

/* Loading */
.loading{
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 1100;
  display:flex;
  gap: 10px;
  align-items:center;

  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(111,61,42,.18);
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.loading.hidden{ display:none; }

.spinner{
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 3px solid rgba(111,61,42,.22);
  border-top-color: rgba(29,129,228,.55);
  animation: spin 1s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg);} }

.loading-title{ font-weight: 800; }
.loading-sub{ font-size: 12px; opacity: .8; }

/* Leaflet popups */
.leaflet-popup-content-wrapper{
  border-radius: 16px;
  border: 1px solid rgba(111,61,42,.18);
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
}
.leaflet-popup-content{
  margin: 10px 12px;
  font-family: "Nunito", sans-serif;
}
.popup-title{
  font-family: "Oswald", sans-serif;
  letter-spacing: .04em;
  margin: 0 0 6px 0;
}
.popup-row{
  font-size: 13px;
  margin: 2px 0;
}
.popup-thumb{
  width: 100%;
  border-radius: 12px;
  margin-top: 8px;
  border: 1px solid rgba(111,61,42,.14);
}

/* Modal */
.modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(29,43,54,.55);
  z-index: 1400;
  display:none;
  padding: 20px;
}
.modal-overlay.open{ display:grid; place-items:center; }

.modal{
  width: min(560px, 96vw);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  border: 1px solid rgba(111,61,42,.18);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modal-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 12px 14px;
  background: linear-gradient(90deg, rgba(242,193,78,.22), rgba(29,129,228,.12));
  border-bottom: 1px dashed rgba(111,61,42,.26);
}
.modal-title{
  font-family:"Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.modal-close{
  border:0; background:transparent;
  font-size: 26px; cursor:pointer; opacity:.75;
}
.modal-body{ padding: 12px 14px; }
.sources{ margin: 0; padding-left: 18px; }
.sources li{ margin: 8px 0; }
.fineprint{ font-size: 12px; opacity:.8; }

/* Hog marker + cluster */
.hog-marker{
  width: 26px; height: 26px;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.16));
}
.cluster-wrap{
  position: relative;
  width: 46px; height: 46px;
  display:grid; place-items:center;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.15));
}
.cluster-count{
  position:absolute;
  bottom: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display:grid; place-items:center;
  border-radius: 999px;
  background: rgba(242,193,78,.95);
  border: 1px solid rgba(111,61,42,.22);
  color: #2b1a10;
  font-weight: 800;
  font-size: 11px;
}

/* Improve attribution z-order under panel */
.leaflet-control-attribution{
  z-index: 2;
}
