@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap');

/* ============================================
   CORE STYLES - Shared across ALL pages
   These do NOT affect background/color theming
   ============================================ */

/* Noise overlay - consistent across all pages */
.noise::before {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    content: "";
    opacity: 0.027;
    background: url(https://bigtwistph.github.io/tumblr_widgets/noise.gif);
    z-index: -1;
    pointer-events: none;
}

/* Base body structure */
body {
    margin: 0;
    font-family: 'IBM Plex Mono', monospace;
    text-align: center;
    cursor: url('https://bigtwistph.github.io/tumblr_widgets/3dwarro.cur'), auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

/* Container system */
.container {
    max-width: 844px;
    margin: 0 auto;
    padding: 20px 20px 0 20px;  /* WAS: 20px, CHANGED: removed bottom padding */
    position: relative;
    z-index: 2;
}

/* Header styles (shared) */
header {
    padding: 20px 0;
}

.image-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: auto;
    margin: 0 auto;
    margin-bottom: 5px;
}

.default-logo,
.hover-logo {
    width: 100%;
    height: auto;
    transition: opacity 0.2s ease-in-out;
}

.hover-logo {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
}

.image-container:hover .hover-logo {
    opacity: 1;
}

.image-container:hover .default-logo {
    opacity: 0;
}

/* Navigation (shared) */
nav {
    margin: 20px 0;
    margin-top: 5px;
    margin-bottom: 20px;  /* WAS: 40px, CHANGED to 20px */
    font-weight: 400;
    font-style: italic;
    z-index: 2;
}

nav a {
    text-decoration: none;
    color: black;
    padding: 10px 20px;
    background-color: white;
    border-radius: 20px;
    margin: 0 10px;
    display: inline-block;
    transition: background-image 0.2s ease;
}

nav a:hover {
    font-weight: 700;
    color: white;
    background-image: url('/logo/gradient.gif');
}

/* ============================================
   MODAL STYLES (shared, won't break)
   ============================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 150px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0, 0, 0);
    background-color: rgba(0, 0, 0, 0.95);
}

.modal-content {
    background-color: rgba(0, 0, 0, 0);
    margin: auto;
    padding: 20px;
    width: 90%;
    max-width: 600px;
}

.modal-content iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

/* Modal windows (gallery & notes) */
.modal-window {
    display: none;
    position: fixed;
    background: var(--modal-bg, #f266b3);
    border: 1px solid white;
    padding: 20px;
    resize: both;
    overflow: auto;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 5;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--modal-header-bg, #f266b3);
    color: white;
    font-weight: bold;
    border-bottom: 2px solid white;
    cursor: move;
}

/* Gallery modal positioning */
#galleryModal {
    width: 20vw;
    height: auto;
    min-width: 20vw;
    min-height: 20vw;
    max-width: 500px;
    max-height: 600px;
    top: 50px;
    left: 15%;
}

#notesModal {
    width: 40vw;
    height: auto;
    min-width: 20vw;
    min-height: 20vw;
    max-width: 500px;
    max-height: 600px;
    top: 50px;
    left: 45%;
}

#notesModal img {
    width: 100%;
    height: auto;
    border: 1px solid white;
    border-radius: 5px;
    transition: transform 0.3s ease;
}

#notesModal img:hover {
    transform: scale(1.08) rotate(2deg);
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.gallery-grid img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    transition: transform 0.3s ease;
}

.gallery-grid img:hover {
    transform: scale(1.08) rotate(2deg);
}

/* Back to top button */
.top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    display: none;
    z-index: 10;
}

/* Responsive */
@media (max-width: 768px) {
    nav a {
        font-size: 14px;
        padding: 8px 15px;
        margin: 0 2px;
    }

    /* Gallery modal on mobile - at the top */
    #galleryModal {
        width: 90%;
        left: 5%;
        right: auto;
        top: 20px;
        max-height: 45vh;  /* Limit height to about half the screen */
        overflow-y: auto;
    }
    
    /* Force gallery thumbnails to 1 column on mobile */
    #galleryModal .gallery-grid,
    .gallery-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
        display: grid !important;
    }
    
    .gallery-grid img {
        width: 100%;
        height: auto;
    }

    /* Notes modal on mobile - positioned at 50% of page height */
    #notesModal {
        width: 90%;
        left: 5%;
        right: auto;
        top: 75%;  /* Position at middle of screen */
        transform: translateY(-50%);  /* Center vertically */
        max-height: 45vh;  /* Limit height to about half the screen */
        overflow-y: auto;
    }
}

/* Add this to remove extra spacing from header container */
#site-header .container {
    padding-bottom: 0;
    margin-bottom: 0;
}

/* If you have a main container class, add this */
.main-container {
    margin-top: -10px;
}

/* ============================================
   LIGHTBOX MODAL FOR GALLERY IMAGES
   ============================================ */

/* Lightbox modal (image viewer) */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0, 0, 0);
    background-color: rgba(0, 0, 0, 0.95);
}

.image-modal-content {
    margin: auto;
    display: block;
    width: auto;
    max-width: 70vw;
    max-height: 80vh;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.image-modal-content img {
    width: 100%;
    height: auto;
    border-radius: 5px;
}

/* Hide captions */
#imageCaption {
    display: none;
}

/* Close button for lightbox */
.image-modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10001;
}

.image-modal-close:hover,
.image-modal-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Navigation arrows - positioned at sides */
.image-modal-prev,
.image-modal-next {
    cursor: pointer;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 40px;
    transition: 0.3s;
    user-select: none;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
}

.image-modal-prev {
    left: 10px;
    border-radius: 0 3px 3px 0;
}

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

.image-modal-prev:hover,
.image-modal-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
    text-decoration: none;
}

/* Hide back-to-top button when lightbox is open */
.image-modal ~ .top,
body:has(.image-modal[style*="display: block"]) .top {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .image-modal-content {
        max-width: 90vw;
        max-height: 70vh;
    }
    
    .image-modal-prev,
    .image-modal-next {
        font-size: 30px;
        padding: 12px;
    }
    
    .image-modal-prev {
        left: 5px;
    }
    
    .image-modal-next {
        right: 5px;
    }
}