/* Vinsman — a quiet travel journal. Warm paper, soft cards, one muted accent. */

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

:root {
  --bg:          #f6f3ee;
  --card:        #fffdfa;
  --ink:         #2f2b27;
  --ink-soft:    #4a443e;
  --muted:       #756d63;
  --line:        #e8e1d6;
  --accent:      #93392d;
  --accent-soft: #f1e4df;

  --font-display: 'Fraunces Variable', Georgia, 'Times New Roman', serif;
  --font-body:    'Figtree Variable', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --max-width:  1120px;
  --post-width: 680px;
  --radius:     16px;
  --shadow:       0 1px 2px rgba(74, 55, 36, 0.05), 0 10px 30px -14px rgba(74, 55, 36, 0.18);
  --shadow-hover: 0 2px 4px rgba(74, 55, 36, 0.06), 0 20px 40px -16px rgba(74, 55, 36, 0.28);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow a { color: inherit; }

/* ── Header ── */
.site-header { padding: 1.9rem 0 1.4rem; }
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  position: relative;
}
.brand { display: flex; flex-direction: column; gap: 0.2rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.site-title {
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 100;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.05;
}
.site-tagline { font-size: 0.95rem; color: var(--muted); }

/* ── Navigation ── */
.nav-list { list-style: none; display: flex; align-items: center; gap: 0.2rem; }
.nav-list li { position: relative; }
.nav-list a {
  display: block;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.96rem;
  font-weight: 500;
  color: var(--ink);
  transition: background 0.15s, color 0.15s;
}
.nav-list a:hover,
.nav-list a:focus-visible { background: rgba(147, 57, 45, 0.08); color: var(--accent); text-decoration: none; }

.has-dropdown > a::after {
  content: '';
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  margin-left: 0.5em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.15em) rotate(45deg);
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 230px;
  padding: 0.4rem;
  list-style: none;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow-hover);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  z-index: 50;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown { opacity: 1; visibility: visible; transform: none; }
.dropdown a { border-radius: 10px; font-size: 0.93rem; padding: 0.55rem 0.8rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.6rem;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }

@media (max-width: 768px) {
  .site-title { font-size: 1.7rem; }
  .nav-toggle { display: flex; }
  .nav-list {
    display: none;
    position: absolute;
    top: calc(100% + 0.6rem);
    left: 1.5rem;
    right: 1.5rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    z-index: 50;
  }
  .nav-list.open { display: flex; }
  .nav-list a { border-radius: 10px; padding: 0.7rem 0.9rem; }
  .dropdown {
    position: static;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    padding: 0 0 0.25rem 0.9rem;
    background: none;
  }
  .has-dropdown:hover .dropdown, .has-dropdown:focus-within .dropdown { display: none; }
  .has-dropdown.open .dropdown { display: block; }
}

/* ── Layout ── */
main { min-height: 60vh; }
.page-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1.5rem 4.5rem;
}

/* ── Post listing ── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  margin-bottom: 3.25rem;
}
@media (max-width: 980px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .post-grid { grid-template-columns: 1fr; gap: 1.25rem; } }

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.9rem 1.75rem;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: rise 0.6s ease both;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.post-grid > :nth-child(2) { animation-delay: 70ms; }
.post-grid > :nth-child(3) { animation-delay: 140ms; }
.post-grid > :nth-child(4) { animation-delay: 210ms; }
.post-grid > :nth-child(5) { animation-delay: 280ms; }
.post-grid > :nth-child(6) { animation-delay: 350ms; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.post-card-cat {
  align-self: flex-start;
  position: relative;
  z-index: 2;
  margin-bottom: 0.95rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.post-card-title {
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 100;
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.6rem;
}
.post-card-title a { color: var(--ink); }
.post-card-title a:hover { text-decoration: none; }
/* Stretch the title link over the whole card so the entire card is clickable */
.post-card-title a::after { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius); }

