/* Media Query voor GSM/Mobiel */
@media screen and (max-width: 768px) {

    html:root {
        -webkit-text-size-adjust: 100%;
        scrollbar-gutter: stable;
    }

    html:root:has(#menu-toggle:checked) body,
    html:root body.lade-open {
        overflow: hidden;
    }

    /* Stapel de flexbox elementen onder elkaar */
    .flex-container {
        display: block;
        margin-top:0px;
    }

    /* menu */

    section {
        margin: 10px auto;
        margin-top: 0px;
        padding-right: 0px;
        width: 100%;
        background-color: black;

        position: fixed;
        top: 0;
        z-index: 1000;
    }

    html:root section {
        left: 0;
        height: 56px;
        margin: 0;
        min-width: 0;
        box-sizing: border-box;
        border-bottom: 1px solid #222;
    }

    img.logo {
        display:none;
    }

    .small-logo {
        position: fixed;
        top: 8px;
        right:8px;
        display: block;
        height: 50px;

        opacity:1;
        transition: opacity 0.5s ease-in-out;
    }

    #menu-toggle:checked ~ .small-logo {
        opacity:0;
    }

    html:root section .small-logo {
        position: fixed;
        top: 8px;
        left: 20px;
        right: auto;
        display: block;
        height: 40px;
        z-index: 3;
        animation: none;
    }

    html:root section a.small-logo img {
        position: static;
        height: 100%;
    }

    html:root body:has(#menu-toggle) section .small-logo {
        opacity: 1 !important;
    }

    /* Toon het hamburger icoon */
    .hamburger {
        display: block;
    }

    html:root .hamburger {
        position: fixed;
        top: 0;
        right: 0;
        width: 56px;
        height: 56px;
        padding: 0;
        border: 0;
        font-size: 0;
        z-index: 1;
        background-color: rgba(0, 0, 0, 0);
        transition: background-color 0.3s ease, width 0s 0.3s, height 0s 0.3s;
        -webkit-tap-highlight-color: transparent;
    }

    html:root #menu-toggle:checked + .hamburger {
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.65);
        transition: background-color 0.3s ease;
    }

    html:root .hamburger::before,
    html:root .hamburger::after {
        content: "";
        position: fixed;
        top: 27px;
        right: 17px;
        width: 22px;
        height: 2px;
        background-color: white;
        transition: transform 0.3s ease;
    }

    html:root .hamburger::before {
        transform: translateY(-4px);
    }

    html:root .hamburger::after {
        transform: translateY(4px);
    }

    html:root #menu-toggle:checked + .hamburger::before {
        transform: rotate(45deg);
    }

    html:root #menu-toggle:checked + .hamburger::after {
        transform: rotate(-45deg);
    }

