/* Base styles */
body {
    font-family: Arial, sans-serif;
    /* Sets the default font for the entire document */
    line-height: 1.6;
    /* Sets the line height to 1.6 times the font size for better readability */
    margin: 0;
    /* Removes default margin */
    padding: 0;
    /* Removes default padding */
    font-size: 16px;
    /* Sets the base font size */
}

/* Navigation styles */
nav {
    background-color: #333;
    /* Dark background for the navigation */
    padding: 1rem;
    /* Adds padding around the navigation content */
}

nav a {
    color: white;
    /* Sets the text color of navigation links to white */
    text-decoration: none;
    /* Removes underline from links */
    /* padding: 0.5rem 1rem; */
    /* Adds padding to make links more clickable */
}

#main-nav {
    display: flex;
    /* Uses flexbox for layout */
    justify-content: space-between;
    /* Spreads out child elements */
    align-items: center;
    /* Vertically centers child elements */
    background-color: #333;
    /* Dark background for main navigation */
    padding: 1rem;
    /* Adds padding around the main navigation content */
}

.main-nav-list {
    display: flex;
    /* Uses flexbox for layout */
    list-style-type: none;
    /* Removes bullet points from list */
    padding: 0;
    /* Removes default padding */
    margin: 0;
    /* Removes default margin */
}

.main-nav-list li {
    margin-right: 1rem;
    /* Adds space between list items */
}

.main-nav-list a {
    color: white;
    /* Sets the text color of main navigation links to white */
    text-decoration: none;
    /* Removes underline from links */
    padding: 0.5rem 1rem;
    /* Adds padding to make links more clickable */
}

.main-nav-list a:hover,
#sub-nav a:hover {
    background-color: #555;
    /* Changes background color on hover for visual feedback */
}

#main-nav a.active,
#sub-nav a.active {
    background-color: #555555;
    /* Highlights the active navigation item */
    font-weight: bold;
    /* Makes the active item text bold */
}

#search-container {
    display: flex;
    /* Uses flexbox for layout */
    align-items: center;
    /* Vertically centers child elements */
}

#search-input {
    padding: 5px;
    /* Adds internal spacing */
    margin-right: 5px;
    /* Adds space to the right of the input */
    width: 200px;
    /* Sets a fixed width for the search input */
}

#search-button {
    padding: 5px 10px;
    /* Adds internal spacing */
    background-color: #555;
    /* Sets button background color */
    color: white;
    /* Sets button text color */
    border: none;
    /* Removes default border */
    cursor: pointer;
    /* Changes cursor to pointer on hover */
}

#search-button:hover {
    background-color: #666;
    /* Darkens button color on hover */
}

#sub-nav {
    background-color: #444;
    /* Sets a slightly lighter background for sub-navigation */
    padding: 1rem;
    /* Adds padding around the sub-navigation content */
    display: inline-block;
    /* Allows the sub-nav to shrink to fit its content */
}

#sub-nav ul {
    list-style-type: none;
    /* Removes bullet points from list */
    padding: 0;
    /* Removes default padding */
    margin: 0;
    /* Removes default margin */
    display: flex;
    /* Uses flexbox for layout */
    flex-wrap: nowrap;
    /* Prevents wrapping of items */
}

#sub-nav li {
    margin-right: 1rem;
    /* Adds space between list items */
}

#sub-nav li:last-child {
    margin-right: 0;
    /* Removes right margin from the last item */
}

#sub-nav a {
    color: white;
    /* Sets the text color of sub-navigation links to white */
    text-decoration: none;
    /* Removes underline from links */
    padding: 0.5rem 1rem;
    /* Adds padding to make links more clickable */
    white-space: nowrap;
    /* Prevents text wrapping within links */
}

/* Main content styles */
main {
    padding: 2rem;
    /* Adds padding around the main content */
}

/* Home layout styles */
.home-layout {
    display: flex;
    /* Uses flexbox for layout */
    flex-wrap: wrap;
    /* Allows items to wrap to next line */
    gap: 2rem;
    /* Adds space between layout items */
    align-items: flex-start;
    /* Aligns items to the top of the container */
    justify-content: center;
}

