/* ==========================================================================
   Wealth250 Essay Styles
   Layout, typography, and component styles for the single essay
   reading experience and the archive grid.
   ========================================================================== */


/* ==========================================================================
   Global Essay Reset
   ========================================================================== */

.essay {
    font-family: var(--w250-font-body);
    color: var(--w250-text);
    background: var(--w250-bg);
    overflow-x: hidden; /* Prevent horizontal scroll from full-bleed elements */
}

.essay img {
    max-width: 100%;
    height: auto;
}

.essay a {
    color: var(--w250-accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color var(--w250-transition);
}

.essay a:hover {
    color: var(--w250-accent-dark);
}


/* ==========================================================================
   Reading Progress Bar
   ========================================================================== */

.essay-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--w250-progress-height);
    z-index: var(--w250-z-progress);
    background: transparent;
    pointer-events: none;
}

.essay-progress__fill {
    height: 100%;
    width: 0%;
    background: var(--w250-progress-color);
    transition: width 0.1s linear;
    will-change: width;
}


/* ==========================================================================
   Hero Section
   ========================================================================== */

.essay-hero {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    min-height: 80vh;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    background: var(--w250-primary-dark);
}

.essay-hero__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.essay-hero__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.essay-hero__video iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Gradient overlay for text readability */
.essay-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 30%,
        rgba(0, 0, 0, 0.65) 100%
    );
    z-index: 1;
}

.essay-hero__overlay {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--w250-wide-width);
    padding: 4rem 2rem;
    text-align: center;
    color: var(--w250-white);
}

.essay-hero__title {
    font-family: var(--w250-font-heading);
    font-size: var(--w250-text-4xl);
    font-weight: 700;
    line-height: var(--w250-leading-tight);
    margin: 0 0 1.5rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.essay-hero__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.5rem;
    font-family: var(--w250-font-heading);
    font-size: var(--w250-text-sm);
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    opacity: 0.9;
}

.essay-hero__meta > *::before {
    content: '';
}

.essay-hero__meta > *:not(:first-child)::before {
    content: '\00B7\00A0';
    opacity: 0.6;
}


/* ==========================================================================
   Essay Body (content column)
   ========================================================================== */

.essay-body {
    max-width: var(--w250-content-width);
    margin: 0 auto;
    padding: var(--w250-section-gap) 1.5rem;
}


/* ==========================================================================
   Section: Text Block
   ========================================================================== */

.essay-section--text {
    margin-bottom: var(--w250-section-gap);
}

.essay-section--text .essay-section__inner {
    font-size: var(--w250-text-lg);
    line-height: var(--w250-leading);
}

.essay-section--text .essay-section__inner p {
    margin: 0 0 1.5em;
}

.essay-section--text .essay-section__inner h2,
.essay-section--text .essay-section__inner h3,
.essay-section--text .essay-section__inner h4 {
    font-family: var(--w250-font-heading);
    font-weight: 600;
    line-height: var(--w250-leading-tight);
    margin: 2em 0 0.75em;
    color: var(--w250-primary);
}

.essay-section--text .essay-section__inner h2 {
    font-size: var(--w250-text-2xl);
}

.essay-section--text .essay-section__inner h3 {
    font-size: var(--w250-text-xl);
}

.essay-section--text .essay-section__inner ul,
.essay-section--text .essay-section__inner ol {
    margin: 0 0 1.5em;
    padding-left: 1.5em;
}

.essay-section--text .essay-section__inner li {
    margin-bottom: 0.5em;
}

.essay-section--text .essay-section__inner blockquote {
    border-left: 3px solid var(--w250-accent);
    padding-left: 1.5rem;
    margin: 1.5em 0;
    font-style: italic;
    color: var(--w250-text-light);
}


/* ==========================================================================
   Section: Full-Bleed Image
   ========================================================================== */

.essay-section--full-bleed-image {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-bottom: var(--w250-section-gap);
    position: relative;
}

.essay-section--full-bleed-image img {
    width: 100%;
    height: auto;
    display: block;
}

.essay-section--full-bleed-image .essay-section__caption {
    max-width: var(--w250-content-width);
    margin: 0.75rem auto 0;
    padding: 0 1.5rem;
    font-family: var(--w250-font-heading);
    font-size: var(--w250-text-sm);
    color: var(--w250-text-muted);
    line-height: var(--w250-leading-snug);
}


/* ==========================================================================
   Section: Pull Quote
   ========================================================================== */

