/* this is my own css file */

/************************/
/* MARK: Variables
/************************/
:root { 
    --color-font: black;
    --color-font-inverse: white;

    --header-height: 6rem;

    --transition-length: 0.1s;

    --font-headings: "Jura", "Courier New", Arial, sans-serif;
    --font-general: "Albert Sans", Verdana, sans-serif;


    --background-color: var(--color-one);
    --color-one: #e7edf5;
    --color-two: #a0acc7;
    --color-three: #0d0431;
    --color-three-contrast: #2e010a;
    --color-four: #201629;
    --color-four-contrast: #201629;
    --color-five: #7b869e;
    --color-five-contrast: #6b758b;
    --color-outline: var(--color-font);
}



/************************/
/* MARK: Fonts
/************************/

/* Variable Jura */
@font-face {
    font-family: "Jura";
    font-style: normal;
    font-weight: 300 700; /* adjust range if needed */
    font-display: swap;
    src:
        url("../assets/fonts/Jura/Jura-VariableFont_wght.ttf") format("truetype-variations");
}

/* Variable Albert Sans */
@font-face {
    font-family: "Albert Sans";
    font-style: normal;
    font-weight: 100 900; /* full typical range for Albert Sans */
    font-display: swap;
    src:
        url("../assets/fonts/Albert_Sans/AlbertSans-VariableFont_wght.ttf") format("truetype-variations");
}


/************************/
/* MARK: General styling
/************************/

html {
    background: var(--background-color);
}

h1, h2, h3, h4, h5, h6, a {
    color: var(--color-font);
    font-weight: 600;
    font-style: normal;
    font-family: var(--font-headings);
}

p {
    color: var(--color-font);
}

* {
    font-family: var(--font-general);
}

header {
    position: sticky;
    top: 0px;
    z-index: 2000;

    &::after {
        content: "";
        position: absolute;
        background: var(--color-font);
        bottom: 0;
        left: 0;
        width: 100%;
        height: 0.10rem;
    }
}

main {
    background: var(--background-color);
    padding: 0rem 0rem 2rem 0rem;

}

.container {
    padding: 0;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}


/************************/
/* MARK: focus states
/************************/

a:focus-visible {
    outline: none;

}

.logo-link:focus-visible, .category-filter li:has(:focus-visible) {
    outline: 3px solid var(--color-outline);
}

.category-filter li.active:has(:focus-visible) {
    outline: 3px solid white;
}

.photo-item-inner {
    position: relative;
}

.photo-item-trigger {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
}

.photo-modal-close:focus-visible {
    outline: 2px solid #bb9f7c;
}

.download-btn:focus-visible {
    outline: 2px solid var(--color-outline);
}

.photo-category-archive .photo-item:has(:focus-visible) {
    outline: 4px solid var(--color-outline);
}

.password-protected-page .photo-item:has(:focus-visible) {
    outline: 4px solid var(--color-outline);
}


/************************/
/* MARK: Nav Bar
/************************/

/************************/
/* MARK: Primary Nav Bar
/************************/

/* for menu top bar */
header .top-bar {
    list-style: none;
    color: white;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1em;
}

/* hero image in primary header */
.hero img {
    width: 100%;
    max-height: 70vh;
    object-fit: cover;
}


/************************/
/* MARK: General Nav Bar
/************************/


