/*
Theme Name: Holapeques Editorial
Theme URI: https://holapeques.com
Description: Custom editorial theme for Holapeques - revista para madres y familias
Author: Yoel Castano
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: holapeques-editorial
*/

/* ── Reset & Variables ────────────────────────── */
:root {
  --coral: #E07A5F;
  --coral-light: #F2AE99;
  --sage: #81B29A;
  --sage-dark: #5E9478;
  --cream: #FDF6F0;
  --cream-dark: #F5EBE0;
  --warm-white: #FEFCFA;
  --gold: #D4A574;
  --gold-light: #E8C9A8;
  --text: #2C2825;
  --text-light: #6B6560;
  --text-muted: #9E9590;
  --line: #E8E0D8;
  --line-light: #F0EBE5;
  --shadow-sm: 0 1px 3px rgba(44,40,37,0.06);
  --shadow-md: 0 4px 16px rgba(44,40,37,0.08);
  --shadow-lg: 0 12px 40px rgba(44,40,37,0.12);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --max-width: 1280px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'DM Sans', sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--cream);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--coral); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--sage-dark); }

/* ── Typography ───────────────────────────────── */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }

/* ── Layout ───────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}

/* ── Header ───────────────────────────────────── */
.site-header {
  background: var(--warm-white);
  border-bottom: 1px solid var(--line-light);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(254, 252, 250, 0.92);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.site-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.site-logo span { color: var(--coral); }

/* Navigation */
.main-nav { display: flex; gap: 2px; }
.main-nav a {
  color: var(--text-light);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
  letter-spacing: 0.01em;
}
.main-nav a:hover {
  color: var(--text);
  background: var(--cream-dark);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}
.nav-toggle svg { width: 24px; height: 24px; }

/* Search */
.header-search {
  position: relative;
}
.header-search input {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 50px;
  padding: 8px 16px 8px 38px;
  font-size: 0.85rem;
  width: 180px;
  transition: all var(--transition);
  font-family: inherit;
  color: var(--text);
}
.header-search input:focus {
  outline: none;
  border-color: var(--coral-light);
  width: 240px;
  background: var(--warm-white);
  box-shadow: 0 0 0 3px rgba(224,122,95,0.1);
}
.header-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

/* ── Hero (front page) ────────────────────────── */
.hero-section {
  padding: clamp(3rem, 8vw, 6rem) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224,122,95,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -15%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(129,178,154,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  margin-bottom: 1rem;
  position: relative;
  animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  animation: fadeInUp 0.8s ease-out 0.15s both;
}

.hero-categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.hero-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--warm-white);
  border: 1px solid var(--line);
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-light);
  transition: all var(--transition);
}

.hero-cat:hover {
  border-color: var(--coral-light);
  color: var(--coral);
  background: #FFF5F2;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.hero-cat .cat-icon { font-size: 1.1rem; }

/* ── Section Headers ──────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--line);
}

.section-title {
  font-size: 1.4rem;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -1.05rem;
  left: 0;
  width: 50px;
  height: 2px;
  background: var(--coral);
}

.section-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--coral);
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-link:hover { gap: 8px; }

/* ── Featured Post (large) ────────────────────── */
.featured-post {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 3rem;
  animation: fadeInUp 0.6s ease-out;
}

.featured-post .post-image {
  aspect-ratio: 21/9;
  object-fit: cover;
  width: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.featured-post:hover .post-image { transform: scale(1.03); }

.featured-post .post-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: linear-gradient(to top, rgba(20,18,16,0.85) 0%, rgba(20,18,16,0.4) 60%, transparent 100%);
}

.featured-post .post-cat {
  display: inline-block;
  padding: 5px 14px;
  background: var(--coral);
  color: white;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.featured-post .post-title {
  color: white;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  margin-bottom: 8px;
}

.featured-post .post-title a { color: white; }
.featured-post .post-title a:hover { opacity: 0.9; }

.featured-post .post-meta {
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
}

/* ── Post Grid ────────────────────────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: clamp(1.2rem, 3vw, 2rem);
  margin-bottom: 3rem;
}

/* ── Post Card ────────────────────────────────── */
.post-card {
  background: var(--warm-white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-light);
  transition: all var(--transition);
  animation: fadeInUp 0.5s ease-out both;
}

.post-card:nth-child(1) { animation-delay: 0s; }
.post-card:nth-child(2) { animation-delay: 0.08s; }
.post-card:nth-child(3) { animation-delay: 0.16s; }
.post-card:nth-child(4) { animation-delay: 0.24s; }
.post-card:nth-child(5) { animation-delay: 0.32s; }
.post-card:nth-child(6) { animation-delay: 0.4s; }

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.post-card .card-image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/10;
}

.post-card .card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card:hover .card-image { transform: scale(1.06); }

.post-card .card-cat {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 4px 12px;
  background: rgba(254,252,250,0.92);
  backdrop-filter: blur(8px);
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--coral);
}

.post-card .card-body { padding: clamp(1rem, 2.5vw, 1.5rem); }

.post-card .card-title {
  font-size: 1.15rem;
  margin-bottom: 8px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

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

.post-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--line-light);
}

.post-card .card-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.post-card .card-read {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--coral);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--transition);
}

.post-card .card-read:hover { gap: 8px; }

