/* ========================================
   COLOURS AND GENERAL SETTINGS
======================================== */

:root {
    --darkgreen: #3f5947;
    --midgreen: #8aae95;
    --lightgreen: #c7e3cf;
    --navhover: #eafff0;
    --palegreen: #eaf0e8;
    --bordergreen: #d7dfd8;
    --text: #26382e;

    --rehoming-green: var(--darkgreen);
    --rehoming-pale-green: var(--palegreen);
    --rehoming-border: var(--bordergreen);

    --retraining-green: var(--darkgreen);
    --retraining-pale-green: var(--palegreen);
    --retraining-border: var(--bordergreen);

    --companion-green: var(--darkgreen);
    --companion-pale-green: var(--palegreen);
    --companion-border: var(--bordergreen);

    --horse-green: var(--darkgreen);
    --horse-pale-green: var(--palegreen);
    --horse-border: var(--bordergreen);

    --livery-green: var(--darkgreen);
    --livery-pale-green: var(--palegreen);
    --livery-border: var(--bordergreen);

    --home-green: var(--darkgreen);
    --home-pale-green: var(--palegreen);
    --home-border: var(--bordergreen);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
    color: var(--text);
    font-family: "Inter", Arial, sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
}

img {
    max-width: 100%;
    height: auto;
}

.material-symbols-outlined {
    font-variation-settings:
        "FILL" 1,
        "wght" 400,
        "GRAD" 0,
        "opsz" 24;
}

h1,
h2,
h3,
h4 {
    margin: 0 0 14px;
    color: var(--darkgreen);
    line-height: 1.3;
}

h1 {
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1.2;
}

h2 {
    font-size: 26px;
}

h3 {
    font-size: 20px;
}

h4 {
    font-size: 18px;
}

h1 + h2 {
    margin-top: 12px;
}

main {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 40px 30px;
}

main p {
    margin: 0 0 18px;
    line-height: 1.7;
}

main ul,
main ol {
    margin: 0 0 18px;
    padding-left: 24px;
    line-height: 1.7;
}

main li {
    margin-bottom: 8px;
}

main li:last-child {
    margin-bottom: 0;
}

main a {
    color: var(--darkgreen);
    font-weight: 600;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--midgreen);
    outline-offset: 4px;
}


/* ========================================
   HEADER AND NAVIGATION
======================================== */

header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 26px 14px;
    background: var(--darkgreen);
}

header section {
    min-width: 0;
}

section.logo {
    display: flex;
    align-items: center;
    flex: 1;
}

.ep-logo {
    display: block;
    width: 200px;
    max-width: 100%;
    height: auto;
}

section.menu {
    display: none;
    text-align: right;
}

#menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
}

nav {
    display: flex;
    flex-wrap: wrap;
    background: var(--lightgreen);
    border-bottom: 1px solid var(--darkgreen);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* scripts.js toggles this class for the mobile menu. */
nav.hidden {
    display: flex;
}

nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 12px;
    color: var(--darkgreen);
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s;
}

nav a:first-of-type {
    padding-left: 24px;
}

nav a span {
    margin-right: 3px;
}

nav a:hover,
nav a:focus-visible {
    background: var(--navhover);
}


/* ========================================
   FOOTER
======================================== */

footer {
    padding: 18px 20px;
    background: var(--darkgreen);
    color: #ffffff;
    text-align: center;
    font-weight: 600;
    line-height: 1.7;
}

footer p {
    margin: 0 0 8px;
}

footer p:last-child {
    margin-bottom: 0;
}

footer a {
    display: inline-block;
    max-width: 100%;
    color: #ffffff;
    overflow-wrap: anywhere;
    text-underline-offset: 3px;
}


/* ========================================
   HORSE AND ADVICE LISTINGS
======================================== */

.horse-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.advice-list {
    margin-top: 20px;
}

.advice-list:not(.horse-list) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.horse-container {
    min-width: 0;
    margin: 0;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 0 7px rgb(0 0 0 / 10%);
}

.horse-container > a {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.horse-container img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px 6px 0 0;
}

.horse-bio {
    flex: 1;
    padding: 14px 12px;
    text-align: center;
}

.horse-bio h2,
.advice-list .horse-bio h2 {
    margin: 0 0 8px;
    font-size: clamp(18px, 1.3vw, 23px);
    overflow-wrap: anywhere;
}

.horse-info {
    margin: 0;
    font-size: 15px;
}

.more-btn {
    margin: 8px 0 0;
    font-size: 15px;
    font-weight: 600;
}

