/*
  GothamTommy Ghost Theme — screen.css
  Typography : Space Grotesk (display) + Outfit (body)
  Background : oklch(11% 0.008 245) — deep editorial dark
  Accent     : oklch(52% 0.14 220) — teal (default; switchable via accent_hue)
*/

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

:root {
  --bg:            oklch(11%   0.008 245);
  --surface:       oklch(18%   0.012 245);
  --surface-2:     oklch(22%   0.012 245);
  --border:        oklch(28%   0.012 245);
  --text:          oklch(93%   0.006 75);
  --text-muted:    oklch(62%   0.008 75);
  --text-faint:    oklch(46%   0.008 75);
  --accent:        oklch(52%   0.14  220);
  --accent-dim:    color-mix(in oklch, var(--accent) 12%, transparent);
  --accent-border: color-mix(in oklch, var(--accent) 26%, transparent);
  --overlay:       oklch(0% 0 0 / 0.58);

  /* Ghost admin font settings (Design → Branding → Typography) feed --gh-font-* */
  --gh-font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --gh-font-body:    'Outfit', 'Helvetica Neue', Helvetica, sans-serif;
  --font-display: var(--gh-font-heading);
  --font-body:    var(--gh-font-body);
  --font-mono:    'Courier New', 'Courier', monospace;

  --max-w:       1280px;
  --content-w:   720px;
  --gutter:      clamp(20px, 4vw, 60px);
  --section-gap: clamp(56px, 9vw, 100px);

  --r-sm: 3px;
  --r:    6px;
  --r-lg: 14px;

  --ease:   cubic-bezier(0.25, 0.1, 0.25, 1);
  --t:      0.35s var(--ease);
  --t-fast: 0.15s var(--ease);

  --shadow-sm: 0 1px 4px oklch(0% 0 0 / 0.28);
  --shadow:    0 4px 20px oklch(0% 0 0 / 0.40);
  --shadow-lg: 0 12px 44px oklch(0% 0 0 / 0.54);

  color-scheme: dark;
}

/* Accent hue overrides — fed by the accent_hue custom setting (see default.hbs body class).
   Ghost passes the option label verbatim, so the class names match the title-case option values. */
body.accent-Terracotta { --accent: oklch(52% 0.14 28); }
body.accent-Indigo     { --accent: oklch(52% 0.14 270); }
body.accent-Sage       { --accent: oklch(52% 0.14 155); }
body.accent-Teal       { --accent: oklch(52% 0.14 220); }

html {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body { min-height: 100dvh; overflow-x: hidden; }
img  { display: block; max-width: 100%; object-fit: cover; }
a    { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font-body); }

/* ── LAYOUT ───────────────────────────────── */
.container         { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter); }
.content-container { max-width: var(--content-w); margin: 0 auto; padding: 0 var(--gutter); }

/* ── SCROLL PROGRESS ──────────────────────── */
.scroll-progress {
  position: fixed; top: 0; left: 0; width: 100%; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  z-index: 200; pointer-events: none; transition: transform 0.1s linear;
}

/* ── HEADER ───────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg); border-bottom: 1px solid transparent;
  transition: border-color var(--t), background var(--t);
}
.site-header.scrolled {
  border-bottom-color: var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }

.site-logo {
  display: flex; align-items: center; gap: 11px;
  background: none; border: none; padding: 0; color: var(--text);
  transition: opacity var(--t-fast); flex-shrink: 0;
}
.site-logo:hover { opacity: 0.65; }

.logo-mark {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; background: var(--text); color: var(--bg);
  font-size: 0.58rem; font-weight: 600; letter-spacing: 0.04em;
  border-radius: 2px; flex-shrink: 0; transition: background var(--t);
}
.logo-name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 400; letter-spacing: 0.03em; }

.logo-image {
  display: block;
  height: 32px;
  width: auto;
  max-width: clamp(120px, 22vw, 240px);
  object-fit: contain;
}

/* Ghost nav */
.site-nav { margin-left: auto; }
.site-nav .nav { display: flex; align-items: center; gap: 28px; list-style: none; }
.site-nav .nav-item a {
  position: relative; font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted);
  transition: color var(--t-fast); padding-bottom: 2px;
}
.site-nav .nav-item a::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 0; height: 1px; background: var(--text); transition: width var(--t-fast);
}
.site-nav .nav-item a:hover,
.site-nav .nav-item.nav-current a { color: var(--text); }
.site-nav .nav-item a:hover::after,
.site-nav .nav-item.nav-current a::after { width: 100%; }

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