/*    nav {
	margin-top: 10px;
        min-height: auto;
        padding-right: 0;
    }
*/
    nav {
        margin: auto;
        margin-left: 8px;
        margin-top: 10px; /* Verwijder de marge aan de bovenkant voor een naadloze aansluiting */
        min-height: auto;
        padding-right: 0;
        width: 10%;
        box-shadow: 0 2px 10px rgba(255, 0, 0, 0.5);

        transition: width 0.5s ease-in-out;
    }

    /* Toon het menu als de checkbox is aangevinkt */

    nav:has(#menu-toggle:checked) {
        width: 95%;
    }

    html:root nav {
        display: contents;
    }

    /* Verberg het menu standaard op mobiel */
    nav ul.first {
        display: block;
        opacity:0;
        max-height:0;
        overflow: hidden;
        transition: max-height 0.5s ease-in-out, opacity 0.3s ease;

        padding: 0;
        margin: 0;
        margin-left: 30px;
    }

    #menu-toggle:checked ~ ul {
        max-height:1200px;
        opacity:1;
    }

    html:root #menu-toggle ~ ul.first {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 2;
        box-sizing: border-box;
        margin: 0;
        padding: 28px 28px 80px;
        max-height: none;
        overflow-y: auto;
        background-color: black;
        font-size: 1.9rem;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0s 0.2s;
    }

    html:root #menu-toggle:checked ~ ul.first {
        visibility: visible;
        opacity: 1;
        transition: opacity 0.2s ease;
    }

    /* Sub-lijst (zorg, wonen, etc.) aanpassen voor mobiel */
    nav ul ul {
        display: block; /* Altijd tonen als het hoofdmenu open is */
    }

    html:root nav ul ul {
        margin: 0;
        margin-left: 2px;
        padding: 0;
        padding-left: 18px;
        border-left: 1px solid #333;
        font-size: 1.45rem;
    }

    html:root nav ul li {
        padding: 9px 0;
        line-height: 1.2;
        opacity: 0;
        transform: translateY(18px);
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    html:root nav ul li:hover {
        list-style: none;
        color: white;
        font-size: 1em;
    }

    html:root #menu-toggle:checked ~ ul.first li {
        opacity: 1;
        transform: none;
        transition: opacity 0.45s ease 0.15s, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s;
    }

    html:root #menu-toggle:checked ~ ul.first > li:nth-child(2) { transition-delay: 0.19s; }
    html:root #menu-toggle:checked ~ ul.first > li:nth-child(3) { transition-delay: 0.23s; }
    html:root #menu-toggle:checked ~ ul.first > li:nth-child(4) { transition-delay: 0.27s; }
    html:root #menu-toggle:checked ~ ul.first > ul > li:nth-child(1) { transition-delay: 0.31s; }
    html:root #menu-toggle:checked ~ ul.first > ul > li:nth-child(2) { transition-delay: 0.35s; }
    html:root #menu-toggle:checked ~ ul.first > ul > li:nth-child(3) { transition-delay: 0.39s; }
    html:root #menu-toggle:checked ~ ul.first > ul > li:nth-child(4) { transition-delay: 0.43s; }
    html:root #menu-toggle:checked ~ ul.first > ul > li:nth-child(5) { transition-delay: 0.47s; }

    html:root #special {
        margin-top: 26px;
        padding-bottom: 12px;
        color: #777;
        font-size: 0.8rem;
        letter-spacing: 0.14em;
        text-transform: uppercase;
    }

    html:root #page::after {
        content: "";
        display: inline-block;
        width: 8px;
        height: 8px;
        margin-left: 12px;
        border-radius: 50%;
        background-color: red;
        vertical-align: middle;
    }

    html:root a.menu {
        display: block;
    }

    html:root a.menu::first-letter {
        text-transform: uppercase;
    }

    /* content */

    article.main {
        display: flex;
        flex-direction: column;
        padding-right: 0;
        width: 100%;

        margin-top: 53px; /*Due to now fixed menu*/
    }

    html:root article.main {
        box-sizing: border-box;
        width: 100%;
        margin: 56px 0 0;
        padding: 0 20px;
    }

    header {
        width:95%;
        word-wrap: break-word;
        margin-left:8px;
        margin-right:8px;
    }

    header h1 {
        font-size:0.85rem;
    }

    header.title {
        margin-bottom: 20px;
        margin-top: 0px;
        order: -2;
    }

    html:root header.title {
        width: auto;
        margin: 24px 0 18px;
        padding: 0;
    }

    html:root h2.paginatitel {
        font-size: 1.9rem;
        line-height: 1.1;
    }

    /* twee kolommen onder elkaar op mobiel */
    .projecten {
        display: contents;
    }

    html:root .projecten-knop {
        position: fixed;
        top: 50%;
        left: 0;
        z-index: 6;
        display: block;
        padding: 16px 9px;
        background-color: black;
        color: white;
        border: 1px solid #444;
        border-right: 0;
        border-radius: 10px 0 0 10px;
        font-family: Calibri, Arial, sans-serif;
        font-size: 0.9rem;
        letter-spacing: 0.04em;
        writing-mode: vertical-rl;
        transform: translateY(-50%) rotate(180deg);
        transition: left 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    html:root body.lade-open .projecten-knop {
        left: min(82vw, 330px);
        border-color: red;
    }

    .projectkeuze, .projectweergave {
        display: block;
    }

    .projectkeuze {
        order: -1;
    }

    html:root .projectkeuze {
        position: fixed;
        top: 56px;
        left: 0;
        bottom: 0;
        z-index: 5;
        box-sizing: border-box;
        width: min(82vw, 330px);
        padding: 0 16px 40px;
        overflow-y: auto;
        overscroll-behavior: contain;
        background-color: #0c0c0c;
        border-right: 1px solid #222;
        box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0);
        transform: translateX(-101%);
        transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease;
    }

    html:root body.lade-open .projectkeuze {
        box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.6);
        transform: none;
    }

    html:root .projectkeuze header.title {
        margin: 20px 0 18px;
    }

    html:root .projectkeuze header.title h1 {
        margin: 0 0 4px;
        font-size: 0.8rem;
        letter-spacing: 0.06em;
    }

    /* geen keuze van tegels per rij op mobiel */
    .kolommen {
        display: none;
    }

    /* Zorg dat de afbeeldingen op mobiel goed schalen */
    div.images {
        text-align: center;

        scroll-margin-top: 60px;
    }

    html:root div.images {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px 12px;
        text-align: left;
        scroll-margin-top: 72px;
    }

    html:root figure figcaption::-webkit-scrollbar,
    html:root div.images::-webkit-scrollbar {
        display: none;
    }

    div.images:hover img.album {
        opacity: 1;
    }

    html:root div.images img {
        display: block;
        box-sizing: content-box;
        width: 100%;
        height: auto;
        aspect-ratio: 3 / 2;
        padding: 0;
        padding-bottom: 26px;
    }

    html:root .image-tooltip-wrapper {
        display: block;
    }

    html:root .image-tooltip-wrapper:has(.gekozen)::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1;
        box-sizing: border-box;
        height: auto;
        aspect-ratio: 3 / 2;
        border: 2px solid red;
        background-color: transparent;
        pointer-events: none;
    }

    .floating-bubble {
        display: none;
    }

    html:root .image-tooltip-wrapper .floating-bubble {
        display: block;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        height: auto;
        padding: 0;
        background: none;
        border: 0;
        border-radius: 0;
        visibility: visible;
        opacity: 1;
        transform: none;
        transition: none;
        z-index: 1;
    }

    html:root .floating-bubble p {
        margin: 0;
        font-family: inherit;
    }

    html:root .floating-bubble p:first-child {
        font-size: 0.85rem;
        line-height: 20px;
    }

    html:root .floating-bubble p:last-child {
        display: none;
    }

    html:root .image-tooltip-wrapper:has(.gekozen) .floating-bubble p {
        color: red;
    }

    header.description {
        margin-bottom: 0px;
        margin-top: 25px;
        border-top: 2px solid red;

        scroll-margin-top: 60px;
    }

    html:root .projectweergave header.description {
        width: auto;
        height: auto;
        margin: 0px 0 16px;
        padding: 20px 0 0;
        overflow: visible;
        border-top: 1px solid #333;
        scroll-margin-top: 56px;
    }

    html:root header.description p {
        margin: 0;
    }

    html:root header.description br {
        display: none;
    }

    html:root header.description span {
        display: block;
        line-height: 1.35;
    }

    html:root #beschrijving1 {
        font-size: 1.4rem;
        font-weight: bold;
    }

    html:root #beschrijving2 {
        margin: 6px 0 8px;
        color: red;
    }

    html:root #beschrijving3 {
        color: #bbb;
    }

    figure {
        margin-left: 0;
        width: 100%;
    }

    html:root figure {
        display: block;
        width: auto;
        height: auto;
        margin: 0 -20px;
    }

    #bigParent {
        padding-top: 10px;
    }

    html:root #bigParent {
        padding-top: 0;
    }

    #divbigParent {
        scroll-margin-top: 200px;

        touch-action: pan-y; /* Allows vertical scrolling but prevents browser interference with horizontal swipes */
        cursor: pointer;
    }

    html:root #divbigParent {
        overflow: hidden;
        scroll-margin-top: 170px;
    }

    #divbigParent::after {
        content: "swipe ↔";
        display: block;
        text-align: center;
        font-size: 0.8rem;
        color: rgba(255, 255, 255, 0.5);
        margin-top: 5px;
    }

    html:root #divbigParent::after {
        margin: 8px 0 10px;
        font-size: 0.75rem;
        letter-spacing: 0.08em;
    }

    .big {
        max-width: 100%;
        position: relative;
        left: 50%;
        transform: translateX(-50%);
    }

    html:root .big {
        position: static;
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto;
        aspect-ratio: 4 / 3;
        object-fit: contain;
        background-color: transparent;
        transform: none;
    }

    /* Geen zoom cursor op mobiel */
    #big {
        cursor: default;
    }

    html:root figure figcaption {
        display: flex;
        gap: 6px;
        max-width: none;
        padding: 0 20px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    html:root img.figcap {
        flex: 0 0 72px;
        width: 72px;
        height: 54px;
        padding: 0;
        opacity: 0.45;
        transition: opacity 0.25s ease;
    }

    html:root img.figcap.gekozen {
        opacity: 1;
        outline: 2px solid red;
        outline-offset: -2px;
    }

    html:root img.figcap[src=""],
    html:root img.figcap[src$="black.jpg"] {
        display: none;
    }

    /* Zorg dat de lightbox NOOIT toont op mobiel */
    .lightbox {
        display: none !important;
    }

    .scroll-up-container {
        width: 100%;
        display: flex;
        justify-content: center;
        margin: 30px 0;
    }

    html:root .scroll-up-container {
        box-sizing: border-box;
        justify-content: space-between;
        gap: 8px;
        margin: 28px 0 0;
        padding: 0 20px;
    }

    html:root .scroll-up-container button {
        padding: 10px 12px;
        white-space: nowrap;
        background-color: transparent;
        color: white;
        border: 1px solid #444;
        border-radius: 999px;
        font-family: Calibri, Arial, sans-serif;
        font-size: 0.85rem;
    }

    html:root .scroll-up-container button:active {
        color: red;
        border-color: red;
    }

    .back-to-projects {
        background-color: #111;
        color: red;
        border: 1px solid red;
        padding: 12px 24px;
        font-family: Calibri, Arial, sans-serif;
        font-size: 16px;
        border-radius: 5px;
        cursor: pointer;
        transition: background 0.3s;

        z-index:10;
    }

    .back-to-projects:active {
        background-color: red;
        color: white;
    }

    html:root .back-to-projects {
        display: none;
    }

    /* footer */

    article.center {
        position: relative !important;
        top: 0 !important;
        margin: 40px 0 !important;
        transform: none !important;
        left: 0 !important;
    }

    .footer-text {
        display: none;
    }

    .footer-icons {
        display: flex;
        justify-content: center;
        gap: 30px; /* Ruimte tussen de iconen */
        margin-bottom: 15px;
    }

    .footer-icons a {
        color: red; /* Primaire kleur uit het ontwerp */
        font-size: 1.2rem;
        transition: transform 0.3s ease, color 0.3s ease;
        text-decoration: none;
    }

    .footer-icons a:hover {
        transform: scale(1.2);
        color: white; /* Kleurverandering bij hover */
    }

    html:root p.footer-namen,
    html:root p.footer-copyright {
        width: auto;
        padding: 0 20px;
    }
}
