/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --ocean-blue: #1e5f8c;
  --ocean-dark: #164a6e;
  --sand: #f4e8d8;
  --foam: #e8f4f8;
  --dark: #2a2a2a;
  --muted: #666;
  --border: #ddd;
  --accent: #2a9fd6;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background: var(--foam);
}

/* ═══ HEADER ═══ */
header {
  background: linear-gradient(135deg, var(--ocean-blue), var(--ocean-dark));
  color: white;
  padding: 2.5rem 1rem 2rem;
  text-align: center;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.tagline {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

nav {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

nav a {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: background 0.2s;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ═══ MAIN ═══ */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

section {
  background: white;
  padding: 2rem;
  margin-bottom: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#hero {
  text-align: center;
  color: white;
  padding: 3rem 2rem;
}

.hero-bg {
  background: linear-gradient(rgba(30, 95, 140, 0.75), rgba(30, 95, 140, 0.85)), url('images/hero-coast.jpg') center/cover no-repeat;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ═══ TOWN GOVERNMENT ═══ */
.gov-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .gov-grid {
    grid-template-columns: 1fr;
  }
}

.gov-column h3 {
  font-size: 1.1rem;
  color: var(--ocean-blue);
  margin-bottom: 1rem;
}

.gov-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid #eee;
}

.gov-item:last-child {
  border-bottom: none;
}

.gov-item a {
  color: var(--dark);
  text-decoration: none;
  font-weight: 500;
}

.gov-item a:hover {
  color: var(--accent);
}

.gov-item .gov-date {
  font-size: 0.8rem;
  color: var(--muted);
  display: block;
  margin-top: 0.2rem;
}

.gov-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* ═══ SECTION BANNERS ═══ */
.section-banner {
  width: calc(100% + 4rem);
  margin: -2rem -2rem 1.5rem -2rem;
  height: 200px;
  background-size: cover;
  background-position: center;
  border-radius: 12px 12px 0 0;
}

h2 {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
  color: var(--ocean-blue);
}

#hero h2 {
  color: white;
  font-size: 2rem;
}

#hero p {
  max-width: 700px;
  margin: 0 auto;
  font-size: 1.1rem;
  opacity: 0.95;
}

.section-intro {
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

/* ═══ GUIDE GRID ═══ */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.guide-card {
  padding: 1.5rem;
  background: var(--foam);
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: transform 0.15s, box-shadow 0.15s;
}

.guide-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.guide-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
  color: var(--ocean-blue);
}

.card-type {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.card-link {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.card-link:hover {
  text-decoration: underline;
}

.beach-card {
  border-left: 4px solid var(--ocean-blue);
}

/* ═══ EVENTS ═══ */
.events-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.event-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--foam);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.event-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
  padding: 0.5rem;
  background: var(--ocean-blue);
  color: white;
  border-radius: 8px;
  text-align: center;
}

.event-month {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.event-day {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.event-details h3 {
  font-size: 1.1rem;
  color: var(--ocean-blue);
  margin-bottom: 0.25rem;
}

.event-details p {
  font-size: 0.95rem;
  color: var(--muted);
}

/* ═══ REAL ESTATE ═══ */
.listing-links {
  margin-top: 2rem;
}

.listing-links h3 {
  font-size: 1.2rem;
  color: var(--ocean-blue);
  margin-bottom: 1rem;
}

.listing-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.listing-source-btn {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: var(--foam);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--dark);
  transition: transform 0.15s, box-shadow 0.15s;
}

.listing-source-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.source-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ocean-blue);
  margin-bottom: 0.25rem;
}

.source-desc {
  font-size: 0.9rem;
  color: var(--muted);
}

.listing-card {
  border-left: 4px solid #e74c3c;
}

.listing-placeholder {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
}

/* Redfin-inspired listing cards */
.listing-card-full {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: white;
  transition: transform 0.15s, box-shadow 0.15s;
}

.listing-card-full:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.listing-img {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: #e8f4f8;
}

.listing-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.listing-info {
  padding: 1rem 1.25rem;
}

.listing-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.25rem;
}

.listing-address {
  font-size: 0.95rem;
  color: var(--dark);
  margin-bottom: 0.25rem;
}

.listing-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.listing-source {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.listing-view-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--ocean-blue);
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s;
}

.listing-view-btn:hover {
  background: var(--ocean-dark);
}

/* ═══ SCHOOLS ═══ */
.school-card {
  border-left: 4px solid #f39c12;
}

.school-events-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.school-events-section h3 {
  font-size: 1.2rem;
  color: var(--ocean-blue);
  margin-bottom: 1rem;
}

.school-event-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #eee;
  font-size: 0.95rem;
}

.school-event-item:last-child {
  border-bottom: none;
}

.school-event-item a {
  color: var(--accent);
  text-decoration: none;
}

.school-event-item a:hover {
  text-decoration: underline;
}

.school-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.tag-district {
  background: #3498db;
  color: white;
}

.tag-athletics {
  background: #e74c3c;
  color: white;
}

.tag-center {
  background: #2ecc71;
  color: white;
}

.tag-hammondtown {
  background: #f39c12;
  color: white;
}

.tag-jhs {
  background: #9b59b6;
  color: white;
}

