/*
 * Utilities Styles
 * Section navigation, glossary, progress, footer, navigation, misc utilities
 */

/* ==========================================================================
   Navigation
   ========================================================================== */

nav[aria-label="breadcrumb"] {
    margin-bottom: 2rem;
}

nav[aria-label="breadcrumb"] ul {
    padding: 0;
}

/* Date navigation */
header nav {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

/* ==========================================================================
   Section Navigation (Sidebar)
   ========================================================================== */

aside.section-nav {
    background: var(--pico-background-color);
    border: var(--pico-border-width) solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    padding: 1rem;
    margin-bottom: 2rem;
}

aside.section-nav summary {
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

aside.section-nav nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

aside.section-nav nav li {
    margin-bottom: 0.5rem;
}

aside.section-nav nav a {
    color: var(--pico-color);
    text-decoration: none;
    font-size: 0.9em;
}

aside.section-nav nav a:hover {
    color: var(--pico-primary);
    text-decoration: underline;
}

aside.section-nav nav a.active {
    color: var(--pico-primary);
    font-weight: 600;
    border-left: 3px solid var(--pico-primary);
    padding-left: 0.5rem;
    margin-left: -0.5rem;
}

/* ==========================================================================
   Office Layout (Desktop Sidebar)
   ========================================================================== */

@media (min-width: 992px) {
    .office-layout {
        display: flex;
        gap: 2rem;
        align-items: flex-start;
    }

    .office-content {
        flex: 1 1 auto;
        min-width: 0;
    }

    aside.section-nav {
        flex: 0 0 280px;
        position: sticky;
        top: 1rem;
        margin-bottom: 0;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }

    aside.section-nav details {
        pointer-events: none;
    }

    aside.section-nav details > * {
        pointer-events: auto;
    }

    aside.section-nav summary {
        list-style: none;
    }

    aside.section-nav summary::-webkit-details-marker {
        display: none;
    }
}

/* ==========================================================================
   Glossary
   ========================================================================== */

.glossary {
    max-width: 50rem;
}

.glossary dt {
    font-weight: 600;
    color: var(--pico-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.glossary dt:first-child {
    margin-top: 0;
}

.glossary dd {
    margin-left: 0;
    padding-left: 1rem;
    border-left: 2px solid var(--pico-muted-border-color);
    color: var(--pico-color);
}

@media (min-width: 768px) {
    .glossary {
        columns: 2;
        column-gap: 3rem;
    }
}

/* Keep term and definition together */
.glossary dt {
    break-after: avoid;
}

.glossary dd {
    break-inside: avoid;
    break-before: avoid;
}

/* ==========================================================================
   Progress & Achievements
   ========================================================================== */

/* Achievement cards grid - prevent squishing */
section h3 + .grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Recent achievements and stats grids */
section h2 + .grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* Stack on small screens */
@media (max-width: 576px) {
    section h3 + .grid,
    section h2 + .grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Liturgical Colors Page
   ========================================================================== */

.color-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.color-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.color-swatch {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: var(--pico-border-radius);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.color-info h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
}

.color-info p {
    margin: 0 0 0.5rem 0;
}

.color-info p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer.container {
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid var(--pico-muted-border-color);
    max-width: 100%;
}

.made-in {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--pico-muted-color);
    font-size: 0.85rem;
    margin-top: 2rem;
}

.utah-outline {
    width: 1em;
    height: 1.2em;
}

.built-with {
    display: block;
    margin-top: 0.5rem;
}
