/*
 * Santuario Winston · Punto 6
 * Capa de pulido visual mobile-first.
 * Se carga después de winston-enhancements.css para mantener los cambios
 * aislados y reversibles sin reescribir la base visual aprobada.
 */

/* El título contiene una palabra larga ("Transparencia").
 * La base heredada limita el bloque a 10/11ch y hace que la palabra desborde
 * su propio h1. Esta capa conserva el corte editorial en dos líneas sin
 * permitir que el texto salga de su caja en ningún breakpoint. */
.transparency-hero h1 {
  max-width: 14ch;
}

/* En escritorio muy ancho el clamp heredado alcanza 7rem y la palabra
 * "Transparencia" vuelve a superar la anchura de su columna. Mantener el
 * tamaño que ya funciona a 1366px evita ese salto sin alterar el layout. */
@media (min-width: 1600px) {
  .transparency-hero h1 {
    font-size: 6.4rem;
  }
}

@media (max-width: 900px) {
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .site-header {
    min-height: 74px;
  }

  .brand {
    min-width: 0;
    gap: 9px;
  }

  .brand img {
    width: 46px;
    height: 46px;
    flex: none;
    object-fit: contain;
  }

  .brand span {
    min-width: 0;
    font-size: clamp(.96rem, 4.2vw, 1.08rem);
    line-height: 1.04;
  }

  .home-hero h1,
  .page-hero h1,
  .legal-hero h1 {
    font-size: clamp(2.95rem, 13.2vw, 4.55rem);
    line-height: .94;
    overflow-wrap: normal;
    word-break: normal;
  }

  .floating-actions {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(14px + env(safe-area-inset-bottom));
    z-index: 30;
  }

  .floating-actions a {
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    justify-content: center;
    padding: 0;
  }

  .floating-actions a span:last-child {
    display: none;
  }

  .storefront-hero-grid,
  .storefront-transparency-grid {
    grid-template-columns: 1fr;
  }

  .storefront-steps,
  .storefront-collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .storefront-books-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-header {
    min-height: 70px;
  }

  .photo-carousel:not(.is-large) .photo-track figure {
    flex-basis: min(84vw, 520px);
    width: min(84vw, 520px);
    height: auto;
    aspect-ratio: 4 / 5;
  }

  .photo-carousel:not(.is-large) .photo-track img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  .resident-profile-photo,
  .resident-profile-photo img {
    min-height: 0;
  }

  .resident-profile-photo {
    aspect-ratio: 4 / 3;
  }

  .resident-profile-photo img,
  .resident-related-card img {
    width: 100%;
    height: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center;
  }

  .home-discover-card {
    min-height: 340px;
  }

  .home-discover-card div {
    left: 1.25rem;
    right: 1.25rem;
    bottom: 1.25rem;
  }

  .storefront-steps,
  .storefront-collection-grid,
  .storefront-books-grid {
    grid-template-columns: 1fr;
  }

  .storefront-card,
  .storefront-book {
    min-width: 0;
  }

  .storefront-book {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 1rem;
  }

  .storefront-book-mark {
    width: 72px;
    height: 96px;
  }

  .content-index {
    min-width: 0;
  }

  .content-card {
    min-width: 0;
  }

  .content-body {
    min-width: 0;
    font-size: 1rem;
    line-height: 1.78;
  }

  .content-related-grid article {
    min-width: 0;
    grid-template-columns: 1fr;
  }

  .content-hero-image {
    max-height: none;
    height: auto;
  }

  .content-card > img,
  .content-related-grid img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }
}

@media (max-width: 620px) {
  .portal-dashboard,
  .portal-sponsorship-card {
    min-width: 0;
  }

  .portal-payment-row,
  .portal-incident {
    min-width: 0;
  }

  .portal-sponsorship-card > * {
    min-width: 0;
  }

  .portal-card-actions {
    width: 100%;
    justify-content: stretch;
  }

  .portal-card-actions .button {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 430px) {
  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  .site-header {
    min-height: 70px;
    padding-inline: 14px;
  }

  .brand img {
    width: 44px;
    height: 44px;
  }

  .brand span {
    font-size: clamp(.92rem, 4.35vw, 1rem);
  }

  .home-hero h1,
  .page-hero h1,
  .legal-hero h1 {
    font-size: clamp(2.72rem, 12.6vw, 3.85rem);
    line-height: .95;
  }

  .button-row {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .button-row .button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 360px) {
  .brand small {
    display: none;
  }

  .home-hero h1,
  .page-hero h1,
  .legal-hero h1 {
    font-size: clamp(2.5rem, 12.2vw, 3.25rem);
  }
}
