main {
    background-color: var(--offWhite);
}

nav {
    margin-top: 0;
}

.header {
    font-family: 'Playfair Display';
    color: var(--accent);
}

#descentIntro .header,
#descentWhatChanged .header,
#descentDocumentation .header,
#descentHowWeHelp .header {
    font-family: 'Playfair Display';
    color: var(--accent);
}

p {
    color: var(--textLighter);
}

#aboutStroke svg {
    fill: var(--complementDarker);
}

/* Main intro title at top; squiggly line scaled like about/services (percentage width, img 100%) */
#descentIntro h3 {
    position: relative;
    padding-bottom: 0.5em;
}

#descentIntro #aboutStroke {
    position: absolute;
    line-height: 0;
}

#descentIntro #aboutStroke img,
#descentIntro #aboutStroke svg {
    width: 100%;
    height: auto;
    display: block;
}

.descentSubtitle {
    font-family: 'Playfair Display';
    color: var(--accent);
    margin-top: 0.5em;
    margin-bottom: 1em;
    /* Same size as other section h3s (What changed, Documentation, How We Help) */
}

#descentIntro,
#descentWhatChanged,
#descentDocumentation,
#descentHowWeHelp {
    width: 100%;
}

/* Vertical spacing between sections */
#descentIntro {
    margin-bottom: 4vw;
}

/* Section pictures: same margin/padding for alignment (left or right) */
:root {
    --descentPictureGap: 5%;
}

.descentSectionPicture {
    background-repeat: no-repeat;
    background-position: center;
}

#descentIntroPicture {
    background-image: url(../images/citizenship-by-descent/second-generation-born-abroad.png);
    background-size: 120% auto;
}

#descentWhatChangedPicture {
    position: relative;
    background-image: url(../images/citizenship-by-descent/who-may-qualify.png);
    background-size: 120% auto;
}

#descentHowWeHelpPicture {
    position: relative;
    background-image: url(../images/citizenship-by-descent/how-aeloria-can-help.png);
    /* Fill container like first picture: cover so image always fills set width/height */
    background-size: cover;
    background-position: center;
}

.descentHelpSubheading {
    font-family: 'Playfair Display', serif;
    font-size: 1.05em;
    font-weight: 600;
    color: var(--accent);
    margin-top: 1.25em;
    margin-bottom: 0.5em;
    line-height: 1.3;
}

.descentWhatChangedLabelLine,
.descentDocumentationLabelLine {
    margin-top: 0.75em;
    margin-bottom: 0.25em;
}

#descentDocumentation {
    margin-top: 4vw;
    margin-bottom: 1vw;
}

#descentDocumentationInner {
    max-width: 100%;
}

#descentIntro ul,
#descentWhatChanged ul,
#descentDocumentation ul,
#descentHowWeHelp ul {
    color: var(--textLighter);
    margin: 1em 0;
    padding-left: 1.5em;
}

#descentIntro li,
#descentWhatChanged li,
#descentDocumentation li,
#descentHowWeHelp li {
    margin-bottom: 0.5em;
    line-height: 1.6;
}

/* CTA button: same style as services page Contact us (pink/salmon, rounded) */
.descentCtaButton {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-top: 1em;
    padding: 12px 32px;
    font-weight: 500;
    text-decoration: none;
    color: var(--offWhite);
    background-color: var(--complementDarker);
    border: solid var(--complementDarker) 2px;
    border-radius: 15px;
    transition: background-color 200ms ease-out, color 200ms ease-out;
}

.descentCtaButton:hover,
.descentCtaButton:active {
    background-color: var(--offWhite);
    color: var(--complementDarker);
}

