/* ==========================================================================
   BLOG PÚBLICO · ELENA MATEOS
   Estética editorial marítima a juego con styles.css (Gloock + Figtree)
   ========================================================================== */

.blog-hero {
  position: relative;
  background:
    radial-gradient(circle at 82% 22%, rgba(246, 184, 74, .16), transparent 45%),
    linear-gradient(135deg, #08203a 0%, var(--navy) 58%, #0e4a73 100%);
  color: var(--white);
  padding: 68px 0 96px;
  overflow: hidden;
}
.blog-hero .eyebrow { color: var(--gold); margin-bottom: .7em; }
.blog-hero h1 {
  color: var(--white);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  max-width: 18ch;
  margin-bottom: .45em;
}
.blog-hero p {
  color: rgba(255, 255, 255, .84);
  font-size: clamp(1.02rem, 2vw, 1.18rem);
  max-width: 44em;
  margin: 0;
}
.blog-hero .wave {
  height: 54px;
  fill: var(--sand);
}

/* Barra de categorías */
.blog-main {
  background: var(--sand);
  padding: 20px 0 90px;
  min-height: 55vh;
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.blog-filters-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.blog-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-width: 0;
}
.blog-filters::-webkit-scrollbar { display: none; }

/* Buscador rápido público */
.blog-search-wrap {
  flex: 0 0 auto;
}
.blog-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1.5px solid rgba(11, 42, 74, .14);
  border-radius: 999px;
  padding: 6px 14px 6px 16px;
  min-width: 270px;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
  box-shadow: 0 2px 8px rgba(11, 42, 74, .04);
}
.blog-search-box:hover {
  border-color: rgba(11, 42, 74, .28);
}
.blog-search-box:focus-within {
  border-color: var(--navy);
  box-shadow: 0 6px 18px rgba(11, 42, 74, .12);
  background: #ffffff;
}
.blog-search-icon {
  width: 17px;
  height: 17px;
  color: var(--muted);
  flex-shrink: 0;
  transition: color .2s;
}
.blog-search-box:focus-within .blog-search-icon {
  color: var(--navy);
}
.blog-search-input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--sans);
  font-size: .92rem;
  color: var(--navy);
  width: 100%;
}
.blog-search-input::placeholder {
  color: var(--muted);
  opacity: .85;
}
.blog-search-clear {
  appearance: none;
  border: none;
  background: rgba(11, 42, 74, .08);
  color: var(--navy);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0;
  margin-left: 4px;
  transition: background .18s, transform .15s;
}
.blog-search-clear:hover {
  background: rgba(11, 42, 74, .2);
  transform: scale(1.08);
}

/* Barra informativa de resultados de búsqueda */
.blog-search-feedback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, .8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(11, 42, 74, .1);
  padding: 10px 18px;
  border-radius: 14px;
  margin-bottom: 24px;
  font-size: .92rem;
  color: var(--navy);
}
.blog-search-feedback strong {
  color: var(--navy);
}
.blog-clear-search-link {
  appearance: none;
  border: none;
  background: none;
  color: var(--coral);
  font-family: var(--sans);
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .15s;
}
.blog-clear-search-link:hover {
  color: var(--coral-dark);
}

.filter-pill {
  flex: 0 0 auto;
  appearance: none;
  border: 1.5px solid rgba(11, 42, 74, .14);
  background: var(--white);
  color: var(--navy);
  font-family: var(--sans);
  font-size: .92rem;
  font-weight: 600;
  padding: .55em 1.15em;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s ease;
}
.filter-pill:hover {
  border-color: var(--navy);
}
.filter-pill.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
  box-shadow: 0 6px 16px rgba(11, 42, 74, .18);
}

/* Etiquetas y metadatos de tarjeta */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: .84rem;
  color: var(--muted);
  margin-bottom: 12px;
}
.cat-badge {
  display: inline-flex;
  align-items: center;
  background: var(--sky);
  color: var(--ocean);
  font-weight: 700;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: .32em .85em;
  border-radius: 999px;
}
.draft-pill {
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
  font-size: .75rem;
  padding: .25em .7em;
  border-radius: 999px;
}
.meta-dot { opacity: .45; }

/* Artículo destacado */
.featured-post {
  display: grid;
  grid-template-columns: 1.18fr 1fr;
  background: var(--white);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 36px;
  text-decoration: none;
  color: inherit;
  transition: transform .25s ease, box-shadow .25s ease;
}
.featured-post:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 44px rgba(11, 42, 74, .14);
}
.featured-media {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  background: var(--navy);
}
.featured-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .55s ease;
}
.featured-post:hover .featured-media img {
  transform: scale(1.04);
}
.featured-body {
  padding: 42px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.featured-body h2 {
  font-family: var(--serif);
  font-size: clamp(1.55rem, 2.7vw, 2.15rem);
  line-height: 1.18;
  margin: 0 0 .55em;
  color: var(--navy);
}
.featured-body p {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.62;
  margin: 0 0 1.4em;
}
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--coral);
  font-size: .95rem;
  margin-top: auto;
}
.featured-post:hover .read-more,
.post-card:hover .read-more {
  color: var(--coral-dark);
}

