/* Tonidero Travels — styling inspired by the Ghost "London" theme:
   minimal black-on-white, centered header, photo-grid home page. */

:root {
  --color-bg: #ffffff;
  --color-text: #131313;
  --color-muted: #757575;
  --color-border: #e6e6e6;
  --color-accent: #000000;
  --color-placeholder: #f2f2f2;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --content-width: 720px;
  --wide-width: 1080px;
  --grid-width: 1200px;
}

html[data-theme="dark"] {
  --color-bg: #131313;
  --color-text: #ececec;
  --color-muted: #9a9a9a;
  --color-border: #2b2b2b;
  --color-accent: #ffffff;
  --color-placeholder: #222222;
}

* { box-sizing: border-box; }

html { font-size: 62.5%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.7rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

body.lightbox-open { overflow: hidden; }

a { color: var(--color-accent); }

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

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

.site-header { padding: 2rem 4vw 0; }

.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.3rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.site-nav ul {
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a { color: var(--color-text); text-decoration: none; }
.site-nav a:hover { opacity: 0.6; }

.theme-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--color-text);
  font-size: 1.7rem;
  line-height: 1;
}

.theme-toggle:hover { opacity: 0.6; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html:not([data-theme="dark"]) .theme-toggle .icon-sun { display: none; }

.site-branding { text-align: center; padding: 5rem 0 6rem; }

.site-title {
  margin: 0;
  font-size: 4.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.site-title a { color: var(--color-text); text-decoration: none; }

.site-description {
  margin: 0.6rem 0 0;
  color: var(--color-muted);
  font-size: 1.7rem;
  font-weight: 400;
}

/* ---------- Home: photo grid ---------- */

.post-grid {
  max-width: var(--grid-width);
  margin: 0 auto;
  padding: 0 4vw 6rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
}

@media (max-width: 900px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .post-grid { grid-template-columns: 1fr; } }

.post-card {
  display: block;
  text-decoration: none;
  color: var(--color-text);
}

.post-card-image {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--color-placeholder);
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.post-card:hover .post-card-image img { transform: scale(1.03); opacity: 0.92; }

.post-card-meta { padding: 1.2rem 0 0; text-align: center; }

.post-card-title {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.post-card-date {
  display: block;
  margin-top: 0.3rem;
  color: var(--color-muted);
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Post page ---------- */

.post { padding: 0 4vw 6rem; }

.post-header { max-width: var(--content-width); margin: 0 auto; text-align: center; }

.post-date {
  color: var(--color-muted);
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-title {
  margin: 0.6rem 0 3rem;
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.post-feature-image {
  max-width: var(--wide-width);
  margin: 0 auto 4rem;
}

.post-feature-image img { width: 100%; display: block; }

.post-content { max-width: var(--content-width); margin: 0 auto; }

.post-content h2 { font-size: 2.6rem; margin: 4rem 0 1rem; letter-spacing: -0.01em; }
.post-content h3 { font-size: 2rem; margin: 3rem 0 0.8rem; }
.post-content p { margin: 0 0 1.6em; }

.post-content img { display: block; margin: 0 auto; }

/* Single image cards */
.kg-image-card { margin: 3rem 0; }
.kg-image-card img { margin: 0 auto; }

/* Figure captions */
figure { margin: 3rem 0; }
figcaption {
  padding-top: 0.8rem;
  text-align: center;
  color: var(--color-muted);
  font-size: 1.4rem;
}

/* ---------- Ghost gallery cards (same markup as the Ghost site) ---------- */

.kg-width-wide {
  position: relative;
  width: min(var(--wide-width), 92vw);
  left: 50%;
  transform: translateX(-50%);
}

.kg-gallery-container { display: flex; flex-direction: column; }

.kg-gallery-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
}

.kg-gallery-image img {
  display: block;
  margin: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kg-gallery-row:not(:first-of-type) { margin: 0.75em 0 0; }
.kg-gallery-image:not(:first-of-type) { margin: 0 0 0 0.75em; }

/* ---------- Prev / next ---------- */

.post-nav {
  max-width: var(--content-width);
  margin: 6rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  font-size: 1.4rem;
}

.post-nav a { text-decoration: none; }
.post-nav a:hover { text-decoration: underline; }
.post-nav-next { margin-left: auto; text-align: right; }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 8, 0.88);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease;
}

.lightbox-img {
  max-width: 92vw;
  max-height: 86vh;
  width: auto;
  height: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.lightbox button {
  position: absolute;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  font-size: 3rem;
  line-height: 1;
  padding: 1.5rem;
  z-index: 101;
}

.lightbox button:hover { color: #fff; }

.lightbox-close { top: 1rem; right: 1.5rem; font-size: 4rem; }
.lightbox-prev { left: 0.5rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 0.5rem; top: 50%; transform: translateY(-50%); }

.lightbox-counter {
  position: absolute;
  bottom: 1.6rem;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.4rem;
  letter-spacing: 0.05em;
}

@media (max-width: 560px) {
  .lightbox-prev, .lightbox-next { display: none; } /* swipe instead */
}

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

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 3rem 4vw;
  text-align: center;
  color: var(--color-muted);
  font-size: 1.3rem;
}