/* Phone */
@media screen and (max-width: 766.99px) {

    main {
        padding: 15vw 10vw;
        top: 16vw;
    }

    /* Main title: same size as about/services (not larger) */
    #descentIntro h3 {
        width: fit-content;
        text-align: center;
        margin: 0 auto 12vw;
        font-size: 12vw;
        margin-bottom: 12vw;
    }

    /* Stroke: 1.5x width (600px), slightly lower so not touching title (hidden on phone) */
    #descentIntro #aboutStroke {
        bottom: -28px;
        left: 50%;
        transform: translateX(-50%);
        width: 600px;
        max-width: 90vw;
    }

    /* Subtitle: same size as other section h3s (Who May Qualify, How We Help) */
    .descentSubtitle {
        font-size: 7vw;
        text-align: center;
        margin-bottom: 6vw;
    }

    #descentIntroContainer p,
    #descentWhatChanged p,
    #descentDocumentation p,
    #descentHowWeHelp p {
        font-size: 3.5vw;
        line-height: 1.75;
        margin-bottom: 4vw;
    }

    #descentDocumentation {
        margin-top: 14vw;
    }

    .descentHelpSubheading {
        font-size: 5vw;
        margin-top: 6vw;
    }

    #descentIntroContainer {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .descentIntroTopRow {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    #descentIntroPicture {
        width: 100%;
        height: 100vw;
        margin-bottom: 10vw;
        margin-left: 0;
        margin-right: 0;
    }

    .descentIntroTextAfter {
        width: 100%;
    }

    #descentWhatChangedContainer,
    #descentHowWeHelpContainer {
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        width: 100%;
    }

    .descentHowWeHelpTopRow {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    #descentWhatChangedPicture {
        width: 100%;
        height: 55vw;
        margin-top: 8vw;
        margin-left: 0;
        margin-right: 0;
        order: 1;
    }

    #descentHowWeHelpTextPart1 {
        width: 100%;
        order: 0;
    }

    #descentHowWeHelpPicture {
        width: 100%;
        height: 95vw;
        margin-top: 6vw;
        margin-bottom: 6vw;
        margin-left: 0;
        margin-right: 0;
        order: 1;
    }

    #descentHowWeHelpTextPart2 {
        width: 100%;
        order: 2;
        margin-top: 0;
    }

    #descentWhatChangedText {
        width: 100%;
        order: 0;
    }

    #descentWhatChanged {
        margin-top: 18vw;
    }

    #descentHowWeHelp {
        margin-top: 12vw;
    }

    #descentWhatChanged h3,
    #descentDocumentation h3,
    #descentHowWeHelp h3 {
        font-size: 7vw;
        margin-bottom: 4vw;
    }

    #descentWhatChanged ul,
    #descentDocumentation ul {
        font-size: 3.5vw;
        margin-bottom: 4vw;
    }

    #descentWhatChanged li {
        margin-bottom: 1.2em;
    }

    #descentWhatChangedText > p {
        margin-top: 1em;
    }

    #descentHowWeHelp ul {
        font-size: 3.5vw;
        margin-bottom: 4vw;
    }

    #descentHowWeHelpTextPart2 .descentCtaButton {
        margin-top: 2em;
    }

    .descentCtaButton {
        font-size: 4vw;
        padding: 3vw 8vw;
        border-radius: 3vw;
    }
}

/* Phone only: hide squiggly line, smaller main title, left-aligned */
@media screen and (max-width: 766.99px) {
    #descentIntro #aboutStroke {
        display: none;
    }
    #descentIntro h3 {
        font-size: 10vw;
        text-align: left;
        margin-left: 0;
        margin-right: auto;
        margin-bottom: 6vw;
    }
}

