* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;

    background: #111;
    color: #fff;

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

body {
    margin: 0;
}

a {
    color: inherit;
}


/* =========================================================
   HEADER
   ========================================================= */

.site-header {
    position: fixed;

    top: 0;
    left: 0;
    right: 0;

    z-index: 100;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;

    padding: 26px 42px;

    background: #111;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    color: white;
    text-decoration: none;

    font-size: 30px;
    font-weight: 500;

    letter-spacing: 0.06em;

    text-shadow:
        0 2px 12px
        rgba(0, 0, 0, 0.55);
}

.site-logo-icon {
    display: block;

    width: 38px;
    height: 38px;

    object-fit: contain;

    flex: 0 0 auto;
}

.site-nav {
    display: flex;
    align-items: center;

    gap: 34px;
}

.site-nav a {
    color: white;
    text-decoration: none;

    font-size: 16px;
    font-weight: 500;

    letter-spacing: 0.04em;

    text-shadow:
        0 2px 10px
        rgba(0, 0, 0, 0.70);

    transition:
        opacity 0.2s ease;
}

.site-nav a:hover {
    opacity: 0.68;
}

.site-logo:focus-visible,
.site-nav a:focus-visible,
.nature-card:focus-visible,
.shuffle-button:focus-visible,
.bird-photo-button:focus-visible {
    outline: 2px solid white;
    outline-offset: 6px;
}


/* =========================================================
   GEMENSAM SIDLAYOUT
   ========================================================= */

.page {
    max-width: 1800px;

    margin: 0 auto;

    padding:
        115px
        42px
        42px;
}

.page-title {
    margin:
        0
        0
        28px;

    font-size:
        clamp(
            34px,
            4vw,
            64px
        );

    font-weight: 400;

    letter-spacing: 0.02em;
}


/* =========================================================
   NATUR
   ========================================================= */

.nature-grid {
    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );

    gap: 18px;

    min-height: 70vh;
}

.nature-card {
    position: relative;

    min-width: 0;

    overflow: hidden;

    border-radius: 4px;

    background: #222;

    color: white;
    text-decoration: none;
}

.nature-card img {
    display: block;

    width: 100%;
    height: 100%;

    min-height: 620px;

    object-fit: cover;

    transition:
        transform 0.7s ease,
        opacity 0.4s ease;
}

.nature-card::after {
    content: "";

    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            to top,
            rgba(0, 0, 0, 0.70) 0%,
            rgba(0, 0, 0, 0.08) 45%,
            rgba(0, 0, 0, 0.02) 100%
        );

    pointer-events: none;
}

.nature-card-title {
    position: absolute;

    left: 30px;
    bottom: 26px;

    z-index: 2;

    font-size:
        clamp(
            24px,
            2vw,
            38px
        );

    font-weight: 400;

    letter-spacing: 0.04em;

    text-shadow:
        0 2px 14px
        rgba(0, 0, 0, 0.70);
}

.nature-status {
    padding: 30px 0;

    color:
        rgba(
            255,
            255,
            255,
            0.70
        );
}


/* =========================================================
   FÅGLAR - RUBRIK OCH KNAPP
   ========================================================= */

.gallery-heading {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 25px;

    margin-bottom: 18px;
}

.gallery-heading .page-title {
    margin-bottom: 0;
}