/* the nav-bar that stays the same throuught all header */
.navigation-bar {
    background: var(--background-color);
    color: var(--color-font);
    width: 100%;
    height: var(--header-height);
    
    display: flex;
    justify-content: space-between;
    align-items: center;

    .logo-link {
        color: var(--font-color);
        text-decoration: none;
        height: 100%;
        width: auto;
        padding: 1rem;
        transition: 0.05s;
        display: flex;
        align-items: center;
        gap: 0.5rem;

        .logo-span {
            display: inline-block;
            height: 100%;
            width: auto;
            aspect-ratio: 1;

            background-image: url(../images/AndreasLogo.png);
            background-size: cover;

            @media (prefers-color-scheme: dark) {
                background-image: url(../images/AndreasLogoWhite.png);
            }
        }

        img {
            height: 100%;
            width: auto;
        }

    }
    /* menu navigation */
    .nav-primary {
        margin-right: 3rem;

        a {
            color: var(--color-font);
            text-decoration: inherit;
            position: relative;
            display: inline-block;  
            transition: 0.1s;

            &::after {
                content: "";
                position: absolute;
                background: var(--color-font);
                bottom: -0.4rem;
                left: 0;
                width: 0;
                height: 0.10rem;
                transition: width 0.3s ease;
            }

            &:hover::after, &:focus-visible::after {
                width: 100%;
            }

            &:focus-visible {
                outline: none;
            }
        }
    }

}

/************************/
/* MARK: Mobile Hambuger Menu
/************************/

/* hamburger menu */
@media screen and (min-width: 678px) {
    .menu-button {
    display: none;
    }

}

@media screen and (max-width: 677px) {
    .menu-button {
        border: none;
        background: none;
        display: flex;
        height: 100%;
        width: 30px;
        cursor: pointer;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin-right: 1.5rem;
        gap: 0.3rem;
    }
    
    .menu-button span:nth-of-type(1),
    .menu-button span:nth-of-type(2),
    .menu-button span:nth-of-type(3) {
        display: inline-block;

        background-color: var(--color-font);
        
        height: 4px;
        width: 30px;
        transition: transform 400ms cubic-bezier(0.23, 1, 0.32, 1);
        border-radius: 2px;
    }


    .nav-primary {
        display: none;
    }


    /* visible mobile menu */
    .menu-mobile-visible {
        background: var(--background-color);
        position: absolute;
        margin-right: 0 !important;
        top: var(--header-height); 
        right: 0px;
        height: min-content;
        width: clamp(10rem, 40vw, 20rem);
        padding: 1rem 0 2rem 1rem;
        border-radius: 0 0 0 1rem;
        border-left: 0.10rem solid var(--color-font);
        border-bottom: 0.10rem solid var(--color-font);

        display: block;

        z-index: 1000;

        ul {
            display: flex;
            flex-direction: column;
            
        }


        
    }


    /* the menu to x toggle */
    :has(.menu-mobile-visible) {

        .menu-button {
            position: relative;
        }

        span:nth-of-type(1) {
            position: absolute;
            top: 0px;
            margin-top: 0px;
            transform: rotate(45deg);
        }

        span:nth-of-type(2) {
            display: none;
        }

        span:nth-of-type(3) {
            margin-top: 0px;
            position: absolute;
            top: 0px;
            transform: rotate(-45deg);
        }
    }

}


/************************/
/* MARK: Page Content
/************************/

/* just everything that includes section-content */
.content {
    .container {
        display: flex;
        flex-direction: column;


        h1, h2 {
            align-self: center;
        }
    }
}


/************************/
/* MARK: Front Page
/************************/

.orange-divider {
    height: 2rem;
    width: 100%;
    background-color: var(--color-three);
}

.front-page-section1 {
    background-color: var(--color-two);
    width: 100%;
    padding: 1rem;

    .container {
        display: grid;
        justify-items: center;
    }
}


.front-page section {
    padding-top: 2rem;
}

/************************/
/* MARK: Single Category Page
/************************/

.category-overview {
    height: min-content;
    .container {
        height: min-content;
    }
}

/************************/
/* MARK: Category overview
/************************/

.spacer {
    height: 1rem;
}

/* the layout for all photo categories on the front page */
.category-overview {
    .container {
        display: flex;
        flex-direction: column;

        h2 {
            align-self: center;
        }
    }
}



