/* Blog — remonti77.eu (extends styles.css) */
.blog-page {
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.blog-page .footer {
  display: block;
  flex-shrink: 0;
  margin-top: auto;
  width: 100%;
}

.header__inner--blog .header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.lang-select--blog .lang-select__input {
  max-width: 7.5rem;
}

.blog-page main {
  overflow-x: hidden;
  overflow-y: visible;
}

.blog-hero {
  padding: calc(var(--header-h) + 2rem) 0 2rem;
  background: var(--bg-section);
  border-bottom: 1px solid var(--border);
}

.blog-hero__title {
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  font-weight: 700;
  margin-bottom: 0.35rem;
  max-width: 28ch;
  line-height: 1.2;
}

.blog-hero__desc {
  color: var(--text-muted);
  max-width: 52ch;
  font-size: 1rem;
  line-height: 1.55;
}

.blog-hero--landing {
  padding: calc(var(--header-h) + 0.75rem) 0 1rem;
}

.blog-hero__grid {
  display: grid;
  grid-template-columns: 1fr minmax(14rem, 22rem);
  gap: 1.25rem;
  align-items: center;
}

.blog-hero__about {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-3d);
  border: 1px solid var(--border);
}

.blog-hero__about--accent {
  padding: 0.45rem;
  background: linear-gradient(145deg, var(--accent) 0%, #a84a1a 55%, var(--accent-hover) 100%);
  border: none;
  box-shadow: 0 14px 36px var(--accent-glow), 0 4px 14px rgba(0, 0, 0, 0.12);
}

.blog-hero__about--accent .blog-hero__about-img {
  border-radius: calc(var(--radius-lg) - 5px);
  display: block;
}

.blog-hero__about--accent figcaption {
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-weight: 600;
  text-align: center;
}

.blog-hero__about-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  -webkit-user-drag: none;
  touch-action: pan-y pinch-zoom;
  pointer-events: auto;
}

.blog-hero__about figcaption {
  padding: 0.65rem 0.85rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--card-bg);
  border-top: 1px solid var(--border);
}

.blog-grid__heading {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  padding-top: 0.25rem;
}

.blog-grid__intro {
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  max-width: 55ch;
  line-height: 1.5;
}

.blog-grid__count {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 1rem;
}

.blog-card--soon {
  opacity: 0.72;
  cursor: default;
  pointer-events: none;
}

.blog-card--soon:hover {
  transform: none;
  box-shadow: var(--shadow);
  border-color: var(--border);
}

.blog-article__wrap {
  max-width: 46rem;
}

.blog-toc {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  margin-bottom: 1.75rem;
}

.blog-toc__title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.blog-toc ol {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text-muted);
  line-height: 1.55;
  font-size: 0.9rem;
}

.blog-toc a {
  color: var(--accent);
  text-decoration: none;
}

.blog-toc a:hover {
  text-decoration: underline;
}

.blog-intro-questions {
  background: var(--bg-section);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.blog-intro-questions p {
  margin: 0 0 0.5rem;
  font-weight: 500;
  color: var(--text);
}

.blog-intro-questions p:last-child {
  margin-bottom: 0;
}

.blog-figure {
  margin: 1.5rem 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.blog-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.blog-figure figcaption {
  padding: 0.6rem 0.85rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--card-bg);
}

.blog-flags {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

.blog-flags .bad,
.blog-flags .good,
.blog-flags__col {
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.blog-flags .bad {
  background: rgba(180, 40, 40, 0.06);
}

.blog-flags .good {
  background: rgba(40, 120, 60, 0.08);
}

.blog-flags h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.blog-flags ul {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: 1.25rem;
  padding: 0.5rem 0 2rem;
}

.blog-card {
  position: relative;
  z-index: 1;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow);
  border-color: var(--accent);
}

.blog-card__img-wrap {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-elevated);
}

.blog-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
  -webkit-user-drag: none;
  touch-action: pan-y pinch-zoom;
  pointer-events: auto;
}

