/* =========================================
   THE MARGIN — Blog Stylesheet
   Aesthetic: Editorial / Literary Magazine
   ========================================= */

:root {
  --cream: #F6F1E9;
  --ink: #1C1A17;
  --ink-light: #4A4540;
  --ink-faint: #9A9088;
  --accent: #B85C38;
  --accent-warm: #E8956D;
  --rule: #D6CFC4;
  --card-bg: #FDFAF5;
  --ff-display: 'Playfair Display', Georgia, serif;
  --ff-body: 'Source Serif 4', Georgia, serif;
  --max-width: 1100px;
  --reading-width: 680px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--ff-body);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

/* ---- HEADER ---- */

.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 0 clamp(1.5rem, 5vw, 4rem);
}

.header-inner { max-width: var(--max-width); margin: 0 auto; }

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.header-nav { display: flex; gap: 2rem; }
.header-nav a {
  transition: color 0.2s;
  font-family: var(--ff-body);
  font-weight: 300;
}
.header-nav a:hover { color: var(--accent); }

.masthead {
  text-align: center;
  padding: 2.5rem 0 2rem;
}

.site-title {
  font-family: var(--ff-display);
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 0.95;
  color: var(--ink);
  animation: titleDrop 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.site-tagline {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  color: var(--ink-faint);
  margin-top: 0.75rem;
  animation: fadeUp 0.8s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.header-rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0;
  margin-bottom: -1px;
  animation: fadeUp 0.6s 0.4s ease both;
}

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

.rule-dot {
  color: var(--accent);
  font-size: 0.6rem;
  line-height: 1;
}

/* ---- MAIN ---- */

.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
}

/* ---- FEATURED POST ---- */

.featured-section {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--rule);
}

.featured-post {
  display: block;
  max-width: 780px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.featured-post.visible { opacity: 1; transform: none; }

.featured-label {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
  font-family: var(--ff-body);
}

.featured-title {
  font-family: var(--ff-display);
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 1rem;
  transition: color 0.2s;
}
.featured-post:hover .featured-title { color: var(--accent); }

.featured-excerpt {
  font-size: 1.1rem;
  color: var(--ink-light);
  max-width: 600px;
  margin-bottom: 1.5rem;
}

.featured-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.8rem;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
}

/* ---- POSTS GRID ---- */

.posts-section { padding: 4rem 0; }

.section-heading {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

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

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5px;
  border: 1.5px solid var(--rule);
}

.post-card {
  display: flex;
  gap: 1rem;
  padding: 2rem;
  background: var(--card-bg);
  border: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease, background 0.2s;
}
.post-card.visible { opacity: 1; transform: none; }
.post-card:hover { background: #FFFCF6; }
.post-card--placeholder { opacity: 0.45 !important; pointer-events: none; }
.post-card--placeholder.visible { opacity: 0.45 !important; }

.card-number {
  font-family: var(--ff-display);
  font-size: 0.7rem;
  color: var(--rule);
  letter-spacing: 0.05em;
  padding-top: 0.2rem;
  flex-shrink: 0;
  transition: color 0.2s;
}
.post-card:hover .card-number { color: var(--accent-warm); }

.card-body { flex: 1; }

.card-date {
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.card-title {
  font-family: var(--ff-display);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 0.6rem;
  transition: color 0.2s;
}
.post-card:hover .card-title { color: var(--accent); }

.card-excerpt {
  font-size: 0.9rem;
  color: var(--ink-light);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.card-link {
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  font-family: var(--ff-body);
}

/* ---- ABOUT ---- */

.about-section {
  border-top: 1px solid var(--rule);
  padding: 4rem 0 5rem;
}

.about-inner {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 3rem;
  max-width: 780px;
}

.about-label {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 0.4rem;
}

.about-name {
  font-family: var(--ff-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.about-content p {
  color: var(--ink-light);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.about-content a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-warm);
  transition: border-color 0.2s;
}

/* ---- FOOTER ---- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem clamp(1.5rem, 5vw, 4rem);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.footer-title {
  font-family: var(--ff-display);
  font-weight: 700;
  color: var(--ink);
  font-size: 1rem;
}

/* ---- POST PAGE STYLES ---- */

.post-header {
  padding: 4rem clamp(1.5rem, 5vw, 4rem) 0;
  max-width: calc(var(--reading-width) + 8rem);
  margin: 0 auto;
}

.post-header .back-link {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 3rem;
  transition: color 0.2s;
}
.post-header .back-link:hover { color: var(--accent); }

.post-header .post-category {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.post-header h1 {
  font-family: var(--ff-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  max-width: 780px;
  margin-bottom: 1.5rem;
}

.post-header .post-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin-bottom: 0;
}

.post-divider {
  border: none;
  border-top: 1px solid var(--rule);
  max-width: calc(var(--reading-width) + 8rem);
  margin: 2.5rem auto;
}

.post-body {
  max-width: var(--reading-width);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 4rem) 6rem;
}

.post-body p {
  margin-bottom: 1.6rem;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--ink-light);
}
.post-body p:first-child { color: var(--ink); }

.post-body h2 {
  font-family: var(--ff-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  margin: 2.5rem 0 1rem;
}

.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--ink);
}

/* ---- ANIMATIONS ---- */

@keyframes titleDrop {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: none; }
}

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

/* ---- RESPONSIVE ---- */

@media (max-width: 600px) {
  .header-top { flex-direction: column; gap: 0.5rem; text-align: center; }
  .about-inner { grid-template-columns: 1fr; gap: 0.5rem; }
  .about-label { padding-top: 0; }
  .footer-inner { flex-direction: column; gap: 0.5rem; text-align: center; }
}