/* class photographer is only used for image on start page: */

.photographer-photo {
    flex: 0 1 300px;
    /* Sets flex properties for the photographer photo */
}

.photographer-photo img {
    max-width: 100%;
    /* Ensures image doesn't exceed its container width */
    height: auto;
    /* Maintains aspect ratio */
    border-radius: 10px;
    /* Adds rounded corners to the image */
}

.citations {
    flex: 1 1 300px;
    /* Sets flex properties for citations */
    max-width: 375px;
    /* Limits maximum width of citations */
}

blockquote {
    font-style: italic;
    /* Italicizes quote text */
    margin: 0 0 1rem 0;
    /* Adds bottom margin to quotes */
    padding: 1rem;
    /* Adds padding inside quotes */
    background-color: #f9f9f9;
    /* Sets a light background for quotes */
    border-left: 5px solid #ccc;
    /* Adds a left border to quotes */
}

cite {
    display: block;
    /* Makes citation appear on a new line */
    text-align: right;
    /* Aligns citation text to the right */
    margin-bottom: 2rem;
    /* Adds space below citations */
}

/* Lightbox styles */
.lightbox {
    position: fixed;
    /* Fixes lightbox position relative to viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    /* Sets a semi-transparent black background */
    display: none;
    /* Hides lightbox by default */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    /* Ensures lightbox appears above other content */
}

.lightbox-content {
    max-width: 90%;
    /* Limits width of lightbox content */
    max-height: 90%;
    /* Limits height of lightbox content */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image-container {
    max-width: 100%;
    max-height: calc(90vh - 80px);
    /* Calculates maximum height based on viewport */
    display: flex;
    justify-content: center;
    /* align-items: center; must be off to keep image within container boundaries*/
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* Ensures image fits within container without distortion */
}

.caption {
    color: #fff;
    /* Sets caption text color to white */
    text-align: center;
    padding: 10px;
    width: 100%;
    margin-top: 10px;
    max-height: 60px;
    overflow-y: auto;
    /* Adds vertical scrollbar if caption is too long */
}

.close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #bbb;
    /* Changes color on hover/focus for visual feedback */
    text-decoration: none;
    cursor: pointer;
}

.prev,
.next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.6s ease;
    /* Adds smooth transition effect */
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
    background-color: rgba(0, 0, 0, 0.8);
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev {
    left: 0;
}

.prev:hover,
.next:hover {
    background-color: rgba(0, 0, 0, 1);
    /* Darkens background on hover */
}

/* Form styles */

button {
    padding: 10px 20px;
    background-color: #333;
    color: white;
    border: none;
    cursor: pointer;
}

button:hover {
    background-color: #555;
    /* Darkens button color on hover */
}

/* Instagram link styles */
.instagram-link {
    display: inline-flex;
    align-items: center;
    background-color: #E1306C;
    /* Instagram brand color */
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-family: Arial, sans-serif;
    transition: background-color 0.3s ease;
    /* Smooth transition for hover effect */
}

.instagram-link:hover {
    background-color: #C13584;
    /* Darker shade of Instagram brand color on hover */
}

.instagram-link i {
    font-size: 24px;
    margin-right: 10px;
}

/* Image gallery styles */
.image-gallery {
    display: flex;
    /* Uses flexbox for layout */
    flex-wrap: wrap;
    /* Allows items to wrap to next line */
    gap: 2rem;
    /* Adds space between gallery items */
    padding: 2rem;
    /* Adds padding around the gallery */
    justify-content: center;
    /* Centers gallery items */
}

.gallery-image {
    max-height: 300px;
    /* Sets a fixed height for gallery images */
    /* object-fit: contain; */
    /* Ensures images are contained in their container without distortion */
    border: 5px solid lightgray;
    /* Adds a light gray border around images */
    cursor: pointer;
    /* Changes cursor to pointer on hover */
}

