@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&family=Inter:wght@400;500;600&family=Courier+Prime:wght@400;700&family=Quicksand:wght@400;500&family=Space+Mono:ital,wght@0,400;1,400&family=Fraunces:ital,wght,SOFT@0,400,100;1,400,100&display=swap');

:root {
  --bg: #469dbe;
  --text: #ffffff;
  --tagline: #cfeaf6;
  --date: #f4d35e;
  --description: #eaf5fb;
  --tag: #ffc7a1;
  --bracket: #7fb8d1;
  --accent: #fff27a;
  --footer: #9ec9dc;
  --rule: rgba(255, 255, 255, 0.18);

  --font-pixel: 'Press Start 2P', monospace;
  --font-body: 'VT323', monospace;
  --font-readable: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-typewriter: 'Courier Prime', 'Courier New', monospace;
  --font-prose: 'Lora', Georgia, 'Times New Roman', serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
}

img {
  image-rendering: pixelated;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  position: relative;
  z-index: 1;
}

/* ---------- Background effect: CRT scanlines ---------- */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(255, 255, 255, 0.05) 3px,
    rgba(255, 255, 255, 0.05) 4px
  );
  animation: scanlines 6s linear infinite;
}

@keyframes scanlines {
  from { background-position: 0 0; }
  to { background-position: 0 12px; }
}

/* ---------- Header ---------- */

header.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  position: relative;
}

header.site-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  display: block;
  height: 40px;
  width: auto;
}

.tagline {
  font-family: var(--font-typewriter);
  font-size: 11px;
  font-weight: 400;
  color: #faf35e;
  letter-spacing: 1.4px;
  line-height: 1.1;
  white-space: nowrap;
  text-transform: uppercase;
}

.menu {
  position: relative;
}

.menu-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: center;
}

.menu-toggle img {
  display: block;
  height: 39px;
  width: auto;
  image-rendering: pixelated;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.3s ease;
}

.menu-toggle img + img {
  margin-top: -22px;
}

.sword-rot-90 { transform: rotate(90deg); }
.sword-rot-270 { transform: rotate(270deg); }

.menu.open .menu-toggle img:nth-child(1) {
  transform: translateY(17px) rotate(-45deg);
}

.menu.open .menu-toggle img:nth-child(2) {
  transform: translateX(140vw) rotate(270deg);
  opacity: 0;
}

.menu.open .menu-toggle img:nth-child(3) {
  transform: translateY(-17px) rotate(45deg);
}

nav.site-nav {
  position: absolute;
  right: calc(100% + 22px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 22px;
  white-space: nowrap;
  font-family: var(--font-pixel);
  font-size: 11px;
  pointer-events: none;
  z-index: 5;
}

nav.site-nav a {
  color: var(--text);
  text-decoration: none;
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.65, 0, 0.35, 1), color 0.2s ease;
}

.menu.open nav.site-nav {
  pointer-events: auto;
}

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

.menu.open nav.site-nav a:nth-child(3) { transition-delay: 0.20s, 0.20s, 0s; }
.menu.open nav.site-nav a:nth-child(2) { transition-delay: 0.28s, 0.28s, 0s; }
.menu.open nav.site-nav a:nth-child(1) { transition-delay: 0.36s, 0.36s, 0s; }

nav.site-nav a:hover,
nav.site-nav a.active {
  color: var(--accent);
}

/* ---------- Filter Container (double-line separator like header) ---------- */

.filter-container {
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  position: relative;
}

.filter-container::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

/* ---------- Page title ---------- */

main h1.page-title {
  font-family: var(--font-pixel);
  font-size: 16px;
  margin: 0 0 28px;
  line-height: 1.5;
}

/* ---------- Content Area (between header lines & footer lines) ---------- */

main {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.content-area {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin-top: 20px;
  margin-bottom: 24px;
}

.posts-container {
  display: flex;
  flex-direction: column;
}

/* ---------- Filter Badge ---------- */

.filter-badge {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--font-typewriter);
  font-size: 13px;
  padding: 10px 0;
  color: var(--description);
  gap: 4px;
}

.filter-badge .filter-hashtag {
  color: #faf35e;
  cursor: pointer;
  letter-spacing: 0.3px;
  padding: 4px 4px;
  border-radius: 4px;
}

.filter-badge .filter-hashtag:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* ---------- Posts ---------- */

article.post {
  padding-bottom: 36px;
  margin-bottom: 0;
  margin-top: 36px;
  border-bottom: 2px dashed rgba(255, 255, 255, 0.32);
}

.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 3px;
}

.post-meta .date {
  margin-bottom: 0;
  display: flex;
  align-items: center;
}

article.post.pinned .pinned-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-pixel);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #0e3a52;
  background: var(--accent);
  padding: 0 9px;
  border-radius: 3px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.18);
  height: 21px;
}

article.post.pinned .pinned-badge i {
  font-size: 10px;
  transform: rotate(-20deg);
}

article.post:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