@media (hover: hover) {
    .horse-container > a:hover {
        background: var(--darkgreen);
        color: #ffffff;
    }

    .horse-container > a:hover h2 {
        color: var(--lightgreen);
    }
}


/* ========================================
   STANDARD HORSE PROFILES
======================================== */

main.horse-profile {
    display: flex;
    align-items: flex-start;
    gap: 30px;
}

main.horse-profile section:first-of-type {
    flex: 1 1 65%;
    min-width: 0;
}

main.horse-profile section:last-of-type {
    flex: 1 1 35%;
    min-width: 0;
}

main.horse-profile section.profile-img {
    padding: 0;
}

main.horse-profile section.profile-img img {
    display: block;
    width: 100%;
    height: auto;
    margin-bottom: 20px;
    border-radius: 6px;
}

.horse-profile-bio {
    color: #5a5a5a;
    font-weight: 800;
}

.rehome-info {
    padding: 18px;
    border: 1px solid var(--darkgreen);
    border-radius: 4px;
    background: var(--lightgreen);
}

.rehome-info p:last-of-type {
    margin-bottom: 0;
}

.back-btn {
    display: block;
    margin-top: 24px;
    color: var(--darkgreen);
    font-weight: 600;
    text-decoration: none;
}

.video-btn {
    display: inline-block;
    padding: 6px;
    border: 1px solid var(--darkgreen);
    border-radius: 4px;
    background: #ffffff;
    font-weight: 800;
}

.video-btn a {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--darkgreen);
    text-decoration: none;
}


/* ========================================
   ORIGINAL TWO-COLUMN PAGES
======================================== */

section.two-col {
    display: flex;
    align-items: flex-start;
    gap: 30px;
}

.col-one {
    flex: 1 1 70%;
    min-width: 0;
}

.col-two {
    flex: 1 1 30%;
    min-width: 0;
    padding: 0;
}

.col-two img {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 20px;
    border-radius: 6px;
}

.col-two img:first-of-type {
    margin-top: 0;
}


/* ========================================
   SHARED INTRODUCTION LAYOUTS
======================================== */

.rehoming-intro,
.retraining-intro,
.companion-intro,
.horse-intro,
.livery-intro,
.home-hero {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 40px;
    align-items: center;
}

.rehoming-intro > *,
.retraining-intro > *,
.companion-intro > *,
.horse-intro > *,
.livery-intro > *,
.home-hero > * {
    min-width: 0;
}

.retraining-subheading {
    margin-bottom: 20px;
    font-size: 23px;
}


/* ========================================
   PAGE PHOTOGRAPHS

   Add each image's actual width and height
   to its HTML tag. No aspect-ratio override
   is applied here.
======================================== */

main img.rehoming-photo,
main img.retraining-photo,
main img.companion-photo,
main img.horse-photo,
main img.livery-photo,
main img.home-photo {
    display: block;
    width: 100%;
    max-width: 480px;
    height: auto;
    max-height: none;
    object-fit: contain;
    margin: 0;
    border-radius: 6px;
    justify-self: center;
    align-self: center;
}

main img.home-hero-photo {
    max-width: 560px;
}


/* ========================================
   BUTTONS AND ACTION ROWS
======================================== */

.rehoming-actions,
.retraining-actions,
.companion-actions,
.horse-actions,
.livery-actions,
.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.rehoming-button,
.retraining-button,
.companion-button,
.horse-button,
.livery-button,
.home-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    max-width: 100%;
    padding: 12px 18px;
    border: 1px solid var(--darkgreen);
    border-radius: 4px;
    background: transparent;
    color: var(--darkgreen);
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.rehoming-button-primary,
.retraining-button-primary,
.companion-button-primary,
.horse-button-primary,
.livery-button-primary,
.home-button-primary {
    background: var(--darkgreen);
    color: #ffffff;
}

.rehoming-button:hover,
.retraining-button:hover,
.companion-button:hover,
.horse-button:hover,
.livery-button:hover,
.home-button:hover {
    background: var(--palegreen);
    color: var(--darkgreen);
}

.rehoming-button-primary:hover,
.retraining-button-primary:hover,
.companion-button-primary:hover,
.horse-button-primary:hover,
.livery-button-primary:hover,
.home-button-primary:hover {
    background: #2e4436;
    color: #ffffff;
}


/* ========================================
   PROCESS AND INFORMATION CARDS
======================================== */

.rehoming-process,
.retraining-process,
.companion-considerations,
.horse-guide,
.livery-guide,
.home-explore {
    margin-top: 44px;
    padding-top: 32px;
    border-top: 1px solid var(--bordergreen);
}