/* ── HOME PAGE ────────────────────────────── */
.home-page { padding-top: clamp(32px, 5vw, 60px); padding-bottom: var(--section-gap); }
.featured-section { margin-bottom: var(--section-gap); }

.featured-post {
  display: grid; grid-template-columns: 3fr 2fr;
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow); transition: box-shadow var(--t), transform var(--t);
  min-height: clamp(320px, 50vw, 520px); color: var(--text);
}
.featured-post:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }

.featured-post__image { position: relative; overflow: hidden; }
.featured-post__image-inner { position: absolute; inset: 0; transition: transform 0.7s var(--ease); }
.featured-post:hover .featured-post__image-inner { transform: scale(1.04); }

.featured-post__content {
  position: relative;
  padding: clamp(24px, 3.5vw, 48px); background: var(--surface);
  display: flex; flex-direction: column; justify-content: flex-end; gap: 0;
  transition: background var(--t);
}

/* City-inspired: subtle dot grid on the featured panel — Tokyo planning docs / NYC street grid */
.featured-post__content::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, oklch(50% 0 0 / 0.055) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
  z-index: 0;
}
.featured-post__content > * { position: relative; z-index: 1; }

.featured-post__eyebrow {
  font-size: 0.65rem; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.featured-post__title {
  font-family: var(--font-display); font-size: clamp(2rem, 4vw, 4.4rem);
  font-weight: 700; line-height: 0.95; letter-spacing: -0.04em; margin-bottom: 8px;
}
.featured-post__excerpt {
  font-size: clamp(0.9rem, 1.4vw, 1.05rem); line-height: 1.72;
  color: var(--text-muted); margin-bottom: 24px; font-weight: 300;
}
.featured-post__cta {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.65rem; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); transition: gap var(--t-fast);
}
.featured-post:hover .featured-post__cta { gap: 12px; }

@media (max-width: 800px) {
  .featured-post { grid-template-columns: 1fr; }
  .featured-post__image { aspect-ratio: 16/9; }
  .featured-post__content { justify-content: flex-start; }
}

.grid-section { margin-bottom: var(--section-gap); }
.grid-header {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 28px;
}
.grid-label {
  font-size: 0.65rem; font-weight: 500; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-faint);
}
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2.5vw, 28px); }
@media (max-width: 900px) { .posts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .posts-grid { grid-template-columns: 1fr; } }

/* ── POST CARD ────────────────────────────── */
a.post-card {
  display: flex; flex-direction: column;
  border-radius: var(--r); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform var(--t), box-shadow var(--t); color: var(--text);
}
a.post-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

.post-card__image { aspect-ratio: 4/3; overflow: hidden; position: relative; flex-shrink: 0; }
.post-card__image-inner { position: absolute; inset: 0; transition: transform 0.7s var(--ease); }
a.post-card:hover .post-card__image-inner { transform: scale(1.05); }
.post-card__location-pin {
  position: absolute; top: 10px; right: 10px;
  font-size: 0.58rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: white; background: oklch(0% 0 0 / 0.44); backdrop-filter: blur(6px);
  padding: 4px 8px; border-radius: 3px;
}
.post-card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.post-card__tags { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.post-card__title {
  font-family: var(--font-display); font-size: clamp(1.4rem, 2.5vw, 1.75rem);
  font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 3px;
}

/* City-inspired: coordinate label on cards — Courier-mono, like a map annotation */
.post-card__coords {
  font-family: var(--font-mono);
  font-size: 0.58rem; letter-spacing: 0.06em;
  color: var(--text-faint); opacity: 0.8;
  margin-top: 2px; margin-bottom: 10px;
}

.post-card__subtitle {
  font-size: 0.75rem; font-weight: 300;
  color: var(--text-muted); letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.post-card__excerpt { font-size: 0.845rem; line-height: 1.68; color: var(--text-muted); margin-bottom: 14px; flex: 1; }
.post-card__meta { font-size: 0.65rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }

/* ── POST PAGE ────────────────────────────── */
.post-hero { height: clamp(320px, 56vh, 680px); position: relative; overflow: hidden; }
.post-hero__overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  justify-content: space-between; padding: 20px var(--gutter) clamp(32px, 5vw, 52px);
  background: linear-gradient(165deg, oklch(0% 0 0 / 0.28) 0%, transparent 38%, oklch(0% 0 0 / 0.58) 100%);
}
.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.65rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: oklch(93% 0 0 / 0.9); background: oklch(0% 0 0 / 0.28);
  border: 1px solid oklch(100% 0 0 / 0.22); padding: 8px 14px; border-radius: 40px;
  transition: all var(--t-fast); backdrop-filter: blur(6px); align-self: flex-start;
}
.back-btn:hover { background: oklch(100% 0 0 / 0.14); border-color: oklch(100% 0 0 / 0.4); }
.post-hero__country {
  font-size: 0.68rem; font-weight: 500; letter-spacing: 0.18em;
  text-transform: uppercase; color: oklch(85% 0 0 / 0.9);
}
.post-hero__title {
  font-family: var(--font-display); font-size: clamp(2.8rem, 7vw, 7rem);
  font-weight: 700; line-height: 0.9; color: white;
  text-shadow: 0 4px 24px oklch(0% 0 0 / 0.38); letter-spacing: -0.05em;
}

