/* ═══════════════════════════════════════════════════════════════
   Crezia Moms — Article Shared Stylesheet
   Same typefaces as the main app: Quicksand + Inter
   ═══════════════════════════════════════════════════════════════ */

/* Mirrors globals.css line 1 — identical fonts, no jarring switch */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@500;600;700;800&family=Inter:wght@400;500;600&display=swap');

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

/* ── Brand tokens ──────────────────────────────────────────────── */
:root {
  --coral:       #F89C74;
  --coral-dark:  #C96B3A;
  --turquoise:   #56CFD3;
  --lavender:    #D090E7;
  --green:       #B4D44A;

  --accent:      var(--coral);
  --accent-dark: var(--coral-dark);
  --accent-tint: #FDE8DC;

  /* Warm neutrals */
  --bark:   #2D1B00;
  --mid:    #7A5230;
  --cream:  #FEF9F5;
  --blush:  #FDE8DC;
  --sand:   #FEF4ED;

  /* Typography — identical to main app */
  --font-heading: 'Quicksand', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;

  --prose-width: 780px;
}

/* ── Base ──────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--bark);
  line-height: 1.75;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

/* ── Article wrapper ───────────────────────────────────────────── */
.article-wrapper {
  max-width: var(--prose-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

.article-section {
  margin-bottom: 4rem;
}

/* ── Article header ────────────────────────────────────────────── */
.article-header {
  margin-bottom: 2.5rem;
}

.article-header .article-tag {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .3rem .9rem;
  border-radius: 2rem;
  margin-bottom: 1.1rem;
}

/* Section headline — Quicksand, same as page-header-title */
.article-header h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 900;
  line-height: 1.15;
  color: var(--bark);
  margin-bottom: 1rem;
  letter-spacing: -.02em;
}

/* Pull quote / subtitle — Inter italic, top border accent */
.article-header .subtitle {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--mid);
  font-style: italic;
  background: var(--sand);
  border-top: 3px solid var(--coral);
  border-radius: 0 0 10px 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  line-height: 1.65;
}

/* ── Article meta (author + date) ─────────────────────────────── */
.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.article-meta .author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--blush);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  border: 2px solid rgba(248,156,116,.25);
}

.article-meta-text {
  font-family: var(--font-body);
  font-size: .88rem;
}

.article-meta-text strong {
  display: block;
  color: var(--bark);
  font-weight: 600;
}

.article-meta-text span {
  color: var(--mid);
  font-size: .82rem;
}

/* ── Article hero image ────────────────────────────────────────── */
.article-hero-img {
  width: 100%;
  border-radius: 16px;
  margin-bottom: 2.5rem;
  object-fit: cover;
  max-height: 420px;
  box-shadow: 0 8px 32px rgba(45,27,0,.1);
}

.article-hero-placeholder {
  width: 100%;
  border-radius: 16px;
  margin-bottom: 2.5rem;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  background: var(--blush);
}

/* ── Body prose — Inter for readability ────────────────────────── */
.article-body {
  font-family: var(--font-body);
  font-size: 1.02rem;
  color: #3a2820;
  line-height: 1.8;
}

/* Section subheadings — Quicksand, mirrors hub-section-title */
.article-body h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  font-weight: 800;
  color: var(--bark);
  margin: 2.5rem 0 .9rem;
  letter-spacing: -.015em;
}

.article-body h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--bark);
  margin: 1.75rem 0 .5rem;
}

.article-body p { margin-bottom: 1.4rem; }

.article-body ul,
.article-body ol {
  margin: 0 0 1.4rem 1.6rem;
}

.article-body li { margin-bottom: .55rem; }

.article-body strong { color: var(--coral-dark); }

