/* Latchly Blog — warm, soft, mom-friendly */

:root {
  --pink: #E09AAA;
  --pink-dark: #C27785;
  --pink-light: #F5D8DE;
  --pink-pale: #FCEEF1;
  --cream: #FAF8F5;
  --cream-warm: #FFF9F7;
  --ink: #2D1F23;
  --ink-soft: #4A3540;
  --muted: #8A7380;
  --white: #FFFFFF;
  --shadow-sm: 0 2px 8px rgba(194, 119, 133, 0.08);
  --shadow-md: 0 8px 24px rgba(194, 119, 133, 0.12);
  --shadow-lg: 0 16px 48px rgba(194, 119, 133, 0.16);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --font: 'Nunito', -apple-system, BlinkMacSystemFont, 'SF Pro Rounded', 'Segoe UI', sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--pink-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ----- Layout ----- */

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-wide {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

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

.site-header {
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 10;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.35s ease, border-bottom-color 0.35s ease;
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(250, 248, 245, 0.55);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: -1;
}

.site-header.scrolled::before {
  opacity: 1;
}

.site-header.scrolled {
  border-bottom-color: rgba(224, 154, 170, 0.1);
}

.site-header .container-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.logo::before {
  content: "🌸";
  margin-right: 6px;
}

.site-nav { display: flex; gap: 24px; align-items: center; }
.site-nav a { color: var(--ink-soft); font-weight: 600; font-size: 15px; }
.site-nav a.nav-cta {
  background: var(--pink);
  color: var(--white);
  padding: 10px 18px;
  border-radius: 999px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.site-nav a.nav-cta:hover { background: var(--pink-dark); text-decoration: none; transform: translateY(-1px); }

/* ----- Hero ----- */

.post-hero {
  width: 100%;
  height: 54vw;
  max-height: 480px;
  min-height: 240px;
  background: linear-gradient(135deg, var(--pink-light) 0%, var(--pink) 100%);
  background-size: cover;
  background-position: center;
  margin-bottom: 40px;
}

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

.post {
  padding-bottom: 80px;
}

.post h1 {
  font-size: clamp(32px, 6vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 20px;
}

.post-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }

.post-content {
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink-soft);
}

.post-content > * + * { margin-top: 1.4em; }

.post-content h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
  margin-top: 2.2em;
  letter-spacing: -0.01em;
}

.post-content h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin-top: 2em;
}

.post-content p { font-size: 18px; }

.post-content ul, .post-content ol {
  padding-left: 1.4em;
}

.post-content li { margin-top: 0.5em; }

.post-content blockquote {
  border-left: 4px solid var(--pink);
  padding: 8px 0 8px 20px;
  font-style: italic;
  color: var(--ink-soft);
  background: var(--pink-pale);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
}

.post-content a { color: var(--pink-dark); border-bottom: 1px solid var(--pink-light); }
.post-content a:hover { text-decoration: none; border-bottom-color: var(--pink-dark); }

.post-content strong { color: var(--ink); font-weight: 700; }

.post-content code {
  background: var(--pink-pale);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ----- TL;DR block ----- */

.tldr {
  background: var(--pink-pale);
  border-left: 4px solid var(--pink);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 20px 24px 22px 24px;
  margin: 32px 0 40px 0;
}

.tldr-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--pink-dark);
  margin-bottom: 8px;
}

.tldr p {
  font-size: 17px !important;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 !important;
}

/* ----- Post figures (inline images with captions) ----- */

.post-content figure.post-figure {
  display: block;
  margin-top: 64px !important;
  margin-bottom: 72px !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding: 0 !important;
}

.post-content figure.post-figure img {
  width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
  box-shadow: var(--shadow-md);
  margin: 0 !important;
}

.post-content figure.post-figure figcaption {
  display: block;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  margin-top: 18px !important;
  margin-bottom: 0 !important;
  margin-left: auto;
  margin-right: auto;
  font-style: italic;
  padding: 0 20px;
  line-height: 1.55;
  max-width: 560px;
}

/* ----- FAQ section ----- */

.faq {
  padding: 96px 0 96px 0;
  background: linear-gradient(180deg, var(--cream) 0%, var(--pink-pale) 100%);
}

.faq .container {
  max-width: 760px;
}

.faq-header {
  text-align: center;
  margin-bottom: 48px;
}

