/* =========================================================
   Root / resets
   ========================================================= */
:root {
  --bg: #141414;
  --text: #F5F0E8;
  --text-muted: #a8a39a;
  --accent: #D4AF7A;
  --border: #2a2a2a;
  --card-bg: #1c1c1c;
  --max-width: 760px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

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

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

h1 {
  font-size: 1.8rem;
  margin: 0 0 8px;
}

h2 {
  font-size: 1.2rem;
  margin: 40px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

p {
  margin: 0 0 16px;
}

/* =========================================================
   Nav
   ========================================================= */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.nav {
  max-width: 900px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.nav-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.nav-name:hover {
  text-decoration: none;
  color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-links a.active {
  color: var(--text);
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 4px;
    padding-top: 14px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 8px 0;
  }
}

/* =========================================================
   Home page
   ========================================================= */
.home-hero {
  margin: 8px 0 40px;
}

.home-hero img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.home-name {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 16px;
}

.home-intro {
  font-size: 1.5rem;
  line-height: 1.5;
  font-weight: 400;
  margin: 0 0 12px;
}

.home-note {
  font-size: 1rem;
  font-weight: 300;
  font-style: italic;
  color: var(--text-muted);
  margin: 0;
}

/* =========================================================
   Lyricist's Lexicon / Anota — shared content pages
   ========================================================= */
.download-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.download-list li {
  margin-bottom: 10px;
}

.download-list a {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
}

.download-list a:hover {
  border-color: var(--accent);
  text-decoration: none;
  color: var(--accent);
}

.embed-frame {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 16px 0 24px;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.post-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.post-list li:last-child {
  border-bottom: none;
}

.post-list a {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}

.post-list a:hover {
  color: var(--accent);
}

.post-list p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* =========================================================
   Postcards page — postcard grid
   ========================================================= */
.travel-heading {
  font-family: 'EB Garamond', serif;
  font-size: 4.5rem;
  text-align: center;
  margin: 0 0 14px;
}

.page-description {
  font-family: 'EB Garamond', serif;
  font-style: normal;
  font-size: 1.4rem;
  line-height: 1.5;
  text-align: center;
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0 auto;
}

.travel-section {
  margin-top: 56px;
}

.travel-section:first-of-type {
  margin-top: 48px;
}

.section-title {
  font-family: 'EB Garamond', serif;
  font-size: 3rem;
  text-align: center;
  margin: 0 0 14px;
  border-bottom: none;
  padding-bottom: 0;
}

.section-description {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1.5;
  text-align: center;
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0 auto;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 32px;
}

.card {
  aspect-ratio: 3 / 2;
  cursor: pointer;
}

.card-media {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 6px;
}

.card-media img,
.card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
  pointer-events: none; /* clicks always open the lightbox, never interact with the video directly */
}

.card:hover .card-media img,
.card:hover .card-media video {
  transform: scale(1.03);
}

/* Full-width "original size" postcards — no cropping.
   Mark a card with `full: true` to give it its own row at its
   natural aspect ratio, capped so a tall photo can't blow out the page. */
.card.full {
  grid-column: 1 / -1;
  aspect-ratio: auto;
}

.card.full .card-media {
  display: flex;
  justify-content: center;
  background: var(--bg);
}

.card.full .card-media img,
.card.full .card-media video {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.card.full:hover .card-media img,
.card.full:hover .card-media video {
  transform: none;
}

/* A normal card left alone on its row (because a neighboring .full
   card pushed everything else down) spans the row and centers itself
   at its usual width, instead of sitting pinned to the left edge. */
.card.lone {
  grid-column: 1 / -1;
  justify-self: center;
}

/* =========================================================
   Travel page — postcard lightbox
   ========================================================= */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  padding: 32px;
  z-index: 100;
  cursor: pointer;
}

.lightbox.open {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
}

.lightbox-card {
  perspective: 1600px;
  cursor: pointer;
}

.lightbox-inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox.flipped .lightbox-inner {
  transform: rotateY(180deg);
}

.lightbox-face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-face-front {
  display: flex;
  overflow: hidden;
}

.lightbox-face-front img,
.lightbox-face-front video {
  display: block;
  width: auto;
  height: auto;
  max-width: min(92vw, 900px);
  max-height: 85vh;
  object-fit: contain;
  pointer-events: none;
}

.lightbox-face-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  background: var(--card-bg);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.lightbox-face-back p {
  font-family: 'EB Garamond', serif;
  font-size: 1.3rem;
  line-height: 1.7;
  color: var(--text);
  text-align: center;
  margin: 0;
}
