:root {
    --forest-deep: #1a3c34;
    --forest-mid: #2d5a4a;
    --forest-light: #4a7c6f;
    --earth-warm: #8b7355;
    --earth-gold: #c9a227;
    --mist: #f5f7f2;
    --mist-dark: #e8ebe5;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', sans-serif;
    margin: 0;
    background: var(--mist);
    color: var(--forest-deep);
}

h1,
h2,
h3,
h4 {
    font-family: 'Lora', serif;
    font-weight: 400;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.6rem;
}

p {
    line-height: 1.7;
}

section img {
    max-width: 100%;
}

a {
    color: var(--earth-warm);
}

/* Hero section */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    /* Important: clips the zoomed image */
}

/* Animated background image */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('images/Rebio_Equitativa_e_Taquara.jpg') center/cover;
    animation: kenburns 10s ease-in-out infinite alternate;
    z-index: 1;
}

/* Gradient overlay on top of animated image */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(26, 60, 52, 0.3), rgba(26, 60, 52, 0.7));
    z-index: 2;
}

@keyframes kenburns {
    0% {
        transform: scale(1) translate(0, 0);
    }

    100% {
        transform: scale(1.15) translate(-2%, -1%);
    }
}

/* 
.hero {
    height: 100vh;
    background: linear-gradient(to bottom, rgba(26, 60, 52, 0.3), rgba(26, 60, 52, 0.7)),
        url('https://upload.wikimedia.org/wikipedia/commons/thumb/7/7b/Rebio_Equitativa_e_Taquara.jpg/1599px-Rebio_Equitativa_e_Taquara.jpg?20200731172838') center/cover fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
} */

.hero-title {
    position: relative;
    z-index: 3;
    color: var(--mist);
    padding: 2rem;
    max-width: 900px;
}

.hero-title h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    line-height: 1.1;
    margin: 0;
    text-shadow: 2px 4px 20px rgba(0, 0, 0, 0.4);
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    margin-top: 1.5rem;
    opacity: 0.9;
    font-weight: 400;
}

.scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--mist);
    opacity: 0.7;
    animation: bounce 2s infinite;
    z-index: 3;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(10px);
    }
}

/* Nav cards */
.nav-section {
    padding: 4rem 2rem;
    background: var(--mist);
}

.nav-section h2 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--forest-deep);
    margin-bottom: 2rem;
}

.nav-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
    justify-content: center;
    /* center items on last row */
}

.nav-card {
    flex: 1 1 180px;
    /* grow/shrink, min width 180px */
    max-width: 180px;
    /* optional, keeps them from stretching too wide */
    background: white;
    border: 2px solid var(--mist-dark);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--forest-deep);
    transition: all 0.3s ease;
}

.nav-card:hover {
    border-color: var(--forest-mid);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(26, 60, 52, 0.15);
}

.nav-card h4 {
    margin: 0;
    font-size: 1.1rem;
}

.nav-card .part-num {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--earth-gold);
    margin-bottom: 0.5rem;
}

/* Scrollytelling - Full Width Background Style */
.scrolly {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.scrolly__figure {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--forest-deep);
    overflow: hidden;
    z-index: 1;
}

.scrolly__figure img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.scrolly__figure img.is-active {
    opacity: 1;
}

.scrolly__figure::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(26, 60, 52, 0.7), rgba(26, 60, 52, 0.3));
    pointer-events: none;
}

.scrolly__steps {
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin-left: 5%;
    padding: 30vh 0;
}

.scrolly__step {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 40vh;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    opacity: 0.8;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.scrolly__step.is-active {
    opacity: 1;
    transform: translateY(0);
}

.scrolly__citation {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.5);
    color: rgb(222, 222, 222);
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
    border-radius: 6px;
    z-index: 10;
}

.scrolly__citation a {
    color: rgb(222, 222, 222);
    text-decoration: underline;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .scrolly__steps {
        margin: 0 auto;
        padding: 20vh 1rem;
        max-width: 90%;
    }

    .scrolly__step {
        margin-bottom: 30vh;
        padding: 1.5rem;
    }

    .scrolly__figure::after {
        background: linear-gradient(to bottom, rgba(26, 60, 52, 0.5), rgba(26, 60, 52, 0.7));
    }
}