/* Cuadrícula de artículos */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.posts-grid.cols-2,
.posts-grid:has(> :nth-child(2):last-child) {
  grid-template-columns: repeat(2, 1fr) !important;
}
.posts-grid.cols-1,
.posts-grid:has(> :only-child) {
  grid-template-columns: 1fr;
  max-width: 580px;
}
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform .25s ease, box-shadow .25s ease;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 38px rgba(11, 42, 74, .14);
}
.post-card-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--navy);
}
.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.post-card:hover .post-card-media img {
  transform: scale(1.05);
}
.post-card-body {
  padding: 24px 26px 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.post-card-body h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.32rem;
  line-height: 1.24;
  color: var(--navy);
  margin: 0 0 .55em;
}
.post-card-body p {
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.58;
  margin: 0 0 1.3em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Estado vacío / cargando */
.blog-skeleton {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.skel-card {
  height: 360px;
  border-radius: 20px;
  background: linear-gradient(90deg, #efe8dc 25%, #f7f2e9 50%, #efe8dc 75%);
  background-size: 200% 100%;
  animation: skelPulse 1.4s infinite;
}
@keyframes skelPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.blog-empty {
  text-align: center;
  background: var(--white);
  border-radius: 22px;
  padding: 56px 28px;
  box-shadow: var(--shadow);
}
.blog-empty h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.6rem;
  margin-bottom: .4em;
}
.blog-empty p { color: var(--muted); max-width: 34em; margin: 0 auto 1.4em; }

/* Botón "Cargar más artículos" */
.blog-load-more-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 46px;
  margin-bottom: 24px;
}
.btn-load-more {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid rgba(11, 42, 74, .16);
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: .96rem;
  padding: 13px 28px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(11, 42, 74, .06);
  transition: all .24s ease;
}
.btn-load-more:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(11, 42, 74, .18);
}
.btn-load-more .load-more-counter {
  font-size: .84rem;
  font-weight: 600;
  opacity: .75;
}
.btn-load-more svg {
  transition: transform .22s ease;
}
.btn-load-more:hover svg {
  transform: translateY(2px);
}

/* ==========================================================================
   VISTA DE ARTÍCULO INDIVIDUAL (blog/articulo.html)
   ========================================================================== */

.article-page {
  background: var(--white);
  padding: 40px 0 84px;
}
.article-header {
  max-width: 840px;
  margin: 0 auto 36px;
  text-align: center;
}
.article-header .post-meta {
  justify-content: center;
}
.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ocean);
  font-weight: 600;
  font-size: .94rem;
  text-decoration: none;
  margin-bottom: 22px;
}
.article-back:hover { color: var(--navy); text-decoration: underline; }

.article-header h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.14;
  color: var(--navy);
  margin: 10px auto 18px;
}
.article-standfirst {
  font-size: clamp(1.06rem, 1.9vw, 1.2rem);
  line-height: 1.6;
  color: var(--muted);
  max-width: 680px;
  margin: 0 auto;
}

.article-cover {
  max-width: 960px;
  margin: 0 auto 46px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(11, 42, 74, .14);
  background: var(--sand);
}
.article-cover img {
  width: 100%;
  max-height: 540px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Cuerpo tipográfico editorial */
.article-content {
  max-width: 740px;
  margin: 0 auto;
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--ink);
}
.article-content p {
  margin: 0 0 1.45em;
}
.article-content a {
  color: var(--ocean);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.article-content a:hover { color: var(--coral); }

.article-content h2 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.22;
  color: var(--navy);
  margin: 1.9em 0 .65em;
}

/* Bloque cita destacada */
.article-quote {
  margin: 2.1em 0;
  padding: 26px 30px;
  background: var(--sand);
  border-left: 4px solid var(--gold);
  border-radius: 0 18px 18px 0;
}
.article-quote blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.22rem, 2.4vw, 1.48rem);
  line-height: 1.45;
  color: var(--navy);
}
.article-quote figcaption {
  margin-top: 12px;
  font-size: .92rem;
  font-weight: 700;
  color: var(--muted);
}

/* Bloque imagen individual */
.article-figure {
  margin: 2.2em -40px;
}
.article-figure img {
  width: 100%;
  border-radius: 20px;
  box-shadow: 0 14px 34px rgba(11, 42, 74, .11);
  cursor: zoom-in;
}
.article-figure figcaption,
.article-gallery figcaption {
  margin-top: 10px;
  text-align: center;
  font-size: .9rem;
  color: var(--muted);
}

