/* ==========================================================
   mobiel.css - Limbra Cross Competitie
   Laden ALS LAATSTE stylesheet, na limbra.css (of limbra2.css):

   <link rel="stylesheet" href="limbra.css" type="text/css" media="screen">
   <link rel="stylesheet" href="mobiel.css" type="text/css" media="screen">

   Alle regels staan in een mediaquery en veranderen dus niets
   aan de weergave op een computer.
   ========================================================== */

@media (max-width: 900px) {

  /* ------------------------------------------------------
     1. GEDEELD: pagina-opbouw, kop, menu
     ------------------------------------------------------ */
  body { font-size: 16px; }
  img { max-width: 100%; }

  #container { width: 100%; }

  #header { border-radius: 0; }
  div#header h1 {
    font-size: 30px;
    top: 0;
    line-height: 60px;
  }

  #opbouwlinks {
    float: none;
    width: auto;
    margin: 10px 8px 0;
    display: block;
  }
  #content {
    float: none;
    width: auto;
    margin: 10px 8px 40px;
    padding-left: 0;
    display: block;
  }
  #fb-root { margin: 0 8px 10px; }

  h2 { font-size: 26px; }
  h3 { font-size: 22px; }

  /* Hoofdmenu: tikbare knoppen die doorlopen naar de volgende regel */
  div.menu {
    width: auto;
    margin-bottom: 10px;
    box-shadow: none;
  }
  div.menu h2 {
    width: auto;
    font-size: 18px;
    margin-right: -3px;
  }
  div.menu ul {
    display: flex;
    flex-wrap: wrap;
    padding: 8px 5px 0;
  }
  div.menu ul li a {
    display: block;
    margin: 2px;
    padding: 8px 12px;
    font-size: 16px;
    border: 1px solid #ddd;
  }
  div.menu ul li a:hover,
  div.menu ul li a.select {
    padding-left: 12px;
    transform: none;
    box-shadow: none;
  }

  /* ------------------------------------------------------
     2. PAGINA STANDEN
     ------------------------------------------------------ */

  /* Menu U8 t/m U12 | U14 t/m U20 | Korte Cross | Lange Cross | PDF */
  ul#standenmenu {
    float: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: auto;
  }
  ul#standenmenu li { display: block; }
  ul#standenmenu li:last-child { display: flex; gap: 4px; }
  ul#standenmenu li a {
    float: none;
    display: block;
    width: auto;
    padding: 0 12px;
    font-size: 18px;
    line-height: 40px;
    border-right: 0;
    border-radius: 8px;
  }
  ul#standenmenu li a.pdfbutton,
  ul#standenmenu li a.top { padding: 0; }

  /* Menu U8 Vrouwen | U9 Vrouwen | ... */
  ul#standencatmenu {
    float: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 8px 0 12px;
  }
  ul#standencatmenu li { display: block; }
  ul#standencatmenu li a {
    float: none;
    display: block;
    width: auto;
    min-width: 70px;
    padding: 6px 10px;
    border-right: 0;
    border-radius: 6px;
  }

  #tooltip { width: auto; max-width: 92vw; }

  /* Standentabel scrolt horizontaal binnen zichzelf */
  table.stand {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 14px;
  }
  table.standen.stand th,
  table.standen.stand td { white-space: nowrap; }
  table.standen.stand th { width: auto !important; }   /* overrulet de inline widths */
  table.standen.stand thead th { font-size: 14px; padding: 6px; }
  table.standen.stand tbody td { padding: 6px; }
  table.standen.stand tbody tr { background: #fff; }

  /* Plaats en Naam blijven staan tijdens het scrollen */
  table.standen.stand th:nth-child(1),
  table.standen.stand td:nth-child(1),
  table.standen.stand th:nth-child(3),
  table.standen.stand td:nth-child(3) {
    position: sticky;
    z-index: 1;
  }
  table.standen.stand th:nth-child(1),
  table.standen.stand td:nth-child(1) {
    left: 0;
    box-sizing: border-box;
    width: 40px !important;
    min-width: 40px;
  }
  table.standen.stand th:nth-child(3),
  table.standen.stand td:nth-child(3) { left: 40px; }
  table.standen.stand tbody td:nth-child(1),
  table.standen.stand tbody td:nth-child(3) { background: inherit; }

  /* ------------------------------------------------------
     3. PAGINA BEGIN (poster)
     ------------------------------------------------------ */
  #poster {
    position: static;
    width: 100%;
    margin-top: 0;
    display: flex;
    flex-direction: column;
  }
  /* In de HTML staat #foto voor #titel; hier zetten we de volgorde recht */
  #titel       { order: 1; }
  #foto        { order: 2; }
  #wedstrijden { order: 3; }
  #vereniging  { order: 4; }

  #titel {
    position: static;
    width: auto;
    height: auto;
    padding: 10px 14px;
    font-size: 34px;
    line-height: 1.1;
    border-radius: 5px 5px 0 0;
  }
  #titel span { font-size: 20px; margin-top: 4px; }
  #titel span br { display: none; }

  #foto { position: static; width: 100%; }
  #foto img {
    width: 100%;
    height: auto;
    margin-top: 0;
    display: block;
    border-radius: 0 0 5px 5px;
  }

  /* Lijst met wedstrijden: elke wedstrijd is een duidelijke knop */
  #wedstrijden {
    position: static;
    width: auto;
    height: auto;
    margin: 12px 0;
    padding: 0;
    font-size: 17px;
    text-transform: none;
    background: transparent;
  }
  #wedstrijden br { display: none; }

  #wedstrijden a,
  #wedstrijden a.uitslag,
  #wedstrijden a:hover,
  #wedstrijden a.uitslag:hover {
    display: block;
    margin: 0 0 10px;
    padding: 15px 16px;            /* ruim tikvlak: ca. 55px hoog */
    font-size: 1em;
    line-height: 1.3;
    color: #fff;
    background: #D00000;           /* rood: link naar de website van de organisator */
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  }
  #wedstrijden a.uitslag,
  #wedstrijden a.uitslag:hover {
    background: #069;              /* blauw: uitslag staat al op deze site */
  }
  #wedstrijden a:active {
    transform: translateY(1px);
    box-shadow: none;
    filter: brightness(0.85);
  }

  /* Datum en naam in dezelfde witte kleur als de rest van de knop */
  #wedstrijden span.datum,
  #wedstrijden a span,
  #wedstrijden a:hover span,
  #wedstrijden a.uitslag span,
  #wedstrijden a.uitslag:hover span {
    color: #fff;
  }

  /* Datum klein bovenaan, wedstrijdnaam groot op een eigen regel eronder.
     span.wednaam wordt gemaakt door js/mobiel_begin.js; zonder dat script
     blijven datum en naam gewoon achter elkaar staan. */
  #wedstrijden span.datum {
    display: inline-block;
    font-size: 14px;
    font-weight: normal;
  }
  #wedstrijden span.wednaam {
    display: block;
    margin-top: 3px;
    font-weight: bold;
  }

  /* Logo's van de organiserende verenigingen */
  #vereniging {
    position: static;
    width: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 8px;
    margin: 10px 0 20px;
  }
  #vereniging img {
    width: 100%;
    max-width: 64px;      /* pas dit getal aan voor grotere of kleinere logo's */
    height: auto;
    margin: 0 auto;
    display: block;
  }
  a.verenigings_link { width: auto; display: block; }

  /* ------------------------------------------------------
     4. PAGINA WEDSTRIJDEN
     ------------------------------------------------------ */
  #wedstrijd {
    position: static;
    width: auto !important;        /* overrulet inline style="width:850px" (Uitslagen) */
    text-align: left;
    line-height: 1.3 !important;   /* overrulet inline style="line-height:55px" */
    font-size: 16px;
    text-transform: none;
  }
  #wedstrijd br { display: none; }
  #wedstrijd p.link { margin: 14px 0 0; font-size: 15px; }

  /* Kaartje per wedstrijd */
  #wedstrijd p.wed { display: block; margin: 0 0 6px; }
  #wedstrijd a.wedstrijd {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 10px;
    font-size: 16px;
  }
  #wedstrijd a.wedstrijd img {
    position: static;
    width: 64px;
    height: auto;
    flex: none;
  }
  #wedstrijd a.wedstrijd span {
    display: block;
    color: red;
    font-size: 15px;
  }

  /* Lege plek als er geen inschrijfknop is */
  #wedstrijd a.leeg {
    display: block;
    width: auto;
    height: 8px;
    margin: 0;
  }

  /* Inschrijfknop over de volle breedte, deadline eronder zichtbaar */
  #wedstrijd a.inschrijf_link {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    margin: 0 0 14px;
    padding: 10px 12px;
    line-height: 1.2;
    font-size: 18px;
    border-radius: 10px;
    box-shadow: none;
  }
  #wedstrijd a.inschrijf_link::after { display: none; }
  #wedstrijd a.inschrijf_link::before {
    content: attr(data-title);
    position: static;
    transform: none;
    width: auto;
    max-width: none;
    padding: 0;
    margin-top: 3px;
    background: transparent;
    border-radius: 0;
    font-size: 12px;
    font-weight: normal;
    text-transform: none;
    color: #fff;
  }

  /* ------------------------------------------------------
     5. PAGINA REGLEMENT
     ------------------------------------------------------ */
  ol.info li ul li { margin-right: 0; }

  /* Tabel "Indeling Limbracross Categorieen": volle breedte, tekst mag afbreken */
  table.catagorie { width: 100%; }
  table.catagorie th {
    width: auto !important;          /* overrulet inline widths 150px / 350px */
    font-size: 16px;
    padding: 6px;
  }
  table.catagorie td {
    padding: 6px;
    vertical-align: top;
  }
  table.catagorie th:first-child,
  table.catagorie td:first-child { width: 40%; }

  /* ------------------------------------------------------
     6. PAGINA ARCHIEF
     ------------------------------------------------------ */
  .archief {
    width: auto;
    margin-bottom: 20px;
    text-align: left;
    text-transform: none;
    font-size: 15px;
  }
  .archief br { display: none; }

  /* Seizoenskop met de knop "Klassement" ernaast */
  .archief h3.intro {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    font-size: 24px;
    margin-bottom: 10px;
  }
  .archief a.klas {
    width: auto;
    height: auto;
    margin-left: 0;
    padding: 6px 16px;
    font-size: 16px;
    line-height: 1.2;
  }

  /* Eén kaartje per wedstrijd (regelhoogte van desktop was 5px) */
  .archief p { line-height: 1.3; }
  .archief p.wed { display: block; margin: 0 0 6px; }
  .archief a.wedstrijd,
  .archief p.wed a {
    display: block;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 10px;
    font-size: 16px;
    line-height: 1.3;
  }
  .archief p.wed a span {
    display: block;
    color: red;
    font-size: 15px;
  }

  /* ------------------------------------------------------
     7. PAGINA UITSLAGENLIJST (uitslag per wedstrijd, page=lijst)
     ------------------------------------------------------ */

  /* Knoppen Terug en Website */
  a.terug {
    width: auto;
    height: auto;
    margin: 0 10px 12px 0;
    padding: 8px 18px;
    font-size: 16px;
    line-height: 1.2;
  }

  /* Tabel Plts | Naam | GJ | Vereniging | Tijd past op de schermbreedte.
     (alleen tabellen direct na een <h3 class="ond">; dus niet Standen, Reglement, Puntentelling of Informatie) */
  h3.ond + table.standen {
    width: 100%;
    font-size: 14px;
  }
  h3.ond + table.standen th {
    width: auto !important;          /* overrulet inline widths 40/200/70/200/100px */
    font-size: 14px;
    padding: 6px 4px;
  }
  h3.ond + table.standen td {
    padding: 6px 4px;
    vertical-align: top;
  }
  /* Plaats en tijd nooit afbreken, tijd rechts uitlijnen */
  h3.ond + table.standen th:first-child,
  h3.ond + table.standen td:first-child { white-space: nowrap; }
  h3.ond + table.standen th:last-child,
  h3.ond + table.standen td:last-child {
    white-space: nowrap;
    text-align: right;
  }

  /* ------------------------------------------------------
     8. PAGINA CONTACT (formulier)
     ------------------------------------------------------ */
  #contact { margin: 10px 0 20px; }
  #formulier { width: auto; }
  .kop {
    width: auto;
    height: auto;
    line-height: 1.3;
    padding: 4px 8px;
    font-size: 18px;
  }
  #contact .regel {
    padding: 0 10px;
    margin: 10px 0;
    line-height: 1.3;
    overflow: visible;
  }
  /* Label boven het veld in plaats van ernaast */
  #contact label {
    float: none;
    display: block;
    width: auto;
    margin: 0 0 4px;
    text-align: left;
  }
  #contact input[type="text"],
  #contact input[type="email"],
  #contact select,
  #contact textarea {
    width: 100% !important;      /* overrulet style="width:500px" op de keuzelijst */
    max-width: 100%;
    box-sizing: border-box;
    font-size: 16px;             /* voorkomt inzoomen op iPhone */
  }
  #contact textarea { height: 180px; }
  #knop { padding: 0 10px 10px; }
  #contact input[type="submit"] { width: 100%; margin: 0; }

  /* ------------------------------------------------------
     9. PAGINA PUNTENTELLING
     ------------------------------------------------------ */
  /* 5 paren Plaats/Punten naast elkaar: 10 gelijke kolommen op schermbreedte */
  table.standen.punt {
    width: 100%;
    table-layout: fixed;
  }
  table.standen.punt th {
    width: auto;
    padding: 6px 0;
    font-size: 12px;
    text-align: center;
  }
  table.standen.punt td {
    padding: 5px 0;
    font-size: 14px;
    text-align: center;
  }
  /* Streepje tussen de paren */
  table.standen.punt th:nth-child(odd):not(:first-child) { border-left: 1px solid rgba(255, 255, 255, 0.6); }
  table.standen.punt td:nth-child(odd):not(:first-child) { border-left: 1px solid #ccc; }

  /* ------------------------------------------------------
     10. PAGINA INFORMATIE
     ------------------------------------------------------ */
  /* Tabel Inschrijfgeld: inline widths 300/150/150px overrulen */
  .informatie table.standen { width: 100%; }
  .informatie table.standen th {
    width: auto !important;
    padding: 6px 4px;
    font-size: 14px;
  }
  .informatie table.standen td {
    padding: 6px 4px;
    vertical-align: top;
  }
  /* Bedragen niet afbreken */
  .informatie table.standen td:not(:first-child) { white-space: nowrap; }

  /* ------------------------------------------------------
     11. OVERIGE PAGINA'S: veilig vangnet (nog niet getest,
        alleen nog de oude klassementstabel)
     ------------------------------------------------------ */
  table.klasoud {
    display: block;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Geen hover-tooltips op apparaten zonder muis (telefoon/tablet) */
@media (hover: none) {
  a.verenigings_link::before,
  a.verenigings_link::after { display: none; }
}

/* Heel smalle telefoons: uitslagtabellen iets compacter */
@media (max-width: 400px) {
  h3.ond + table.standen,
  h3.ond + table.standen th {
    font-size: 13px;
  }
  h3.ond + table.standen th,
  h3.ond + table.standen td { padding: 5px 3px; }
  table.standen.punt th { font-size: 11px; }
  table.standen.punt td { font-size: 13px; }
}