/* Tablet / iPad (includes 1024 landscape) */
@media screen and (min-width: 767.01px) and (max-width: 1024.98px) {

    main {
        padding: 10vw 10%;
        top: 0;
    }

    /* Main title: match about page (8vw); stroke removed on tablet */
    #descentIntro h3 {
        font-size: 8vw;
        margin-bottom: 10vw;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }

    #descentIntro #aboutStroke {
        display: none;
    }

    /* Subtitle: left-aligned on tablet; first two paragraphs sit beside image */
    .descentSubtitle {
        font-size: 4vw;
        margin-bottom: 4vw;
        text-align: left;
    }

    /* Picture height = top copy only (subtitle + 2 paragraphs); no min-height overflow */
    #descentIntroContainer {
        display: grid;
        grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
        grid-template-rows: auto auto;
        column-gap: var(--descentPictureGap);
        row-gap: 2vw;
        width: 100%;
    }

    .descentIntroTopRow {
        display: contents;
    }

    #descentIntroPicture {
        grid-column: 1;
        grid-row: 1;
        align-self: stretch;
        width: 100%;
        min-height: 0;
        margin: 0;
        float: none;
        height: auto;
        background-size: cover;
        background-position: center top;
    }

    .descentIntroTopCopy {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        align-self: start;
    }

    .descentIntroTopCopy .descentSubtitle {
        margin-top: 0;
    }

    .descentIntroTextAfter {
        grid-column: 1 / -1;
        grid-row: 2;
        min-width: 0;
    }

    #descentIntroContainer p,
    #descentWhatChanged p,
    #descentDocumentation p,
    #descentHowWeHelp p {
        font-size: 1.75vw;
        line-height: 2.0;
        margin-bottom: 2vw;
    }

    /* Beats #descentIntroContainer p — no gap under 2nd paragraph so image height matches copy */
    #descentIntroContainer .descentIntroTopCopy > p:last-of-type {
        margin-bottom: 0;
    }

    #descentDocumentation {
        margin-top: 10vw;
    }

    .descentHelpSubheading {
        font-size: 2.2vw;
        margin-top: 1.25em;
    }

    #descentWhatChangedContainer {
        display: flex;
        width: 100%;
    }

    #descentWhatChangedText {
        flex: 1;
        min-width: 0;
    }

    /* Same width as third picture: 260px, height matches text (stretch) */
    #descentWhatChangedPicture {
        flex: 0 0 260px;
        width: 260px;
        align-self: stretch;
        min-height: 200px;
        margin-left: var(--descentPictureGap);
        margin-right: 0;
    }

    #descentWhatChanged li {
        margin-bottom: 1em;
    }

    #descentWhatChangedText > p {
        margin-top: 0.75em;
    }

    /* Image height = part1 only (flex stretch); gap before closing copy */
    #descentHowWeHelpContainer {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .descentHowWeHelpTopRow {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 0 var(--descentPictureGap);
        width: 100%;
    }

    #descentHowWeHelpTextPart1 {
        flex: 1 1 0;
        min-width: 0;
    }

    #descentHowWeHelpTextPart1 ul:last-of-type {
        margin-bottom: 0;
    }

    #descentHowWeHelpTextPart1 ul:last-of-type > li:last-of-type {
        margin-bottom: 0;
    }

    #descentHowWeHelpPicture {
        flex: 0 0 260px;
        width: 260px;
        min-width: 260px;
        min-height: 0;
        margin: 0;
        align-self: stretch;
        height: auto;
    }

    #descentHowWeHelpTextPart2 {
        width: 100%;
        min-width: 0;
        margin-top: 2em;
        padding-top: 0.35em;
    }

    #descentWhatChanged {
        margin-top: 12vw;
    }

    #descentHowWeHelp {
        margin-top: 8vw;
    }

    #descentWhatChanged h3,
    #descentDocumentation h3,
    #descentHowWeHelp h3 {
        font-size: 4vw;
        margin-bottom: 2vw;
    }

    #descentWhatChanged ul,
    #descentDocumentation ul,
    #descentHowWeHelp ul {
        font-size: 1.75vw;
        margin-bottom: 2vw;
    }

    #descentHowWeHelpTextPart2 .descentCtaButton {
        margin-top: 1.5em;
    }

    /* Match navbar #contactButton (≈225×50) or slightly larger */
    .descentCtaButton {
        min-width: 240px;
        min-height: 52px;
        font-size: 16px;
        font-weight: 500;
        padding: 14px 36px;
        border-radius: 18px;
        box-sizing: border-box;
    }
}