/* Section titles */
.section-intro {
    text-align: center;
    padding: 4rem 2rem 2rem;
    background: var(--forest-deep);
    color: var(--mist);
}

.section-intro h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin: 0;
}

/* Footer */
.site-footer {
    background: var(--forest-deep);
    color: var(--mist);
    padding: 4rem 2rem;
}

.site-footer h4 {
    color: var(--earth-gold);
    font-size: 1.3rem;
}

.site-footer ul {
    list-style: none;
    padding: 0;
}

.site-footer li {
    margin-bottom: 0.5rem;
}

.site-footer a {
    color: var(--mist);
    opacity: 0.8;
    text-decoration: none;
    transition: opacity 0.2s;
}

.site-footer a:hover {
    opacity: 1;
}

.site-footer .byline {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0.7;
}

/** Components **/

/* Audio */
figure audio {
    border-radius: 8px;
    margin-bottom: -16px;
}

/* Pullquote */
.pullquote {
    max-width: 700px;
    margin: 3rem auto;
    padding: 1rem 2rem 2rem;
    border-left: 4px solid var(--earth-gold);
    background: white;
}

.pullquote .quote-text {
    font-family: 'Instrument Serif', serif;
    font-size: 1.5rem;
    font-style: italic;
    color: var(--forest-deep);
    margin: 0;
}

.pullquote .quote-attribution {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--forest-mid);
}

/* Image */
.image-regular {
    margin: 2rem auto;
    width: 100%;
    text-align: center;
}

.image-full {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    text-align: center;
}

.image-full {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    text-align: center;
}

.image-full img {
    width: 100%;
    max-height: 80vh;
    object-fit: cover;
}

.image-full.fullheight img {
    height: 100%;
    max-height: none;
}

.image-full figcaption,
.image-regular figcaption {
    font-size: 0.80rem;
    color: var(--forest-mid);
}

.image-full figcaption {
    padding: 0rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Image pair */
.image-pair {
    max-width: 900px;
    margin: 2rem auto;
}

.image-pair__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.image-pair__grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.image-pair figcaption {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.80rem;
    color: var(--forest-mid);
}

/* Call-to-action box */
.cta-box {
    max-width: 700px;
    margin: 3rem auto;
    padding: 2rem;
    background: var(--forest-deep);
    color: var(--mist);
    border-radius: 12px;
    text-align: center;
}

.cta-box .cta-title {
    color: var(--earth-gold);
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
}

.cta-box .cta-content a {
    color: var(--mist);
    text-decoration: underline;
}

.cta-box .cta-content ul {
    list-style: none;
    padding: 0;
}

.cta-box .cta-content li {
    margin: 0.5rem 0;
}

.iframe-full {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.iframe-full figcaption {
    padding: 0rem 2rem;
    font-size: 0.80rem;
    color: var(--forest-mid);
    text-align: center;
}

.iframe-normal {
    max-width: 900px;
    margin: 2rem auto;
}

@media (max-width: 600px) {
    .image-pair__grid {
        grid-template-columns: 1fr;
    }
}

/* Stat block */
.stat-block {
    text-align: center;
    padding: 3rem 2rem;
    max-width: 700px;
    margin: 2rem auto;
}

.stat-number {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(3rem, 10vw, 6rem);
    color: var(--earth-gold);
    line-height: 1;
}

.stat-label {
    font-size: 1.25rem;
    color: var(--forest-deep);
    margin-top: 0.5rem;
}

.stat-caption {
    font-size: 0.9rem;
    color: var(--forest-mid);
    margin-top: 1rem;
}

/* nav */

.article-nav {
    display: flex;
    justify-content: space-between;
    margin: 3rem auto;
    gap: 1rem;
}

.nav-btn {
    background: var(--forest-deep);
    color: var(--mist);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s, transform 0.2s;
}

.nav-btn:hover {
    background: var(--forest-mid);
    transform: translateY(-2px);
}

.nav-btn--prev {
    margin-right: auto;
}

.nav-btn--next {
    margin-left: auto;
}


/* video */
.video-regular {
    max-width: 800px;
    margin: 2rem auto;
    border-radius: 8px;
}

.video-regular figcaption {
    text-align: center;
    padding: 0rem 2rem;
    font-size: 0.80rem;
    color: var(--forest-mid);
}

.video-full {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-top: 2rem;
    margin-bottom: 2rem;
    border-radius: 0px;
}

.video-full figcaption {
    padding: 0rem 2rem;
    font-size: 0.80rem;
    color: var(--forest-mid);
    text-align: center;
}


/* Full-width map */
.map-full {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.map-container {
    height: 70vh;
    width: 100%;
}

.map-full figcaption {
    text-align: center;
    padding: 0rem 2rem;
    font-size: 0.80rem;
    color: var(--forest-mid);
    background: var(--mist);
}

/** Start: Sound Widget **/

.sound-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.sound-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--forest-deep);
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.sound-toggle:hover {
    transform: scale(1.1);
}

.sound-player {
    display: none;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.sound-player.is-open {
    display: block;
}

/** End: Sound Widget **/


/** Start: References **/

.references {
    font-size: 0.9rem;
    line-height: 1.6;
}

.references p {
    padding-left: 2rem;
    text-indent: -2rem;
    /* Hanging indent */
    margin-bottom: 1rem;
}

.references a {
    color: var(--forest-mid);
    word-break: break-word;
}

/** End: References **/


/* diagonal section */

.diagonal-section {
    position: relative;
    overflow: hidden;
    padding: 4rem 2rem;
    background: var(--mist);
}

.diagonal-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
    justify-content: center;
}

/* Left content */
.diagonal-content {
    flex: 1 1 300px;
    max-width: 500px;
}

.diagonal-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--forest-deep);
}