article.post .date {
  font-family: var(--font-typewriter);
  font-size: 14px;
  font-weight: 400;
  color: #b3d6ea;
  margin-bottom: 3px;
  letter-spacing: 0.3px;
}

article.post h2 {
  font-family: var(--font-pixel);
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.6;
}

article.post h2 a {
  color: #faf35e;
  text-decoration: none;
}

article.post h2 a:hover {
  color: #ffffff;
}

article.post .description {
  margin: 0 0 16px;
  color: var(--description);
  font-family: 'Space Mono', 'Courier New', monospace;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.7;
}

.tags {
  font-family: var(--font-typewriter);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.3px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tags a {
  color: #faf35e;
  text-decoration: none;
}

.tags a::before {
  content: '#';
  color: #ded056;
}

.tags a:hover {
  color: #ffffff;
}

.tags a:hover::before {
  color: #ffffff;
}

/* ---------- About ---------- */

article.post.about-post h2 {
  color: #faf35e;
}

.image-collage {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  width: 100%;
  margin-top: 28px;
}

.collage-item {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.collage-img-wrap {
  position: relative;
  border-radius: 20px;
  border: 4px solid #ffffff;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.22);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.collage-front .collage-img-wrap {
  width: 220px;
  height: 220px;
  border-color: #faf35e;
}

.collage-back-left .collage-img-wrap,
.collage-back-right .collage-img-wrap {
  width: 150px;
  height: 150px;
}

.collage-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.collage-img-wrap.is-placeholder::after {
  content: '\f03e';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: rgba(255, 255, 255, 0.4);
}

.collage-item figcaption {
  font-family: var(--font-typewriter);
  font-size: 12px;
  color: var(--description);
  letter-spacing: 0.3px;
  text-align: center;
}

/* ---------- Footer ---------- */

footer.site-footer {
  margin-top: 64px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  text-align: center;
  position: relative;
  display: flex;
  justify-content: center;
  gap: 28px;
}

footer.site-footer::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 0;
  right: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

footer.site-footer a {
  color: #ffffff;
  font-size: 22px;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-block;
}

footer.site-footer a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

/* ---------- Travel Map page ---------- */

.page-map main.map-main {
  margin-top: 24px;
  padding: 0;
}

.travel-map {
  width: 100%;
  height: 70vh;
  min-height: 480px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 18px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.maplibregl-popup-content {
  font-family: 'Space Mono', 'Courier New', monospace;
  font-size: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #0e3a52;
  max-width: 240px;
}

.map-popup .map-popup-title {
  font-family: var(--font-pixel);
  font-size: 10px;
  line-height: 1.5;
  color: #0e3a52;
  margin-bottom: 8px;
}

.map-popup .map-popup-desc {
  font-size: 12px;
  line-height: 1.6;
  color: #335;
  margin-bottom: 10px;
}

.map-popup .map-popup-btn {
  display: inline-block;
  font-family: var(--font-typewriter);
  font-size: 13px;
  letter-spacing: 0.5px;
  color: #0e3a52;
  background: #faf35e;
  padding: 5px 10px;
  border-radius: 4px;
  text-decoration: none;
}

.map-popup .map-popup-btn:hover {
  background: #fff27a;
}

.map-popup .map-popup-carousel {
  position: relative;
  width: 100%;
  margin-bottom: 10px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(14, 58, 82, 0.08);
}

.map-popup .map-popup-carousel-track {
  display: flex;
  width: 100%;
  height: 130px;
}

.map-popup .map-popup-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.map-popup .map-popup-carousel-slide.is-active {
  display: block;
}

.map-popup .map-popup-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(14, 58, 82, 0.7);
  color: #faf35e;
  border: none;
  width: 22px;
  height: 28px;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  line-height: 28px;
}

.map-popup .map-popup-carousel-btn.is-prev { left: 0; border-radius: 0 4px 4px 0; }
.map-popup .map-popup-carousel-btn.is-next { right: 0; border-radius: 4px 0 0 4px; }

.map-popup .map-popup-carousel-btn:hover { background: rgba(14, 58, 82, 0.9); }

.map-popup .map-popup-carousel-dots {
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 4px;
}

.map-popup .map-popup-carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(14, 58, 82, 0.4);
}

.map-popup .map-popup-carousel-dot.is-active {
  background: #faf35e;
}

.map-hover-label {
  position: absolute;
  pointer-events: none;
  transform: translate(-50%, -100%);
  background: #0e3a52;
  color: #faf35e;
  font-family: var(--font-pixel);
  font-size: 9px;
  line-height: 1.4;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 5;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

/* ---------- Quest landing pages ---------- */

.quest-landing {
  margin-top: 24px;
}

.quest-landing .quest-title {
  font-family: var(--font-pixel);
  font-size: 18px;
  color: var(--accent);
  margin: 0 0 8px;
  line-height: 1.4;
}

.quest-landing .quest-title i {
  margin-right: 6px;
}

.quest-landing .quest-tagline {
  font-family: var(--font-typewriter);
  font-size: 14px;
  color: var(--description);
  margin: 0 0 22px;
  line-height: 1.6;
}

.quest-embed {
  position: relative;
  width: 100%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  background: #0e3a52;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
  overflow: hidden;
  margin-bottom: 24px;
  aspect-ratio: 16 / 10;
}

.quest-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #0e3a52;
}

.quest-embed-fullscreen {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-typewriter);
  font-size: 12px;
  color: #0e3a52;
  background: #faf35e;
  border: 2px solid #0e3a52;
  padding: 5px 9px;
  border-radius: 5px;
  cursor: pointer;
  z-index: 2;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.25);
}