.rehoming-steps,
.retraining-steps,
.companion-cards,
.horse-cards,
.livery-cards,
.home-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rehoming-step,
.retraining-step,
.companion-card,
.horse-card,
.livery-card,
.home-card {
    min-width: 0;
    margin: 0;
    padding: 24px;
    border-radius: 6px;
    background: var(--palegreen);
    color: var(--text);
}

.rehoming-step h3,
.retraining-step h3,
.companion-card h3,
.horse-card h3,
.livery-card h3,
.home-card h3 {
    margin: 0 0 14px;
    font-size: 19px;
    line-height: 1.4;
}

.rehoming-step p,
.retraining-step p,
.companion-card p,
.horse-card p,
.horse-card ul,
.livery-card p {
    font-size: 15px;
}

.rehoming-step > :last-child,
.retraining-step > :last-child,
.companion-card > :last-child,
.horse-card > :last-child,
.livery-card > :last-child {
    margin-bottom: 0;
}

.rehoming-step-number,
.retraining-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: var(--darkgreen);
    color: #ffffff;
    font-weight: 600;
}


/* ========================================
   SECONDARY IMAGE AND TEXT PANELS
======================================== */

.rehoming-information,
.retraining-information,
.companion-information,
.horse-information,
.livery-information,
.home-welfare {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 32px;
    align-items: center;
    margin-top: 36px;
    padding: 28px;
    border: 1px solid var(--bordergreen);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
}

.rehoming-information > *,
.retraining-information > *,
.companion-information > *,
.horse-information > *,
.livery-information > *,
.home-welfare > * {
    min-width: 0;
}

.rehoming-information h3,
.retraining-information h3,
.companion-information h3,
.horse-information h3,
.livery-information h3 {
    margin: 24px 0 12px;
}

.rehoming-information p:last-child,
.retraining-information p:last-child,
.companion-information p:last-child,
.horse-information p:last-child,
.livery-information p:last-child {
    margin-bottom: 0;
}


/* ========================================
   HIGHLIGHTED INFORMATION PANELS
======================================== */

.rehoming-note,
.retraining-note,
.companion-note,
.horse-note,
.livery-note,
.home-note {
    margin-top: 28px;
    padding: 22px 26px;
    border-left: 4px solid var(--darkgreen);
    background: var(--palegreen);
    color: var(--text);
}

.rehoming-note h2,
.retraining-note h2,
.companion-note h2,
.horse-note h2,
.livery-note h2,
.home-note h2 {
    margin: 0 0 12px;
    font-size: 20px;
}

.rehoming-note p:last-child,
.retraining-note p:last-child,
.companion-note p:last-child,
.horse-note p:last-child,
.livery-note p:last-child,
.home-note p:last-child {
    margin-bottom: 0;
}


/* ========================================
   HOMEPAGE DETAILS
======================================== */

.home-page h1 {
    font-size: clamp(34px, 4vw, 52px);
    line-height: 1.15;
}

.home-eyebrow {
    margin-bottom: 14px;
    color: var(--darkgreen);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.home-lead {
    font-size: 19px;
}

.home-card {
    display: flex;
    flex-direction: column;
}

.home-card h3 {
    font-size: 22px;
}

.home-card-link {
    align-self: flex-start;
    margin-top: auto;
    padding: 8px 0;
    color: var(--darkgreen);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.home-welfare {
    grid-template-columns: 1fr 1.3fr;
}

.home-note p {
    margin-bottom: 0;
}


/* ========================================
   SUCCESS STORIES
======================================== */

.success-intro {
    width: 100%;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--bordergreen);
}

.success-story {
    display: flex;
    align-items: flex-start;
    gap: 35px;
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--bordergreen);
}

.success-story.reverse {
    flex-direction: row-reverse;
}

.story-text {
    flex: 3;
    min-width: 0;
}

.story-text h2 {
    margin-bottom: 18px;
}

.story-image {
    flex: 2;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.story-image img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: 8px;
}

.story-image img.large-image {
    max-height: 550px;
}


/* ========================================
   JUDICIAL AND MAPLE JACK
======================================== */

.paired-intro {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--bordergreen);
    color: var(--darkgreen);
    font-weight: 600;
}

.paired-horse {
    display: flex;
    align-items: flex-start;
    gap: 35px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--bordergreen);
}

.paired-horse.reverse {
    flex-direction: row-reverse;
}