/* Desktop (viewports wider than 1024px — full-height intro image, stroke visible) */
@media screen and (min-width: 1025px) {

    main {
        padding: 75px 10%;
        top: 0;
    }

    /* Main title: match about page (48px) */
    #descentIntro h3 {
        font-size: 48px;
        margin-bottom: 100px;
    }

    /* Stroke: 1.5x width (600px), slightly lower so not touching title */
    #descentIntro #aboutStroke {
        bottom: -28px;
        width: 600px;
        left: -20px;
    }

    /* Subtitle: same as section h3s (28px) */
    .descentSubtitle {
        font-size: 28px;
        margin-bottom: 30px;
    }

    /* Image spans both text rows; top copy + after stack in column 2 */
    #descentIntroContainer {
        display: grid;
        grid-template-columns: minmax(0, 30%) minmax(0, 1fr);
        grid-template-rows: auto auto;
        column-gap: var(--descentPictureGap);
        row-gap: 16px;
        width: 100%;
    }

    .descentIntroTopRow {
        display: contents;
    }

    #descentIntroPicture {
        grid-column: 1;
        grid-row: 1 / -1;
        align-self: stretch;
        width: 100%;
        max-width: 420px;
        margin: 0;
        float: none;
        height: auto;
        min-height: 280px;
        background-size: cover;
        background-position: center top;
    }

    .descentIntroTopCopy {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        align-self: start;
    }

    .descentIntroTextAfter {
        grid-column: 2;
        grid-row: 2;
        min-width: 0;
    }

    #descentIntroContainer p,
    #descentWhatChanged p,
    #descentDocumentation p,
    #descentHowWeHelp p {
        font-size: 15px;
        line-height: 2.0;
        margin-bottom: 16px;
    }

    #descentDocumentation {
        margin-top: 70px;
    }

    .descentHelpSubheading {
        font-size: 20px;
        margin-top: 1.25em;
    }

    #descentWhatChangedContainer {
        display: flex;
        width: 100%;
    }

    #descentWhatChangedText {
        flex: 1;
        min-width: 0;
    }

    /* Same width as third picture: 300px, height matches text (stretch) */
    #descentWhatChangedPicture {
        flex: 0 0 300px;
        width: 300px;
        align-self: stretch;
        min-height: 240px;
        margin-left: var(--descentPictureGap);
        margin-right: 0;
    }

    #descentWhatChanged li {
        margin-bottom: 1em;
    }

    #descentWhatChangedText > p {
        margin-top: 10px;
    }

    #descentHowWeHelpContainer {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .descentHowWeHelpTopRow {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 0 var(--descentPictureGap);
        width: 100%;
    }

    #descentHowWeHelpTextPart1 {
        flex: 1 1 0;
        min-width: 0;
    }

    #descentHowWeHelpTextPart1 ul:last-of-type {
        margin-bottom: 0;
    }

    #descentHowWeHelpPicture {
        flex: 0 0 300px;
        width: 300px;
        min-width: 300px;
        min-height: 0;
        margin: 0;
        align-self: stretch;
        height: auto;
    }

    #descentHowWeHelpTextPart2 {
        width: 100%;
        min-width: 0;
        margin-top: 2.25em;
        padding-top: 0.35em;
    }

    #descentWhatChanged {
        margin-top: 90px;
    }

    #descentHowWeHelp {
        margin-top: 60px;
    }

    #descentWhatChanged h3,
    #descentDocumentation h3,
    #descentHowWeHelp h3 {
        font-size: 28px;
        margin-bottom: 20px;
    }

    #descentWhatChanged ul,
    #descentDocumentation ul,
    #descentHowWeHelp ul {
        font-size: 15px;
        margin-bottom: 20px;
    }

    #descentHowWeHelpTextPart2 .descentCtaButton {
        margin-top: 1.5em;
    }

    .descentCtaButton {
        font-size: 15px;
        padding: 0 30px;
        height: 50px;
        border-radius: 15px;
    }
}