/* style the a link to be above the pictures */
.category-overview li {
    display: grid;
    position: relative;
    transition: 0.1s;

    figure {
        margin-bottom: 0;
    }

    h3 {
        position: relative;
        color: var(--color-font-inverse);
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
        
    }

    a {
        position: relative;
        display: inline-block;
        width: 100%;
        height: 100%;

        text-decoration: none;
        color: white;
        text-align: center;
        font-size: 1.5rem;
        
        span {
            position: relative;
            z-index: 1000;
        }

        &:hover, &:focus-visible, &:focus {
            transform: none;
        }

        &::after {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            display: inline-block;
            height: 100%;
            width: 100%;
            background-color: rgba(0, 0, 0, 0);
            transition: background-color 0.3s ease; 
            z-index: 0;

        }
    }


}

.category-overview li:hover, .category-overview li:has(:focus-visible) {
    h3 {
        position: absolute;
        left: 0;
        top: 0;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        overflow: visible !important;
        clip: auto !important;
        white-space: normal !important;
    }
    
    a {
        display: grid;
        place-items: center;
    }

    a::after {
        background-color: rgba(0, 0, 0, 0.4); /* Dark overlay on hover */
        height: 100%;
        
    }
}


.photo-item--description {
    padding: 1rem;
    background-color: var(--color-two);

}


/* ******** */
/*  MARK: category filters 
/* ******** */

.category-filter {
    ul {
        display: flex;
        justify-content: center;
        gap: 0.5rem;
        flex-wrap: wrap;
        margin: 1rem 0;

        li {
            box-sizing: content-box;
            padding: 0.5rem 1rem;
            border-radius: 0.5rem;
            background-color: var(--color-two);

            
            
            &.active {
                background-color: var(--color-four);
                
                

                a {
                    color: var(--color-font-inverse);

                }
            }
            

            a {
                height: 100%;
                width: 100%;
                color: var(--color-font);
                text-decoration: none;

                
            }
        }
    }
}

/************************/
/* MARK: All photos page
/************************/

/* center the heading */

.heading-without-photo {
    display: grid;
     h1 {
        justify-self: center;
        background-color: var(--color-two);
        width: 100%;
        text-align: center;
        padding: 1rem;
    }

}

.center-heading {
    display: grid;
    /* max-height: 60vh; */

    h1 {
        justify-self: center;
        background-color: var(--color-two);
        width: 100%;
        text-align: center;
        padding: 1rem;
    }



    .random-photo-secondary-container {
        min-height: min-content;
        max-height: 60vh;

        overflow: hidden;
        display: grid;
        place-items: center;

        figure {
            width: 100%;
            min-height: 100%;
            margin: 0;
            overflow: hidden;
            border-bottom: 0.1rem solid black;
    
            img {
                min-width: 100%;
                min-height: 50vh;
                object-fit: cover;
                display: block;
            }
        }
    }

}

/* the grid layout for all photos */
.photo-grid {

    column-count: 3;         
    column-gap: 1rem;         
    list-style: none;
    padding: 0;
    margin: 0;
    max-width: 2000px;

    li {
        break-inside: avoid;    
        margin-bottom: 1rem; 
    }

    img {
        width: 100%;  
        height: auto;    
        display: block;
    }

}

.photo-item {
    overflow: hidden;
    border-radius: 0.5rem;

    @media (width <= 575px) {
        border-radius: 0;
    }
}

.photo-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.photo-item:hover img, .photo-item:has(:focus-visible) img {
    transform: scale(1.05);
}



@media screen and (max-width: 900px) {
    .photo-grid { column-count: 2; }
}

@media screen and (max-width: 600px) {
    .photo-grid { column-count: 1; }
}


/* ****** */
/* Family Secrets
/* ****** */

.family-secrets {
    .container:has(form) {
        height: 30rem;
        display: grid;
        align-items: center;
        justify-items: center;
    }
}

.family-visible {
    display: grid;

    h1 {
        justify-self: center;
        margin: 1.5rem;
    }
}