.post-article { padding: var(--section-gap) 0; }
.post-article__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 32px; }
.post-article__date { font-size: 0.65rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }
.post-article__content { font-size: clamp(1rem, 1.6vw, 1.1rem); line-height: 1.85; font-weight: 300; }
.post-article__content p + p { margin-top: 1.6em; }
.post-article__content h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 600; letter-spacing: -0.02em; margin: 2em 0 0.6em; }
.post-article__content h3 { font-family: var(--font-display); font-size: clamp(1.3rem, 2vw, 1.7rem); font-weight: 500; margin: 1.8em 0 0.5em; }
.post-article__content blockquote {
  margin: 2em 0; padding: 20px 28px; border-left: 3px solid var(--accent);
  font-family: var(--font-display); font-style: italic; font-size: 1.2em; color: var(--text-muted);
}
.post-article__content a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-border); }
.post-article__content a:hover { text-decoration-color: var(--accent); }

/* City-inspired: section eyebrow with a small + map-annotation mark */
.section-eyebrow {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.62rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 6px;
}
.section-eyebrow::before {
  content: '';
  display: inline-block;
  width: 10px; height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 1v8M1 5h8' stroke='currentColor' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: contain; background-repeat: no-repeat;
  opacity: 0.45; flex-shrink: 0;
}

.section-title { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 600; letter-spacing: -0.03em; color: var(--text); margin-bottom: 20px; }

.post-map { padding: var(--section-gap) 0; border-top: 1px solid var(--border); }
.post-map__coords {
  font-family: var(--font-mono);
  font-size: 0.72rem; letter-spacing: 0.06em;
  color: var(--text-faint); margin-bottom: 18px;
}
.map-embed { height: clamp(280px, 40vw, 460px); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }

/* ── KG CONTENT CARDS ─────────────────────── */
.kg-content > * + * { margin-top: 1.6em; }
.kg-image { max-width: 100%; height: auto; border-radius: var(--r); }
.kg-image-card { margin: 2em 0; }
.kg-image-card figcaption { margin-top: 10px; font-size: 0.8rem; color: var(--text-faint); text-align: center; letter-spacing: 0.03em; }

.kg-width-wide  { margin-left: calc(-1 * (var(--content-w) - 100%) / 2 + var(--gutter)); margin-right: calc(-1 * (var(--content-w) - 100%) / 2 + var(--gutter)); }
.kg-width-full  { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); border-radius: 0; }

/* Ghost Gallery Card — styled as masonry-style grid */
.kg-gallery-container { margin: 2em 0; }
.kg-gallery-row { display: flex; gap: 8px; margin-bottom: 8px; }
.kg-gallery-image { flex: 1; overflow: hidden; border-radius: var(--r-sm); }
.kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: var(--r-sm); transition: transform 0.6s var(--ease); }
.kg-gallery-image img:hover { transform: scale(1.03); }
.kg-gallery-container figcaption { font-size: 0.78rem; color: var(--text-faint); text-align: center; margin-top: 10px; letter-spacing: 0.03em; }

.kg-embed-card { margin: 2em 0; }
.kg-embed-card iframe { border-radius: var(--r); max-width: 100%; }

