/* ============================================================
   BLOG — Essential Idiomas
   Extends shared.css (navy + champagne + DM Sans/Serif)
   ============================================================ */

/* Blog Hero (post page) */
.blog-hero {
  background: var(--navy);
  padding: clamp(140px, 16vw, 200px) 0 clamp(60px, 8vw, 100px);
  position: relative;
  overflow: hidden;
}
.blog-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.03'/%3E%3C/svg%3E");
  pointer-events: none;
}
.blog-hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--section-px);
  position: relative;
  z-index: 1;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: rgba(255,255,255,.35);
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: rgba(255,255,255,.45);
  transition: color .2s;
}
.breadcrumb a:hover { color: var(--champagne); }
.breadcrumb-sep { opacity: .3; }

/* Category badge */
.cat-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 40px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(200,169,126,.12);
  color: var(--champagne-light);
  border: 1px solid rgba(200,169,126,.15);
  margin-bottom: 20px;
}

/* Post title */
.blog-hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 20px;
  max-width: 800px;
}
.blog-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: .85rem;
  color: rgba(255,255,255,.35);
}
.blog-meta time { color: rgba(255,255,255,.5); }

/* Featured image */
.blog-featured {
  max-width: var(--max-w);
  margin: -40px auto 0;
  padding: 0 var(--section-px);
  position: relative;
  z-index: 2;
}
.blog-featured img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 16px 60px rgba(0,0,0,.15);
}

/* Article body */
.blog-body {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) var(--section-px);
}
.blog-body h2 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
  margin: 48px 0 16px;
  color: var(--text-primary);
}
.blog-body h3 {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.3;
  margin: 36px 0 12px;
  color: var(--text-primary);
}
.blog-body h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 28px 0 10px;
  color: var(--text-primary);
}
.blog-body p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.blog-body a {
  color: var(--champagne);
  text-decoration: underline;
  text-decoration-color: rgba(200,169,126,.3);
  text-underline-offset: 3px;
  transition: text-decoration-color .2s;
}
.blog-body a:hover {
  text-decoration-color: var(--champagne);
}
.blog-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 24px 0;
}
.blog-body ul, .blog-body ol {
  padding-left: 24px;
  margin-bottom: 20px;
}
.blog-body li {
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.blog-body blockquote {
  border-left: 3px solid var(--champagne);
  padding: 16px 24px;
  margin: 28px 0;
  background: var(--cream-mid);
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: var(--text-secondary);
}
.blog-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: .92rem;
}
.blog-body th {
  background: var(--navy);
  color: var(--white);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
}
.blog-body td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--cream-mid);
  color: var(--text-secondary);
}
.blog-body tr:nth-child(even) td { background: var(--cream); }
.blog-body pre, .blog-body code {
  font-family: 'Fira Code', monospace;
  font-size: .9rem;
  background: var(--cream-mid);
  border-radius: 6px;
}
.blog-body code { padding: 2px 6px; }
.blog-body pre {
  padding: 20px;
  overflow-x: auto;
  margin: 20px 0;
}
.blog-body pre code { padding: 0; background: none; }
.blog-body hr {
  border: none;
  border-top: 1px solid var(--cream-mid);
  margin: 40px 0;
}

/* Related posts */
.blog-related {
  padding: var(--section-py) 0;
  background: var(--cream);
}
.blog-related-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--section-px);
}
.blog-related h2 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 40px;
  text-align: center;
}
.blog-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* Blog CTA banner */
.blog-cta {
  background: var(--navy);
  border-radius: 20px;
  padding: 48px 40px;
  text-align: center;
  margin: 48px 0;
  position: relative;
  overflow: hidden;
}
.blog-cta::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(200,169,126,.06);
}
.blog-cta h3 {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--white);
  margin-bottom: 12px;
  position: relative;
}
.blog-cta p {
  color: rgba(255,255,255,.45) !important;
  margin-bottom: 24px !important;
  position: relative;
}
.blog-cta .btn {
  position: relative;
}
.blog-body .btn-champagne,
.blog-cta .btn-champagne {
  color: var(--navy);
  text-decoration: none;
}

/* ============================================================
   BLOG LISTING (index + category pages)
   ============================================================ */
.blog-listing-hero {
  background: var(--navy);
  padding: clamp(140px, 16vw, 200px) 0 clamp(40px, 6vw, 60px);
  text-align: center;
  position: relative;
}
.blog-listing-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.03'/%3E%3C/svg%3E");
  pointer-events: none;
}
.blog-listing-hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  color: var(--white);
  position: relative;
  z-index: 1;
}
.blog-listing-hero p {
  color: rgba(255,255,255,.4);
  font-size: 1.05rem;
  margin-top: 16px;
  position: relative;
  z-index: 1;
}

/* Category tabs */
.blog-cats {
  background: var(--white);
  border-bottom: 1px solid var(--cream-mid);
  position: sticky;
  top: 88px;
  z-index: 50;
}
.blog-cats-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--section-px);
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.blog-cats-inner::-webkit-scrollbar { display: none; }
.blog-cat-tab {
  padding: 16px 20px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all .2s;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.blog-cat-tab:hover { color: var(--text-primary); }
.blog-cat-tab.active {
  color: var(--navy);
  border-bottom-color: var(--champagne);
}

/* Post cards grid */
.blog-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px var(--section-px) var(--section-py);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* Post card */
.post-card {
  background: var(--white);
  border-radius: 20px;
  overflow: hidden;
  transition: transform .4s ease, box-shadow .4s ease;
  display: flex;
  flex-direction: column;
}
.post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0,0,0,.06);
}
.post-card-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: var(--cream-mid);
}
.post-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.post-card-cat {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--champagne);
  margin-bottom: 10px;
}
.post-card-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.3;
  margin-bottom: 10px;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-excerpt {
  font-size: .88rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-date {
  font-size: .78rem;
  color: var(--text-muted);
  padding-top: 12px;
  border-top: 1px solid var(--cream-mid);
}

/* No thumb fallback */
.post-card-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16/10;
  background: linear-gradient(145deg, var(--navy-mid), var(--navy-light));
  display: flex;
  align-items: center;
  justify-content: center;
}
.post-card-thumb-placeholder svg {
  width: 40px;
  height: 40px;
  color: rgba(255,255,255,.1);
}

/* Load more */
.blog-load-more {
  text-align: center;
  padding: 0 var(--section-px) var(--section-py);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .blog-related-grid { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; }
  .blog-featured img { max-height: 360px; }
}
@media (max-width: 600px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-cta { padding: 36px 24px; }
  .blog-body { padding: 32px var(--section-px); }
  .blog-featured { margin-top: -24px; }
  .blog-featured img { max-height: 260px; border-radius: 14px; }
}
