/* ============================================================
   ALPINE SKI ACADEMY — Blog layer (v1)
   Loaded only on /blog and on the article pages, on top of app.min.css.
   Progressive enhancement: every rule here either restyles existing
   markup or styles elements that blog.js adds. No JS -> the page still
   renders exactly as before, just narrower.
   ============================================================ */

/* ---------- shared: wider canvas on blog pages ---------- */
.v2.blog-index section > .wrap,
.v2.blog-post .blog-article > .wrap { max-width: 1320px; }

/* footers are far below the fold on every blog page: let the browser skip
   laying them out until they are near the viewport */
.v2.blog-index footer.ft,
.v2.blog-post footer.ft { content-visibility: auto; contain-intrinsic-size: 1px 760px; }

/* =====================================================================
   ARTICLE
   ===================================================================== */
.v2.blog-post .phero-blog { padding: clamp(4.6rem, 8.5vw, 7rem) 0 clamp(2.8rem, 5.5vw, 4.2rem); }
.v2.blog-post .phero-blog .crumb { font-size: .85rem; }
.v2.blog-post .phero-blog h1 { max-width: 900px; letter-spacing: -.01em; }
.v2.blog-post .phero-blog .lead { max-width: 840px; color: #dfe8f0; }

.v2.blog-post .blog-article { padding-top: clamp(1.4rem, 3vw, 2.4rem); }
.v2.blog-post .blog-article > .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.4rem;
  align-items: start;
}
.v2.blog-post .blog-body { max-width: 840px; width: 100%; margin: 0 auto; }
@media (min-width: 1100px) {
  .v2.blog-post .blog-article > .wrap.has-toc { grid-template-columns: minmax(0, 1fr) 292px; }
  .v2.blog-post .blog-article > .wrap.has-toc .blog-body { margin: 0 0 0 auto; max-width: 840px; }
}