.kg-bookmark-card {
  margin: 2em 0; border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden; display: flex; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.kg-bookmark-card:hover { border-color: var(--accent-border); box-shadow: var(--shadow); }
.kg-bookmark-content { padding: 20px 24px; flex: 1; min-width: 0; }
.kg-bookmark-title { font-weight: 500; margin-bottom: 6px; font-size: 0.95rem; }
.kg-bookmark-description { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kg-bookmark-metadata { display: flex; align-items: center; gap: 8px; font-size: 0.72rem; color: var(--text-faint); }
.kg-bookmark-icon { width: 16px; height: 16px; border-radius: 2px; }
.kg-bookmark-thumbnail { width: 140px; flex-shrink: 0; }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; display: block; }

.kg-callout-card {
  display: flex; gap: 16px; padding: 20px 24px; margin: 2em 0;
  background: var(--surface); border-radius: var(--r); border: 1px solid var(--border);
}
.kg-callout-emoji { font-size: 1.4rem; line-height: 1; flex-shrink: 0; }
.kg-callout-text { font-size: 0.95rem; line-height: 1.7; }

.kg-toggle-card { margin: 2em 0; border: 1px solid var(--border); border-radius: var(--r); }
.kg-toggle-heading { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; cursor: pointer; user-select: none; gap: 16px; }
.kg-toggle-heading-text { font-weight: 500; }
.kg-toggle-content { padding: 0 20px 16px; font-size: 0.9rem; line-height: 1.7; color: var(--text-muted); }

.kg-divider-card { border: none; border-top: 1px solid var(--border); margin: 2.5em 0; }

.kg-button-card { margin: 2em 0; text-align: center; }
.kg-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 28px; font-size: 0.8rem; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; border-radius: var(--r); transition: all var(--t-fast);
}
.kg-btn.kg-btn-accent {
  background: var(--accent); color: white; border: 1px solid var(--accent);
}
.kg-btn.kg-btn-accent:hover { background: oklch(from var(--accent) calc(l - 0.05) c h); }

/* ── POST NAVIGATION ──────────────────────── */
.post-nav { padding: var(--section-gap) 0; border-top: 1px solid var(--border); }
.post-nav__inner { display: flex; align-items: stretch; justify-content: space-between; gap: 24px; }
.post-nav__link { display: flex; flex-direction: column; gap: 6px; max-width: 45%; transition: color var(--t-fast); }
.post-nav__link:hover { color: var(--accent); }
.post-nav__label { font-size: 0.62rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); }
.post-nav__title { font-family: var(--font-display); font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 500; line-height: 1.2; }
.post-nav__link--next { text-align: right; margin-left: auto; }

/* ── PAGINATION ───────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: var(--section-gap); padding-top: clamp(32px, 4vw, 48px);
  border-top: 1px solid var(--border);
}
.pagination a, .pagination .page-number {
  font-size: 0.68rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted); padding: 8px 16px; border: 1px solid var(--border);
  border-radius: 40px; transition: all var(--t-fast);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .page-number { border-color: transparent; color: var(--text-faint); }

/* ── TAG PAGE ─────────────────────────────── */
.tag-header { margin-bottom: var(--section-gap); }
.tag-hero { width: 100%; aspect-ratio: 21/9; border-radius: var(--r-lg); margin-bottom: clamp(28px, 4vw, 44px); overflow: hidden; }
.tag-header__desc { font-size: 1rem; line-height: 1.7; color: var(--text-muted); margin-top: 12px; max-width: 580px; }
.tag-header__count { margin-top: 16px; }

/* ── SHARED COMPONENTS ────────────────────── */
.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  font-size: 0.6rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-dim); border: 1px solid var(--accent-border);
  border-radius: var(--r-sm); transition: background var(--t-fast); white-space: nowrap;
}
a.tag:hover { background: color-mix(in oklch, var(--accent) 22%, transparent); }

.photo-placeholder { position: relative; overflow: hidden; }

/* ── FOOTER ───────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border); padding: clamp(28px, 4vw, 44px) 0;
  background: var(--bg); transition: background var(--t);
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.footer-copy { font-size: 0.72rem; color: var(--text-faint); letter-spacing: 0.04em; }
.footer-links .nav { display: flex; gap: 24px; list-style: none; }
.footer-links .nav-item a {
  font-size: 0.65rem; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-faint); transition: color var(--t-fast);
}
.footer-links .nav-item a:hover { color: var(--text); }

/* ── LEAFLET OVERRIDES ────────────────────── */
.leaflet-container { font-family: var(--font-body) !important; background: var(--surface) !important; }
.leaflet-control-attribution {
  font-size: 0.6rem !important; background: color-mix(in srgb, var(--bg) 88%, transparent) !important;
  color: var(--text-faint) !important; backdrop-filter: blur(4px);
}
.leaflet-control-attribution a { color: var(--text-muted) !important; }
.leaflet-bar a { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
.leaflet-bar a:hover { background: var(--surface-2) !important; }

/* ── ANIMATIONS ───────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeIn 0.55s cubic-bezier(0.25, 0.1, 0.25, 1) both; }