/* Image container styles */
.image-container {
    text-align: center;
    /* only then images are centered */
    position: relative;
    /* needed to position overlay correctly */
    cursor: pointer;
    margin: 10px auto;
    /* give more space between images */
}

.image-container img {
    /* width: 100%; */
    /* height: auto; */
    border-radius: 10px;
    display: inline-block;
}

.image-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    opacity: 0;
    transition: .5s ease;
    /* Smooth transition for hover effect */
    background-color: rgba(0, 0, 0, 0.7);
    /* pointer-events: none; event handler now also added 
    to the overlay because the "overlay" may also be below the image*/
}

.image-container:hover .image-overlay {
    opacity: 1;
    /* Shows overlay on hover */
}

.image-text {
    color: white;
    font-size: 30px;
    font-weight: bold;
    text-align: center;
    /* padding: 10px; */
}

/* Fullscreen related styles */
.fullscreen-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
}

.fullscreen-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.lightbox.fullscreen {
    background-color: black;
}

.lightbox.fullscreen .lightbox-content {
    max-width: 100%;
    max-height: 100%;
}

.lightbox.fullscreen .lightbox-image-container {
    max-height: calc(100vh - 80px);
}

/* Media Queries */
@media screen and (max-width: 768px),
screen and (max-height: 768px) {

    /* Styles for screens smaller than 768px wide */
    body {
        font-size: 14px;
        /* Reduces base font size for smaller screens */
    }

    main {
        padding: 1rem;
        /* Adds padding around the main content */
    }

    #main-nav {
        align-items: stretch;
    }

    .main-nav-list {
        width: 100%;
    }

    .main-nav-list li {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }

    #search-container {
        width: 100%;
    }

    #search-input {
        width: calc(100% - 70px);
        /* Adjusts width to account for button */
    }

    #sub-nav {
        width: 100%;
        display: none;
    }

    #sub-nav ul {
        flex-wrap: wrap;
    }

    #sub-nav li {
        margin-bottom: 0.5rem;
    }

    .image-gallery {
        gap: 0rem;
        padding: 1rem;
    }

    .gallery-image {
        max-height: 200px;
        /*         max-width: 100%;
        height: auto; */
    }

    .image-overlay {
        position: initial;
        opacity: 1;
        height: initial;
        width: initial;
        line-height: initial;
        background-color: rgba(0, 0, 0, 0.2);
    }

    .home-layout {
        flex-direction: column;
    }

    .photographer-photo,
    .citations {
        flex: 1 1 100%;
        max-width: 100%;
    }

    nav a,
    button,
    .gallery-image {
        min-height: 44px;
        /* Ensures minimum touch target size */
        min-width: 44px;
    }

    .lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }

    .lightbox-image-container {
        max-height: calc(95vh - 100px);
    }

    .prev,
    .next {
        font-size: 24px;
        padding: 12px;
    }

    .close {
        top: 10px;
        right: 10px;
        font-size: 30px;
    }

    .prev,
    .next,
    .close {
        min-width: 44px;
        /* Ensures minimum touch target size */
        min-height: 44px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .fullscreen-btn {
        display: none;
        /* Hides fullscreen button on small screens */
    }

    .lightbox.fullscreen .prev,
    .lightbox.fullscreen .next {
        display: none;
        /* Hides navigation arrows in fullscreen mode on small screens */
    }

    .lightbox.fullscreen .close {
        top: 10px;
        right: 10px;
        font-size: 24px;
    }

    .lightbox.fullscreen .lightbox-image-container {
        max-height: 100vh;
    }

    .lightbox.fullscreen .caption {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: rgba(0, 0, 0, 0.7);
        padding: 10px;
    }

}

/* Keep navigation visible when scrolling */

body {
    padding-top: 100px;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #fff
}

/* Breadcrumb related things */

.breadcrumb {
    display: flex;
    list-style: none;
    padding: 0.5rem 1rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
}

.breadcrumb-item+.breadcrumb-item::before {
    content: "/";
    padding: 0 0.5rem;
}

.breadcrumb-item a {
    text-decoration: none;
    color: #007bff;
}

.breadcrumb-item.active {
    color: #6c757d;
}