/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f8f0;
    color: #333;
    line-height: 1.6;
}

header {
    background-color: #333;
    color: #fff;
    padding: 1rem 2rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 300;
}

header nav a {
    color: #ddd;
    text-decoration: none;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: inline-block;
}

header nav a:hover {
    color: #fff;
    text-decoration: underline;
}

main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Main Gallery List */
.gallery-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.album-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.album-card a {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.thumb-container {
    height: 200px;
    overflow: hidden;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumb-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.album-card:hover .thumb-container img {
    transform: scale(1.05);
}

.album-info {
    padding: 1rem;
    text-align: center;
}

.album-info h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: #222;
}

.album-info p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

/* Directory Index (Thumbnail Grid) */
.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.grid-item {
    display: block;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s;
    background: #fff;
    aspect-ratio: 1 / 1; 
}

.grid-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Single Image View */
.image-viewer-body {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: hidden; /* Prevent scroll on full view mostly */
}

.viewer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 1rem;
    box-sizing: border-box;
}

.main-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
    position: relative; /* For cursor positioning context if needed */
}

.main-image a {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    cursor: pointer; /* Explicitly show it's clickable */
    text-decoration: none; /* Remove any underlines */
}

.main-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    border: none; /* Ensure no border from link */
}

.viewer-controls {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.8rem;
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.btn {
    text-decoration: none;
    color: #333;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn:hover {
    background-color: #eee;
    color: #000;
}