.essay-section--pull-quote {
    margin: var(--w250-section-gap) 0;
    padding: 2rem 0 2rem 2rem;
    border-left: 4px solid var(--w250-accent);
}

.essay-section--pull-quote blockquote {
    margin: 0;
    padding: 0;
}

.essay-section--pull-quote blockquote p {
    font-family: var(--w250-font-body);
    font-size: var(--w250-text-xl);
    font-style: italic;
    font-weight: 600;
    line-height: var(--w250-leading-snug);
    color: var(--w250-primary);
    margin: 0;
}

.essay-section--pull-quote blockquote p::before {
    content: '\201C';
}

.essay-section--pull-quote blockquote p::after {
    content: '\201D';
}

.essay-section--pull-quote cite {
    display: block;
    margin-top: 1rem;
    font-family: var(--w250-font-heading);
    font-size: var(--w250-text-sm);
    font-style: normal;
    font-weight: 500;
    color: var(--w250-text-muted);
}


/* ==========================================================================
   Section: Callout Box
   ========================================================================== */

.essay-section--callout {
    margin: var(--w250-section-gap) 0;
    padding: 2rem;
    border-radius: 8px;
}

.essay-section--callout.callout--info {
    background: var(--w250-accent-light);
    border-left: 4px solid var(--w250-accent);
}

.essay-section--callout.callout--highlight {
    background: var(--w250-gold-light);
    border-left: 4px solid var(--w250-gold);
}

.essay-section--callout.callout--warning {
    background: #fef2f2;
    border-left: 4px solid var(--w250-primary);
}

.callout__title {
    font-family: var(--w250-font-heading);
    font-size: var(--w250-text-xl);
    font-weight: 600;
    margin: 0 0 0.75rem;
    color: var(--w250-text);
}

.callout__body {
    font-size: var(--w250-text-base);
    line-height: var(--w250-leading);
}

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


/* ==========================================================================
   Section: Video Embed
   ========================================================================== */

.essay-section--video {
    margin: var(--w250-section-gap) 0;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 4px;
    background: var(--w250-bg-alt);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.essay-section--video .essay-section__caption {
    margin-top: 0.75rem;
    font-family: var(--w250-font-heading);
    font-size: var(--w250-text-sm);
    color: var(--w250-text-muted);
}


/* ==========================================================================
   Section: Data Visualization
   ========================================================================== */

.essay-section--dataviz {
    max-width: var(--w250-wide-width);
    margin: var(--w250-section-gap) auto;
    /* Break out of the content column for wider display */
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    max-width: var(--w250-wide-width);
    padding: 0 1.5rem;
    box-sizing: border-box;
}

.dataviz-container {
    width: 100%;
    overflow: hidden;
}

.dataviz-container iframe {
    width: 100%;
    border: none;
}

.essay-section--dataviz .essay-section__caption {
    margin-top: 0.75rem;
    font-family: var(--w250-font-heading);
    font-size: var(--w250-text-sm);
    color: var(--w250-text-muted);
}


/* ==========================================================================
   Section: Image Gallery
   ========================================================================== */

/* Grid layout */
.essay-section--gallery {
    margin: var(--w250-section-gap) 0;
}

.essay-section--gallery.gallery--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.gallery__item {
    margin: 0;
    overflow: hidden;
    border-radius: 4px;
}

.gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--w250-transition);
}

.gallery__item:hover img {
    transform: scale(1.03);
}

.gallery__item figcaption {
    padding: 0.5rem 0;
    font-family: var(--w250-font-heading);
    font-size: var(--w250-text-sm);
    color: var(--w250-text-muted);
}

/* Slider layout */
.essay-section--gallery.gallery--slider {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
}

.gallery--slider .gallery__item {
    flex: 0 0 80%;
    scroll-snap-align: center;
}

.gallery--slider .gallery__item img {
    height: 400px;
    object-fit: cover;
}

/* Scrollbar styling for slider */
.gallery--slider::-webkit-scrollbar {
    height: 4px;
}

.gallery--slider::-webkit-scrollbar-track {
    background: var(--w250-bg-alt);
    border-radius: 2px;
}

.gallery--slider::-webkit-scrollbar-thumb {
    background: var(--w250-accent);
    border-radius: 2px;
}


/* ==========================================================================
   Section: Chapter Heading
   ========================================================================== */

.essay-section--chapter {
    margin: calc(var(--w250-section-gap) * 1.5) 0 var(--w250-section-gap);
    text-align: center;
}

