/* ==========================================================================
   responsive.css - SIMDA web (UNED)
   Mobile/tablet adjustments for the estilos.css template.
   Link it in every page AFTER estilos.css:
     <link rel="stylesheet" href="responsive.css" type="text/css" />
   Desktop (> 800px) is not affected.
   ========================================================================== */

/* Always light theme: stops phones in dark mode (Chrome auto-dark,
   Samsung Internet, etc.) from painting a black background */
:root { color-scheme: light only; }
html { background-color: #fff; }

@media (max-width: 800px) {

  /* ---------- Page ---------- */
  html, body { height: auto; min-height: 0; }
  body { overflow-x: hidden; }

  /* ---------- Top banner "SIMDA" ---------- */
  .nombre {
    min-width: 0;
    margin: 0 8px;
    top: 8px;
    height: 54px;
    line-height: 54px;
    font-size: 30px;
    background-color: #005036;     /* fallback behind the banner image */
    background-size: auto 100%;
    border-radius: 6px;
  }

  /* ---------- Side menu -> block on top ---------- */
  .lateral {
    margin: 20px 8px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .menu,
  .menu[style] {                 /* the 2nd menu has inline style="top:39px" */
    top: 0 !important;
    width: auto;
    padding: 0 0 8px;
    background: #fff;
    border: 1px solid #dfe5e2;
    border-radius: 6px;
    overflow: hidden;
  }
  .arriba2 {
    left: 0;
    width: auto;
    padding: 6px 0;
    background: #005036;
    border-radius: 0;
  }
  .abajo2,
  .relleno { display: none; }

  /* Menu buttons as wrapping "pills" */
  .menu > a.boton,
  .menu > div > a.boton {
    display: inline-block;
    width: auto;
    height: auto;
    margin: 8px 0 0 8px;
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.2;
    background-image: none;
    background-color: #eef3f1;
    color: #005036;
    border: 1px solid #d5e0db;
    border-radius: 4px;
  }
  .menu a.boton:hover,
  .menu a.boton:focus-visible,
  .menu a.boton[aria-current="page"] {
    background-image: none;
    background-color: #005036;
    border-color: #005036;
    color: #fff;
  }

  /* ---------- Content box ---------- */
  .cuadro {
    position: static;
    width: auto;
    min-height: 0;
    margin: 12px 8px 0;
  }
  .contenido {
    margin: 0 0 12px;
    background: #fff;             /* replaces the grey cen.png texture */
    border: 1px solid #dfe5e2;
    border-radius: 6px;
    overflow: hidden;
  }
  .cenizq, .cender,               /* grey side strips */
  .supizq, .supder,               /* title corners */
  .abajo, .infizq, .infder {      /* bottom border images */
    display: none;
  }
  .arriba { float: none; }
  .titulo {
    background-color: #005036;     /* fallback behind the title image */
    border-radius: 6px 6px 0 0;
    font-size: 22px;
    padding: 10px 12px;
    box-sizing: border-box;
  }
  .texto {
    margin: 0;
    padding: 20px 14px 14px;
    font-size: 15px;
  }
  p { margin-right: 0; }
  body .texto p { text-align: left; }   /* justified text leaves big gaps on narrow screens */

  /* Long URLs, e-mails and titles must wrap instead of overflowing */
  .texto a,
  .texto li,
  .texto p { overflow-wrap: anywhere; word-break: normal; }
  .term { font-size: inherit; }
  .texto ul,
  .texto ol { padding-left: 22px; }
  .texto img,
  .texto video,
  .texto iframe { max-width: 100%; height: auto; }
  .texto table { display: block; max-width: 100%; overflow-x: auto; }

  /* Tabs (collaborate / publications): smaller buttons */
  .texto .tablist button { padding: 6px 10px; font-size: 14px; }

  /* ---------- Footer: in the flow, not fixed over the content ---------- */
  .caja { position: static; }
  .pie {
    position: static;
    min-width: 0;
    height: auto;
    margin: 0 8px 10px;
    padding: 8px 16px;
    background: none;
    border-top: 1px solid #dfe5e2;
  }
  .izq, .der { display: none; }

  /* Old fixed-width helpers used in other pages */
  .paq { width: auto; }
  .pagina { position: static; min-width: 0; }
  .anio { left: 0; }
}

/* Very small phones */
@media (max-width: 380px) {
  .nombre { font-size: 26px; }
  .titulo { font-size: 20px; }
  .menu > a.boton,
  .menu > div > a.boton { font-size: 12px; padding: 7px 10px; }
}