.paired-horse-text {
    flex: 3;
    min-width: 0;
}

.paired-horse-text h3 {
    margin-top: 20px;
}

.paired-horse-image {
    flex: 2;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.paired-horse-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: 8px;
}


/* ========================================
   SMALLER SCREENS — 1024px
======================================== */

@media (max-width: 1024px) {
    .horse-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .horse-bio h2,
    .advice-list .horse-bio h2 {
        font-size: 18px;
    }

    .rehoming-intro,
    .retraining-intro,
    .companion-intro,
    .horse-intro,
    .livery-intro,
    .home-hero {
        gap: 28px;
    }

    .rehoming-steps,
    .retraining-steps,
    .companion-cards,
    .horse-cards,
    .livery-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    main.horse-profile section:first-of-type,
    main.horse-profile section:last-of-type {
        flex-basis: 50%;
    }

    .col-one {
        flex-basis: 55%;
    }

    .col-two {
        flex-basis: 45%;
    }
}


/* ========================================
   TABLETS — 768px
======================================== */

@media (max-width: 768px) {
    main {
        padding: 26px 20px;
    }

    header {
        padding: 16px 20px;
    }

    section.menu {
        display: block;
    }

    section.menu .material-symbols-outlined {
        padding: 3px 5px;
        border: 1px solid #ffffff;
        border-radius: 4px;
        font-size: 36px;
    }

    nav {
        flex-direction: column;
    }

    nav.hidden {
        display: none;
    }

    nav a,
    nav a:first-of-type {
        justify-content: flex-start;
        min-height: 46px;
        padding: 12px 20px;
        border-bottom: 1px solid rgb(63 89 71 / 20%);
        text-align: left;
    }

    nav a .material-symbols-outlined {
        display: none;
    }

    .horse-list,
    .advice-list:not(.horse-list) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .rehoming-intro,
    .retraining-intro,
    .companion-intro,
    .horse-intro,
    .livery-intro,
    .home-hero,
    .rehoming-information,
    .retraining-information,
    .companion-information,
    .horse-information,
    .livery-information,
    .home-welfare {
        grid-template-columns: 1fr;
        gap: 22px;
        align-items: start;
    }

    main img.rehoming-photo,
    main img.retraining-photo,
    main img.companion-photo,
    main img.horse-photo,
    main img.livery-photo,
    main img.home-photo {
        align-self: start;
    }

    .home-welfare-text {
        grid-row: 1;
    }

    .home-cards {
        grid-template-columns: 1fr;
    }

    .rehoming-information,
    .retraining-information,
    .companion-information,
    .horse-information,
    .livery-information,
    .home-welfare {
        margin-top: 26px;
        padding: 20px;
    }

    .rehoming-process,
    .retraining-process,
    .companion-considerations,
    .horse-guide,
    .livery-guide,
    .home-explore {
        margin-top: 30px;
        padding-top: 24px;
    }

    main.horse-profile {
        flex-direction: column;
        gap: 22px;
    }

    main.horse-profile section:first-of-type,
    main.horse-profile section:last-of-type {
        flex: auto;
        width: 100%;
    }

    main.horse-profile section:first-of-type {
        order: 2;
    }

    main.horse-profile section.profile-img {
        padding: 0;
    }

    section.two-col {
        flex-direction: column;
        gap: 22px;
    }

    .col-one,
    .col-two {
        flex: auto;
        width: 100%;
        padding: 0;
    }

    .success-story,
    .success-story.reverse {
        flex-direction: column-reverse;
        gap: 20px;
    }

    .paired-horse,
    .paired-horse.reverse {
        flex-direction: column;
        gap: 20px;
    }

    .story-text,
    .story-image,
    .paired-horse-text,
    .paired-horse-image {
        flex: auto;
        width: 100%;
    }

    .story-image img,
    .story-image img.large-image,
    .paired-horse-image img {
        max-height: none;
    }
}


/* ========================================
   PHONES — 480px
======================================== */

@media (max-width: 480px) {
    main {
        padding: 22px 16px;
    }

    header {
        padding: 14px 16px;
    }

    .ep-logo {
        width: 150px;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 23px;
    }

    .home-page h1 {
        font-size: 34px;
    }

    .home-lead {
        font-size: 18px;
    }

    .horse-list,
    .advice-list:not(.horse-list),
    .rehoming-steps,
    .retraining-steps,
    .companion-cards,
    .horse-cards,
    .livery-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .horse-bio h2,
    .advice-list .horse-bio h2 {
        font-size: 22px;
    }

    .rehoming-step,
    .retraining-step,
    .companion-card,
    .horse-card,
    .livery-card,
    .home-card {
        padding: 20px;
    }

    .rehoming-note,
    .retraining-note,
    .companion-note,
    .horse-note,
    .livery-note,
    .home-note {
        padding: 18px;
    }

    .rehoming-actions,
    .retraining-actions,
    .companion-actions,
    .horse-actions,
    .livery-actions,
    .home-actions {
        flex-direction: column;
        align-items: stretch;
    }

    footer {
        padding: 16px;
        font-size: 14px;
    }
}