.blog-card:hover .blog-card__img {
  transform: scale(1.05);
}

@media (hover: none) {
  .blog-card:hover .blog-card__img {
    transform: none;
  }
}

.blog-card__body {
  padding: 1rem 1.1rem 1.15rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card__tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.blog-card__title {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.4rem;
}

.blog-card__subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
  flex: 1;
}

.blog-card__more {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
}

/* Article */
.blog-article {
  padding: calc(var(--header-h) + 0.5rem) 0 3rem;
}

.blog-article__meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.blog-article__title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.4rem;
}

.blog-article__lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.blog-article__hero-img {
  width: 100%;
  max-height: 22rem;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin: 0 0 1.25rem;
  box-shadow: var(--shadow-3d);
  -webkit-user-drag: none;
  touch-action: pan-y pinch-zoom;
  pointer-events: auto;
}

.blog-article__content {
  max-width: 42rem;
}

.blog-article__content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.75rem 0 0.65rem;
  color: var(--text);
}

.blog-article__content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}

.blog-article__content p {
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.blog-article__content ul {
  margin: 0 0 1rem 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.blog-article__content li {
  margin-bottom: 0.35rem;
}

.blog-article__content strong {
  color: var(--text);
  font-weight: 600;
}

/* FAQ acordeón */
.blog-faq {
  margin: 2rem 0 1.5rem;
  max-width: 42rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.blog-faq__item + .blog-faq__item {
  border-top: 1px solid var(--border);
}

.blog-faq__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.15rem;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.blog-faq__trigger:hover {
  background: var(--bg-alt, rgba(0, 0, 0, 0.03));
  color: var(--accent);
}

.blog-faq__trigger[aria-expanded="true"] {
  background: rgba(199, 91, 42, 0.08);
  color: var(--accent);
}

.blog-faq__icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  position: relative;
}

.blog-faq__icon::before,
.blog-faq__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transform: translate(-50%, -50%);
  transition: transform 0.25s ease;
}

.blog-faq__icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.blog-faq__trigger[aria-expanded="true"] .blog-faq__icon::after {
  transform: translate(-50%, -50%) rotate(0deg);
  opacity: 0;
}

.blog-faq__panel {
  padding: 0 1.15rem 1rem;
}

.blog-faq__panel[hidden] {
  display: none;
}

.blog-faq__panel p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.blog-cta {
  margin-top: 2.5rem;
  max-width: 42rem;
}

.blog-cta.contact__box {
  text-align: center;
}

.blog-cta h2 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  margin-bottom: 0.5rem;
}

.blog-cta p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.blog-cta .contact__actions {
  justify-content: center;
  flex-wrap: wrap;
}

.blog-page .header__inner--blog {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
}

.blog-page .header__brand {
  justify-self: start;
}

.blog-page .header__actions {
  justify-self: end;
}

.header__nav--blog-center {
  justify-self: center;
  flex: none;
}

.blog-nav-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0 1rem;
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}

.blog-nav-back:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.blog-nav-back svg {
  flex-shrink: 0;
}

.blog-page .fab-scroll-top {
  display: none;
}

.blog-page .fab-scroll-top.is-visible {
  display: flex;
}

.blog-page .fab-blog-back {
  display: none !important;
}

.blog-page .fab-stack {
  z-index: 1050;
}

.blog-footer-cta {
  padding: 2rem 0 3rem;
  background: var(--bg-section);
  border-top: 1px solid var(--border);
}

.blog-article__content table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.blog-article__content img {
  max-width: 100%;
  height: auto;
}

.blog-article__content pre,
.blog-article__content .blog-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
  .blog-page .header__inner--blog {
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem;
  }

  .header__inner--blog .header__name {
    display: none;
  }

  .lang-select--blog .lang-select__input {
    max-width: 6.25rem;
    font-size: 0.8125rem;
    padding: 0.35rem 0.5rem;
  }

  .blog-card__img {
    aspect-ratio: 16 / 10;
    object-fit: cover;
  }

  .blog-card__body {
    padding: 0.85rem 1rem 1rem;
  }

  .blog-card__title {
    font-size: 1rem;
    line-height: 1.35;
  }

  .blog-nav-back {
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem 0.65rem;
  }

  .blog-nav-back span {
    font-size: 0.8rem;
  }

  .blog-nav-back {
    padding: 0 0.65rem;
    min-width: 44px;
  }
}

