/* Macro Grid Setup */
.site-header {
    grid-area: header;
}
.site-sidebar {
    grid-area: sidebar;
}
.site-main {
    grid-area: main;
}
.site-footer {
    grid-area: footer;
}

/* Mobile-First (Default): 1-column stacked flow */
.site-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas:
        'header'
        'sidebar'
        'main'
        'footer';
}

/* Header */
.site-header {
    background: radial-gradient(darkorange, firebrick);
    border-bottom: 1px solid #e2e8f0;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
}

/* Sidebar */
.site-sidebar {
    background-color: #f1f5f9;
    border-right: 1px solid #e2e8f0;
    padding: var(--space-lg) var(--space-md);
}

.site-sidebar ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    list-style: none;
    align-items: center;
}

.site-sidebar a {
    display: block;
    padding: var(--space-xs) var(--space-sm);
    color: var(--color-text-main);
    text-decoration: none;
    border-radius: 4px;
}

.site-sidebar a:hover {
    background-color: #e2e8f0;
}

.logo {
    width: 5rem;
    height: auto;
}

/* Main */
.site-main {
    background-color: var(--color-canvas);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* About */

.about {
    text-align: center;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    text-align: justify;
}

.about figure {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    max-width: 400px;
}

.about figure img {
    width: 100%;
    display: block;
}

.about figure figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.875rem;
    text-align: center;
    backdrop-filter: blur(4px);
}

.about p {
    max-width: 65ch;
}

/* Stats */

.stats {
    background-color: darkorange;
    padding: 2rem;
}
.stats ul {
    padding-left: 1rem;
}

/* Effects */
.effects .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.effect {
    background: var(--color-surface);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.effect figcaption {
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.effect img {
    width: 100%;
    aspect-ratio: 16 / 9; /* Standardizes every image to a consistent 16:9 box */
    object-fit: cover; /* Crops excess edges without squishing the pixels */
    display: block;
}

.effect img.img-bottom {
    object-position: 50% 75%; /* Pins bottom edge; crops out the sky/top */
}

.effect img.img-top {
    object-position: 50% 20%; /* Pins bottom edge; crops out the sky/top */
}

/* Footer */
.site-footer {
    background-color: var(--color-surface);
    border-top: 1px solid #e2e8f0;
    padding: var(--space-lg);
    text-align: center;
}

.credits {
    padding-top: 2rem;
}

.credits ul {
    padding-left: 1rem;
    list-style: none;
}

/* Expansion Breakpoints*/
@media (min-width: 768px) {
    /* Macro Grid */
    .site-layout {
        grid-template-columns: 240px 1fr;
        grid-template-rows: auto 1fr auto;
        grid-template-areas:
            'header  header'
            'sidebar main'
            'footer  footer';
    }

    .site-sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
    }

    /* About 2-Column Split (Text on Left, Figure on Right) */
    .about-grid {
        grid-template-columns: 1fr 1fr;
        align-items: center;
        gap: var(--space-lg);
    }

    .about-grid p {
        order: 1; /* Pushes text into the 1st column */
    }

    .about-grid figure {
        order: 2; /* Pushes figure into the 2nd column */
    }

    .site-footer {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: var(--space-lg);
    }

    .credits {
        padding-top: 0; /* Remove top padding since it now sits side-by-side */
    }
}
