/* ── Variables ── */
:root {
  --ink: #1a1a1a;
  --soft: #666;
  --paper: #fafaf8;
  --paper-warm: #f5f2eb;
  --accent: #c44;
  --radius: 8px;
}

/* ── Base ── */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
  margin: 0;
}

main {
  min-height: calc(100vh - 180px);
}

/* ── Map Container ── */
.map-hero {
  position: relative;
  width: 100%;
  height: 75vh;
  min-height: 500px;
  margin: 0;
  border-bottom: 1px solid #ddd;
}

#map {
  width: 100%;
  height: 100%;
}

/* ── Map Controls (toggles, legend, stats) ── */
.map-controls {
  position: absolute;
  z-index: 1000;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  padding: 12px 16px;
  font-size: 14px;
  min-width: 180px;
}

.map-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
  user-select: none;
}

.map-controls input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.map-controls hr {
  margin: 6px 0;
  border: none;
  border-top: 1px solid #e0e0e0;
}

/* ── Legend ── */
.legend-row {
  position: absolute;
  z-index: 1000;
  bottom: 24px;
  left: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(255,255,255,0.92);
  border-radius: var(--radius);
  padding: 8px 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-swatch {
  width: 20px;
  height: 3px;
  border-radius: 2px;
}

.legend-swatch.plane  { background: #e74c3c; }
.legend-swatch.bus    { background: #27ae60; }
.legend-swatch.boat   { background: #2980b9; }
.legend-swatch.car    { background: #f39c12; }
.legend-swatch.train  { background: #8e44ad; }

/* ── Stats Bar ── */
.stats-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  padding: 18px 12px;
  background: #fff;
  border-bottom: 1px solid #eee;
}

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

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}

.stat-label {
  font-size: 11px;
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Content Sections ── */
.section {
  padding: 40px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.section h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 20px;
  border-bottom: 2px solid #eee;
  padding-bottom: 8px;
}

/* (Blog card styles moved to bottom of file) */



/* (Photo strip styles moved to bottom of file) */

/* ── Photo Gallery Page ── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.photo-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4/3;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.photo-item:hover img {
  transform: scale(1.05);
}

.photo-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  padding: 12px;
  opacity: 0;
  transition: opacity 0.2s;
}

.photo-item:hover .photo-overlay {
  opacity: 1;
}

.photo-overlay .photo-title {
  font-size: 14px;
  font-weight: 600;
}

.photo-overlay .photo-loc {
  font-size: 12px;
  opacity: 0.85;
}

/* ── Post Layout ── */
.post-content {
  max-width: 750px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.8;
}

.post-hero {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: 0;
}

.post-header {
  max-width: 750px;
  margin: 40px auto 20px;
  padding: 0 24px;
}

.post-header h1 {
  font-size: 36px;
  line-height: 1.2;
  margin-bottom: 8px;
}

/* ── Modal ── */
#modalExif span {
  display: inline-block;
  margin-right: 12px;
  white-space: nowrap;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .map-hero {
    height: 55vh;
    min-height: 350px;
  }
  .map-controls {
    top: 8px;
    right: 8px;
    padding: 8px 12px;
    min-width: 150px;
    font-size: 13px;
  }
  .legend-row {
    bottom: 8px;
    left: 8px;
    padding: 6px 10px;
    gap: 6px;
    font-size: 11px;
  }
  .post-header h1 {
    font-size: 26px;
  }
  .stats-bar {
    gap: 16px;
    padding: 12px 8px;
  }
  .stat-value {
    font-size: 22px;
  }
}

/* ── Route popup ── */
.route-popup .leaflet-popup-content {
  font-size: 13px;
  line-height: 1.5;
  margin: 8px 12px;
}

.route-popup b {
  color: var(--ink);
}

/* ── City label tooltip ── */
.city-label {
  background: none;
  border: none;
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  text-shadow: 0 0 4px rgba(255,255,255,0.8);
  white-space: nowrap;
  pointer-events: none;
}

.city-label::before {
  display: none;
}

/* ═══════════════════════════════════════════
   NMF-STYLE NAVBAR
   ═══════════════════════════════════════════ */

/* Top header bar — brand + tagline */
.site-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  background: #2c3e50;
  color: #fff;
  gap: 16px;
  flex-wrap: wrap;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.site-brand:hover { color: rgba(255,255,255,0.85); }

.header-tagline {
  font-size: 0.9rem;
  opacity: 0.75;
  text-align: right;
  line-height: 1.15;
}

/* Dark navbar */
.site-navbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 16px;
  min-height: 48px;
  background: #1a252f;
  border-bottom: 2px solid rgba(0,0,0,0.15);
  position: relative;
  z-index: 100;
}

.site-navbar-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  text-decoration: none;
  color: rgba(255,255,255,0.9);
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s;
}

.site-navbar-link:hover,
.site-navbar-link:focus {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.site-mobile-toggle {
  color: rgba(255,255,255,0.9) !important;
}

/* Mobile nav dropdown */
.site-mobile-nav {
  background: #1a252f;
  color: #fff;
  border-bottom: 2px solid rgba(0,0,0,0.15);
  box-shadow: 0 8px 18px rgba(0,0,0,0.2);
}

.site-mobile-nav .w3-bar-item,
.site-mobile-nav .w3-button {
  font-weight: 600;
  color: rgba(255,255,255,0.9) !important;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.site-mobile-nav .w3-button:hover {
  background: rgba(255,255,255,0.12) !important;
}

/* ═══════════════════════════════════════════
   NMF-STYLE BLOG CARDS
   ═══════════════════════════════════════════ */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s, transform 0.15s;
  text-decoration: none;
  color: inherit;
}

.blog-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

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

.blog-card .card-body {
  padding: 18px 20px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card .card-date {
  font-size: 0.78rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  order: -1;
}

.blog-card h3,
.blog-card .card-title {
  font-size: 1.12rem;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.3;
  color: #1a1a1a;
}

.blog-card .card-excerpt {
  font-size: 0.88rem;
  color: #555;
  line-height: 1.55;
  margin: 0;
}

/* ═══════════════════════════════════════════
   PHOTO STRIP — prevent horizontal overflow
   ═══════════════════════════════════════════ */

.photo-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
  max-width: 100%;
}

.photo-strip img {
  height: 200px;
  flex-shrink: 0;
  border-radius: var(--radius);
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform 0.2s;
  object-fit: cover;
}

/* ═══════════════════════════════════════════
   MODAL Z-INDEX — fix behind map
   ═══════════════════════════════════════════ */

.w3-modal {
  z-index: 2000 !important;
}

#modalMap {
  z-index: 1;
}

/* ═══════════════════════════════════════════
   MODAL Z-INDEX — fix behind map
   ═══════════════════════════════════════════ */

.w3-modal {
  z-index: 2000 !important;
}

#modalMap {
  z-index: 1;
}

/* ═══════════════════════════════════════════
   HOMEPAGE PHOTO GRID — matches gallery cards
   ═══════════════════════════════════════════ */

.home-photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.home-photo-grid .photo-item {
  aspect-ratio: 4/3;
}

@media (max-width: 768px) {
  .home-photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ═══════════════════════════════════════════
   POST TABLES — centered, alternating rows
   ═══════════════════════════════════════════ */

:root {
  --primary: #2c3e50;
  --primary-strong: #1a252f;
  --primary-rgb: 44, 62, 80;
  --on-primary: #ffffff;
  --accent: #c0392b;
}

.post-content table,
table.site-table {
  width: 100%;
  max-width: 540px;
  margin: 1.5rem auto;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.95rem;
}

.post-content thead th,
table.site-table thead th {
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  padding: 12px 16px;
  text-align: center;
  border-bottom: 2px solid rgba(0, 0, 0, 0.12);
}

.post-content td,
.post-content th,
table.site-table td,
table.site-table th {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  text-align: center;
}

.post-content tbody tr:last-child td,
table.site-table tbody tr:last-child td {
  border-bottom: none;
}

.post-content tbody tr:nth-child(odd) td,
table.site-table tbody tr:nth-child(odd) td {
  background: rgba(var(--primary-rgb), 0.03);
}

.post-content tbody tr:nth-child(even) td,
table.site-table tbody tr:nth-child(even) td {
  background: rgba(var(--primary-rgb), 0.01);
}

.post-content tbody tr:hover td,
table.site-table tbody tr:hover td {
  background: rgba(var(--primary-rgb), 0.08);
}

@media (max-width: 600px) {
  .post-content table,
  table.site-table {
    max-width: 100%;
    font-size: 0.85rem;
  }
  .post-content td,
  .post-content th {
    padding: 8px 10px;
  }
}

/* Modal: no padding on image, content centered */
#photoModal .w3-modal-content {
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
}
#photoModal img { padding: 0; margin: 0; }

/* Modal: cap at 95vw on small screens */
@media (max-width: 1263px) {
  #photoModal .w3-modal-content {
    max-width: 95vw !important;
  }
}

