/* Experiencia v6 · iPhone estable, comentarios sin zoom y tarjetas sin recortes */

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.phone-frame,
.mobile-shell {
  max-width: 100%;
  overflow-x: hidden;
}

.mobile-content {
  overscroll-behavior-y: contain;
  overscroll-behavior-x: none;
  overflow-x: hidden !important;
}

/* iOS Safari amplía automáticamente el viewport al enfocar campos con texto < 16 px. */
@media (max-width: 900px) {
  .phone-frame input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  .phone-frame textarea,
  .phone-frame select,
  .community-comment-dock input,
  .community-comment-dock textarea,
  .football-comment-dock input,
  .football-comment-dock textarea,
  .post-comment-form input,
  .post-comment-form textarea {
    font-size: 16px !important;
    line-height: 1.3 !important;
    transform: none !important;
    zoom: 1 !important;
  }

  .community-comment-dock textarea,
  .football-comment-dock textarea,
  [data-post-comment-form] textarea,
  [data-football-comment-form] textarea {
    min-height: 2.85rem;
  }
}

/* El dock debe quedarse visualmente anclado cuando aparece el teclado. */
body.keyboard-open .community-comment-dock,
body.ios-keyboard-open .community-comment-dock,
body.keyboard-open .football-comment-dock,
body.ios-keyboard-open .football-comment-dock {
  transform: translate3d(0, 0, 0) !important;
  will-change: auto;
}

body.keyboard-open .mobile-header,
body.ios-keyboard-open .mobile-header {
  transform: none !important;
}

/* Cabecera del debate: misma lectura limpia que la ficha del partido. */
.community-post-hero.match-discussion-hero {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 0 !important;
  height: auto !important;
  aspect-ratio: auto !important;
  overflow: hidden !important;
  padding: 1rem 1rem 1.05rem !important;
  border: 1px solid rgba(185, 128, 31, 0.25) !important;
  border-radius: 1.15rem !important;
  background: #ffffff !important;
  background-image: none !important;
  box-shadow: 0 0.55rem 1.35rem rgba(42, 34, 22, 0.06) !important;
  filter: none !important;
  color: #171512 !important;
  text-shadow: none !important;
}

.community-post-hero.match-discussion-hero::before,
.community-post-hero.match-discussion-hero::after,
.community-post-hero.match-discussion-hero > *::before,
.community-post-hero.match-discussion-hero > *::after {
  content: none !important;
  display: none !important;
  background: none !important;
}

.community-post-hero.match-discussion-hero > * {
  position: relative;
  z-index: 2;
  filter: none !important;
  text-shadow: none !important;
}

.match-discussion-hero__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  color: #9b6209 !important;
  font-size: 0.74rem !important;
  font-weight: 900;
  letter-spacing: 0.035em;
  line-height: 1.15;
  text-transform: uppercase;
}

.match-discussion-hero__scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.8rem minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin: 1rem 0 0 !important;
  padding: 0.15rem 0 0.2rem;
}

.match-discussion-hero__team {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  min-width: 0;
  color: #171512 !important;
  text-align: center;
}

.match-discussion-hero__team img {
  display: block;
  width: 4rem !important;
  height: 4rem !important;
  max-width: 100%;
  object-fit: contain !important;
  filter: none !important;
}

.match-discussion-hero__team strong {
  width: 100%;
  overflow: hidden;
  color: #171512 !important;
  font-size: 0.84rem !important;
  font-weight: 850;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-discussion-hero__vs {
  display: grid;
  justify-items: center;
  gap: 0.16rem;
  color: #171512 !important;
  text-align: center;
}

.match-discussion-hero__vs small {
  color: #777168 !important;
  font-size: 0.62rem !important;
  font-weight: 650;
  line-height: 1.1;
}

.match-discussion-hero__vs strong {
  color: #111 !important;
  font-size: 1.7rem !important;
  font-weight: 950;
  line-height: 1;
}

.match-discussion-hero__footer {
  display: none !important;
}

/* Evita que gradientes, pseudo-elementos o imágenes asomen fuera de las tarjetas. */
.community-post-hero,
.community-news-card,
.community-post-card,
.draw-hero,
.draw-list-art,
.draw-card,
.event-art,
.event-card,
.ticket-art,
.ticket-card,
.travel-card,
.detail-hero,
.media-card,
.mobile-card {
  isolation: isolate;
  overflow: hidden !important;
  background-clip: padding-box;
}

.community-post-hero > img,
.community-news-card > img,
.draw-hero > img,
.draw-list-art > img,
.event-art > img,
.ticket-art > img,
.detail-hero > img {
  display: block;
  max-width: 100%;
}

/* Las imágenes de portada nunca deben quedar con una línea negra de una capa inferior. */
.community-post-hero img,
.community-news-card img,
.draw-hero img,
.draw-list-art img,
.event-art img,
.ticket-art img,
.travel-card img,
.detail-hero img {
  backface-visibility: hidden;
  transform: translateZ(0);
}

@media (max-width: 520px) {
  .community-post-hero.match-discussion-hero {
    padding: 0.9rem 0.85rem 0.95rem !important;
  }

  .match-discussion-hero__scoreboard {
    grid-template-columns: minmax(0, 1fr) 3.2rem minmax(0, 1fr);
    gap: 0.35rem;
  }

  .match-discussion-hero__team img {
    width: 3.55rem !important;
    height: 3.55rem !important;
  }

  .match-discussion-hero__team strong {
    font-size: 0.78rem !important;
  }
}
