/*
 * PUBLIC WEBSITE STYLES
 *
 * This CSS file styles the public-facing website.
 * CSS (Cascading Style Sheets) controls how things LOOK:
 * - Colors
 * - Fonts
 * - Spacing
 * - Layout
 *
 * Think of it like this:
 * - HTML is the skeleton (structure)
 * - CSS is the skin and clothes (appearance)
 */

/* ============================================================
   RESET & BASE STYLES
   These set up defaults for the whole page
   ============================================================ */

/* Remove default margins and paddings, set up box-sizing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base body styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* The main container limits width for readability */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* ============================================================
   HEADER & NAVIGATION
   ============================================================ */

.site-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.site-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    transition: background 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.4);
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */

.content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

/* ============================================================
   HOME PAGE STYLES
   ============================================================ */

.welcome {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.welcome h2 {
    color: #667eea;
    margin-bottom: 15px;
}

.recent-posts h2 {
    color: #333;
    margin-bottom: 20px;
}

.post-list {
    list-style: none;
}

.post-item {
    margin-bottom: 10px;
}

.post-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-link:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.post-title {
    font-weight: 600;
    color: #667eea;
}

.post-date {
    font-size: 0.875rem;
    color: #888;
}

.view-all-link {
    display: inline-block;
    margin-top: 20px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.view-all-link:hover {
    text-decoration: underline;
}

.no-posts {
    color: #888;
    font-style: italic;
}

/* ============================================================
   PAGE & POST STYLES
   ============================================================ */

.page-title,
.post-title {
    color: #333;
    font-size: 2rem;
    margin-bottom: 10px;
}

.page-meta,
.post-meta {
    color: #888;
    font-size: 0.875rem;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.page-body,
.post-body {
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.back-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

/* ============================================================
   BLOG LIST STYLES
   ============================================================ */

.blog-list {
    list-style: none;
}

.blog-item {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.blog-item:last-child {
    border-bottom: none;
}

.blog-item-title {
    margin-bottom: 5px;
}

.blog-item-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-item-title a:hover {
    color: #667eea;
}

.blog-item-date {
    color: #888;
    font-size: 0.875rem;
    margin-bottom: 10px;
}

.blog-item-preview {
    color: #666;
}

.read-more {
    display: inline-block;
    margin-top: 10px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.read-more:hover {
    text-decoration: underline;
}

/* ============================================================
   GALLERY STYLES
   ============================================================ */

.gallery-description {
    color: #666;
    margin-bottom: 10px;
}

.gallery-meta {
    color: #888;
    font-size: 0.875rem;
    margin-bottom: 30px;
}

/* Gallery list grid - shows gallery cards */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.gallery-card {
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.gallery-cover {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #e0e0e0;
}

.gallery-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-cover {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.gallery-info {
    padding: 15px;
}

.gallery-title {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #333;
}

.gallery-count {
    font-size: 0.875rem;
    color: #888;
    margin: 0;
}

/* Image grid for gallery detail page */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.image-item {
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.image-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.image-item:hover img {
    transform: scale(1.05);
}

.image-caption {
    padding: 10px;
    font-size: 0.875rem;
    color: #666;
    text-align: center;
    background: white;
    margin: 0;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 0.875rem;
}

/* ============================================================
   RESPONSIVE DESIGN
   Makes the site look good on phones and tablets
   ============================================================ */

@media (max-width: 600px) {
    .site-title {
        font-size: 1.8rem;
    }

    .main-nav {
        flex-direction: column;
    }

    .nav-link {
        text-align: center;
    }

    .post-link {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .content {
        padding: 20px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
}