/* Modal scroll: overlay scrolls, background locked */
body.modal-open {
  overflow: hidden;
}
#photoModal {
  overflow-y: auto;
}
#photoModal .w3-modal-content {
  overflow: visible;
}

#photoModal .w3-modal-content > .w3-padding {
  width: 100%;
  box-sizing: border-box;
  max-width: 100%;
}

#photoModal .w3-modal-content > .w3-padding {
  width: 100%;
  box-sizing: border-box;
}

/* Info area constrained to match image */
#photoModal .w3-modal-content > .w3-padding {
  max-width: 500px;
  margin-left: auto !important;
  margin-right: auto !important;
  width: auto;
}

#photoModal .w3-modal-content > .w3-padding {
  contain: inline-size;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box;
}

#photoModal .w3-modal-content {
  display: inline-block !important;
  width: auto !important;
  max-width: 95vw;
}

#photoModal {
  overscroll-behavior: contain;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
}
body.modal-open {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
}

#photoModal .w3-display-topright {
  background: transparent !important;
  color: #c0392b !important;
  border-radius: 10px;
  width: 44px;
  height: 44px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 300;
  padding: 0 !important;
  transition: background 0.15s, color 0.15s;
}
#photoModal .w3-display-topright:hover {
  background: rgba(192,57,43,0.12) !important;
  color: #a93226 !important;
}

