:root {
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333;
    --gap: 16px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 20px;
}

/* Nav Bar */
.top-nav {
    background-color: var(--card-bg);
    padding: 1rem;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.top-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.top-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.top-nav a:hover, .top-nav a.active {
    background-color: var(--bg-color);
    color: #000;
}

/* Content Container */
.content-container {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.content-container h1, 
.content-container h2, 
.content-container h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.content-container h1:first-child {
    margin-top: 0;
}

.content-container ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.content-container p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* Device specific display layouts (default is phone), dictated by screen resolution. */
#gallery {
    column-count: 1;
    column-gap: var(--gap);
    max-width: 1600px;
    margin: 0 auto;
}

@media (min-width: 600px) {
    #gallery {
        column-count: 2;
    }
}

@media (min-width: 900px) {
    #gallery {
        column-count: 3;
    }
}

@media (min-width: 1100px) {
    #gallery {
        column-count: 4;
    }
}

.card {
    background-color: var(--card-bg);
    border-radius: 16px;
    margin-bottom: var(--gap);
    break-inside: avoid;
    display: inline-block;
    width: 100%;
    overflow: hidden;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-4px);
}

.card img {
    width: 100%;
    height: auto;
    display: block;
}

.card-content {
    padding: 15px;
}

.card-title {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.card-description {
    font-size: 0.9rem;
    color: #666;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s linear 0s;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    object-fit: contain;
}