.shuffle-button {
    border:
        1px solid
        rgba(
            255,
            255,
            255,
            0.38
        );

    border-radius: 999px;

    padding: 10px 18px;

    background:
        rgba(
            255,
            255,
            255,
            0.06
        );

    color: white;

    font: inherit;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.shuffle-button:hover {
    background:
        rgba(
            255,
            255,
            255,
            0.13
        );

    border-color:
        rgba(
            255,
            255,
            255,
            0.65
        );
}

.shuffle-button:disabled {
    opacity: 0.45;
    cursor: default;
}


/* =========================================================
   FÅGLAR - LAGERKOLLAGE
   Alla bilder är 3:2
   ========================================================= */

.bird-photo-gallery {
    position: relative;

    width: 100%;

    height:
        clamp(
            820px,
            63vw,
            1120px
        );

    margin-top: 12px;
}

.bird-photo-card {
    position: absolute;

    aspect-ratio: 3 / 2;

    overflow: hidden;

    min-width: 0;
    min-height: 0;

    background: #181818;

    border-radius: 10px;

    box-shadow:
        0 12px 32px
        rgba(
            0,
            0,
            0,
            0.38
        );

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}


/* 1 - övre vänster */

.bird-photo-card:nth-child(1) {
    left: 0%;
    top: 7%;

    width: 30%;

    z-index: 7;
}


/* 2 - övre mitten */

.bird-photo-card:nth-child(2) {
    left: 31%;
    top: 0%;

    width: 37%;

    z-index: 2;
}


/* 3 - övre höger */

.bird-photo-card:nth-child(3) {
    right: 0%;
    top: 8%;

    width: 29%;

    z-index: 3;
}


/* 4 - vänster mitten */

.bird-photo-card:nth-child(4) {
    left: 0%;
    top: 36%;

    width: 32%;

    z-index: 7;
}


/* 5 - stor mittbild */

.bird-photo-card:nth-child(5) {
    left: 28%;
    top: 28%;

    width: 46%;

    z-index: 5;

    box-shadow:
        0 16px 42px
        rgba(
            0,
            0,
            0,
            0.50
        );
}


/* 6 - höger mitten */

.bird-photo-card:nth-child(6) {
    right: 0%;
    top: 38%;

    width: 31%;

    z-index: 8;
}


/* 7 - nedre vänster */

.bird-photo-card:nth-child(7) {
    left: 2%;
    bottom: 4%;

    width: 31%;

    z-index: 7;
}


/* 8 - nedre mitten */

.bird-photo-card:nth-child(8) {
    left: 31%;
    bottom: 0%;

    width: 37%;

    z-index: 4;
}


/* 9 - nedre höger */

.bird-photo-card:nth-child(9) {
    right: 1%;
    bottom: 3%;

    width: 30%;

    z-index: 8;
}


/* =========================================================
   BILDER
   Eftersom både källa och lager är 3:2 behöver bilden
   inte beskäras.
   ========================================================= */

.bird-photo-button {
    display: block;

    width: 100%;
    height: 100%;

    padding: 0;
    border: 0;

    background: transparent;

    cursor: zoom-in;
}

.bird-photo-button img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;

    background: #111;

    transition:
        transform 0.45s ease;
}


/* =========================================================
   HOVER
   ========================================================= */

@media (
    hover: hover
) and (
    pointer: fine
) {

    .bird-photo-card:hover {
        z-index: 20;

        transform:
            translateY(-4px);

        box-shadow:
            0 20px 48px
            rgba(
                0,
                0,
                0,
                0.55
            );
    }

    .bird-photo-card:hover
    .bird-photo-button img {
        transform:
            scale(1.015);
    }

    .nature-card:hover img {
        transform:
            scale(1.025);
    }
}


/* =========================================================
   LIGHTBOX
   ========================================================= */

.photo-lightbox[hidden] {
    display: none;
}

.photo-lightbox {
    position: fixed;
    inset: 0;

    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        rgba(
            0,
            0,
            0,
            0.94
        );

    padding: 50px 85px;
}

.lightbox-content {
    max-width: 92vw;
    max-height: 92vh;

    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    display: block;

    max-width: 100%;
    max-height: 82vh;

    width: auto;
    height: auto;

    object-fit: contain;
}

.lightbox-counter {
    margin-top: 10px;

    color:
        rgba(
            255,
            255,
            255,
            0.55
        );

    font-size: 13px;
}

.lightbox-close,
.lightbox-arrow {
    position: absolute;

    border: 0;

    background: transparent;

    color: white;

    cursor: pointer;

    text-shadow:
        0 2px 12px
        rgba(
            0,
            0,
            0,
            0.8
        );
}

.lightbox-close {
    top: 18px;
    right: 28px;

    font-size: 44px;
    line-height: 1;
}

