/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base */
:root {
  --bg: #ffffff;
  --bg-elevated: #f7f7f7;
  --text: #333333;
  --text-heading: #111111;
  --text-muted: #999999;
  --accent: #111111;
  --border: #e8e8e8;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", Menlo, monospace;
  --content-width: 1328px;
  --grid-width: 1328px;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.8;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}
a:hover {
  opacity: 0.6;
}

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

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 2rem;
}
.header-inner {
  max-width: var(--grid-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-heading);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.site-title:hover {
  text-decoration: none;
  opacity: 0.6;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}
.nav-links a {
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav-links a:hover {
  color: var(--text-heading);
  text-decoration: none;
  opacity: 1;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text-heading);
  transition: transform 0.2s;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
}

/* Post grid (listing page) */
.post-list {
  max-width: var(--grid-width);
  margin: 0 auto;
  padding: 3rem 2rem;
}
.page-title {
  color: var(--text-heading);
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
}
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}
.post-card {
  display: flex;
  flex-direction: column;
}
.post-card-link {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}
.post-card-link:hover {
  color: inherit;
  opacity: 1;
}
.post-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin-bottom: 1rem;
}
.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.post-card-link:hover .post-thumb img {
  transform: scale(1.03);
}
.post-card h2 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
  color: var(--text-heading);
  line-height: 1.4;
}
.post-card time {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}
.post-summary {
  margin-top: 0.4rem;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.7;
}

/* Single post */
.post {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 4rem 2rem;
}
.post-header {
  margin-bottom: 3rem;
}
.post-header h1 {
  color: var(--text-heading);
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.post-meta time {
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

/* Post content */
.post-content {
  line-height: 1.8;
  font-size: 1rem;
}
.post-content p {
  margin: 0 0 1.75rem;
}
.post-content h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 3.5rem 0 1rem;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}
.post-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2.5rem 0 0.75rem;
  color: var(--text-heading);
}
.post-content blockquote {
  margin: 2rem 0;
  padding: 0 0 0 1.5rem;
  border-left: 3px solid var(--border);
  color: var(--text-muted);
  font-style: italic;
}
.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3.5rem 0;
}

/* Photos */
.blog-photo, .blog-video, .blog-youtube {
  width: 100%;
  margin: 2.5rem 0;
}
.blog-map {
  width: 100%;
  margin: 2.5rem 0;
}
.photo-container {
  position: relative;
  cursor: pointer;
  overflow: hidden;
}
.photo-container img {
  width: 100%;
  transition: opacity 0.3s;
}
.photo-container:hover img {
  opacity: 0.93;
}
.exif-toggle {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 13px;
  font-family: var(--font-mono);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-container:hover .exif-toggle {
  opacity: 1;
}
.exif-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(255, 255, 255, 0.75);
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.6;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.25rem 1rem;
}
figcaption {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
  margin-top: 0.75rem;
  font-style: italic;
}
.photos-caption {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-style: italic;
  font-size: 0.9rem;
}

/* YouTube */
.youtube-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}
.youtube-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Video */
.blog-video video {
  width: 100%;
}

/* Map */
.map-container {
  border-radius: 2px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
.lightbox[aria-hidden="false"] {
  display: flex;
}
.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.97);
}
.lightbox-content {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox-img {
  max-width: 95vw;
  max-height: 85vh;
  object-fit: contain;
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.75rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.2s;
}
.lightbox-close:hover {
  color: #ffffff;
}
.lightbox-prev, .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 2.5rem;
  cursor: pointer;
  padding: 1rem;
  transition: color 0.2s;
}
.lightbox-prev:hover, .lightbox-next:hover {
  color: #ffffff;
}
.lightbox-prev {
  left: 1rem;
}
.lightbox-next {
  right: 1rem;
}
.lightbox-caption {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  margin-top: 0.75rem;
  text-align: center;
  font-style: italic;
}
.lightbox-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.lightbox-exif {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.02em;
}
.lightbox-fullres {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color 0.2s;
}
.lightbox-fullres:hover {
  color: #ffffff;
  opacity: 1;
}

/* Post navigation */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.post-nav a {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.post-nav a:hover {
  color: var(--text-heading);
  opacity: 1;
}

/* Responsive */
@media (max-width: 1024px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  html { font-size: 16px; }

  .post-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .nav-toggle {
    display: flex;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 1rem 2rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }
  .nav-links.open {
    display: flex;
  }
  .site-nav {
    position: relative;
  }

  .post { padding: 2.5rem 1.25rem; }
  .post-list { padding: 2rem 1.25rem; }
  .site-header { padding: 1rem 1.25rem; }
}