#photoModal img {
  border-radius: 10px 10px 0 0;
}

/* ── Photo Thumbnail Markers ── */
.photo-marker {
  background: transparent !important;
  border: none !important;
}
.photo-marker-inner {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.photo-marker-inner:hover {
  transform: scale(1.25);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  z-index: 1000;
}

/* ── Photo Clusters ── */
.photo-cluster {
  background: transparent !important;
  border: none !important;
}
.cluster-icon {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #c0392b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: transform 0.15s;
}
.cluster-icon:hover {
  transform: scale(1.15);
}

/* ── About Card ── */
.about-card {
  line-height: 1.8;
}
.about-card h2 {
  border-bottom: none;
  margin-top: 0;
}
.about-card h3 {
  margin-top: 28px;
  margin-bottom: 12px;
  font-size: 1.1rem;
  color: var(--primary);
}

.about-card {
  padding-left: 48px !important;
  padding-right: 48px !important;
}

/* ── Post Images ── */
.post-content p:has(img) {
  text-align: center;
}
.post-content img {
  max-width: 100%;
  max-height: 55vh;
  border-radius: 10px;
  display: block;
  margin: 1.5rem auto;
}

#btnMinimize {
  width: 24px;
  height: 24px;
  font-size: 16px !important;
  border-radius: 4px;
  transition: background 0.15s;
}
#btnMinimize:hover {
  background: rgba(0,0,0,0.08) !important;
}
