/* =========================================================
   Matt and Jade — Travelling the World
   style.css
   ========================================================= */

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

:root {
  --ink:       #1a1a1a;
  --muted:     #6b6b6b;
  --rule:      #e4e0db;
  --bg:        #faf9f7;
  --card-bg:   #ffffff;
  --accent:    #b85c3a;   /* warm terracotta */
  --accent-dk: #9a4a2e;
  --serif:     'Lora', Georgia, 'Times New Roman', serif;
  --sans:      'Inter', system-ui, -apple-system, sans-serif;
  --max:       720px;
  --wide:      1100px;
  --radius:    4px;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dk); text-decoration: underline; }

/* --- Typography ------------------------------------------ */
h1, h2, h3, h4 {
  font-family: var(--serif);
  line-height: 1.25;
  font-weight: 700;
  color: var(--ink);
}

p { margin-bottom: 1.4rem; }
p:last-child { margin-bottom: 0; }

/* --- Site Header ----------------------------------------- */
.site-header {
  background: var(--ink);
  color: #fff;
  padding: 1.25rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner {
  max-width: var(--wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header__brand {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.site-header__brand:hover { color: #f0d9c8; text-decoration: none; }

.site-header__brand span {
  font-weight: 400;
  opacity: 0.7;
  font-size: 0.85em;
}

.site-nav { display: flex; gap: 1.5rem; align-items: center; }
.site-nav a {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.site-nav a:hover { color: #fff; text-decoration: none; }

/* --- Hero (homepage) ------------------------------------- */
.hero {
  background: var(--ink);
  color: #fff;
  padding: 5rem 1.5rem 4rem;
  text-align: center;
}

.hero__title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
  color: #fff;
}

.hero__subtitle {
  font-family: var(--sans);
  font-size: 1rem;
  color: rgba(255,255,255,0.65);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* --- Post grid (homepage) -------------------------------- */
.posts-section {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
}

.posts-section__heading {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.75rem;
  margin-bottom: 2.5rem;
}

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

.post-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1), 0 12px 32px rgba(0,0,0,0.07);
}

.post-card__thumb {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #e8e4df;
}
.post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.post-card:hover .post-card__thumb img { transform: scale(1.04); }

.post-card__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 2rem;
  aspect-ratio: 16/10;
}

.post-card__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card__meta {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.post-card__title {
  font-size: 1.2rem;
  margin-bottom: 0.65rem;
  line-height: 1.3;
}

.post-card__title a { color: var(--ink); }
.post-card__title a:hover { color: var(--accent); text-decoration: none; }

.post-card__excerpt {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 1.25rem;
}

.post-card__link {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  align-self: flex-start;
}
.post-card__link:hover { color: var(--accent-dk); text-decoration: none; }
.post-card__link::after { content: ' →'; }

/* --- Post page ------------------------------------------- */
.post-header {
  background: var(--ink);
  color: #fff;
  padding: 4rem 1.5rem 3rem;
  text-align: center;
}

.post-header__meta {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 1rem;
}

.post-header__title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 700;
  color: #fff;
  max-width: 800px;
  margin: 0 auto 1.25rem;
  line-height: 1.2;
}

.post-header__back {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.post-header__back:hover { color: rgba(255,255,255,0.85); text-decoration: none; }
.post-header__back::before { content: '← '; }

/* Hero image for post */
.post-hero {
  width: 100%;
  max-height: 600px;
  object-fit: cover;
  display: block;
}

/* --- Post content --------------------------------------- */
.post-content {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.post-content p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink);
}

/* Images inside post content */
.post-content img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 2rem 0;
  cursor: pointer;
}

/* Two-up and multi-image runs */
.post-content .img-group {
  display: grid;
  gap: 0.5rem;
  margin: 2rem 0;
}
.post-content .img-group--2 { grid-template-columns: 1fr 1fr; }
.post-content .img-group--3 { grid-template-columns: 1fr 1fr 1fr; }
.post-content .img-group img { margin: 0; border-radius: var(--radius); }

/* --- Lightbox ------------------------------------------- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  cursor: zoom-out;
}
.lightbox.is-open { display: flex; }

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  cursor: default;
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  color: rgba(255,255,255,0.7);
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
  border: none;
  background: none;
  padding: 0.25rem;
}
.lightbox__close:hover { color: #fff; }

/* --- Post navigation ------------------------------------ */
.post-nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--rule);
  flex-wrap: wrap;
}

.post-nav a {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  max-width: 45%;
  line-height: 1.4;
}
.post-nav a:hover { color: var(--accent); text-decoration: none; }
.post-nav__next { margin-left: auto; text-align: right; }

/* --- Footer --------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
}

/* --- Responsive ----------------------------------------- */
@media (max-width: 600px) {
  .post-grid { grid-template-columns: 1fr; }
  .post-content .img-group--3 { grid-template-columns: 1fr 1fr; }
  .site-nav { display: none; }
}

@media (max-width: 400px) {
  .post-content .img-group--2,
  .post-content .img-group--3 { grid-template-columns: 1fr; }
}