.article-body a {
  color: var(--coral-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Highlight box ─────────────────────────────────────────────── */
.highlight-box {
  background: var(--sand);
  border: 1px solid rgba(248,156,116,.25);
  border-top: 3px solid var(--coral);
  border-radius: 0 0 12px 12px;
  padding: 1.25rem 1.5rem;
  margin: 2.25rem 0;
  font-family: var(--font-body);
  font-size: .97rem;
  line-height: 1.7;
}

.highlight-box .highlight-label {
  font-family: var(--font-heading);
  font-weight: 800;
  text-transform: uppercase;
  font-size: .68rem;
  letter-spacing: .1em;
  color: var(--coral-dark);
  margin-bottom: .5rem;
}

/* ── Stat callout ──────────────────────────────────────────────── */
.stat-callout {
  text-align: center;
  background: linear-gradient(135deg, #0D2E30 0%, #1a5a5f 55%, #2a8a8f 100%);
  color: #fff;
  border-radius: 20px;
  padding: 2.5rem 1.5rem;
  margin: 3rem 0;
  box-shadow: 0 12px 32px rgba(13,46,48,.2);
}

.stat-callout .stat-number {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 8vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
  color: #a8eced;
}

.stat-callout .stat-desc {
  font-family: var(--font-body);
  font-size: 1rem;
  opacity: .9;
  margin-top: .5rem;
  line-height: 1.5;
}

.stat-callout .stat-source {
  font-family: var(--font-body);
  font-size: .72rem;
  opacity: .55;
  margin-top: .6rem;
}

/* ── Tips grid ─────────────────────────────────────────────────── */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.1rem;
  margin: 2.25rem 0;
}

.tip-card {
  background: var(--blush);
  border-radius: 14px;
  padding: 1.25rem 1.1rem;
  border: 1px solid rgba(248,156,116,.18);
  transition: transform .2s;
}

.tip-card:hover { transform: translateY(-2px); }

.tip-card .tip-emoji {
  font-size: 1.75rem;
  margin-bottom: .5rem;
}

.tip-card h4 {
  font-family: var(--font-heading);
  font-size: .9rem;
  font-weight: 800;
  color: var(--bark);
  margin-bottom: .3rem;
}

.tip-card p {
  font-family: var(--font-body);
  font-size: .82rem;
  color: var(--mid);
  margin: 0;
  line-height: 1.55;
}

/* ── Do / Don't cards ──────────────────────────────────────────── */
.do-card {
  background: #EDF7EE;
  border: 1.5px solid #7ac97a;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: .75rem;
}

.dont-card {
  background: #FDF0EE;
  border: 1.5px solid #e0897a;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: .75rem;
}

/* ── Warning box ───────────────────────────────────────────────── */
.warning-box {
  background: #FFF9EC;
  border: 1.5px solid #F5C842;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin: 2.25rem 0;
  font-family: var(--font-body);
  font-size: .93rem;
  line-height: 1.65;
}

.warning-box strong { color: #C47A1E; }

/* ── References ────────────────────────────────────────────────── */
.references {
  background: var(--sand);
  border: 1px solid rgba(248,156,116,.15);
  border-radius: 14px;
  padding: 1.75rem;
  margin-top: 3.5rem;
}

.references h4 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--bark);
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.references ol { margin-left: 1.2rem; }

.references li {
  font-family: var(--font-body);
  font-size: .82rem;
  color: #666;
  margin-bottom: .55rem;
  line-height: 1.55;
}

.references a {
  color: var(--coral-dark);
  word-break: break-all;
}

/* ── Audio player card ─────────────────────────────────────────── */
.audio-player-card {
  background: linear-gradient(135deg, #0f3538 0%, #1a5a5f 100%);
  border-radius: 20px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 2.25rem;
  box-shadow: 0 8px 32px rgba(13,46,48,.28), 0 2px 8px rgba(0,0,0,.12);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.audio-player-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(86,207,211,.18) 0%, transparent 70%);
  pointer-events: none;
}

.audio-player-header {
  display: flex;
  align-items: center;
  gap: .9rem;
}

.audio-player-icon {
  width: 44px; height: 44px; min-width: 44px;
  background: rgba(86,207,211,.18);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #56CFD3;
}

.audio-player-info { flex: 1; }

.audio-player-title {
  font-family: var(--font-heading);
  font-size: .92rem;
  font-weight: 700;
  color: #e0f7f8;
  display: block;
}

.audio-player-subtitle {
  font-family: var(--font-body);
  font-size: .78rem;
  color: rgba(255,255,255,.5);
  display: block;
  margin-top: 2px;
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: .85rem;
}

.audio-play-btn {
  width: 46px; height: 46px; min-width: 46px;
  background: #56CFD3;
  border: none; border-radius: 50%;
  color: #0d2e30;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, transform .15s;
  box-shadow: 0 4px 14px rgba(86,207,211,.4);
}

.audio-play-btn:hover { background: #7edfe2; transform: scale(1.06); }
.audio-play-btn:active { transform: scale(0.96); }

.audio-progress-wrap {
  flex: 1;
  display: flex; flex-direction: column; gap: 6px;
}

.audio-progress-bar-bg {
  width: 100%; height: 5px;
  background: rgba(255,255,255,.15);
  border-radius: 99px;
  cursor: pointer;
  position: relative; overflow: hidden;
}

.audio-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #56CFD3, #a0eced);
  width: 0%;
  transition: width .2s linear;
}

.audio-time-row {
  display: flex; justify-content: space-between;
  font-family: var(--font-body);
  font-size: .72rem;
  color: rgba(255,255,255,.45);
  font-variant-numeric: tabular-nums;
}

.audio-volume-wrap {
  display: flex; align-items: center; gap: 6px;
  min-width: 90px;
}

.audio-volume-wrap svg { color: rgba(255,255,255,.5); flex-shrink: 0; }

.audio-volume-wrap input[type=range] {
  -webkit-appearance: none;
  width: 70px; height: 4px;
  border-radius: 99px;
  background: rgba(255,255,255,.18);
  outline: none; cursor: pointer;
}

.audio-volume-wrap input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #56CFD3;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(86,207,211,.4);
}

/* ── Post divider ──────────────────────────────────────────────── */
.post-divider {
  max-width: var(--prose-width);
  margin: 0 auto 1rem;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--blush), transparent);
}