.post-card-date { font-size: 0.86rem; color: var(--muted); margin-bottom: 1.05rem; }
.post-card-excerpt {
  flex: 1;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-more {
  display: inline-flex;
  gap: 0.45rem;
  margin-top: 1.4rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}
.post-card-more .arrow { transition: transform 0.2s ease; }
.post-card:hover .post-card-more { color: var(--accent); }
.post-card:hover .post-card-more .arrow { transform: translateX(4px); }

/* ── Category / archive header ── */
.archive-header { margin: 0.5rem 0 2.25rem; }
.archive-title {
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 100;
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0.35rem 0 0.25rem;
}
.archive-count { color: var(--muted); font-size: 0.95rem; }

/* ── Pagination ── */
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.35rem; }
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.9rem;
  border-radius: 999px;
  font-size: 0.95rem;
  color: var(--ink);
}
.pagination a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.pagination .current { background: var(--ink); color: var(--bg); font-weight: 600; }
.pagination .dots { color: var(--muted); min-width: 1.5rem; padding: 0; }

/* ── Single post ── */
.post-header, .post-body, .post-nav { max-width: var(--post-width); margin-left: auto; margin-right: auto; }
.post-header { margin-top: 0.75rem; margin-bottom: 2.5rem; }
.post-title {
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 100;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0.6rem 0 0.9rem;
}
.post-meta { display: block; font-size: 0.92rem; color: var(--muted); }

.post-body { font-size: 1.1rem; line-height: 1.85; }
.post-body p { margin-bottom: 1.4em; }
.post-body h2, .post-body h3 {
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 100;
  font-weight: 500;
  line-height: 1.25;
  margin: 2em 0 0.6em;
}
.post-body ul, .post-body ol { margin: 0.75em 0 1.4em 1.5em; }
.post-body li { margin-bottom: 0.35em; }
.post-body blockquote {
  margin: 1.75em 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--accent-soft);
  color: var(--ink-soft);
  font-style: italic;
}
.post-body a { text-decoration: underline; text-decoration-color: rgba(147, 57, 45, 0.35); text-underline-offset: 3px; }
.post-body a:hover { text-decoration-color: currentColor; }
.post-body img {
  margin: 2rem auto;
  border-radius: 12px;
  box-shadow: var(--shadow);
}
/* An italic line right after a photo reads as its caption */
.post-body p:has(img) + p:has(> em:only-child) {
  margin-top: -1rem;
  text-align: center;
  font-size: 0.92rem;
  color: var(--muted);
}
.post-body hr { border: none; border-top: 1px solid var(--line); margin: 2.5em 0; }

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.post-nav a {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.1rem 1.3rem;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.post-nav a:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.post-nav .next { grid-column: 2; text-align: right; }
.post-nav-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.post-nav-title { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.3; }
@media (max-width: 640px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { grid-column: 1; }
}

/* ── Pages (About, Resources) ── */
.page-content { max-width: var(--post-width); margin: 0.75rem auto 0; font-size: 1.08rem; line-height: 1.8; }
.page-title {
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 100;
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-bottom: 1.5rem;
}
.page-content h2 {
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 100;
  font-size: 1.4rem;
  font-weight: 500;
  margin: 2.25rem 0 0.6rem;
}
.page-content p { margin-bottom: 1.25em; }
.page-content ul { margin: 0 0 1.25em 1.25rem; }
.page-content li { margin-bottom: 0.5em; }
.page-content a { text-decoration: underline; text-decoration-color: rgba(147, 57, 45, 0.35); text-underline-offset: 3px; }
.page-content a:hover { text-decoration-color: currentColor; }
.page-content img { border-radius: 12px; margin: 1.5rem 0; }

/* ── Footer ── */
.site-footer {
  padding: 2rem 1rem 2.5rem;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.86rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .post-card, .post-nav a, .dropdown { animation: none; transition: none; }
  .post-card:hover, .post-nav a:hover { transform: none; }
}