.chapter__title {
    font-family: var(--w250-font-heading);
    font-size: var(--w250-text-3xl);
    font-weight: 700;
    line-height: var(--w250-leading-tight);
    color: var(--w250-primary);
    margin: 0 0 0.5rem;
}

.chapter__subtitle {
    font-family: var(--w250-font-heading);
    font-size: var(--w250-text-lg);
    font-weight: 400;
    color: var(--w250-text-light);
    margin: 0 0 1.5rem;
}

.chapter__divider {
    width: 60px;
    height: 3px;
    background: var(--w250-gold);
    margin: 0 auto;
    border-radius: 2px;
}


/* ==========================================================================
   Section: Two-Column Layout
   ========================================================================== */

.essay-section--two-column {
    max-width: var(--w250-wide-width);
    margin: var(--w250-section-gap) auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
    /* Break out of content column */
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    max-width: var(--w250-wide-width);
    padding: 0 1.5rem;
    box-sizing: border-box;
}

.two-column__left,
.two-column__right {
    font-size: var(--w250-text-base);
    line-height: var(--w250-leading);
}

.two-column__right img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}


/* ==========================================================================
   Section: Drop Cap (text block enhancement)
   ========================================================================== */

.essay-section--text.has-drop-cap .essay-section__inner > p:first-of-type::first-letter {
    float: left;
    font-family: var(--w250-font-heading);
    font-size: 4.5em;
    font-weight: 700;
    line-height: 0.8;
    padding-right: 0.1em;
    padding-top: 0.05em;
    color: var(--w250-primary);
}


/* ==========================================================================
   Section: Parallax Image (full-bleed enhancement)
   ========================================================================== */

.essay-section--full-bleed-image.has-parallax {
    overflow: hidden;
    max-height: 80vh;
}

.essay-section--full-bleed-image.has-parallax img {
    will-change: transform;
    /* Extra height so parallax shift doesn't reveal edges */
    min-height: 110%;
    object-fit: cover;
}


/* ==========================================================================
   Section: Text Over Media (Scrollmation)
   ========================================================================== */

.essay-section--textovermedia {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-bottom: var(--w250-section-gap);
}

.textovermedia__media {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    z-index: 1;
}

.textovermedia__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.textovermedia__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, var(--w250-tom-opacity, 0.5));
    z-index: 2;
}

.textovermedia__content {
    position: relative;
    z-index: 3;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 4rem 2rem;
}

.textovermedia__content--center {
    justify-content: center;
}

.textovermedia__content--left {
    justify-content: flex-start;
}

.textovermedia__content--right {
    justify-content: flex-end;
}

.textovermedia__text {
    max-width: var(--w250-content-width);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 3rem;
    border-radius: 8px;
    color: var(--w250-white);
    font-size: var(--w250-text-lg);
    line-height: var(--w250-leading);
}

.textovermedia__text p {
    margin: 0 0 1.5em;
}

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

.textovermedia__text h2,
.textovermedia__text h3 {
    font-family: var(--w250-font-heading);
    font-weight: 600;
    color: var(--w250-white);
    margin: 0 0 0.75rem;
}


/* ==========================================================================
   Section: Background Reveal
   ========================================================================== */

.essay-section--reveal {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-bottom: var(--w250-section-gap);
    overflow: hidden;
}

.reveal__image {
    width: 100%;
    display: block;
}

.reveal__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.essay-section--reveal .essay-section__caption {
    max-width: var(--w250-content-width);
    margin: 0.75rem auto 0;
    padding: 0 1.5rem;
    font-family: var(--w250-font-heading);
    font-size: var(--w250-text-sm);
    color: var(--w250-text-muted);
    line-height: var(--w250-leading-snug);
}


/* ==========================================================================
   Section: Statistics Row
   ========================================================================== */

