/* ===========================
   BLOG (blog.html + articulo.html)
   Posts are fetched from Ghost by assets/js/blog.js.
   Tokens live in base/site.css.
=========================== */

.blog-page { width: min(1040px, 100% - 3 * var(--gutter)); margin: 0 auto; padding: calc(7rem + var(--section) * .3) 0 var(--section); }

/* --- List page hero: full-bleed photo (base .page-heading in site.css) with the title over it --- */
.page-heading-blog { min-height: clamp(460px, 72vh, 720px); background-image: url(../../Imagenes-copy/Photo-blog-hero.jpg); background-position: 60% 40%; }
/* Desktop: photo enlarged and anchored left so the worker stands right of the title */
@media (min-width: 901px) { .page-heading-blog { background-size: 130% auto; background-position: 0% 15%; } }
.blog-hero-inner { width: min(1040px, 100% - var(--gutter)); margin: 0 auto; }
.page-heading-blog .blog-head { margin-bottom: 0; }
.page-heading-blog .blog-head p { color: var(--white); text-shadow: 0 1px 12px rgba(6,14,28,.5); }
.blog-page-list { padding-top: clamp(3rem, 6vw, 5rem); }

/* --- List page header --- */
.blog-head { max-width: 46rem; margin-bottom: clamp(3rem, 6vw, 5rem); }
.blog-eyebrow {
  display: inline-block; margin-bottom: 1.25rem;
  font-family: var(--font-mono); font-size: var(--fs-mono); font-weight: 500;
  letter-spacing: var(--track-mono); text-transform: uppercase; color: var(--blue);
}
.blog-head h1 { margin-bottom: 1.5rem; font-size: var(--fs-display); letter-spacing: var(--track-display); line-height: 1.05; text-wrap: balance; }
.blog-head p { margin-bottom: 2rem; font-size: var(--fs-lede); line-height: 1.5; }

.blog-status { padding: 2rem 0; color: var(--muted); }