.faq h2 {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 12px;
  text-align: center;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.faq-intro {
  text-align: center;
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 40px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  background: var(--white);
  border: 1px solid rgba(194, 119, 133, 0.12);
  border-radius: var(--radius-md);
  padding: 0;
  overflow: hidden;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.faq-item:hover {
  border-color: rgba(194, 119, 133, 0.28);
  box-shadow: var(--shadow-sm);
}

.faq-item[open] {
  box-shadow: var(--shadow-md);
  border-color: var(--pink);
  background: var(--white);
}

.faq-question {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  padding: 24px 64px 24px 28px;
  cursor: pointer;
  list-style: none;
  position: relative;
  line-height: 1.4;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.faq-item[open] .faq-question {
  color: var(--pink-dark);
  padding-bottom: 12px;
}

.faq-question::-webkit-details-marker { display: none; }

.faq-question::after {
  content: "";
  position: absolute;
  right: 28px;
  top: 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pink-pale);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23C27785' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.25s ease;
}

.faq-item[open] .faq-question::after {
  background-color: var(--pink);
  transform: rotate(45deg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
}

.faq-answer {
  padding: 4px 28px 28px 28px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.75;
}

.faq-answer p {
  margin-top: 0.8em;
  font-size: 16px !important;
}
.faq-answer p:first-child { margin-top: 0; }
.faq-answer ul, .faq-answer ol { margin-top: 0.8em; padding-left: 1.4em; }
.faq-answer li { margin-top: 0.4em; }
.faq-answer a {
  color: var(--pink-dark);
  border-bottom: 1px solid var(--pink-light);
}
.faq-answer strong { color: var(--ink); font-weight: 700; }

@media (max-width: 640px) {
  .faq { padding: 64px 0 64px 0; }
  .faq-question { padding: 20px 56px 20px 22px; font-size: 16px; }
  .faq-question::after { right: 22px; top: 22px; width: 24px; height: 24px; }
  .faq-answer { padding: 4px 22px 22px 22px; font-size: 15px; }
  .faq-answer p { font-size: 15px !important; }
}

/* ----- Mid-article CTA ----- */

.cta-box {
  background: linear-gradient(135deg, var(--pink-pale) 0%, var(--pink-light) 100%);
  border-radius: var(--radius-md);
  padding: 32px;
  margin: 48px 0 !important;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(194, 119, 133, 0.1);
}

.cta-box h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 12px 0 !important;
  line-height: 1.3;
}

.cta-box p {
  font-size: 16px;
  color: var(--ink-soft);
  margin: 0 0 20px 0 !important;
}

.cta-btn {
  display: inline-block;
  background: var(--pink);
  color: var(--white) !important;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  border: none !important;
  transition: transform 0.15s ease, background 0.15s ease;
  box-shadow: 0 4px 12px rgba(224, 154, 170, 0.3);
}

.cta-btn:hover {
  background: var(--pink-dark);
  text-decoration: none !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(194, 119, 133, 0.4);
}

/* ----- Footer CTA ----- */
/*
 * Flows continuously from the FAQ section above.
 * FAQ gradient ends at pink-pale; this starts at pink-pale and
 * continues to pink-light, so they read as one smooth gradient
 * with no seam. No margin-top — any gap breaks the flow.
 */

.footer-cta {
  background: linear-gradient(180deg, var(--pink-pale) 0%, var(--pink-light) 100%);
  padding: 96px 0 112px 0;
  text-align: center;
}

.footer-cta h2 {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 16px;
}

.footer-cta p {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 0 auto 32px auto;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .footer-cta { padding: 72px 0 88px 0; }
}

/* ----- Related posts ----- */

.related {
  padding: 80px 0;
  background: var(--cream-warm);
}

.related h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 32px;
  text-align: center;
  letter-spacing: -0.01em;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.related-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: block;
  color: var(--ink) !important;
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  text-decoration: none !important;
}

.related-card-hero {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--pink-light), var(--pink));
  background-size: cover;
  background-position: center;
}

.related-card-body { padding: 20px 24px 24px 24px; }
.related-card h3 { font-size: 18px; font-weight: 800; line-height: 1.3; color: var(--ink); }
.related-card p { font-size: 14px; color: var(--muted); margin-top: 8px; }

/* ----- Homepage (index) ----- */

.home-hero {
  background: linear-gradient(180deg, var(--pink-pale) 0%, var(--cream) 100%);
  padding: 80px 0 60px 0;
  text-align: center;
}

.home-hero h1 {
  font-size: clamp(36px, 7vw, 56px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 16px;
}

.home-hero p {
  font-size: 20px;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.5;
}

.post-list {
  padding: 60px 0 80px 0;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
}

.post-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: block;
  color: var(--ink) !important;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  text-decoration: none !important;
}

.post-card-hero {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--pink-light), var(--pink));
  background-size: cover;
  background-position: center;
}

.post-card-body { padding: 24px 28px 28px 28px; }

.post-card h2 {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.post-card p {
  font-size: 15px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.55;
}

.post-card .post-meta {
  margin-top: 16px;
  margin-bottom: 0;
  font-size: 13px;
}

/* ----- Site footer ----- */

.site-footer {
  padding: 40px 0;
  text-align: center;
  background: var(--cream-warm);
  border-top: 1px solid var(--pink-pale);
  font-size: 14px;
  color: var(--muted);
}

.site-footer a { color: var(--muted); }

/* ----- Responsive ----- */

@media (max-width: 640px) {
  body { font-size: 17px; }
  .site-header { padding: 14px 0; }
  .logo { font-size: 20px; }
  .site-nav { gap: 14px; }
  .site-nav a:not(.nav-cta) { display: none; }
  .post-content { font-size: 17px; }
  .post-content p { font-size: 17px; }
  .cta-box { padding: 24px 20px; }
  .home-hero { padding: 50px 0 40px 0; }
  .footer-cta { padding: 60px 0; }
  .related { padding: 60px 0; }
}