.essay-section--stats {
    max-width: var(--w250-wide-width);
    margin: var(--w250-section-gap) auto;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    max-width: var(--w250-wide-width);
    padding: 3rem 1.5rem;
    box-sizing: border-box;
    display: flex;
    justify-content: space-evenly;
    align-items: flex-start;
    gap: 2rem;
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-item__number {
    font-family: var(--w250-font-heading);
    font-size: var(--w250-text-3xl);
    font-weight: 700;
    color: var(--w250-accent);
    line-height: var(--w250-leading-tight);
    margin-bottom: 0.5rem;
}

.stat-item__label {
    font-family: var(--w250-font-heading);
    font-size: var(--w250-text-sm);
    color: var(--w250-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}


/* ==========================================================================
   Section: Section Divider
   ========================================================================== */

.essay-section--divider {
    margin: var(--w250-section-gap) 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.divider--line {
    width: 60px;
    height: 2px;
    background: var(--w250-border);
}

.divider--dots {
    display: flex;
    gap: 0.75rem;
}

.divider--dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--w250-text-muted);
}

.divider--space {
    height: calc(var(--w250-section-gap) * 2);
}

.divider--ornament {
    font-size: 1.5rem;
    color: var(--w250-gold);
    line-height: 1;
}


/* ==========================================================================
   Chapter Number (chapter heading enhancement)
   ========================================================================== */

.chapter__number {
    display: block;
    font-family: var(--w250-font-heading);
    font-size: var(--w250-text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--w250-accent);
    margin-bottom: 0.5rem;
}


/* ==========================================================================
   Lightbox Overlay
   ========================================================================== */

.w250-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: var(--w250-z-lightbox);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: w250-lightbox-in 0.25s ease;
}

@keyframes w250-lightbox-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.w250-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    cursor: default;
    border-radius: 2px;
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.5);
}

.w250-lightbox__close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--w250-white);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--w250-transition);
}

.w250-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.gallery__lightbox-link {
    display: block;
    cursor: zoom-in;
}


/* ==========================================================================
   Social Share Buttons
   ========================================================================== */

/* Desktop: sticky sidebar */
.essay-share {
    position: fixed;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    z-index: var(--w250-z-share);
}

.essay-share__label {
    font-family: var(--w250-font-heading);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--w250-text-muted);
    writing-mode: vertical-rl;
    margin-bottom: 0.5rem;
}

.essay-share__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--w250-bg-alt);
    color: var(--w250-text-light);
    text-decoration: none;
    transition: background var(--w250-transition), color var(--w250-transition);
}

.essay-share__link:hover {
    background: var(--w250-accent);
    color: var(--w250-white);
}

.essay-share__link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}


/* ==========================================================================
   Author Cards (essay footer)
   ========================================================================== */

.essay-authors {
    max-width: var(--w250-content-width);
    margin: var(--w250-section-gap) auto 0;
    padding: var(--w250-section-gap) 1.5rem 2rem;
    border-top: 1px solid var(--w250-border);
}

.essay-author-card {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.essay-author-card:last-child {
    margin-bottom: 0;
}

.essay-author-card__photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.essay-author-card__info h3 {
    font-family: var(--w250-font-heading);
    font-size: var(--w250-text-lg);
    font-weight: 600;
    margin: 0 0 0.25rem;
    color: var(--w250-text);
}

.essay-author-card__title {
    font-family: var(--w250-font-heading);
    font-size: var(--w250-text-sm);
    color: var(--w250-text-muted);
    margin: 0 0 0.5rem;
}

.essay-author-card__bio {
    font-size: var(--w250-text-base);
    line-height: var(--w250-leading);
    color: var(--w250-text-light);
    margin: 0;
}


/* ==========================================================================
   Chapter Navigation (floating sidebar, built by JS)
   ========================================================================== */

.essay-chapter-nav {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: var(--w250-z-chapter-nav);
    max-width: 200px;
}

.essay-chapter-nav ol {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid var(--w250-border);
}

.essay-chapter-nav li {
    margin: 0;
}

.essay-chapter-nav__link {
    display: block;
    padding: 0.375rem 0 0.375rem 1rem;
    font-family: var(--w250-font-heading);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--w250-text-muted);
    text-decoration: none;
    transition: color var(--w250-transition), border-color var(--w250-transition);
    border-left: 2px solid transparent;
    margin-left: -2px;
}

.essay-chapter-nav__link:hover {
    color: var(--w250-accent);
}

.essay-chapter-nav__link.is-active {
    color: var(--w250-accent);
    border-left-color: var(--w250-accent);
    font-weight: 600;
}


/* ==========================================================================
   Essay Archive Grid
   ========================================================================== */

