/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #4a4a4a;
    background-color: #f7f7f7;
    padding: 20px;
    margin-bottom: 40px;
}

/* Typography */
h1 {
    color: #2a2a2a;
    text-align: center; /* Center all heading elements */
}

a {
    color: #2a2a2a;
    text-decoration: none;
}

a:hover {
    color: #6d6d6d;
}

/* Header */
header {
    background-color: #ffffff;
    color: #2a2a2a;
    padding: 0px 0 0 0;
    margin-bottom: 5px;
}

header h1 {
    margin-bottom: 10px;
}

/* Navigation Menu */
nav ul {
    background: #ffffff;
    list-style-type: none;
    text-align: center;
    padding: 10px;
    margin-bottom: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

nav ul li {
    display: inline;
}

nav ul li a {
    display: inline-block;
    padding: 10px 15px;
    transition: background-color 0.3s;
}

nav ul li a:hover {
    background-color: #e6e6e6;
}

/* Sections */
section {
    margin-bottom: 20px;
    padding: 20px;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

section h2 {
    margin-bottom: 15px;
}

section p {
    margin-bottom: 15px;
}

/* Contact */
#contact {
    text-align: center;
}

/* Footer */
footer {
    background-color: #2a2a2a;
    color: #f7f7f7;
    text-align: center;
    padding: 15px 0;
    width: 100%;
}

section {
    min-height: 100vh; /* Make each section take up at least the height of the viewport */
    padding: 20px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.5s ease-in-out; /* Transition effect for the click event */
}

/* Targeted section styles */
:target {
    transform: scale(1.05); /* Slightly increase the size of the section when it's targeted */
}

header {
    background-color: #ffffff;
    color: #2a2a2a;
    padding: 20px 0;
    width: 100%;
    position: fixed; /* Fixed positioning to keep it at the top */
    top: -70px; /* Hide it above the viewport */
    left: 0;
    transition: top 0.3s ease-in-out; /* Transition for smooth appearance */
    z-index: 1000; /* Ensure the header is above other content */
}

/* When hovering over the header's position, show the header */
body:hover header {
    top: 0;
}

.photo-collage {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Two columns */
    gap: 10px;
    max-width: 600px; /* Set a maximum width for the collage container */
    margin: auto; /* Center the collage in the available space */
}

.collage-photo {
    width: 100%; /* Make the image responsive within the grid */
    height: auto; /* Maintain aspect ratio */
    cursor: pointer;
    object-fit: cover; /* Ensure images cover their respective areas */
    border: 2px solid #ddd; /* Smaller border for the smaller images */
}

/* Ensure the collage is responsive and adjusts to screen size */
@media (max-width: 768px) {
    .photo-collage {
        grid-template-columns: 1fr; /* Stack images vertically on smaller screens */
        max-width: 300px; /* Smaller maximum width for the collage on smaller screens */
    }
}

.modal {
    display: none; /* Hide by default */
    align-content: center;
    position: fixed; /* Position fixed to cover the entire viewport */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent background */
    z-index: 1000; /* High z-index to be on top of other elements */
    display: flex; /* Use flexbox to center the modal content */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
    overflow: auto; /* Enable scrolling if the content is too tall */
    padding: 20px; /* Add some padding around the modal content */
}

.modal-content {
    display: flex;
    flex-direction: column; /* Default to column, JavaScript will adjust */
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 5px;
    text-align: left;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: 100%; /* Maximum width of modal content */
    max-height: 80%; /* Maximum height of modal content */
}

.modal-content img {
    display: block; /* Ensure the image is a block-level element */
    max-width: 90%; /* Limit image width to not overflow its container */
    max-height: 80vh; /* Limit image height to not exceed 80% of the viewport height */
    margin: 10px auto; /* Center the image with automatic horizontal margins */
    padding: 8px; /* Padding around the image to create the frame effect */
    background-color: #fff; /* Background color of the frame */
    border: 2px solid #ddd; /* Border to enhance the frame effect */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow to the frame */
    transition: box-shadow 0.3s ease; /* Transition for the shadow effect */
}

.modal-content img {
    display: block; /* Ensure the image is a block-level element */
    max-width: 100%; /* Limit image width to not overflow its container */
    max-height: 60vh; /* Limit image height to not exceed 60% of the viewport height */
    margin: 10px 0; /* Spacing above and below image */
}

.modal-content #image-story {
    max-width: 100%; /* Text container takes up to 100% of modal width */
    overflow-y: auto; /* Enable scrolling for text content if too tall */
}

/* Landscape orientation styles */
.modal-content.landscape {
    flex-direction: column; /* Stack image and text vertically */
    gap: 1px;
}

.modal-content.landscape img,
.modal-content.landscape #image-story {
    max-width: 100%; /* Allow image and text to take full width */
}

/* Portrait orientation styles */
.modal-content.portrait {
    flex-direction: row; /* Place image and text side by side */
    gap: 10px;
}

.modal-content.portrait img,
.modal-content.portrait #image-story {
    max-width: 30%; /* Each takes up to half of the modal-content width */
}

/* Ensure the collage is responsive and adjusts to screen size */
@media (max-width: 768px) {
    #image-story {
        width: auto
    }

    /* Portrait orientation styles */
    .modal-content.portrait {
        flex-direction: column; /* Place image and text side by side */
        gap: 1px;
    }

    .modal-content.portrait img,
    .modal-content.portrait #image-story {
        max-width: 100%; /* Each takes up to half of the modal-content width */
    }

}

/* Close button */
.close {
    position: absolute;
    right: -10px;
    top: -10px;
    background: #ffffff;
    border-radius: 50%;
    padding: 10px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.close:hover {
    opacity: 1;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .modal-content {
        flex-direction: column; /* Stack children on smaller screens */
        max-width: 90%; /* Use a higher percentage of the screen width */
        max-height: 90%;
    }

    .modal-content img,
    .modal-content #image-story {
        max-width: 100%;
        margin-right: 0; /* Remove right margin */
    }

    .modal-content #image-story {
        margin-top: 20px; /* Add space between the image and the text */
    }
}

.image-container {
    position: relative;
    overflow: hidden;
    margin: 5px; /* Optional: add some space around the images */
}

.collage-photo {
    display: block;
    width: 100%;
    height: auto;
    padding: 8px; /* Padding around the image to create the frame effect */
    background-color: #fff; /* Background color of the frame */
    border: 2px solid #ddd; /* Border to enhance the frame effect */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Optional: add a subtle shadow to the frame */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Transition for the zoom and shadow effect */
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7); /* Dark overlay */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0; /* Overlay is initially invisible */
    transition: opacity 0.3s ease;
}

.tagline {
    text-align: center;
    padding: 15px;
    font-size: 1.2em;
}

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

.image-container:hover .collage-photo {
    transform: scale(1.1); /* Slight zoom effect on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Enhanced shadow on hover for a lifting effect */
}

.intro {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
    margin: 0 auto; /* Center the intro section */
    max-width: 800px; /* Set a max-width to prevent the section from getting too wide */
    padding: 20px; /* Add padding for spacing */
}

.intro-me,
.intro-you {
    flex: 1; /* Both children should take up equal space */
    padding: 10px; /* Add some padding */
}

.intro-me {
    text-align: right; /* Right-align text for the 'Me' section */
}

.intro-you {
    text-align: left; /* Left-align text for the 'You' section */
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .intro {
        flex-direction: column; /* Stack children vertically */
    }

    .intro-me,
    .intro-you {
        text-align: center; /* Center-align text for better readability on small screens */
        padding: 10px 0; /* Adjust padding for a tighter layout */
    }
}