.lightbox-arrow {
    top: 50%;

    transform:
        translateY(-50%);

    font-size: 72px;

    padding: 20px;
}

.lightbox-prev {
    left: 8px;
}

.lightbox-next {
    right: 8px;
}

.lightbox-open {
    overflow: hidden;
}


/* =========================================================
   REDUCERAD RÖRELSE
   ========================================================= */

@media (
    prefers-reduced-motion: reduce
) {

    .nature-card img,
    .bird-photo-button img,
    .bird-photo-card {
        transition: none;
    }
}


/* =========================================================
   SURFPLATTA
   ========================================================= */

@media (
    max-width: 1000px
) {

    .nature-grid {
        grid-template-columns:
            1fr;

        min-height: auto;
    }

    .nature-card img {
        min-height: 420px;
        max-height: 600px;
    }

    .bird-photo-gallery {
        position: static;

        height: auto;

        display: grid;

        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        gap: 6px;
    }

    .bird-photo-card,
    .bird-photo-card:nth-child(n) {
        position: relative;

        left: auto;
        right: auto;
        top: auto;
        bottom: auto;

        width: 100%;
        height: auto;

        aspect-ratio: 3 / 2;

        z-index: auto;

        transform: none;
    }

    .bird-photo-card:nth-child(5) {
        grid-column: 1 / 3;
    }
}


/* =========================================================
   MOBIL
   ========================================================= */

@media (
    max-width: 700px
) {

    .site-header {
        align-items: flex-start;

        padding: 20px;
    }

    .site-logo {
        font-size: 24px;
    }

    .site-nav {
        gap: 16px;

        flex-wrap: wrap;

        justify-content: flex-end;
    }

    .site-nav a {
        font-size: 15px;
    }

    .page {
        padding:
            110px
            20px
            25px;
    }

    .nature-card img {
        min-height: 330px;
    }

    .nature-card-title {
        left: 20px;
        bottom: 18px;
    }
}


@media (
    max-width: 600px
) {

    .gallery-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .bird-photo-gallery {
        display: block;
    }

    .bird-photo-card,
    .bird-photo-card:nth-child(n) {
        position: relative;

        width: 100%;
        height: auto;

        aspect-ratio: 3 / 2;

        margin-bottom: 6px;

        box-shadow: none;
    }

    .bird-photo-button {
        height: 100%;
    }

    .bird-photo-button img {
        width: 100%;
        height: 100%;

        object-fit: contain;
    }

    .photo-lightbox {
        padding:
            55px
            15px;
    }

    .lightbox-arrow {
        font-size: 52px;

        padding: 10px;
    }
}
/* =========================================================
   NATUR DROPDOWN
   ========================================================= */

.site-nav .nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.site-nav .nav-dropdown > a {
    position: relative;
    z-index: 2;
}

.site-nav .nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);

    min-width: 170px;

    padding: 8px;

    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0.18s ease;

    z-index: 100;
}

.site-nav .nav-dropdown-menu::before {
    content: "";
    position: absolute;

    top: -14px;
    left: 0;

    width: 100%;
    height: 14px;
}

.site-nav .nav-dropdown-menu a {
    display: block;

    padding: 10px 14px;

    color: #fff;
    text-decoration: none;
    white-space: nowrap;

    border-radius: 7px;

    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}

.site-nav .nav-dropdown-menu a:hover,
.site-nav .nav-dropdown-menu a:focus-visible {
    background: rgba(255, 255, 255, 0.10);
}

.site-nav .nav-dropdown:hover .nav-dropdown-menu,
.site-nav .nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform: translateX(-50%) translateY(0);
}


/* Mobil / mindre skärmar */

@media (max-width: 700px) {

    .site-nav .nav-dropdown-menu {
        left: auto;
        right: 0;

        transform: translateY(-6px);

        min-width: 160px;
    }

    .site-nav .nav-dropdown:hover .nav-dropdown-menu,
    .site-nav .nav-dropdown:focus-within .nav-dropdown-menu {
        transform: translateY(0);
    }
}