.quest-embed-fullscreen:hover {
  background: #fff27a;
}

.quest-embed.is-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  border: 0;
  z-index: 1000;
  margin: 0;
  aspect-ratio: auto;
}

.quest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.quest-actions .quest-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-typewriter);
  font-size: 14px;
  letter-spacing: 0.5px;
  color: #0e3a52;
  background: #faf35e;
  padding: 10px 16px;
  border: 2px solid #0e3a52;
  border-radius: 6px;
  text-decoration: none;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.18);
  transition: transform 0.1s ease, background 0.15s ease;
}

.quest-actions .quest-btn:hover {
  background: #fff27a;
  transform: translate(-1px, -1px);
}

.quest-actions .quest-btn.is-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.18);
}

.quest-actions .quest-btn.is-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
}

.quest-section-title {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 20px 0 12px;
}

.quest-downloads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.quest-download-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-typewriter);
  font-size: 13px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 12px 14px;
  border-radius: 6px;
  text-decoration: none;
  line-height: 1.4;
}

.quest-download-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--accent);
}

.quest-download-btn .platform {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--accent);
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 4px;
}

.quest-download-btn .filename {
  display: block;
  color: var(--description);
  font-size: 12px;
}

.quest-download-btn i {
  font-size: 22px;
  color: var(--accent);
}

.quest-note {
  font-family: var(--font-typewriter);
  font-size: 13px;
  color: var(--description);
  background: rgba(0, 0, 0, 0.18);
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  margin-top: 8px;
  line-height: 1.6;
}

/* ---------- Location pages ---------- */

.back-link {
  display: inline-block;
  font-family: var(--font-typewriter);
  font-size: 14px;
  color: #faf35e;
  text-decoration: none;
  letter-spacing: 0.5px;
  margin-top: 22px;
  margin-bottom: 0;
}

.back-link:hover {
  color: #ffffff;
}

.location-post {
  margin-top: 10px;
}

/* ---------- Photo gallery (scattered scrapbook) ---------- */

.photo-gallery {
  column-count: 3;
  column-gap: 16px;
  margin: 6px 0 26px;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 18px;
  border: 5px solid #ffffff;
  border-radius: 3px;
  background: #ffffff;
  box-shadow: 3px 4px 10px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: auto;
}

.gallery-item:nth-child(4n + 1) { transform: rotate(-2.5deg); }
.gallery-item:nth-child(4n + 2) { transform: rotate(1.8deg); }
.gallery-item:nth-child(4n + 3) { transform: rotate(-1.2deg); }
.gallery-item:nth-child(4n)     { transform: rotate(2.6deg); }

.gallery-item:hover {
  transform: rotate(0) scale(1.04);
  box-shadow: 4px 6px 18px rgba(0, 0, 0, 0.45);
  position: relative;
  z-index: 2;
}

.location-photo-placeholder {
  width: 100%;
  height: 200px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px 0 24px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.18);
}

.location-photo-placeholder span {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 1.5px;
}

@media (max-width: 600px) {
  .photo-gallery {
    column-count: 2;
    column-gap: 12px;
  }
}

.location-title {
  font-family: var(--font-pixel);
  font-size: 15px;
  color: #faf35e;
  margin: 0 0 8px;
  line-height: 1.6;
}

.location-region {
  font-family: var(--font-typewriter);
  font-size: 15px;
  color: #b3d6ea;
  letter-spacing: 0.3px;
  margin-bottom: 24px;
}

.info-section {
  margin-bottom: 22px;
}

.info-section h3 {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: #ffffff;
  margin: 0 0 12px;
  letter-spacing: 0.5px;
}

.info-section p {
  margin: 0;
  font-family: 'Space Mono', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.7;
  color: var(--description);
}

.info-section ul {
  margin: 0;
  padding-left: 18px;
  font-family: 'Space Mono', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.85;
  color: var(--description);
}

.info-section li::marker {
  color: #faf35e;
}

/* ---------- Responsive ---------- */

@media (max-width: 600px) {
  article.post h2 {
    font-size: 13px;
  }

  .image-collage {
    gap: 18px;
  }

  .collage-front .collage-img-wrap {
    width: 180px;
    height: 180px;
  }

  .collage-back-left .collage-img-wrap,
  .collage-back-right .collage-img-wrap {
    width: 120px;
    height: 120px;
  }
}