.essay-archive {
    max-width: var(--w250-max-width);
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.essay-archive__header {
    text-align: center;
    margin-bottom: 3rem;
}

.essay-archive__title {
    font-family: var(--w250-font-heading);
    font-size: var(--w250-text-3xl);
    font-weight: 700;
    color: var(--w250-primary);
    margin: 0 0 0.5rem;
}

.essay-archive__subtitle {
    font-family: var(--w250-font-heading);
    font-size: var(--w250-text-lg);
    color: var(--w250-text-light);
    margin: 0;
}

.essay-archive__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

.essay-card {
    background: var(--w250-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: box-shadow var(--w250-transition), transform var(--w250-transition);
}

.essay-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.essay-card__image-link {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.essay-card__image-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--w250-transition);
}

.essay-card:hover .essay-card__image-link img {
    transform: scale(1.03);
}

.essay-card__content {
    padding: 1.5rem;
}

.essay-card__title {
    font-family: var(--w250-font-heading);
    font-size: var(--w250-text-xl);
    font-weight: 600;
    line-height: var(--w250-leading-tight);
    margin: 0 0 0.75rem;
}

.essay-card__title a {
    color: var(--w250-text);
    text-decoration: none;
}

.essay-card__title a:hover {
    color: var(--w250-accent);
}

.essay-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin-bottom: 0.75rem;
    font-family: var(--w250-font-heading);
    font-size: var(--w250-text-sm);
    color: var(--w250-text-muted);
}

.essay-card__excerpt {
    font-size: var(--w250-text-base);
    line-height: var(--w250-leading-snug);
    color: var(--w250-text-light);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* ==========================================================================
   Pagination
   ========================================================================== */

.nav-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    font-family: var(--w250-font-heading);
}

.nav-links a,
.nav-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: 4px;
    font-size: var(--w250-text-sm);
    text-decoration: none;
    transition: background var(--w250-transition), color var(--w250-transition);
}

.nav-links a {
    color: var(--w250-accent);
    background: var(--w250-white);
    border: 1px solid var(--w250-border);
}

.nav-links a:hover {
    background: var(--w250-accent);
    color: var(--w250-white);
    border-color: var(--w250-accent);
}

.nav-links .current {
    background: var(--w250-accent);
    color: var(--w250-white);
    border: 1px solid var(--w250-accent);
}


/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Tablet */
@media (max-width: 1200px) {
    /* Hide chapter nav and share sidebar on narrower screens */
    .essay-chapter-nav {
        display: none;
    }

    .essay-share {
        position: fixed;
        left: auto;
        right: 0;
        bottom: 0;
        top: auto;
        transform: none;
        flex-direction: row;
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
        background: var(--w250-white);
        border-top: 1px solid var(--w250-border);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    }

    .essay-share__label {
        writing-mode: horizontal-tb;
        margin-bottom: 0;
        margin-right: 0.75rem;
    }
}

@media (max-width: 1024px) {
    :root {
        --w250-text-4xl: 2.5rem;
        --w250-text-3xl: 2rem;
        --w250-section-gap: 3rem;
    }
}

@media (max-width: 768px) {
    :root {
        --w250-text-lg: 1.125rem;
        --w250-text-4xl: 2rem;
        --w250-text-3xl: 1.75rem;
        --w250-text-2xl: 1.5rem;
        --w250-section-gap: 2.5rem;
    }

    .essay-hero {
        min-height: 60vh;
    }

    .essay-hero__overlay {
        padding: 2rem 1.5rem;
    }

    .essay-section--two-column {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .essay-archive__grid {
        grid-template-columns: 1fr;
    }

    .gallery--slider .gallery__item {
        flex: 0 0 90%;
    }

    .gallery--slider .gallery__item img {
        height: 260px;
    }

    .essay-author-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Statistics row: 2×2 grid on mobile */
    .essay-section--stats {
        flex-wrap: wrap;
        padding: 2rem 1rem;
    }

    .stat-item {
        flex: 1 1 45%;
        margin-bottom: 1.5rem;
    }

    /* Text over media: smaller text block on mobile */
    .textovermedia__text {
        padding: 2rem 1.5rem;
    }

    .textovermedia__content {
        padding: 2rem 1rem;
    }

    /* Drop cap: smaller on mobile */
    .essay-section--text.has-drop-cap .essay-section__inner > p:first-of-type::first-letter {
        font-size: 3.5em;
    }
}

@media (max-width: 480px) {
    :root {
        --w250-text-base: 1rem;
        --w250-text-lg: 1.0625rem;
        --w250-text-4xl: 1.75rem;
    }

    .essay-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .essay-section--pull-quote {
        padding-left: 1.25rem;
    }

    .essay-section--callout {
        padding: 1.25rem;
    }
}