/* --- Post cards: first one featured full width, the rest in a 3-column grid --- */
.blog-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 2.5vw, 2rem); }
.blog-card-link { display: flex; flex-direction: column; height: 100%; }
.blog-card-img {
  width: 100%; aspect-ratio: 16 / 10; height: auto; object-fit: cover; margin-bottom: 1.25rem;
  border-radius: var(--radius-lg); background: var(--navy); transition: opacity .3s var(--ease);
}
.blog-card-link:hover .blog-card-img { opacity: .85; }
.blog-card-meta {
  margin-bottom: .6rem; font-family: var(--font-mono); font-size: var(--fs-mono); font-weight: 500;
  letter-spacing: var(--track-mono); text-transform: uppercase; color: var(--muted);
}
.blog-card-title { margin-bottom: .6rem; font-size: clamp(1.2rem, 1.6vw, 1.45rem); letter-spacing: -0.02em; line-height: 1.2; transition: color .3s var(--ease); }
.blog-card-link:hover .blog-card-title { color: var(--blue); }
.blog-card-excerpt { font-size: 1rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.blog-card.is-featured { grid-column: 1 / -1; padding-bottom: clamp(1.5rem, 3vw, 2.5rem); border-bottom: 1px solid var(--line-dark); }
.blog-card.is-featured .blog-card-link { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.blog-card.is-featured .blog-card-img { margin-bottom: 0; }
.blog-card.is-featured .blog-card-title { font-size: var(--fs-h2); letter-spacing: var(--track-h2); line-height: 1.1; }
.blog-card.is-featured .blog-card-excerpt { font-size: var(--fs-body); -webkit-line-clamp: 4; }

/* "Disponible solo en inglés" badge */
.blog-lang-note {
  display: inline-block; margin-bottom: .75rem; padding: .25rem .55rem; border: 1px solid var(--line-dark); border-radius: var(--radius);
  font-size: .78rem; color: var(--mist);
}

/* --- Article page --- */
.blog-back { display: inline-block; margin-bottom: 2.5rem; font-size: .92rem; color: var(--muted); transition: color .3s var(--ease); }
.blog-back:hover { color: var(--white); }

.blog-article-head, .blog-article-body { max-width: 44rem; margin-inline: auto; }
.blog-article-meta {
  margin-bottom: 1rem; font-family: var(--font-mono); font-size: var(--fs-mono); font-weight: 500;
  letter-spacing: var(--track-mono); text-transform: uppercase; color: var(--blue);
}
.blog-article-title { margin-bottom: 1.5rem; font-size: var(--fs-h2); letter-spacing: var(--track-h2); line-height: 1.1; text-wrap: balance; }
.blog-article-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2.5rem; }
.blog-article-tags li { padding: .3rem .65rem; border: 1px solid var(--line-dark); border-radius: var(--radius); font-size: .8rem; color: var(--muted); }

.blog-article-figure { max-width: 56rem; margin: 0 auto clamp(2.5rem, 5vw, 4rem); }
.blog-article-figure img { width: 100%; height: auto; border-radius: var(--radius-lg); }
.blog-article-figure figcaption:not(:empty) { margin-top: .75rem; font-size: .85rem; color: var(--muted); text-align: center; }

/* Ghost post content */
.blog-article-body { font-size: clamp(1.0625rem, 1.2vw, 1.175rem); line-height: 1.75; color: var(--mist); }
.blog-article-body > * + * { margin-top: 1.4em; }
.blog-article-body h2 { margin-top: 2.2em; font-size: clamp(1.5rem, 2.3vw, 2rem); letter-spacing: -0.02em; }
.blog-article-body h3 { margin-top: 1.9em; font-size: clamp(1.25rem, 1.8vw, 1.5rem); }
.blog-article-body h4, .blog-article-body h5 { margin-top: 1.7em; font-size: 1.1rem; }
.blog-article-body h2 + *, .blog-article-body h3 + *, .blog-article-body h4 + *, .blog-article-body h5 + * { margin-top: .7em; }
.blog-article-body p, .blog-article-body li { color: var(--mist); }
.blog-article-body strong { color: var(--white); }
.blog-article-body a { color: var(--blue); border-bottom: 1px solid currentColor; }
.blog-article-body a:hover { color: var(--white); }
.blog-article-body ul { list-style: disc; padding-left: 1.4em; }
.blog-article-body ol { list-style: decimal; padding-left: 1.4em; }
.blog-article-body li + li { margin-top: .5em; }
.blog-article-body li::marker { color: var(--blue); }
.blog-article-body blockquote { padding-left: 1.25rem; border-left: 2px solid var(--blue); font-size: 1.15em; color: var(--white); }
.blog-article-body blockquote p { color: inherit; }
.blog-article-body hr { margin: 2.5em 0; border: 0; border-top: 1px solid var(--line-dark); }
.blog-article-body img { height: auto; border-radius: var(--radius-lg); }
.blog-article-body figure { margin-inline: 0; }
.blog-article-body figcaption { margin-top: .6rem; font-size: .85rem; color: var(--muted); text-align: center; }
.blog-article-body table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.blog-article-body th, .blog-article-body td { padding: .7rem .9rem; border-bottom: 1px solid var(--line-dark); text-align: left; vertical-align: top; }
.blog-article-body th { color: var(--white); font-weight: 600; }
.blog-article-body iframe, .blog-article-body video { max-width: 100%; }

/* --- Subscribe band at the end of an article --- */
.blog-subscribe {
  max-width: 44rem; margin: clamp(4rem, 8vw, 6rem) auto 0; padding: clamp(2rem, 4vw, 3rem);
  background: var(--paper); border-radius: var(--radius-lg);
}
.blog-subscribe h2 { margin-bottom: .75rem; font-size: var(--fs-h3); color: var(--navy); }
.blog-subscribe p { margin-bottom: 1.5rem; color: var(--slate); }

/* --- Subscribe window (<dialog>) holding Ghost's signup form --- */
.blog-sub {
  width: min(34rem, 100% - 2rem); padding: clamp(1.75rem, 4vw, 2.5rem); margin: auto;
  background: var(--paper); color: var(--navy); border: 0; border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(6, 14, 28, .45);
}
.blog-sub::backdrop { background: rgba(6, 14, 28, .7); backdrop-filter: blur(3px); }
.blog-sub[open] { animation: blog-sub-in .35s var(--ease); }
@keyframes blog-sub-in { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { .blog-sub[open] { animation: none; } }
.blog-sub h2 { margin: 0 2rem .6rem 0; font-size: var(--fs-h3); color: var(--navy); }
.blog-sub-text { margin-bottom: 1.5rem; font-size: 1rem; line-height: 1.55; color: var(--slate); }
.blog-sub-form { min-height: 58px; }
.blog-sub-close {
  position: absolute; top: .75rem; right: .75rem; width: 2.25rem; height: 2.25rem;
  background: none; border: 0; border-radius: 50%; font-size: 1.5rem; line-height: 1; color: var(--slate);
}
.blog-sub-close:hover { background: var(--line-light); color: var(--navy); }

/* --- Responsive --- */
@media (max-width: 900px) {
  .blog-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-card.is-featured .blog-card-link { grid-template-columns: 1fr; gap: 1.25rem; }
}
@media (max-width: 560px) {
  .blog-list { grid-template-columns: 1fr; }
}

/* --- Share buttons (assets/js/share.js) --- */
.blog-share { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.blog-article-body + .blog-share { max-width: 44rem; margin: clamp(2.5rem, 5vw, 3.5rem) auto 0; padding-top: 1.75rem; border-top: 1px solid var(--line-dark); }
.blog-share .blog-share-label {
  margin: 0; font-family: var(--font-mono); font-size: var(--fs-mono); font-weight: 500;
  letter-spacing: var(--track-mono); text-transform: uppercase; color: var(--muted);
}
.blog-share .t-share { color: var(--white); }
.blog-share-hero { margin-top: 1.75rem; }
.blog-share-hero .blog-share-label { color: var(--white); text-shadow: 0 1px 12px rgba(6,14,28,.5); }

/* --- Share + print icons on the article's date line --- */
.blog-article-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.blog-article-bar .blog-article-meta { margin-bottom: 0; }
.blog-tools { display: flex; align-items: center; gap: .35rem; flex-shrink: 0; }
.blog-tool-share { position: relative; }
.blog-tool {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0;
  background: none; color: var(--muted); border: 0; border-radius: 50%; font-size: 16px;
  transition: color .3s var(--ease), background-color .3s var(--ease);
}
.blog-tool:hover, .blog-tool:focus-visible, .blog-tool[aria-expanded="true"] { color: var(--white); background: rgba(195, 208, 228, .1); }
.blog-share-menu {
  position: absolute; top: calc(100% + .5rem); right: 0; z-index: 20; padding: .6rem;
  background: rgba(11, 26, 48, 0.96); backdrop-filter: blur(14px); border: 1px solid var(--line-dark); border-radius: var(--radius-lg);
}
.blog-share-menu { width: 17.5rem; }
.blog-share-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .35rem .4rem .6rem .6rem; }
.blog-share-menu-title {
  margin: 0; font-family: var(--font-mono); font-size: var(--fs-mono); font-weight: 500;
  letter-spacing: var(--track-mono); text-transform: uppercase; color: var(--muted);
}
.blog-share-menu-close {
  width: 2rem; height: 2rem; padding: 0; background: none; border: 0; border-radius: 50%;
  font-size: 1.4rem; line-height: 1; color: var(--muted);
}
.blog-share-menu-close:hover { background: rgba(195, 208, 228, .1); color: var(--white); }
.blog-share-menu .t-share { color: var(--white); }

/* Phones: the menu becomes a sheet along the bottom of the screen */
@media (max-width: 767px) {
  .blog-share-menu {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 10000; width: auto;
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
    border-width: 1px 0 0; border-radius: 14px 14px 0 0;
    box-shadow: 0 0 0 100vmax rgba(6, 14, 28, .6);
    animation: blog-sheet-in .3s var(--ease);
  }
  .blog-share-menu .t-share-btn { padding: .85rem .75rem; }
}
@keyframes blog-sheet-in { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .blog-share-menu { animation: none; } }

/* --- Printing a post: just the article, dark ink on white --- */
@media print {
  .t-nav, .skip-link, .blog-back, .blog-status, .blog-tools, .blog-share, .blog-subscribe, footer,
  #back-to-top, .cookie-consent-banner, .cookie-modal, .blog-sub { display: none !important; }
  html, body { background: #fff !important; }
  .blog-page { width: auto; padding: 0; }
  .blog-article, .blog-article * { color: #000 !important; }
  .blog-article-body a { border-bottom: 0; text-decoration: underline; }
  .blog-article-body blockquote { border-left-color: #000; }
  .blog-article-tags li, .blog-article-body th, .blog-article-body td, .blog-article-body hr { border-color: #bbb; }
  .blog-article-figure, .blog-article-body img, .blog-article-body figure { break-inside: avoid; }
  .blog-article-body h2, .blog-article-body h3 { break-after: avoid; }
}
