/* La ventana de alta: lo que es o parte y el móvil con el de hoy, que lleva dentro el botón de WhatsApp.
   La cargan la portada de alta y las páginas de noticias. El móvil es el mismo de la portada, con clases propias
   para no mezclarse con las de estilo.css. */

.modal-alta {
  --ma-alto: min(680px, calc(94svh - 48px));
  width: min(900px, calc(100vw - 32px));
  max-width: none;
  height: calc(var(--ma-alto) + 48px);
  max-height: 94svh;
  margin: auto;
  padding: 0;
  border: 0;
  background: #fff;
  color: #141412;
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.45;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal-alta[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "cabeza movil" "corpo movil";
}
.modal-alta::backdrop { background: rgba(20, 20, 18, 0.6); }
html:has(.modal-alta[open]) { overflow: hidden; }
.modal-alta h2, .modal-alta p, .modal-alta dl, .modal-alta dd { margin: 0; padding: 0; }
.modal-alta a:focus-visible, .modal-alta button:focus-visible { outline: 2px solid #141412; outline-offset: 2px; }

.ma-cabeza { grid-area: cabeza; padding: 36px 36px 0; }
.ma-cabeza img { width: 92px; height: auto; margin-bottom: 18px; }
.modal-alta h2 { font-family: "Paytone One", "Arial Black", system-ui, sans-serif; font-weight: 400; font-size: 1.9rem; line-height: 1.08; text-wrap: balance; }
.ma-pecha {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.ma-pecha svg { display: block; width: 20px; height: 20px; margin: 12px; }
.ma-corpo { grid-area: corpo; padding: 14px 36px 32px; overflow-y: auto; }
.ma-entrada { font-size: 1.1rem; }
.ma-corpo dl { margin-top: 18px; }
.ma-corpo dt { padding-top: 9px; border-top: 1px solid #dcdad4; font-weight: 800; }
.modal-alta .ma-corpo dd { padding-bottom: 9px; line-height: 1.4; }

/* El móvil, sobre toxo */
.ma-movil { grid-area: movil; display: grid; place-items: center; padding: 24px 56px 24px 40px; background: #F9C80E; }
.ma-marco { width: 326px; padding: 9px; background: #0c0c0b; border-radius: 48px; box-shadow: inset 0 0 0 2px #3a3a37, 0 24px 40px -18px rgba(20, 20, 18, 0.5); }
.ma-pantalla { display: flex; flex-direction: column; height: calc(var(--ma-alto) - 18px); border-radius: 40px; overflow: hidden; background: #EFE7DD; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.ma-estado { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 10px 24px 6px; background: #fff; font-size: 0.8rem; font-weight: 700; }
.ma-illa { width: 84px; height: 24px; background: #0c0c0b; border-radius: 999px; }
.ma-iconos { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.ma-sinal { width: 16px; height: 11px; background: linear-gradient(to right, #141412 0 3px, transparent 3px 4.3px, #141412 4.3px 7.3px, transparent 7.3px 8.6px, #141412 8.6px 11.6px, transparent 11.6px 13px, #141412 13px 16px); clip-path: polygon(0 60%, 100% 0, 100% 100%, 0 100%); }
.ma-bateria { width: 23px; height: 11px; border: 1.5px solid #141412; border-radius: 3.5px; background: linear-gradient(#141412, #141412) 1.5px center / 72% 5px no-repeat; }
.ma-barra { display: flex; align-items: center; gap: 8px; padding: 6px 12px 9px 6px; background: #fff; border-bottom: 1px solid #e1dcd3; line-height: 1.2; }
.ma-barra svg { width: 24px; height: 24px; flex: none; color: #128C7E; }
.ma-barra img { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.ma-barra strong { display: block; font-size: 0.92rem; font-weight: 600; }
.ma-barra small { font-size: 0.72rem; color: #667781; }
.ma-chat { flex: 1; min-height: 0; padding: 8px 9px 12px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; text-align: center; }
.ma-chat::-webkit-scrollbar { display: none; }
.ma-chat:focus-visible { outline: 3px solid #F9C80E; outline-offset: -3px; }
.ma-data { display: inline-block; margin-bottom: 8px; padding: 3px 10px; background: #fff; border-radius: 7px; font-size: 0.68rem; color: #54656f; box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13); }
.ma-globo { position: relative; max-width: 94%; min-height: 60px; padding: 7px 9px 18px; background: #fff; border-radius: 0 9px 9px 9px; text-align: left; font-size: 0.8rem; line-height: 1.36; color: #111b21; box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13); }
.ma-globo::before { content: ""; position: absolute; left: -7px; top: 0; border-top: 9px solid #fff; border-left: 8px solid transparent; }
.ma-globo p { overflow-wrap: anywhere; }
.ma-globo .ma-globo-texto p + p { margin-top: 9px; }
.ma-hora { position: absolute; right: 9px; bottom: 4px; font-size: 0.64rem; color: #667781; }

/* Donde WhatsApp dice que solo escriben los administradores, el botón y la letra pequeña. */
.ma-pe { flex: none; padding: 11px 14px 16px; background: #fff; border-top: 1px solid #e1dcd3; font-family: "Figtree", system-ui, sans-serif; text-align: center; }
.ma-boton { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 10px; border-radius: 999px; background: #1DA64A; color: #fff; font-weight: 800; font-size: 1.08rem; line-height: 1.15; text-decoration: none; }
.ma-boton:hover { background: #178B3D; }
.ma-boton .ico { width: 24px; height: 24px; flex: none; }
.modal-alta .ma-letra { margin-top: 8px; font-size: 0.74rem; line-height: 1.32; color: #55534d; text-wrap: balance; }
.ma-letra a { color: inherit; text-underline-offset: 2px; }

/* En pantallas estrechas: el título, el móvil (con el botón siempre a la vista) y, deslizando, lo demás. */
@media (max-width: 780px) {
  .modal-alta {
    --ma-alto: clamp(350px, calc(94svh - 116px), 640px);
    width: min(440px, calc(100vw - 24px));
    height: auto;
  }
  .modal-alta[open] { display: block; }
  .ma-cabeza { display: flex; align-items: center; gap: 10px; padding: 12px 64px 10px 16px; background: #F9C80E; }
  .ma-cabeza img { width: 40px; margin: 0; }
  .modal-alta h2 { font-size: 1.04rem; }
  .ma-movil { padding: 2px 14px 14px; }
  .ma-marco { width: min(326px, 100%); border-radius: 42px; }
  .ma-pantalla { border-radius: 34px; }
  .ma-corpo { padding: 14px 18px 18px; }
  .ma-entrada { font-size: 1.02rem; }
  .ma-corpo dl { margin-top: 12px; }
  .ma-corpo dt, .ma-corpo dd { font-size: 0.96rem; }
}
@media (max-width: 780px) and (max-height: 640px) {
  .ma-estado { display: none; }
  .ma-barra { padding-top: 10px; }
}