/* ========================================
   REDUCED MOTION
======================================== */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    nav a,
    .horse-container > a,
    .rehoming-button,
    .retraining-button,
    .companion-button,
    .horse-button,
    .livery-button,
    .home-button {
        transition: none;
    }
}
        main.contact-page {
            display: block;
            width: 100%;
            max-width: 1100px;
            margin: 0 auto;
            padding: 40px 24px 56px;
            box-sizing: border-box;
        }

        .contact-page .contact-intro {
            display: block;
            width: 100%;
            max-width: 700px;
            margin: 0 auto 28px;
            padding: 0;
            text-align: center;
        }

        .contact-page .contact-intro h1 {
            margin: 0 0 16px;
            color: #3f5947;
        }

        .contact-page .contact-intro p {
            margin: 0;
            line-height: 1.7;
        }

        .contact-page .contact-form-container {
            width: 100%;
            max-width: 900px;
            margin: 0 auto;
            overflow: hidden;
            border: 1px solid #c7e3cf;
            border-radius: 12px;
            background: #fff;
            box-sizing: border-box;
        }

        .contact-page .contact-form {
            display: block;
            width: 100%;
            height: 950px;
            border: 0;
        }

        .contact-page .contact-form-fallback {
            margin: 18px 0 0;
            text-align: center;
            font-size: 0.95rem;
            line-height: 1.6;
        }

        .contact-page .contact-form-fallback a {
            color: #3f5947;
            text-decoration: underline;
            text-underline-offset: 3px;
        }

        .contact-page .contact-form-fallback a:focus-visible {
            outline: 2px solid #3f5947;
            outline-offset: 4px;
        }

        @media (max-width: 768px) {
            main.contact-page {
                padding: 28px 18px 40px;
            }

            .contact-page .contact-form {
                height: 1050px;
            }
        }

        @media (max-width: 480px) {
            main.contact-page {
                padding: 24px 12px 32px;
            }

            .contact-page .contact-intro {
                margin-bottom: 20px;
            }

            .contact-page .contact-form-container {
                border-radius: 8px;
            }

            .contact-page .contact-form {
                height: 1150px;
            }
        }
    /* Horse profiles with an embedded video */
main.horse-profile > .profile-img iframe {
    margin-top: 20px;
}

@media (min-width: 769px) {
    main.horse-profile:has(> .profile-img iframe) {
        display: grid;
        grid-template-columns: minmax(0, 65fr) minmax(0, 35fr);
        gap: 24px 30px;
        align-items: stretch;
        align-content: start;
    }

    main.horse-profile:has(> .profile-img iframe) > section:first-of-type {
        display: flex;
        flex-direction: column;
    }

    main.horse-profile:has(> .profile-img iframe) > section:first-of-type .rehome-info {
        margin-top: auto;
    }

    main.horse-profile:has(> .profile-img iframe) > .profile-img {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    main.horse-profile:has(> .profile-img iframe) > .profile-img img {
        margin-bottom: 0;
    }

    main.horse-profile:has(> .profile-img iframe) > .profile-img iframe {
        flex-shrink: 0;
        margin-top: auto;
    }

    main.horse-profile:has(> .profile-img iframe) > .back-btn {
        grid-column: 1 / -1;
        margin-top: 0;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    main.horse-profile:has(> .profile-img iframe) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}main.horse-profile > section.profile-img iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: 0;
}.rehoming-question {
    color: var(--darkgreen);
    font-weight: 600;
}/* Judicial and Maple Jack: photos and videos */

.paired-horses-page .paired-horse-image {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    align-self: flex-start;
}

.paired-horses-page .paired-horse-text {
    min-width: 0;
}

.paired-horses-page .paired-horse-image img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    box-sizing: border-box;
}

.paired-horses-page .paired-horse-image iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: 0;
    flex-shrink: 0;
    box-sizing: border-box;
}@media (max-width: 768px) {
    main.horse-profile > .back-btn {
        order: 3;
    }
}