@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Karla:wght@300;400;500;600&display=swap');

:root {
  --bg: #f6f3ee;
  --bg-warm: #eee9e0;
  --surface: #ffffff;
  --text: #2a2520;
  --text-secondary: #6b6259;
  --text-dim: #a39a8e;
  --accent: #8b6914;
  --accent-light: #c4a44e;
  --border: #ddd6cb;
  --border-light: #e8e3da;
  --shadow: rgba(42, 37, 32, 0.06);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Karla', -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Grain texture ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ── Header ── */
.site-header {
  padding: 48px 0 0;
  margin-bottom: 48px;
}

.header-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--text);
  text-decoration: none;
  text-transform: lowercase;
}

.site-title:hover { color: var(--accent); }

.site-nav {
  display: flex;
  gap: 28px;
  align-items: baseline;
}

.site-nav a {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.site-nav a:hover { color: var(--accent); }

.site-tagline {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 300;
  font-style: italic;
  color: var(--text-dim);
  margin-top: 16px;
}

/* ── Hero / Featured Post ── */
.hero {
  margin-bottom: 56px;
}

.hero-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 1px 3px var(--shadow), 0 8px 32px var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.3s, transform 0.3s;
}

.hero-card:hover {
  box-shadow: 0 2px 6px var(--shadow), 0 12px 40px rgba(42, 37, 32, 0.1);
  transform: translateY(-2px);
}

.hero-image {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
}

.hero-content {
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.hero-excerpt {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

.hero-date {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

/* ── Section Headers ── */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 28px;
}

.section-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Post Grid ── */
.posts-section {
  margin-bottom: 56px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.post-card {
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 1px 2px var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.25s, transform 0.25s;
}

.post-card:hover {
  box-shadow: 0 4px 20px rgba(42, 37, 32, 0.1);
  transform: translateY(-3px);
}

.post-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  background: var(--bg-warm);
}

.post-card-placeholder {
  width: 100%;
  height: 200px;
  background: var(--bg-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-family: var(--serif);
  font-size: 28px;
  font-style: italic;
}

.post-card-body {
  padding: 20px;
}

.post-card-category {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.post-card-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 10px;
}

.post-card-excerpt {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-date {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

/* ── Pages Section ── */
.pages-section {
  margin-bottom: 56px;
}

.page-list {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.page-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  transition: all 0.2s;
}

.page-link:hover {
  border-color: var(--accent-light);
  color: var(--accent);
  box-shadow: 0 2px 8px var(--shadow);
}

.page-link-arrow {
  font-size: 12px;
  color: var(--text-dim);
  transition: transform 0.2s;
}

.page-link:hover .page-link-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

/* ── Password Protection ── */
.locked { position: relative; }
.post-card.locked a { pointer-events: none; }
.post-card.locked .post-card-image,
.post-card.locked .post-card-placeholder { filter: blur(4px); opacity: 0.5; }

.nav-locked {
  opacity: 0.6;
  cursor: default;
}

.pw-overlay {
  margin-top: 16px;
}

.pw-overlay-card {
  margin-top: 12px;
}

.pw-form, .pw-form-inline {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pw-form input {
  font-family: var(--sans);
  font-size: 13px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  width: 160px;
  transition: border-color 0.2s;
}

.pw-form input:focus { border-color: var(--accent); }
.pw-form input.pw-error { border-color: #c44; }

.pw-form button {
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.pw-form button:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.pw-icon {
  font-size: 16px;
  margin-right: 4px;
}

.pw-form-inline {
  margin-top: 8px;
}

.pw-form-inline input { width: 120px; font-size: 12px; padding: 6px 10px; }
.pw-form-inline button { font-size: 12px; padding: 6px 10px; }

.page-link.locked {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  cursor: default;
}

.page-link.locked:hover {
  border-color: var(--border-light);
  color: var(--text);
  box-shadow: none;
}

.post-card-title a {
  color: inherit;
  text-decoration: none;
}

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

/* ── Footer ── */
.site-footer {
  padding: 32px 0;
  margin-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-text {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

/* ── Animations ── */
.fade-up {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.5s ease-out forwards;
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.hero { animation-delay: 0.1s; }
.posts-section { animation-delay: 0.2s; }
.pages-section { animation-delay: 0.3s; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .site-header { padding: 32px 0 0; margin-bottom: 32px; }

  .header-inner {
    flex-direction: column;
    gap: 16px;
  }

  .site-nav { gap: 20px; }

  .hero-card {
    grid-template-columns: 1fr;
  }

  .hero-image { min-height: 240px; }
  .hero-content { padding: 28px 24px; }
  .hero-title { font-size: 26px; }

  .post-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .post-card-image, .post-card-placeholder { height: 180px; }

  .section-header { margin-bottom: 20px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .site-title { font-size: 26px; }
  .site-nav { gap: 16px; }
  .site-nav a { font-size: 12px; }
  .hero-content { padding: 24px 20px; }
  .hero-title { font-size: 22px; }
  .page-list { flex-direction: column; }
  .page-link { width: 100%; }
}