.diagonal-content p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--forest-mid);
}

.diagonal-btn {
    display: inline-block;
    background: var(--forest-deep);
    color: var(--mist);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s, transform 0.2s;
}

.diagonal-btn:hover {
    background: var(--forest-mid);
    transform: translateY(-2px);
}

/* Right image */
.diagonal-image {
    flex: 1 1 300px;
    max-width: 500px;
    position: relative;
    overflow: hidden;
}

/* Optional order classes for swapping sides */
.order-left {
    order: -1;
}

.order-right {
    order: 1;
}

/* Diagonal effect using clip-path */
.diagonal-image img {
    width: 100%;
    height: auto;
    display: block;
    clip-path: polygon(10% 0%, 100% 0%, 100% 100%, 0% 100%);
    object-fit: cover;
    border-radius: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .diagonal-container {
        flex-direction: column-reverse;
        /* image on top for mobile */
        text-align: center;
    }

    .diagonal-content,
    .diagonal-image {
        max-width: 100%;
    }

    .diagonal-image img {
        clip-path: none;
        border-radius: 12px;
    }
}

/* Diagonal effect using clip-path */
.diagonal-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 12px;
}

/* Right side image (default slant) */
.diagonal-right img {
    clip-path: polygon(10% 0%, 100% 0%, 100% 100%, 0% 100%);
}

/* Left side image (opposite slant) */
.diagonal-left img {
    clip-path: polygon(0% 0%, 90% 0%, 100% 100%, 0% 100%);
}

/* About Author */
.about-author {
    max-width: 650px;
    margin: 3rem auto;
    text-align: center;
    background: var(--mist);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(26, 60, 52, 0.08);
}

.about-author img {
    width: 150px;
    height: 150px;
    border-radius: 100%;
    object-fit: cover;
    margin-bottom: 0.5rem;
}

.about-author h4 {
    margin: 0.5rem 0 0.5rem 0;
    color: var(--forest-deep);
    font-size: 1.2rem;
}

.about-author p {
    color: var(--forest-mid);
    font-size: 1rem;
    margin: 0.5rem 0 0 0.5rem;
}