/* ****** */
/* Carousel
/* ****** */

.carousel {
    .container {
        display: grid;
        justify-items: center;
    }

    ul {
        list-style: none;
        padding: 0;
        li {
            margin: 0;
        }
    }
}

.swiper {
  width: 100%;
  height: 100%;
}

.photo-carousel {
  width: 100%;
  max-width: 80vw; 
  height: auto;   
  aspect-ratio: 3/2;  
}

.swiper-slide {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.photo-carousel .swiper-slide img {
  display: block;
  height: 100%;
}


/* ****** */
/* MARK: view transitions
/* ****** */

@view-transition {
    navigation: auto;
}

@supports (view-transition-name: auto) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }

  ::view-transition-old(category-title),
  ::view-transition-new(category-title),
  ::view-transition-old(active-category),
  ::view-transition-new(active-category) {
    animation-duration: 0.5s;
  }
}

/* ***** */
/* MARK: Dialog
/* ***** */

/* Photo Modal */
.photo-modal {
    border: none;
    border-radius: 0.5rem;
    padding: 0;
    max-width: 90vw;
    max-height: 90vh;
    background: transparent;
    backdrop-filter: blur(5px);
}

.photo-modal::backdrop {
    background: rgba(0, 0, 0, 0.7);
}

.photo-modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: var(--background-color);
    padding: 1rem;
    border-radius: 0.5rem;
    max-width: 100%;
    max-height: 100%;

}

#modal-photo {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 0.25rem;
    transition: opacity 0.2s ease;
}

.photo-modal-close {
    background-color: white;
    border: 2px solid black;
    border-radius: 99rem;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: black;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.photo-modal-close:hover, .photo-modal-close:focus-visible, .photo-modal-close:focus {
    transform: scale(1.2);
}

.download-btn {
    background-color: var(--color-five);
    color: white;
    font-weight: 900;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s;
    cursor: pointer;
}

.download-btn:hover, .download-btn:focus-visible, .download-btn:focus {
    background-color: var(--color-five-contrast);
}



/* *** */
/* MARK: download all
/* *** */
.download-all-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.download-all-btn {
    background-color: var(--color-two);
    border: none;
    color: var(--color-font);
}

.download-all-btn:hover, .download-all-btn:focus-visible  {
    background-color: var(--color-five-contrast);
}

.download-all-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.download-status {
    font-family: var(--font-general);
    font-size: 0.9rem;
    color: var(--color-font);
}


/* ******* */
/* MARK: touch screen
/* ******* */

@media (hover: none) {
	.navigation-bar {
        /* menu navigation */
        .nav-primary {
            a {
                &::after {
                    width: 100%;
                }
            }
        }

    }


    .category-overview li {
        h3 {
            position: absolute;
            left: 0;
            top: 0;
            width: 100% !important;
            height: 100% !important;
            margin: 0 !important;
            display: flex !important;
            align-items: center !important;
            overflow: visible !important;
            clip: auto !important;
            white-space: normal !important;
        }
        
        a {
            display: grid;
            place-items: center;
            height: 3rem;
            position: absolute;
            top: 0;
        }

        a::after {
            background-color: rgba(0, 0, 0, 0.4); /* Dark overlay on hover */
            height: 3rem;
            
        }
    }
}



/* ******* */
/* MARK: Password Protected page
/* ******* */

.password-protected-page {
    display: grid;
    justify-items: center;

    .heading {
        width: 100%;
        background-color: var(--color-two);
        padding: 1rem;
        text-align: center;
    }

    .password-wrapper-styling {
        display: grid;
        justify-items: center;
        padding: 1rem;
    }

}



/* ******* */
/* MARK: 404
/* ******* */

.four04 {
    display: grid;
    justify-content: center;
    padding: 1rem;
}

.fallback-category {
    height: 10rem;
    background-color: var(--color-five);
}