/* Bloque galería de fotos */
.article-gallery {
  margin: 2.3em -60px;
}
.gallery-grid {
  display: grid;
  gap: 14px;
}
.gallery-grid.cols-1 { grid-template-columns: 1fr; }
.gallery-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.gallery-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--sand);
  box-shadow: 0 10px 24px rgba(11, 42, 74, .09);
}
.gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform .35s ease;
}
.gallery-item:hover img {
  transform: scale(1.03);
}
.gallery-item span {
  display: block;
  padding: 9px 12px;
  font-size: .82rem;
  line-height: 1.4;
  color: var(--muted);
  background: var(--sand);
}

/* Bloque lista con checks de marca */
.article-content .checks {
  margin: 1.5em 0 1.8em;
}
.article-content .checks li {
  margin-bottom: .75em;
  line-height: 1.65;
}

/* Barra compartir + Tarjeta de autora */
.article-share {
  max-width: 740px;
  margin: 44px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.article-share-label {
  font-weight: 700;
  color: var(--navy);
  font-size: .95rem;
}
.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: .52em 1.05em;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--navy);
  font-family: var(--sans);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all .2s;
}
.share-btn:hover {
  border-color: var(--navy);
  background: var(--sand);
}

.author-card {
  max-width: 760px;
  margin: 44px auto 0;
  background: var(--sand);
  border-radius: 24px;
  padding: 32px 36px;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 26px;
  align-items: center;
  border: 1px solid rgba(11, 42, 74, .07);
}
.author-card img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--white);
  box-shadow: 0 8px 20px rgba(11, 42, 74, .12);
}
.author-card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.4rem;
  margin: 0 0 6px;
}
.author-card p {
  color: var(--muted);
  font-size: .96rem;
  margin: 0 0 16px;
}
.author-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Artículos relacionados */
.related-section {
  background: var(--sand);
  padding: 68px 0 84px;
  border-top: 1px solid var(--line);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  max-width: 860px;
  margin: 28px auto 0;
}

/* Lightbox para ampliar fotografías */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(7, 24, 43, .92);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox-inner {
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox-inner img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.lightbox-caption {
  color: rgba(255, 255, 255, .85);
  font-size: .95rem;
  margin-top: 12px;
  text-align: center;
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, .14);
  color: var(--white);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .28); }

/* Píldora flotante si Elena está conectada como administradora */
.admin-quickbar {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 90;
  display: flex;
  gap: 8px;
  background: var(--navy);
  color: var(--white);
  padding: 8px 12px;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(11, 42, 74, .32);
  border: 1px solid rgba(255, 255, 255, .15);
  font-size: .85rem;
}
.admin-quickbar a {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
}
.admin-quickbar a.primary {
  background: var(--coral);
}
.admin-quickbar a:hover { opacity: .92; }

.nav-links a[aria-current="page"] {
  color: var(--gold);
  font-weight: 600;
}

/* ==========================================================================
   RESPONSIVE MÓVIL Y TABLET
   ========================================================================== */

@media (max-width: 960px) {
  .featured-post { grid-template-columns: 1fr; }
  .featured-media { min-height: 250px; aspect-ratio: 16 / 10; }
  .featured-body { padding: 28px 28px 32px; }
  .posts-grid, .blog-skeleton { grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .article-figure, .article-gallery { margin-inline: 0; }
}

@media (max-width: 680px) {
  .blog-hero { padding: 48px 0 78px; }
  .blog-main { padding: 14px 0 64px; }
  .blog-filters-wrap { flex-direction: column; align-items: stretch; gap: 12px; }
  .blog-search-wrap, .blog-search-box { width: 100%; min-width: 0; }
  .btn-load-more { width: 100%; justify-content: center; }
  .posts-grid, .posts-grid.cols-2, .blog-skeleton, .related-grid { grid-template-columns: 1fr !important; gap: 20px; }
  .featured-body { padding: 22px 22px 26px; }
  .post-card-body { padding: 20px 20px 24px; }
  .article-page { padding: 24px 0 60px; }
  .article-cover { border-radius: 16px; margin-bottom: 28px; }
  .article-content { font-size: 1.05rem; line-height: 1.74; }
  .article-quote { padding: 20px 22px; }
  .gallery-grid.cols-2, .gallery-grid.cols-3 { grid-template-columns: 1fr; }
  .author-card {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 26px 22px;
    gap: 16px;
  }
  .author-card img { margin: 0 auto; width: 84px; height: 84px; }
  .author-actions { justify-content: center; }
  .author-actions .btn { width: 100%; }
  .article-share { flex-direction: column; align-items: flex-start; }
}
