/* =====================================================================
   Responsive.css - Colegios Profesionales de Aragon
   Se carga DESPUES de Estilos.css y solo sobrescribe lo necesario.
   En pantallas de 955px o mas la web se ve igual que antes.
   Para volver al diseno anterior basta con quitar el <link> a este
   archivo (y la etiqueta meta viewport) de las paginas.
   ===================================================================== */

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* ---------- 1. Base fluida: anchos fijos -> maximos ---------- */

img, iframe, video, embed, object { max-width: 100%; }
img { height: auto; }

.ContenedorGlobal,
.ContenedorPrincipal,
.Cabecera,
.CabeceraPuntos,
.MiembrosPuntos,
.Pie,
.PieCierre { width: auto; max-width: 955px; }

.Menu,
.MiembrosTitulo,
.TituloPagina { width: auto; }

.ContenedorPortada { width: 100%; }

/* Portada: destacado (izq.) + actualidad (dcha.) en porcentajes
   370px / 955px y 550px + 35px / 955px */
.PortadaDestacados { width: 38.74%; box-sizing: border-box; }
.PortadaContenedorActualidad { width: 57.5%; margin-left: 3.66%; }

/* El texto ocupa el hueco que deja la foto, sin anchos calculados en el ASP */
.PortadaActualidadTexto { float: none; overflow: hidden; width: auto !important; }

/* Detalle de noticia / miembro / destacado: 685 + 20 + 250 de 955 */
.ContenedorDosColumnasIzquierda { width: 71.6%; margin-right: 2.1%; }
.ContenedorDosColumnasDerecha { width: 26.2%; }
.ListadoEnlacesDerecha { width: auto; }

/* Quienes somos: texto + imagen (antes estilos en linea 655px / 300px) */
.QSTexto { float: left; width: 68.5%; }
.QSImagen { float: left; width: 31.5%; text-align: right; }

/* Contenido que llega del editor (TinyMCE / pegado de Word) */
.ContenedorNormal img { max-width: 100% !important; height: auto !important; }
.ContenedorNormal table { max-width: 100%; }

/* Foto de noticia/destacado: en movil va encima del titular
   (en escritorio sigue en la columna derecha) */
.FotoSoloMovil { display: none; }

/* Menu: el boton hamburguesa solo existe en movil */
.MenuToggle { position: absolute; left: -9999px; opacity: 0; }
.MenuBoton { display: none; }

/* Listado de miembros (portada, pie y pagina Miembros) en rejilla */
.RejillaMiembros {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 2%;
  clear: both;
  margin-top: 12px;
}
.RejillaMiembros .ListadoMiembros {
  float: none;
  width: auto;
  padding: 12px 3%;
  border-bottom: 1px solid #d6d6d6;
}
.RejillaMiembros .LogoMiembros110 { margin-bottom: 6px; }

/* ---------- 2. Pantallas por debajo del ancho original (tablet) ---------- */

@media (max-width: 960px) {
  .ContenedorPrincipal,
  .Pie > .ContenedorUnaColumna {
    padding-left: 12px;
    padding-right: 12px;
    box-sizing: border-box;
  }
  .Menu { height: auto; overflow: hidden; }
  .Menu li { margin-right: 22px; }
  .TituloPagina { height: auto; min-height: 48px; }
}

/* ---------- 3. Movil ---------- */

@media (max-width: 760px) {
  body { padding: 0 0 10px 0; }

  /* Cabecera: logos reducidos, sin la foto de fondo */
  .Cabecera {
    height: auto;
    background-image: none;
    overflow: hidden;
    padding: 6px 12px;
  }
  .CabeceraLogo, .CabeceraLetras { height: auto; width: auto; }
  .CabeceraLogo img { width: 76px; height: 70px; }
  .CabeceraLetras img { width: 147px; height: 70px; }

  /* Menu hamburguesa (sin JavaScript) */
  .Menu { padding: 0; }
  .MenuBoton {
    display: block;
    padding: 10px 12px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
  }
  .MenuBoton:before { content: "\2630"; margin-right: 8px; font-size: 17px; }
  .MenuToggle:checked ~ .MenuBoton:before { content: "\2715"; }
  .MenuToggle:focus-visible ~ .MenuBoton { outline: 2px solid #e30629; }
  .Menu ul { display: none; margin: 0; }
  .MenuToggle:checked ~ ul { display: block; }
  .Menu li {
    float: none;
    margin: 0;
    padding: 0 0 0 34px;
    background-position: 14px center;
    border-top: 1px solid #e8e3c4;
    font-size: 15px;
  }
  .Menu li a { display: block; padding: 11px 0; }

  /* Todo a una columna */
  .PortadaDestacados,
  .PortadaContenedorActualidad,
  .ContenedorDosColumnasIzquierda,
  .ContenedorDosColumnasDerecha,
  .QSTexto,
  .QSImagen {
    float: none;
    width: auto;
    margin-left: 0;
    margin-right: 0;
  }
  .PortadaContenedorActualidad { margin-top: 20px; }
  .ContenedorDosColumnasDerecha { margin-top: 15px; }
  .QSImagen { text-align: center; margin: 10px 0; }
  .ListadoEnlacesDerecha { margin: 10px 0; }
  .FotoSoloMovil { display: block; margin: 12px 0 4px 0; }
  .FotoSoloMovil img { display: block; width: 100%; }
  .FotoSoloEscritorio { display: none; }
  /* Logo del colegio: centrado y sin estirar */
  .LogoMovil { text-align: center; margin: 12px 0; }
  .LogoMovil img { display: inline-block; width: auto; max-width: 70%; max-height: 160px; }

  /* Portada: foto del destacado a todo el ancho */
  .PortadaDestacadosFoto img { width: 100%; }
  .PortadaActualidadFoto { width: 90px; }

  /* Texto legible en movil */
  .ContenedorNormal,
  .PortadaDestacadosTexto,
  .PortadaDestacadosSubtitulo,
  .PortadaActualidadSubtitulo {
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
  }
  .PortadaActualidadTitulo { font-size: 15px; text-align: left; }
  h1 { font-size: 17px; }
  .TituloPagina h1 { margin: 12px 0; }

  /* Tablas del editor: desplazamiento horizontal en vez de romper la pagina */
  .ContenedorNormal table { display: block; overflow-x: auto; width: auto !important; }

  /* Miembros a dos columnas */
  .RejillaMiembros { grid-template-columns: repeat(2, 1fr); }
  .RejillaMiembros .LogoMiembros110 { min-height: 80px; }
  .RejillaMiembros .ListadoMiembros { font-size: 12px; }

  /* Galeria de fotos: dos por fila */
  .FotografiasList { width: 48%; margin: 12px 2% 0 0; height: auto; }

  /* Paginacion */
  .PaginacionSiguiente { width: auto; }
  .PaginacionRegistros { text-align: left; }

  /* Botones con tamano tactil */
  .Boton { height: auto; padding: 8px 16px; }
}

@media (max-width: 380px) {
  .CabeceraLogo img { width: 65px; height: 60px; }
  .CabeceraLetras img { width: 126px; height: 60px; }
}
