/* style.css - the415guy 2003 theme (iOS Optimized & Centered) */

/* ===== CORE LAYOUT & CRT EFFECT ===== */
body {
    background-color: #3f7bd0;
    box-shadow: inset 0 0 100px rgba(0,0,0,0.3);
    margin: 0;
    padding: 60px 15px 40px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'VT323', monospace;
    text-align: center;
    color: #f7da6d;
    image-rendering: pixelated;
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

* {
    -webkit-tap-highlight-color: rgba(0, 0, 128, 0.2);
    box-sizing: border-box;
}

/* ===== TYPOGRAPHY ===== */
h1 {
    font-size: clamp(32px, 8vw, 46px);
    font-weight: normal;
    text-decoration: underline;
    margin: 20px 0 30px 0;
    display: inline-block;
}

a { 
    color: #f7da6d; 
    text-decoration: none; 
}

a:hover { 
    color: #fff; 
    background: #000080; 
}

p {
    font-size: 22px;
    line-height: 1.4;
    max-width: 650px;
    margin-bottom: 20px;
}

/* ===== TOP NAVIGATION BAR ===== */
.top-nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: #000;
    border-bottom: 1px solid #f7da6d;
    padding: 10px 0;
    padding-top: env(safe-area-inset-top, 10px); 
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    font-size: 18px;
    z-index: 1000;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.top-nav a.active {
    background-color: #f7da6d;
    color: #000;
    font-weight: bold;
    padding: 0 5px;
}

/* ===== CONTAINERS & BLURBS ===== */
.intro-container, .blurb-container {
    width: 100%;
    max-width: 750px; 
    margin: 0 auto 40px auto;
    text-align: center;
    border-top: 1px dotted #f7da6d;
    border-bottom: 1px dotted #f7da6d;
    padding: 20px 0;
}

.intro-text {
    font-size: 24px;
    line-height: 1.4;
    margin: 0 auto;
    padding: 0 10px;
}

/* ===== HOME PAGE ICON GRID ===== */
.icon-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap; 
    max-width: 800px;
}

.shortcut {
    width: 120px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.1s;
}

.shortcut:hover {
    transform: scale(1.05);
    background: transparent;
}

.icon-box {
    width: 70px;
    height: 70px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
}

.shortcut:hover .icon-box {
    background-color: rgba(0, 0, 128, 0.5);
    border: 1px dashed #f7da6d;
}

.icon-box img {
    max-width: 60px;
    max-height: 60px;
}

.shortcut span {
    font-size: 20px;
    background: #000;
    padding: 2px 6px;
    color: #f7da6d;
}

/* ===== GALLERY STYLES ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 Columns */
    gap: 20px;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.photo-item {
    cursor: pointer;
    margin-bottom: 20px;
    transition: opacity 0.2s;
}

.photo-item:hover {
    opacity: 0.8;
}

.photo-item img {
    width: 100%;
    height: auto;
    border: 1px solid #f7da6d;
    display: block;
}

.photo-caption {
    display: block;
    margin-top: 8px;
    font-size: 18px;
    line-height: 1.2;
    text-align: left;
}

/* ===== LIGHTBOX (iOS FIXED) ===== */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    
    /* Flex Settings */
    display: none; /* JS toggles this */
    flex-direction: column; /* Vital for iOS height calculation */
    justify-content: center;
    align-items: center;
    
    z-index: 2000;
    padding: 20px;
    backdrop-filter: blur(2px);
}

#lightbox img {
    /* Aggressive Reset for iOS */
    width: auto !important;
    height: auto !important;
    
    /* Maximums */
    max-width: 90vw;
    max-height: 85vh;
    
    /* Presentation */
    object-fit: contain;
    border: 1px solid #f7da6d;
    box-shadow: 0 0 20px rgba(247, 218, 109, 0.2);
    
    /* Centering Fallback */
    margin: auto;
}

/* Close Button Style (Optional if you have it) */
#lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: #f7da6d;
    cursor: pointer;
    font-family: sans-serif;
    z-index: 2001;
}

/* ===== SHARED COMPONENT: "BACK" LINKS ===== */
.back-link-wrapper {
    margin-top: 40px;
    width: 100%;
    text-align: center;
}

.back-link-wrapper a {
    border: 1px dashed #f7da6d;
    padding: 5px 15px; 
    font-size: 24px; 
    text-decoration: none;
}

/* ===== FOOTER ===== */
.footer {
    margin-top: 60px;
    font-size: 18px;
    width: 100%;
    max-width: 600px;
}

.rule {
    border-top: 1px dotted #f7da6d;
    margin: 20px 0;
}

/* ===== MOBILE RESPONSIVENESS ===== */
@media (max-width: 600px) {
    body { padding-top: 90px; }
    h1 { margin-top: 10px; }
    .shortcut { width: 45%; }
    .intro-text, p { font-size: 20px; }
    .top-nav { font-size: 16px; gap: 15px; }
    
    /* Stack gallery columns on mobile */
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}