.tag-orrhs {
  background: #1abc9c;
  color: white;
}

/* ═══ SCANNER ═══ */
#scanner {
  background: #1a2332;
  color: #e0e0e0;
}

#scanner h2 {
  color: #7dd3fc;
}

.scanner-intro {
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

.scanner-player {
  margin-bottom: 1rem;
}

.scanner-note {
  font-size: 0.9rem;
  opacity: 0.7;
}

.scanner-note a {
  color: #7dd3fc;
  text-decoration: none;
}

.scanner-note a:hover {
  text-decoration: underline;
}

#scanner-log {
  background: #111a27;
  border: 1px solid #2a3a4e;
  border-radius: 8px;
  padding: 1rem;
  max-height: 400px;
  overflow-y: auto;
  font-family: "SF Mono", Monaco, "Courier New", monospace;
  font-size: 0.9rem;
}

.scanner-item {
  padding: 0.5rem;
  border-bottom: 1px solid #1e2d3e;
}

.scanner-item:last-child {
  border-bottom: none;
}

.timestamp {
  color: #7dd3fc;
  font-weight: 600;
  margin-right: 1rem;
}

.message {
  color: #c8d6e5;
}

/* ═══ QUICK FACTS ═══ */
.quick-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(30, 95, 140, 0.06);
  border-radius: 12px;
  border: 1px solid rgba(30, 95, 140, 0.12);
}

.fact-item {
  text-align: center;
}

.fact-number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--ocean-blue);
  line-height: 1.1;
}

.fact-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ═══ HISTORY TIMELINE ═══ */
.history-timeline {
  position: relative;
  padding-left: 2rem;
}

.history-timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--ocean-blue), var(--accent));
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding: 0.75rem 0 1.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.75rem;
  top: 1.1rem;
  width: 12px;
  height: 12px;
  background: var(--ocean-blue);
  border: 3px solid var(--foam);
  border-radius: 50%;
}

.timeline-year {
  font-weight: 800;
  color: var(--ocean-blue);
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.timeline-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--dark);
}

.timeline-text em {
  font-style: italic;
  color: var(--ocean-dark);
}

/* ═══ ABOUT ═══ */
#about p {
  margin-bottom: 1rem;
}

#about a {
  color: var(--accent);
  text-decoration: none;
}

#about a:hover {
  text-decoration: underline;
}

/* ═══ FOOTER ═══ */
footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.8rem;
  }

  nav {
    gap: 0.5rem;
  }

  nav a {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
  }

  section {
    padding: 1.5rem;
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }

  .event-item {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ═══ NEWS SECTION ═══ */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.news-item {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border-left: 3px solid #7dd3fc;
}

.news-date {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #7dd3fc;
  min-width: 5rem;
  padding-top: 0.15rem;
  text-transform: uppercase;
}

.news-content h3 {
  margin: 0 0 0.4rem 0;
  font-size: 1.05rem;
  color: #e0f2fe;
}

.news-content p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #94a3b8;
}

.news-content a {
  color: #7dd3fc;
}

@media (max-width: 600px) {
  .news-item {
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* ═══ WEATHER & TIDES ═══ */
.weather-tides-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .weather-tides-grid {
    grid-template-columns: 1fr;
  }
}

.weather-widget-box,
.tide-widget-box {
  background: #0f172a;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #1e293b;
}

.weather-widget-box h3,
.tide-widget-box h3 {
  color: #7dd3fc;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.weather-display {
  min-height: 180px;
}

.weather-loading {
  color: #94a3b8;
  font-style: italic;
}

.weather-current {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.weather-temp {
  font-size: 3rem;
  font-weight: 700;
  color: #e0f2fe;
  line-height: 1;
}

.weather-condition {
  color: #94a3b8;
  font-size: 1rem;
}

.weather-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1rem;
}

.weather-detail {
  color: #94a3b8;
  font-size: 0.9rem;
}

.weather-detail strong {
  color: #e0f2fe;
}

.widget-credit {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #475569;
}

.widget-credit a {
  color: #64748b;
}

.weather-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.weather-link-btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: #1e293b;
  color: #7dd3fc;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.weather-link-btn:hover {
  background: #334155;
}

/* ═══ MULTI-PAGE NAV ═══ */
nav a.active {
  background: rgba(255, 255, 255, 0.25);
  font-weight: 600;
}

.header-home {
  text-decoration: none;
  color: white;
}

.header-home:hover {
  opacity: 0.9;
}

/* ═══ PAGE-SPECIFIC ═══ */
.page-section {
  padding-top: 0;
}

.page-title {
  font-size: 2rem;
  color: var(--ocean-blue);
  margin-bottom: 0.5rem;
}

.page-description {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
  max-width: 700px;
}

/* ═══ RELATED PAGES ═══ */
.related-pages {
  text-align: center;
}

.related-pages h3 {
  font-size: 1.3rem;
  color: var(--ocean-blue);
  margin-bottom: 1rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.related-card {
  display: block;
  padding: 1rem;
  background: var(--foam);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--dark);
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s;
}

.related-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  color: var(--ocean-blue);
}

/* ═══ FOOTER LINKS ═══ */
.footer-links {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ocean-blue);
}
