/* Global Resets & Base Styles */
body {
    margin: 0;
    font-family: "Times New Roman", Times, serif;
    background-color: #fdfcff;
    
    color: #000000;
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- UPDATED Font Scaling Helper --- */
.scaled-text {
    transform: scaleX(0.79);
    transform-origin: left; /* Ensures scaling happens from the left edge */
    letter-spacing: -0.02em; /* Optional: can improve or worsen legibility, adjust as needed */
    /* The element's original block/inline nature determines its flow. */
    /* Scaling reduces visual width, not layout width before transform. */
    padding-bottom: -10px;
}


/* --- New Navigation Button Styling --- */
.nav-button {
    font-family: "Times New Roman", Times, serif;
    font-size: 3.5em;
    transform: scaleX(0.79); 
    transform-origin: center; 
    transition: transform 0.3s ease; /* Smooth scaling effect on hover */
}

/* Optional: Add hover effect for scaling */
.nav-button:hover {
    transform: scaleX(0.9); /* Slightly enlarge on hover */
    transform-origin: right;
}
/* Apply display: inline-block if .scaled-text is on an inline element like <a> or <span> */
/* This is important for transform to apply correctly to them. */
.site-nav ul li a.scaled-text,
span.scaled-text { /* If you use spans for scaling */
    display: inline-block;
}

/* For block elements like h1, p, div that have .scaled-text,
   they remain block elements. The text content within them is scaled. */
.site-header h1.scaled-text,
.site-header p.scaled-text, /* .subtitle */
.main-content p.scaled-text,
.site-footer.scaled-text, /* Applied to footer, will scale its p child */
.site-footer.scaled-text p, /* Ensure p inside scaled footer behaves */
div.modal-caption.scaled-text {
    display: block; /* Explicitly keep/set block behavior */
}
/* Special handling for footer if class is on footer div */
.site-footer.scaled-text > p {
    transform: scaleX(0.79); /* Child p needs scaling if parent has class */
    transform-origin: left;
    display: block; /* Ensure it takes width if footer is text-align center */
    margin-left: auto; /* For centering if text-align center is on parent */
    margin-right: auto;
   
}

.site-footer.scaled-text {
    text-align: center;
}


/* Main Layout - Vertical Split */
.main-container {
    display: flex; /* Ensures columns are side by side */
    min-height: 100vh; /* Full viewport height */
    overflow: hidden; /* Prevents parent container from scrolling */
}

/* Content Column Styling */
.content-column {
    flex: 0 0 25%; /* Fixed width for the content column */
    padding: 10px 20px 1px 20px; /* Padding for the content column */
    background-color: #ffffff;
    /*background-image: url('images/buddhajoy.jpg'); 
    background-size: 100% 100%;
    background-position: center; /* Centers the image */
    /*background-repeat: no-repeat; /* Prevents tiling */
    width: 100%;
    height: 100vh;
    border-right: 10px solid #ffffff; /* Dividing line */
    box-shadow: 3px 0px 15px rgba(100, 100, 150, 0.05);
    display: flex;
    flex-direction: column;
    /* overflow-y: auto; /* Makes the content column scrollable */
    max-height: 100vh;;
    position: relative; /* Ensure proper stacking context */
}

/* Sticky Header and Navigation */
.site-header {
    position: sticky;
    top: 0; /* Sticks to the top of the content column */
    background-color: rgba(255, 255, 255, 0); /* Match the background color */
   
    z-index: 10; /* Ensure it stays above other content */
    text-align: center; /* Centers the block elements h1 and p.subtitle */
    margin-bottom: 0px;
}

.site-nav {
    position: sticky;
    top: calc(100px + 10px); /* Adjust based on the height of the header */
    background-color: rgba(255, 255, 255, 0); /* Match the background color */
    z-index: 10; /* Ensure it stays above other content */
    line-height: 1.1;
}

.site-nav ul {
    list-style: none;
    padding: 0px 50px 0px 0px; /* Padding for the list */ 
    margin: 0 0 30px 0;
}

/* Gallery Column Styling */
.gallery-column {
    flex: 1 1 75%; /* Takes up the remaining space */
    padding: 30px;
    background-color: #7cd5ff;
    background-image: url('images/stairway.png'); 
    background-size: 100% 100%;
    background-position: center; /* Centers the image */
    background-repeat: no-repeat; /* Prevents tiling */
    width: 100%;
    height: 100vh;
    
    overflow-y: auto; /* Makes the gallery column scrollable */
    max-height: 100vh;;
}

.site-header h1 { /* Styling for h1, .scaled-text class handles the transform */
    font-size: 2.2em;
    color: #7070a0;
    padding: 0px 50px 0px 50px;   
    margin: 0px;
    font-weight: normal;
    font-style: italic;
    letter-spacing: 0.05em; /* Original letter-spacing before scaling */
}

.site-header .subtitle { 
    font-size: 3em;
    text-align: justify;
    line-height: 80%;
    padding: 0px 50px 20px 50px;
    margin: 0px;
    color: #8a8aa0;
    font-style: italic;
}

.site-nav ul li a { /* Styling for a, .scaled-text handles transform */
    text-decoration: none;
    color: #606090;
    padding: 3px 0;
    display: block; 
    transition: color 0.3s ease, letter-spacing 0.3s ease;

}

.site-nav ul li a:hover {
    color: #a090c0;
    /* letter-spacing on hover might interact weirdly with scaled text, test carefully */
    /* letter-spacing: 0.03em; */ /* Original spacing might be better */
}

.main-content p { /* Styling for p, .scaled-text handles transform */
    margin-bottom: 1.2em;
    padding: 0px 50px 0px 50px; /* Padding for the main content */
    font-size: 1.5em;
    font-style: bold;
    text-align: justify;
    text-wrap: break-word;
    margin: 0px;
    color: rgba(85, 85, 117, 0.6);
}

.site-footer {
    margin-top: 0;
    padding-top: 0px;
    text-align: left; 
    font-size: 1em; /* Base font size for footer content */
    color: #9090b0;
}
/* site-footer p is scaled by .scaled-text on .site-footer or p itself */

/* --- Gallery Column Styling --- */
.image-grid {
   
    column-width: 250px; /* Adjust this value: desired width for your columns.
                           The browser will create as many columns of this width as fit. */
    column-gap: 30px;   /* This sets the horizontal "padding" or gap between columns. */
    /* You can also use a fixed number of columns if preferred: */
    /* column-count: 3; */ /* (e.g., for 3 columns, but column-width is more responsive) */
}

.grid-item {
    position: relative;
    overflow: hidden; /* Keep this if you have border-radius on the item itself */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(100, 100, 150, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;

    /* ADD/MODIFY for CSS Columns compatibility: */
    margin-bottom: 20px;      /* This sets the vertical "padding" or gap between items. */
    break-inside: avoid-column; /* Prevents an item from breaking across two columns. */
    display: inline-block;    /* Helps items flow correctly in columns. */
    width: 100%;              /* Ensures the item takes the full width of the column it's in. */
                               /* This makes the image inside also scale to 100% of column. */
}

.grid-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 20px rgba(100, 100, 150, 0.15);
}

.grid-item img {
    display: block;
    width: 100%;   /* Image scales to fit the .grid-item (which is 100% of column width) */
    height: auto;  /* Height adjusts to maintain aspect ratio - THIS IS KEY */
    border-radius: inherit; /* If .grid-item has rounded corners, image can inherit */
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.grid-item:hover img {
    transform: scale(1.1);
}

/* Alt Text Popup (same as before) */
.alt-popup {
    display: none;
    position: fixed;
    background-color: rgba(240, 240, 248, 0.95);
    color: #505070;
    border: 1px solid #d0d0e0;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    pointer-events: none;
    max-width: 250px;
}

.hover-text {
    display: none; /* Initially hidden */
    position: fixed; /* Position relative to the viewport */
    background-color: rgba(240, 240, 248, 0.95); /* Light background */
    color: #505070; /* Text color */
    border: 1px solid #d0d0e0; /* Border styling */
    padding: 8px 12px; /* Padding for the text */
    border-radius: 6px; /* Rounded corners */
    font-size: 0.85em; /* Font size */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); /* Subtle shadow */
    z-index: 1001; /* Ensure it appears above other elements */
    pointer-events: none; /* Prevent interaction with the hover text */
    max-width: 250px; /* Limit the width */
    white-space: nowrap; /* Prevent text wrapping */
}

/* --- Modal Styling --- */
.modal {
    /* THIS IS THE KEY FOR INITIAL STATE: */
    display: none; /* Hidden by default */

    /* The rest of your modal styles are for when it *becomes* visible */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(129, 213, 228, 0.6);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(5px);

    /* These flex properties are applied by JS when the modal is shown */
    /* It's fine to have them here as they will be active when display changes to flex */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-caption { /* The div for text ABOVE modal image */
    text-align: center; /* Center the text within the caption box */
    color: #f0f0f8;
    padding: 10px 15px; /* Adjust padding for a nice look */
    font-size: 1em; /* Base font size, .scaled-text will apply transform */
    
    /* --- MODIFIED --- */
    margin-bottom: 15px; /* Space between caption and image */
    /* margin-top: 10px; REMOVED */

    background-color: rgba(60, 60, 90, 0.7);
    border-radius: 4px;
    max-width: 80%; /* Max width of the caption box relative to modal width */
    /* margin-left: auto; margin-right: auto; NO LONGER NEEDED due to flex align-items:center on parent */
    
    /* .scaled-text class is on this div in HTML */
    
    /* Optional: if caption text can be very long */
    max-height: 20vh; /* Prevent caption from taking too much vertical space */
    overflow-y: auto; /* Add scroll if caption text overflows its max-height */
}

.modal-content { /* The image itself in the modal */
    display: block;
    
    margin-left: auto;
    margin-right: auto;
    
    max-width: 90%; /* Max width relative to modal's available space */
    
    /* --- MODIFIED --- */
    /* Adjust max-height to account for caption, close button, and padding */
    /* (85vh total modal content area - approx caption height - space for close button/padding) */
    max-height: calc(85vh - 50px - 30px); /* Tune these values as needed */
    
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(50, 50, 100, 0.3);
    animation: zoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    object-fit: contain; /* Important: scales image down to fit bounds, maintains aspect ratio */
}

.close-modal {
    position: absolute;
    top: 25px;
    right: 45px;
    color: #333;
    font-size: 45px;
    font-weight: bold;
    transition: color 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    z-index: 1005; /* Ensure it's above modal image and caption */
}

/* --- MODIFIED ANIMATION (optional, for smoother appearance with new layout) --- */
@keyframes zoomIn {
    from { transform: scale(0.7) translateY(15px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

/* Responsive adjustments for modal */
@media (max-width: 768px) {
    .modal-caption {
        max-width: 90%; /* Allow caption to be wider on small screens */
        margin-bottom: 10px;
        max-height: 25vh; /* Potentially more vertical space for caption on mobile */
    }
    .modal-content {
        max-width: 95%;
        /* Adjust max-height for smaller screens */
        max-height: calc(80vh - 40px - 20px);
    }
    .close-modal {
        top: 15px;
        right: 20px; /* Slightly more inset */
        font-size: 35px;
    }
}

.close-modal:hover,
.close-modal:focus {
    color: #7070a0;
    text-decoration: none;
    transform: rotate(90deg);
}

@keyframes zoomIn {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Responsive adjustments (same as before) */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    .content-column, .gallery-column {
        flex: 1 1 auto;
        width: 100%;
        box-sizing: border-box;
    }
    .content-column {
        border-right: none;
        border-bottom: 1px solid #dcdcf0;
        max-height: 50vh;
    }
    .site-header h1 { font-size: 1.8em; }
    .image-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }
    .modal-content {
        max-width: 95%;
        max-height: 80vh;
    }
    .close-modal {
        top: 15px;
        right: 25px;
        font-size: 35px;
    }
    /* Adjust scaled text on mobile if needed */
    /* .scaled-text { transform: scaleX(0.85); } */ /* Example: slightly less scaling */
}

.contact-page .gallery-column {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.contact-page .info-column {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    overflow-y: auto;
}

.contact-page .info-column h1 {
    font-size: 3.5em;
    color: #7070a0;
    padding-left: 60px;
    margin: 0;
    font-weight: bold;
    font-style: normal; 
    text-align: center;
}

.contact-page .info-column p {
    font-size: 2em;
    color: #3c3c3f;
    line-height: 1.5;
    word-wrap: break-word;
    text-align: justify;
}

.contact-page .info-box {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(100, 100, 150, 0.1);
}

.contact-page .gallery-section {
    flex: 1;
    position: relative;
    overflow: hidden;
    overflow-y: auto;
    max-height: 100%;
    padding: 10px;
}

.contact-page .image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.contact-page .grid-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-page .grid-item img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Modal Styling Scoped to .gallery-section */
.gallery-section .modal {
    display: none; /* Hidden by default */
    position: absolute; /* Position relative to .gallery-section */
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%; /* Full width of the .gallery-section */
    height: 100%; /* Full height of the .gallery-section */
    background-color: rgba(129, 213, 228, 0.6); 
    backdrop-filter: blur(5px); /* Blur effect */
    justify-content: center; /* Center modal content */
    align-items: center; /* Center modal content */
    overflow: hidden;
}

.gallery-section .modal-content {
    max-width: 90%; /* Limit the image width */
    max-height: 80%; /* Limit the image height */
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    object-fit: contain; /* Maintain aspect ratio */
}

.gallery-section .modal-caption {
    margin-top: 15px;
    color: #fff;
    font-size: 1em;
    text-align: center;
}

.gallery-section .close-modal {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #fff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.gallery-section .close-modal:hover {
    color: #ccc;
}

/* Interests Page */

.interests-page .main-container {
    display: flex;
}

.interests-page .content-column {
    width: 25%;
    padding: 20px;
}

.interests-page .gallery-column {
    width: 75%;
    position: relative;
    overflow: hidden; /* Hide overflow outside the gallery column */
    padding: 0;
}

.interests-page .collage-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Ensure items outside the container are hidden */
}

/* Position each collage item based on the Photoshop mockup */
/* shirt */
.interests-page .collage-item:nth-child(1) {
    top: 60px;
    left: 100px;
    width: 330px;
    height: auto;
    rotate: -30deg;
}

/* music */
.interests-page .collage-item:nth-child(2) {
    top: 35%;
    left: 30%;
    width: 270px;
    height: auto;
}

/* tf2 */
.interests-page .collage-item:nth-child(3) {
    top: 69.5%;
    left: 50px;
    width: 520px;
    height: auto;
}

/* palms */
.interests-page .collage-item:nth-child(4) {
    top: 350px;
    left: 730px;
    width: 550px;
    height: auto;
}

/* art */
.interests-page .collage-item:nth-child(5) {
    top: 55px;
    right: 80px;
    width: 320px;
    height: auto;
    rotate: 15deg;
}

/* poppy */
.interests-page .collage-item:nth-child(6) {
    top: 40px;
    left: 580px;
    width: 250px;
    height: auto;
}
/* Interests Page Collage Item Styling */
.interests-page .collage-item {
    position: absolute;
    cursor: pointer;
    transition: transform 0.3s ease, z-index 0.3s ease;
}

.interests-page .collage-item img {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 2; /* Ensure the image is above the glow layer */
}

/* Glow Effect with Godray Style */
.interests-page .collage-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%; /* Slightly larger than the image */
    height: 120%;
    background: radial-gradient(
        circle,
        rgb(238, 255, 0) 0%,
        rgba(239, 250, 89, 0.637) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    filter: blur(30px); /* Create the soft glow effect */
    z-index: 1; /* Place behind the image */
    opacity: 0; /* Initially hidden */
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hover Effects for Collage Items */
.interests-page .collage-item:hover {
    transform: scale(1.01); /* Scale up the item */
    z-index: 10; /* Bring the item to the front */
}

.interests-page .collage-item:hover::before {
    opacity: 1; /* Show the glow effect */
    transform: translate(-50%, -50%) scale(1.5); /* Slightly expand the glow */
}

.interests-page .hover-description {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9em;
    display: none;
    pointer-events: none;
    z-index: 20;
    white-space: nowrap;
}

.interests-page .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(238, 255, 0.3, 0.3);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.interests-page .modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 80%;
    max-height: 80%;
    overflow-y: auto;
}

.interests-page .close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
}

/* Music Page */

/* Music Modal Styling */

.embed-container .music-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.music-header h1 {
    font-size: 2.5em;
    color: #0000009d;
    text-align: center;
    font-weight: bold;
    margin: 0;
    background-image: url(images/cloudsgod.jpg);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    border: rgba(255, 192, 203, 1) solid 5px;
    border-radius: 10px;
    padding: 10px;
}

.embed-container {
    position: relative;
    display: flex;
    width: fit-content;
    height: fit-content;
    overflow: hidden;
    align-items: center;
    gap: 15px
}

.embed-container .subtitle {
    position: relative;
    display: flex;
    width: 120px;
    height: 140px;
    text-wrap: break-word;
    text-align: justify;
    margin: 0px, 0px;
    padding-right: 40px;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 1)),
        url("images/statue.png");
        
    
}

.embed-container .subtitle h3 {
    font-size: 1.8em;
    color: black;
    font-weight: bold;
    font-style: italic;
    margin: 0;
}

.embed-container .subtitle h4 {
    font-size: 1.2em;
    color: black;
    font-weight: bold;
    font-style: normal;
    text-align: justify;
    margin: 0;
}

.music-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.album {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 200px;
    text-align: center;
}

.album img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.album-info {
    margin-top: 5px;
}

.embed-container .modal-content h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #571818;
    text-align: center;
    font-weight: bold;
}

.album-info h3 {
    font-size: 1.2em;
    margin-bottom: 5px;
    margin-top: 0;
    color: #571818;
}

.album-info p {
    font-size: 0.9em;
    color: #555;
    margin: 0;
    margin-bottom: 5px;
}    

.album-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.album-info ul li {
    font-size: 0.9em;
    margin: 3px 0;
}