/* Móvil y tablet: botón «назад» visible (styles.css oculta .header__nav por defecto) */
@media (max-width: 900px) {
  .blog-page .header__nav.header__nav--blog-center {
    position: static;
    inset: auto;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    overflow: visible;
    z-index: 1;
  }
}

/* Tablet */
@media (max-width: 900px) {
  .blog-hero__grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .blog-hero__title {
    max-width: none;
    font-size: clamp(1.45rem, 5vw, 1.85rem);
  }

  .blog-hero__desc {
    max-width: none;
    font-size: 0.9375rem;
  }

  .blog-hero__about-img {
    max-height: none;
    aspect-ratio: 16 / 10;
  }

  .blog-flags {
    grid-template-columns: 1fr;
  }

  .blog-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
    gap: 1rem;
  }

  .blog-article__wrap {
    max-width: 100%;
  }

  .blog-article__title {
    font-size: clamp(1.35rem, 5vw, 1.75rem);
  }

  .blog-article__hero-img {
    max-height: none;
    aspect-ratio: 16 / 10;
    margin: 0.75rem 0 1.25rem;
  }

  .blog-article__content {
    font-size: 1rem;
  }

  .blog-toc,
  .blog-faq,
  .blog-flags {
    max-width: 100%;
  }

  .blog-faq__trigger {
    min-height: 48px;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
  }

  .blog-cta .contact__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .blog-cta .contact__actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  .blog-footer-cta {
    padding: 1.5rem 0 2.5rem;
  }

  .blog-page .fab-stack {
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: max(0.75rem, env(safe-area-inset-bottom));
  }
}

/* Tablet */
@media (min-width: 601px) and (max-width: 1024px) {
  .blog-hero__grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .blog-hero__title {
    max-width: none;
    font-size: clamp(1.5rem, 3.5vw, 2rem);
  }

  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem;
  }

  .blog-article__wrap {
    max-width: 42rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .blog-flags {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .blog-article__content {
    font-size: 1.0625rem;
    line-height: 1.7;
  }

  .blog-toc {
    padding: 1.1rem 1.25rem;
  }
}

/* Escritorio ancho */
@media (min-width: 1200px) {
  .blog-article__wrap {
    max-width: 48rem;
  }

  .blog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .blog-hero__grid {
    grid-template-columns: 1.15fr minmax(16rem, 24rem);
    gap: 2rem;
  }
}

/* Móvil */
@media (max-width: 600px) {
  .blog-hero--landing {
    padding: calc(var(--header-h) + 0.5rem) 0 0.85rem;
  }

  .blog-hero__text .section__label {
    font-size: 0.7rem;
  }

  .blog-grid {
    grid-template-columns: 1fr;
    padding-bottom: 1.5rem;
  }

  .blog-card__body {
    padding: 0.9rem 1rem 1rem;
  }

  .blog-card__title {
    font-size: 0.98rem;
  }

  .blog-intro-questions {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
  }

  .blog-article {
    padding: calc(var(--header-h) + 0.35rem) 0 2rem;
  }

  .blog-article__lead {
    font-size: 1rem;
    line-height: 1.55;
  }

  .blog-article__content h2 {
    font-size: 1.15rem;
    margin-top: 1.75rem;
  }

  .blog-article__content p,
  .blog-article__content li {
    font-size: 1rem;
    line-height: 1.65;
  }

  .blog-nav-back {
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem 0.65rem;
  }

  .blog-nav-back span {
    font-size: 0.8rem;
  }

  .blog-grid__heading {
    font-size: 1.2rem;
  }
}