/* ── No thumbnail placeholder ─────────────────── */
.no-thumb {
  background: linear-gradient(135deg, var(--cream-dark) 0%, var(--gold-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  color: var(--gold);
  opacity: 0.5;
}

/* ── Single Post ──────────────────────────────── */
.single-header {
  text-align: center;
  padding: clamp(2rem, 6vw, 4rem) 0 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.single-cat {
  display: inline-block;
  padding: 5px 16px;
  background: #FFF0EB;
  color: var(--coral);
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1.2rem;
}

.single-title {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1rem;
}

.single-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.single-meta span { margin: 0 8px; }

.single-featured {
  max-width: 960px;
  margin: 0 auto 3rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.single-featured img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.single-content {
  max-width: 740px;
  margin: 0 auto;
  padding-bottom: 4rem;
}

.single-content p { margin-bottom: 1.4em; }
.single-content h2 { margin: 2.5em 0 0.8em; }
.single-content h3 { margin: 2em 0 0.6em; }

.single-content ul, .single-content ol {
  margin: 1em 0 1.4em 1.5em;
}
.single-content li { margin-bottom: 0.5em; }

.single-content blockquote {
  border-left: 3px solid var(--coral);
  padding: 1.2rem 1.5rem;
  margin: 2rem 0;
  background: var(--cream-dark);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-light);
}

.single-content img {
  border-radius: var(--radius-sm);
  margin: 2rem auto;
}

/* ── Sidebar ──────────────────────────────────── */
.content-sidebar-wrap {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  align-items: start;
}

.sidebar { position: sticky; top: 90px; }

.widget {
  background: var(--warm-white);
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.widget-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--line);
  position: relative;
}

.widget-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--coral);
}

.widget ul { list-style: none; }
.widget li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line-light);
  font-size: 0.9rem;
}
.widget li:last-child { border-bottom: none; }
.widget li a { color: var(--text-light); }
.widget li a:hover { color: var(--coral); }

/* ── Newsletter CTA ───────────────────────────── */
.newsletter-cta {
  background: linear-gradient(135deg, var(--cream-dark) 0%, #F5E6D8 100%);
  border-radius: var(--radius);
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
  margin: 3rem 0;
  position: relative;
  overflow: hidden;
}

.newsletter-cta::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(224,122,95,0.1);
}

.newsletter-cta h3 { margin-bottom: 0.5rem; }

.newsletter-cta p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* ── Pagination ───────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 3rem 0;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-xs);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-light);
  border: 1px solid var(--line);
  background: var(--warm-white);
  transition: all var(--transition);
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: var(--coral);
  color: white;
  border-color: var(--coral);
}

.pagination .prev, .pagination .next {
  width: auto;
  padding: 0 16px;
  font-weight: 600;
}

/* ── Footer ───────────────────────────────────── */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,0.6);
  padding: clamp(3rem, 6vw, 5rem) 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand .site-logo { color: white; font-size: 1.4rem; margin-bottom: 1rem; }
.footer-brand p { font-size: 0.9rem; line-height: 1.7; max-width: 280px; }

.footer-heading {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 1.2rem;
}

.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 8px; }
.site-footer li a {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  transition: color var(--transition);
}
.site-footer li a:hover { color: var(--coral-light); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}

/* ── Breadcrumb ───────────────────────────────── */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 1rem 0;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--coral); }
.breadcrumb .sep { margin: 0 6px; opacity: 0.4; }

/* ── 404 ──────────────────────────────────────── */
.error-404 {
  text-align: center;
  padding: 6rem 0;
}
.error-404 .big-404 {
  font-family: 'Playfair Display', serif;
  font-size: 8rem;
  color: var(--line);
  line-height: 1;
  margin-bottom: 1rem;
}

/* ── Animations ───────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 1024px) {
  .content-sidebar-wrap { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--warm-white);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow-md);
  }
  .main-nav.active { display: flex; }
  .nav-toggle { display: block; }
  .header-search { display: none; }
  .posts-grid { grid-template-columns: 1fr; }
  .featured-post .post-image { aspect-ratio: 16/10; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}

/* ── WP specific overrides ────────────────────── */
.wp-block-image { margin: 2rem 0; }
.wp-block-image img { border-radius: var(--radius-sm); }
.aligncenter { margin-left: auto; margin-right: auto; }
.alignleft { float: left; margin-right: 1.5rem; margin-bottom: 1rem; }
.alignright { float: right; margin-left: 1.5rem; margin-bottom: 1rem; }

.wp-caption { max-width: 100%; }
.wp-caption-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  padding-top: 8px;
  font-style: italic;
}

/* ── SEO Audit Fixes (2026-04-04) ─────────────── */

/* Fix: iframe responsive (YouTube embeds) */
.single-content iframe,
.entry-content iframe {
  max-width: 100%;
  height: auto;
  aspect-ratio: 16/9;
}

/* Fix: Touch targets on mobile */
@media (max-width: 768px) {
  .breadcrumb a { padding: 8px 4px; display: inline-block; }
  .card-read { padding: 10px 0; }
  .section-link { padding: 10px 0; }
}

/* Medical disclaimer */
.medical-disclaimer {
  margin: 2rem 0;
  padding: 1.2rem 1.5rem;
  background: linear-gradient(135deg, #FFF8F0, #FFF5EB);
  border: 1px solid var(--gold-light);
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.6;
}
.medical-disclaimer strong { color: var(--text); font-weight: 600; }

/* Author meta */
.author-name { font-weight: 400; }
.author-name strong { font-weight: 600; }

/* Screen reader text */
.screen-reader-text {
  clip: rect(1px,1px,1px,1px);
  position: absolute;
  height: 1px;
  width: 1px;
  overflow: hidden;
}
