/*------------------------------------*\
  #LAYOUT
\*------------------------------------*/

/* Main Site Container */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--padding);
    transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Site Introduction Block */
.site-intro {
    text-align: center;
    padding: 3rem var(--padding);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Site Header (if used globally) */
.site-header {
    text-align: center;
    margin: 3rem 0 3rem 0;
}

/* Generic Grid Wrapper for Cards or Essays */
.essay-grid {
    display: grid;
    gap: 2rem;
    padding: 2rem 0;
}

/*------------------------------------*\
  #ESSAY PAGE HEADER & NAVIGATION
\*------------------------------------*/

/* Sticky Header */
.essay-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-bottom: 2rem;
    transition: background 0.3s ease;
}

/* Primary Navigation Bar (Logo/Icon) */
.essay-primary-nav {
    position: relative;
    z-index: 2; /* above breadcrumbs */
    background-color: #fff;
    padding: 0.3rem 0 0.2rem;
    transition: padding 0.3s ease;
}
.essay-primary-nav::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 1px;
    background-color: var(--color-border, #e5e5e5);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Navigation Container (flex) */
.essay-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Home Link in Nav (with icon) */
.essay-home-link {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.5rem; /* margin around icon */
}
.essay-home-link img {
    width: 60px;
    height: auto;
    transition:
        width 0.3s ease,
        transform 0.3s ease;
}
.essay-home-link:hover img {
    transform: scale(1.05) rotate(1deg);
}

/* Shrink Logo/Primary Nav on Scroll */
.essay-header.scrolled .essay-primary-nav {
    padding: 0.25rem 0;
}
.essay-header.scrolled .essay-home-link img {
    width: 40px;
}

/* Breadcrumb Navigation Bar */
.essay-breadcrumb-nav {
    position: relative;
    z-index: 1; /* behind primary nav */
    background: #fff;
    padding: 0.4rem 0;
    font-size: 0.875rem;
    color: var(--color-text-light, #666);
    transition:
        transform 0.4s ease-in-out,
        opacity 0.4s ease-in-out;
}
.essay-breadcrumb-nav::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    height: 1px;
    background: #fff;
    background-color: var(--color-border, #e5e5e5);
}

/* Hide Breadcrumb on Scroll Down */
.essay-breadcrumb-nav.hidden {
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
}

/* Breadcrumb List (horizontal, separators) */
.essay-breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}
.essay-breadcrumb-list li {
    font-weight: 500;
}
.essay-breadcrumb-list li:not(:first-child)::before {
    content: "/";
    margin: 0 0.5rem;
    color: var(--color-text-light, #999);
}
.essay-breadcrumb-list a {
    text-decoration: none;
    color: inherit;
}
.essay-breadcrumb-list a:hover {
    color: var(--color-text, #333);
}
.essay-breadcrumb-list li:last-child {
    color: var(--color-muted, #aaa);
    font-weight: 400;
}

/*------------------------------------*\
  #PROGRESS BAR
\*------------------------------------*/

#progressBar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-progress), #0056b3);
    box-shadow: 0 0 6px var(--color-progress);
    border-radius: 0 2px 2px 0;
    z-index: 9999;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