/* typography */
.v2.blog-post .blog-body .prose > p { font-size: 1.1rem; line-height: 1.82; }
.v2.blog-post .blog-body .prose > p:first-of-type { font-size: 1.16rem; color: var(--ink-2); }
.v2.blog-post .blog-body h2 { scroll-margin-top: 112px; margin-top: 2.6rem; }
.v2.blog-post .blog-body h2::before { content: ""; display: block; width: 36px; height: 2px; background: var(--summit); margin: 0 0 .85rem; border-radius: 2px; }
.v2.blog-post .blog-body h3 { scroll-margin-top: 112px; }
.v2.blog-post .blog-body .prose ul li::marker,
.v2.blog-post .blog-body .prose ol li::marker { color: var(--glacier); font-weight: 700; }
.v2.blog-post .blog-body .prose a:not(.btn2) { text-decoration: underline; text-decoration-color: rgba(29,111,165,.35); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.v2.blog-post .blog-body .prose a:not(.btn2):hover { text-decoration-color: var(--glacier); }
.v2.blog-post .blog-fig { max-width: none; }
.v2.blog-post .blog-fig img { width: 100%; }
.v2.blog-post .blog-body .prose strong { color: var(--ink); }

/* the article's own inline "Tabla de Contenidos" is replaced by the
   sticky / collapsible TOC that blog.js builds */
.v2 .has-toc .toc-inline { display: none; }

/* ---------- sticky TOC (desktop) ---------- */
.v2 .post-toc {
  display: none;
  position: sticky; top: 104px; align-self: start;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 1.2rem 1.25rem 1.05rem; box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 124px); overflow: auto; scrollbar-width: thin;
}
@media (min-width: 1100px) { .v2 .post-toc { display: block; } }
.v2 .post-toc .toc-title { font-family: var(--ff-eyebrow); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--glacier); font-weight: 700; margin: 0 0 .75rem; display: flex; align-items: center; gap: .55em; }
.v2 .post-toc .toc-title i { color: var(--summit); }
.v2 .post-toc ol { list-style: none; margin: 0; padding: 0; }
.v2 .post-toc li { margin: 0; }
.v2 .post-toc a { display: block; padding: .46rem .6rem .46rem .95rem; border-left: 2px solid var(--line); color: var(--slate); font-size: .9rem; line-height: 1.4; transition: color .2s, border-color .2s, background .2s; }
.v2 .post-toc a:hover { color: var(--glacier); border-color: var(--glacier); }
.v2 .post-toc a.active { color: var(--ink); font-weight: 600; border-color: var(--summit); background: linear-gradient(90deg, var(--summit-soft), transparent 85%); }
.v2 .post-toc .toc-progress { height: 3px; background: var(--line); border-radius: 2px; margin: 1rem 0 0; overflow: hidden; }
.v2 .post-toc .toc-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--glacier), var(--summit)); transition: width .15s linear; }
.v2 .post-toc .toc-cta { display: flex; align-items: center; justify-content: center; gap: .5em; margin-top: 1rem; padding: .7em 1em; border-radius: 100px; background: var(--glacier); color: #fff; font-weight: 600; font-size: .88rem; }
.v2 .post-toc .toc-cta:hover { background: var(--glacier-deep); color: #fff; }

/* ---------- collapsible TOC (mobile / tablet) ---------- */
.v2 .toc-mobile { display: block; margin: 0 0 1.7rem; border: 1px solid var(--line); border-radius: var(--r); background: #fff; box-shadow: var(--shadow-sm); }
@media (min-width: 1100px) { .v2 .toc-mobile { display: none; } }
.v2 .toc-mobile summary { cursor: pointer; padding: .95rem 1rem; font-weight: 600; color: var(--ink); list-style: none; display: flex; align-items: center; gap: .6em; user-select: none; }
.v2 .toc-mobile summary::-webkit-details-marker { display: none; }
.v2 .toc-mobile summary i { color: var(--summit); }
.v2 .toc-mobile summary::after { content: "+"; margin-left: auto; color: var(--glacier); font-size: 1.35rem; line-height: 1; font-weight: 300; }
.v2 .toc-mobile[open] summary::after { content: "–"; }
.v2 .toc-mobile ol { margin: 0; padding: 0 1rem 1rem 2.2rem; }
.v2 .toc-mobile li { margin: .4rem 0; line-height: 1.4; }
.v2 .toc-mobile a { color: var(--slate); }
.v2 .toc-mobile a:hover { color: var(--glacier); }

/* ---------- meta + share bar ---------- */
.v2 .post-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.4rem; padding: .9rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 0 1.9rem; }
.v2 .post-bar.bottom { margin: 2.2rem 0 0; border-bottom: 0; }
.v2 .pb-meta { display: flex; flex-wrap: wrap; gap: .45rem 1.25rem; font-size: .86rem; color: var(--mist); font-weight: 600; letter-spacing: .03em; }
.v2 .pb-meta i { color: var(--summit); margin-right: .45em; }
.v2 .pb-meta a { color: var(--ink); }
.v2 .share { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.v2 .share .lbl { font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; color: var(--mist); font-weight: 700; margin-right: .25rem; }
.v2 .share a, .v2 .share button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; cursor: pointer; transition: all .2s; text-decoration: none; padding: 0; font-family: inherit; }
.v2 .share svg { width: 16px; height: 16px; fill: currentColor; }
.v2 .share a:hover, .v2 .share button:hover { background: var(--glacier); border-color: var(--glacier); color: #fff; transform: translateY(-2px); }
.v2 .share .wa:hover { background: #25d366; border-color: #25d366; }
.v2 .toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px); background: var(--ink); color: #fff; padding: .7em 1.25em; border-radius: 100px; font-size: .9rem; opacity: 0; transition: opacity .3s, transform .3s; z-index: 4000; pointer-events: none; box-shadow: var(--shadow); }
.v2 .toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- author box ---------- */
.v2 .author-box { display: grid; grid-template-columns: 92px 1fr; gap: 1.3rem; align-items: center; background: linear-gradient(135deg, var(--glacier-soft), #fff 70%); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.5rem 1.6rem; margin: 2.4rem 0 1.6rem; }
.v2 .author-box img { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: var(--shadow-sm); }
.v2 .author-box .ab-eyebrow { font-family: var(--ff-eyebrow); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--glacier); font-weight: 700; margin: 0 0 .3rem; }
.v2 .author-box h3 { margin: 0 0 .15rem; font-size: 1.18rem; color: var(--ink); }
.v2 .author-box .ab-role { margin: 0 0 .5rem; font-size: .84rem; color: var(--summit); font-weight: 700; letter-spacing: .03em; }
.v2 .author-box p { margin: 0; color: var(--slate); font-size: .95rem; line-height: 1.62; }
.v2 .author-box .more { display: inline-flex; align-items: center; gap: .4em; margin-top: .6rem; font-weight: 600; color: var(--glacier); font-size: .92rem; }
@media (max-width: 560px) {
  .v2 .author-box { grid-template-columns: 64px 1fr; gap: 1rem; padding: 1.15rem; }
  .v2 .author-box img { width: 64px; height: 64px; }
}

/* ---------- tables (articles other than the ones that ship their own) ---------- */
.v2 .tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.4rem 0 1.8rem; border: 1px solid var(--line); border-radius: var(--r); background: #fff; box-shadow: var(--shadow-sm); }
.v2 .tbl-scroll > table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: .95rem; margin: 0; }
.v2 .tbl-scroll th { background: var(--glacier-soft); color: var(--ink); font-family: var(--ff-eyebrow); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; text-align: left; padding: .8rem .9rem; }
.v2 .tbl-scroll td { padding: .8rem .9rem; border-top: 1px solid var(--line); vertical-align: top; color: var(--slate); }

/* back button row */
.v2.blog-post .blog-back { margin-top: 1.2rem; }

/* =====================================================================
   BLOG INDEX
   ===================================================================== */
.v2.blog-index .blog-tools { display: flex; flex-wrap: wrap; gap: .9rem 1.2rem; align-items: center; justify-content: space-between; margin: 0 0 1.7rem; }
.v2 .blog-search { position: relative; flex: 1 1 280px; max-width: 440px; }
.v2 .blog-search input { width: 100%; padding: .82em 2.6em .82em 2.7em; border: 1px solid var(--line); border-radius: 100px; font: inherit; font-size: .95rem; background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); outline: none; transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; }
.v2 .blog-search input::placeholder { color: var(--mist); }
.v2 .blog-search input:focus { border-color: var(--glacier); box-shadow: 0 0 0 3px rgba(29,111,165,.15); }
.v2 .blog-search svg { position: absolute; left: 1.05em; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; fill: none; stroke: var(--mist); stroke-width: 2; pointer-events: none; }
.v2 .blog-search .clear { position: absolute; right: .55em; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--snow-2); color: var(--slate); cursor: pointer; display: none; align-items: center; justify-content: center; font-size: 1rem; line-height: 1; }
.v2 .blog-search.has-value .clear { display: inline-flex; }
.v2 .blog-chips { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.v2 .chip { border: 1px solid var(--line); background: #fff; color: var(--slate); border-radius: 100px; padding: .52em 1.05em; font-size: .82rem; font-weight: 600; letter-spacing: .04em; cursor: pointer; white-space: nowrap; transition: all .2s; font-family: var(--ff-body); line-height: 1.2; }
.v2 .chip:hover { border-color: var(--glacier); color: var(--glacier); }
.v2 .chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.v2 .chip .n { opacity: .6; font-weight: 500; margin-left: .35em; }
.v2 .blog-count { font-size: .8rem; color: var(--mist); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.v2 .blog-empty { display: none; text-align: center; padding: 3rem 1rem; color: var(--slate); border: 1px dashed var(--line); border-radius: var(--r-lg); background: #fff; }
.v2 .blog-empty.show { display: block; }
.v2 .card2.is-hidden, .v2 .bfeat-wrap.is-hidden { display: none !important; }
@media (max-width: 760px) {
  .v2.blog-index .blog-tools { gap: .8rem; }
  .v2 .blog-search { max-width: none; flex-basis: 100%; }
  .v2 .blog-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; margin: 0 -1.1rem; padding-left: 1.1rem; padding-right: 1.1rem; flex-basis: 100%; }
  .v2 .blog-chips::-webkit-scrollbar { display: none; }
  .v2 .blog-count { display: none; }
}

/* cards & featured polish */
.v2.blog-index .blog-cards { gap: 1.8rem; }
.v2.blog-index .card2 .body { padding: 1.35rem 1.45rem 1.55rem; }
.v2.blog-index .card2 .body h3 { font-family: var(--ff-display); font-size: 1.24rem; line-height: 1.3; }
.v2.blog-index .card2 .body p { font-size: .95rem; line-height: 1.62; }
.v2.blog-index .card2 .more { font-weight: 600; }
.v2.blog-index .card2:hover .ph img { transform: scale(1.05); }
.v2.blog-index .bfeat-body h3 { font-size: clamp(1.6rem, 2.8vw, 2.25rem); }
.v2.blog-index .bfeat-media[data-badge]::after { content: attr(data-badge); position: absolute; top: 16px; left: 16px; z-index: 2; background: var(--summit); color: var(--ink); font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; padding: .5em .95em; border-radius: 100px; box-shadow: var(--shadow-sm); }
@media (min-width: 1360px) { .v2.blog-index .blog-cards { gap: 2rem; } }

/* reduced motion: keep the blog layer calm */
@media (prefers-reduced-motion: reduce) {
  .v2 .share a, .v2 .share button, .v2 .chip, .v2 .toast, .v2 .post-toc a, .v2 .post-toc .toc-progress span { transition: none; }
}