/* ── Tags ──────────────────────────────────────────────────────── */
.post-tag, .article-tag {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .28rem .8rem;
  border-radius: 2rem;
  margin-bottom: .8rem;
}

.tag-salud     { background: #FDEAF0; color: #C4705A; }
.tag-neuro     { background: #E8EEF5; color: #3D6B9A; }
.tag-lactancia { background: #EAF5EC; color: #3D7A4A; }
.tag-crianza   { background: #FFF3E0; color: #C47A1E; }
.tag-bienestar { background: #F5EAF5; color: #7A4A9A; }
.tag-coral     { background: var(--blush); color: var(--coral-dark); }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .tips-grid { grid-template-columns: 1fr 1fr; }
  .audio-volume-wrap { display: none; }
  .audio-player-card { padding: 1.2rem; }
  .article-wrapper { padding: 1.5rem 1.1rem 4rem; }
}

/* ══════════════════════════════════════════════════════════════════
   DARK MODE — controlled by parent via postMessage → data-theme="dark"
   ══════════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  --cream:      #0f1117;
  --bark:       #ede8e3;
  --mid:        #a08060;
  --sand:       #1a1624;
  --blush:      #2a1f1a;
  --coral-dark: #e0886a;
}

[data-theme="dark"] body            { background: var(--cream); color: var(--bark); }
[data-theme="dark"] .article-body   { color: #d8cfc8; }
[data-theme="dark"] .article-body h3,
[data-theme="dark"] .article-body h4 { color: var(--bark); }
[data-theme="dark"] .article-header h2 { color: var(--bark); }
[data-theme="dark"] .article-header .subtitle {
  background: #1a1624;
  color: var(--mid);
}
[data-theme="dark"] .highlight-box {
  background: #1e1a17;
  border-top-color: var(--coral);
  border-color: rgba(248,156,116,.2);
}
[data-theme="dark"] .highlight-box .highlight-label { color: var(--coral); }
[data-theme="dark"] .tip-card   { background: #1e1714; border-color: rgba(248,156,116,.12); }
[data-theme="dark"] .tip-card h4 { color: var(--bark); }
[data-theme="dark"] .tip-card p  { color: var(--mid); }
[data-theme="dark"] .do-card    { background: #0e200e; border-color: #3a6a3a; }
[data-theme="dark"] .dont-card  { background: #200e0e; border-color: #6a3a3a; }
[data-theme="dark"] .warning-box { background: #1e1a0a; border-color: #8a7020; }
[data-theme="dark"] .references {
  background: #16141a;
  border-color: rgba(248,156,116,.1);
}
[data-theme="dark"] .references li  { color: #a0a0a0; }
[data-theme="dark"] .stat-callout   { box-shadow: 0 12px 32px rgba(0,0,0,.4); }
[data-theme="dark"] .article-hero-img { box-shadow: 0 8px 32px rgba(0,0,0,.35); }

/* ═══════════════════════════════════════════════════════════════
   Extra component classes (myth/fact, info, checklist, etc.)
   ═══════════════════════════════════════════════════════════════ */

.myth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2rem 0;
}
@media (max-width: 640px) { .myth-grid { grid-template-columns: 1fr; } }

.myth-card {
  background: #FDF0EE;
  border: 1.5px solid #e0897a;
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
}
.myth-card h4 { font-family: var(--font-heading); font-size: .95rem; font-weight: 800; color: #c0453a; margin-bottom: .4rem; }
.myth-card p  { font-size: .88rem; color: var(--mid); margin: 0; line-height: 1.55; }

.fact-card {
  background: #EDF7EE;
  border: 1.5px solid #7ac97a;
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
}
.fact-card h4 { font-family: var(--font-heading); font-size: .95rem; font-weight: 800; color: #3D7A4A; margin-bottom: .4rem; }
.fact-card p  { font-size: .88rem; color: var(--mid); margin: 0; line-height: 1.55; }

.info-box {
  background: var(--sand);
  border: 1px solid rgba(248,156,116,.25);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-size: .95rem;
  line-height: 1.7;
}
.info-label {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--coral-dark);
  margin-bottom: .5rem;
}
.info-box p { margin-bottom: .5rem; }

.checklist { list-style: none; margin-left: 0; padding-left: 0; }
.checklist li { padding-left: 1.5rem; position: relative; margin-bottom: .6rem; }
.checklist li::before { content: '✓'; position: absolute; left: 0; color: var(--coral); font-weight: 700; }

/* Dark mode — extra components */
[data-theme="dark"] .myth-card   { background: #200e0e; border-color: #6a3a3a; }
[data-theme="dark"] .myth-card h4 { color: #e88; }
[data-theme="dark"] .fact-card   { background: #0e200e; border-color: #3a6a3a; }
[data-theme="dark"] .fact-card h4 { color: #8c8; }
[data-theme="dark"] .info-box    { background: #1e1a17; border-color: rgba(248,156,116,.2); }

/* ═══════════════════════════════════════════════════════════════
   Cross-post links — a[data-crezia-post]
   Inline references to other blog articles, navigated via postMessage.
   Usage: <a data-crezia-post="slug-del-post">Título visible</a>
   ═══════════════════════════════════════════════════════════════ */

a[data-crezia-post] {
  color: var(--coral-dark);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1.5px solid rgba(248,156,116,.35);
  padding-bottom: 1px;
  cursor: pointer;
  transition: border-color .2s, color .15s;
}

a[data-crezia-post]::after {
  content: ' →';
  font-size: .85em;
  opacity: .55;
  transition: opacity .2s, transform .2s;
  display: inline-block;
}

a[data-crezia-post]:hover {
  color: var(--coral);
  border-bottom-color: var(--coral);
}

a[data-crezia-post]:hover::after {
  opacity: 1;
  transform: translateX(2px);
}

[data-theme="dark"] a[data-crezia-post] {
  color: var(--coral);
  border-bottom-color: rgba(248,156,116,.25);
}

[data-theme="dark"] a[data-crezia-post]:hover {
  color: #ffb894;
  border-bottom-color: #ffb894;
}
