/*
 * Foundation bootstrap from https://getbootstrap.com/docs/5.3/getting-started/introduction/, accessed 2024-06-05.
 * - fonts from Google Fonts.
 * - all images from Adobe stock.
 * - Audio files crated by Sienna updergraff using Adobe Audio library.
 * - animations created using assets from adobe stock modified by Sienna Updegraff.
 * framework created by microsoft copilot and modified by Sienna Updegraff with the help of copilot in VScode.
 */

/* Theme colors */
:root {
    --leaf: #8fbd67;
    --rose: #d96c72;
    --slate: #315746;
    --sage: #c4dda0;
    --orange: #d87936;
    --ink: #263b30;
    --paper: #f4f6ed;
    --action-color: var(--orange);
    --action-hover: var(--rose);
    --action-text: #fff;
}

/* Fonts: local heading and body typefaces */
@font-face {
    font-family: 'Gorditas';
    src: url('../fonts/Gorditas-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Gorditas';
    src: url('../fonts/Gorditas-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Patrick Hand';
    src: url('../fonts/PatrickHand-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Shared page background and body text */
body {
    background-color: var(--paper);
    background-image: repeating-linear-gradient(135deg, rgb(49 87 70 / 3%) 0 1px, transparent 1px 14px);
    color: var(--ink);
    font-family: 'Patrick Hand', cursive;
    font-size: 1.15rem;
    line-height: 1.45;
}

/* Shared site navigation */
.navbar {
    position: relative;
    z-index: 1;
    background: var(--slate);
    padding: 0.75rem clamp(1rem, 4vw, 3rem);
    box-shadow: 0 4px 16px rgb(38 59 48 / 18%);
}

.navbar-brand {
    color: #fff;
    font-family: "Gorditas", Georgia, serif;
    font-size: 1.35rem;
    font-weight: 700;
}

.navbar-brand:hover,
.navbar-brand:focus {
    color: var(--sage);
}

.navbar .nav-link {
    color: rgb(255 255 255 / 88%);
    font-weight: 600;
    padding-inline: 0.9rem;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus,
.navbar .nav-link.active {
    color: var(--sage);
}

.navbar-toggler {
    border-color: rgb(255 255 255 / 55%);
}

.navbar-toggler-icon {
    filter: invert(1);
}

.navbar .dropdown-menu {
    min-width: 12rem;
    padding: 0.4rem;
    border: 1px solid rgb(49 87 70 / 18%);
    border-radius: 6px;
    background: var(--paper);
    box-shadow: 0 10px 24px rgb(38 59 48 / 18%);
}

.navbar .dropdown-item {
    border-radius: 4px;
    color: var(--slate);
    font-family: 'Patrick Hand', cursive;
    font-size: 1.1rem;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
    background: var(--action-hover);
    color: var(--action-text);
}

/* Homepage hero */
.title {
    display: flex;
    min-height: 54vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 1.5rem;
    background: linear-gradient(90deg, rgb(24 52 38 / 78%), rgb(24 52 38 / 20%)),
        url("../images for Capstone/Americas/Land and water/grasslands.jpeg") center / cover no-repeat;
    color: #fff;
    text-shadow: 0 2px 14px rgb(0 0 0 / 30%);
}

.title h1,
.section h2,
main > .row > section:not(.section) h2,
.card-title {
    font-family: "Gorditas", Georgia, serif;
    font-weight: 400;
    font-style: normal;
}

.title h1 {
    margin-bottom: 0.75rem;
    font-size: clamp(2.5rem, 5vw, 4.25rem);
    text-wrap: balance;
}

.title .lead {
    max-width: 42rem;
    margin-bottom: 0;
    font-size: 1.4rem;
    text-wrap: balance;
}

/* Homepage animal cards */
main#home-content {
    width: calc(100% - 2rem);
    max-width: 1440px;
    padding-top: 1.5rem;
    padding-bottom: 2rem;
    margin-inline: auto;
}

main > .row > section:not(.section) > .card {
    height: 100%;
    border: 1px solid rgb(49 87 70 / 16%);
    border-top: 4px solid var(--sage);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 24px rgb(38 59 48 / 8%);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

main > .row > section:not(.section) > .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgb(38 59 48 / 13%);
}

main > .row > section:nth-child(2) > .card {
    border-top-color: var(--rose);
}

main > .row > section:nth-child(3) > .card {
    border-top-color: var(--orange);
}

main > .row > section:not(.section) > .card > .card-body {
    padding: 1.5rem;
}

.column-two-card-body {
    display: flex;
    flex-direction: column;
}

.column-two-image-link {
    display: block;
    margin-top: auto;
}

.column-two-card-body .column-two-image-link .card-img-top {
    max-height: 320px;
}

main > .row > section:not(.section) h2 {
    color: var(--slate);
    font-family: "Gorditas", Georgia, serif;
    font-size: 1.5rem;
}

main > .row > section:not(.section) p {
    line-height: 1.5;
}

.card .card {
    width: 100% !important;
    border: 0;
    border-radius: 4px;
    background: transparent;
}

.card-title {
    color: var(--slate);
}

.card .card-img-top {
    max-height: 230px;
    object-fit: contain;
}

/* Homepage Americas gallery band */
.section {
    width: 100%;
    margin-top: 1.5rem;
    padding: clamp(2rem, 5vw, 4rem) clamp(1.25rem, 4vw, 3.5rem);
    background-color: var(--slate);
    background-image: repeating-linear-gradient(45deg, rgb(255 255 255 / 3%) 0 1px, transparent 1px 18px);
    color: #fff;
}

.gallery-band {
    width: 100%;
    margin: 0;
}

.gallery-inner {
    width: min(100% - 2rem, 1440px);
    margin-inline: auto;
}

.gallery-next-link {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    width: fit-content;
    margin: 1.5rem auto 0;
    padding: 0.45rem 0.9rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    color: var(--action-text);
    font-weight: 700;
    text-decoration: none;
}

.gallery-heading {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 2rem;
}

.gallery-heading h2 {
    grid-column: 2;
    margin: 0;
    color: #fff;
    text-wrap: balance;
}

.gallery-top-button {
    grid-column: 3;
    justify-self: end;
}

/* Sprinkles animation and message dialog */
.sprinkles-dialog {
    width: min(440px, calc(100vw - 2rem));
    max-width: none;
    padding: 0;
    border: 2px solid var(--leaf);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 18px 55px rgb(0 0 0 / 35%);
}

.sprinkles-dialog::backdrop {
    background: rgb(20 30 25 / 70%);
}

.sprinkles-dialog-content {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 0.75rem;
    padding: 2rem;
    text-align: center;
}

.sprinkles-dialog-content h2 {
    margin: 0;
    padding-inline: 1.5rem;
    font-size: 1.5rem;
}

.sprinkles-dialog-close {
    position: absolute;
    top: 0.5rem;
    right: 0.65rem;
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid var(--action-color);
    border-radius: 50%;
    background-color: var(--action-color);
    color: var(--action-text);
    font-size: 1.75rem;
    line-height: 1;
    padding: 0;
}

.sprinkles-popout-animation {
    width: 180px;
    height: 180px;
    object-fit: contain;
}

.sprinkles-message {
    max-width: 32ch;
    margin: 0;
    padding: 0.85rem 1rem;
    border: 2px solid var(--leaf);
    border-radius: 8px;
    background: #f2f8e9;
    font-weight: 600;
}

.section img {
    width: 100%;
    height: clamp(190px, 22vw, 290px);
    border: 3px solid rgb(255 255 255 / 72%);
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 10px 24px rgb(0 0 0 / 22%);
    transition: transform 200ms ease;
}

.section img:hover {
    transform: translateY(-3px);
}

/* Shared buttons and keyboard focus */
.buttons {
    border: 2px solid var(--action-color);
    border-radius: 6px;
    font-family: 'Patrick Hand', cursive;
    font-size: 1.15rem;
    font-weight: 400;
    padding: 0.45rem 1rem;
}

:focus-visible {
    outline: 3px solid var(--orange);
    outline-offset: 3px;
}

/* Shared footer foundation */
footer {
    background: #20372b !important;
    padding-block: 1.25rem !important;
}

footer p {
    margin: 0;
}

/* Regions page hero */
.regions-hero {
    position: relative;
    display: flex;
    min-height: 62vh;
    align-items: end;
    padding: clamp(2rem, 7vw, 6rem);
    background: linear-gradient(90deg, rgb(22 48 36 / 83%), rgb(22 48 36 / 10%)),
        url("../images for Capstone/Americas/Land and water/grasslands.jpeg") center 48% / cover no-repeat;
    color: #fff;
}

.regions-hero-copy {
    max-width: 700px;
}

.regions-hero h1,
.conservation-hero h1 {
    margin: 0 0 1rem;
    font-family: "Gorditas", Georgia, serif;
    font-size: clamp(2.4rem, 5vw, 4.5rem);
    line-height: 1.15;
    text-wrap: balance;
}

.regions-hero-copy > p:last-child,
.conservation-hero-copy > p:not(.page-kicker) {
    max-width: 38rem;
    margin-bottom: 0;
    font-size: 1.35rem;
}

.page-kicker,
.section-number {
    color: var(--orange);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sprinkles-number {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border: 1px solid var(--action-color);
    border-radius: 999px;
    background-color: var(--action-color);
    padding: 0.25rem 0.8rem;
    cursor: pointer;
    font-family: 'Patrick Hand', cursive;
    text-align: left;
    text-decoration: none;
}

.regions-hero .page-kicker,
.conservation-hero .page-kicker {
    color: var(--sage);
}

.regions-hero-note {
    position: absolute;
    right: clamp(1.25rem, 4vw, 4rem);
    bottom: 2rem;
    padding-left: 1rem;
    border-left: 2px solid var(--sage);
    font-size: 1rem;
    line-height: 1.2;
}

/* Regions page intro, habitat links, and image cards */
.regions-main,
.conservation-main {
    width: calc(100% - 2rem);
    max-width: 1200px;
    margin-inline: auto;
}

.habitat-intro {
    display: flex;
    justify-content: center;
    padding: 3rem 0 2rem;
    border-bottom: 1px solid rgb(49 87 70 / 25%);
}

.habitat-intro p {
    max-width: 52rem;
    margin: 0;
    font-size: 1.35rem;
    text-align: center;
}

.habitat-index {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid rgb(49 87 70 / 25%);
    background: var(--paper);
}

.habitat-index a,
.conservation-note a,
.site-footer a {
    color: var(--slate);
    font-weight: 700;
    text-decoration-color: var(--leaf);
    text-underline-offset: 4px;
}

.habitat-index a {
    flex: 0 0 auto;
    padding: 0.3rem 0.85rem;
    border: 1px solid var(--action-color);
    border-radius: 999px;
    text-decoration: none;
}

.habitat-list {
    padding-block: 1.5rem 4rem;
}

.world-regions {
    padding: 1rem 0 4rem;
    scroll-margin-top: 5rem;
}

.world-regions > .page-kicker,
.world-regions > h2 {
    text-align: center;
}

.world-regions > h2 {
    margin: 0.4rem 0 1.5rem;
    color: var(--slate);
    font-family: "Gorditas", Georgia, serif;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.world-region-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.world-region {
    padding: 1.25rem;
    border: 1px solid rgb(49 87 70 / 16%);
    border-top: 4px solid var(--sage);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 24px rgb(38 59 48 / 7%);
    scroll-margin-top: 5rem;
}

.world-region:nth-child(3n + 2) {
    border-top-color: var(--rose);
}

.world-region:nth-child(3n) {
    border-top-color: var(--orange);
}

.world-region h3 {
    margin: 0.4rem 0;
    color: var(--slate);
    font-family: "Gorditas", Georgia, serif;
    font-size: 1.3rem;
}

.world-region-link {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.7rem;
    border: 1px solid var(--action-color);
    border-radius: 999px;
    text-decoration: none;
}

/* Consistent colors and hover feedback for action controls */
.buttons,
.navbar-toggler,
.sprinkles-dialog-close,
.sprinkles-number,
.gallery-next-link,
.habitat-index a,
.world-region-link {
    background-color: var(--action-color);
    border-color: var(--action-color);
    border-radius: 999px;
    color: var(--action-text);
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

body .buttons:hover,
body .buttons:focus-visible,
body .navbar-toggler:hover,
body .navbar-toggler:focus-visible,
body .sprinkles-dialog-close:hover,
body .sprinkles-dialog-close:focus-visible,
body .sprinkles-number:hover,
body .sprinkles-number:focus-visible,
body .gallery-next-link:hover,
body .gallery-next-link:focus-visible,
body .habitat-index a:hover,
body .habitat-index a:focus-visible,
body .world-region-link:hover,
body .world-region-link:focus-visible {
    border-color: var(--action-hover);
    background-color: var(--action-hover);
    color: var(--action-text);
}

.world-region p {
    margin: 0;
}

.habitat-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    gap: clamp(1.5rem, 5vw, 5rem);
    align-items: center;
    margin-bottom: 1.25rem;
    padding: clamp(1rem, 2.5vw, 2rem);
    border: 1px solid rgb(49 87 70 / 16%);
    border-top: 4px solid var(--sage);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 24px rgb(38 59 48 / 7%);
    scroll-margin-top: 5rem;
}

.habitat-row:nth-child(even) {
    border-top-color: var(--rose);
}

.habitat-row:nth-child(3n) {
    border-top-color: var(--orange);
}

.habitat-row-reverse .habitat-image {
    order: 2;
}

.habitat-image img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 6px;
    object-fit: cover;
}

.habitat-copy h2,
.conservation-statement h2,
.response-heading h2,
.conservation-note h2 {
    margin: 0.5rem 0 0.75rem;
    color: var(--slate);
    font-family: "Gorditas", Georgia, serif;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    line-height: 1.25;
    text-wrap: balance;
}

.habitat-copy p,
.response-row p,
.conservation-statement p,
.conservation-note p {
    max-width: 44rem;
    margin: 0;
    font-size: 1.2rem;
}

/* Conservation page hero and introduction */
.conservation-hero {
    position: relative;
    display: flex;
    min-height: 58vh;
    align-items: center;
    overflow: hidden;
    background: #20372b;
    color: #fff;
}

.conservation-hero-image {
    position: absolute;
    inset: 0;
}

.conservation-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 42%;
}

.conservation-hero-copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: center;
    width: min(100% - 2rem, 1200px);
    min-height: 58vh;
    margin-inline: auto;
    padding-block: clamp(2rem, 6vw, 6rem);
    color: #fff;
    text-shadow: 0 2px 14px rgb(0 0 0 / 30%);
}

.conservation-hero::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgb(24 52 38 / 82%), rgb(24 52 38 / 16%));
    content: "";
}

.conservation-hero h1 {
    max-width: 760px;
    color: #fff;
}

.conservation-hero-copy .page-kicker {
    margin-bottom: 0.85rem;
}

.conservation-hero-copy .buttons {
    margin-top: 1.5rem;
}

.conservation-main {
    padding-block: 4rem;
}

.conservation-statement {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 4rem;
    border-bottom: 1px solid rgb(49 87 70 / 25%);
    text-align: center;
}

.conservation-statement .section-number {
    padding-top: 0;
}

.conservation-statement h2 {
    margin-top: 0;
    font-size: clamp(1.8rem, 3.5vw, 3rem);
}

.conservation-statement p {
    max-width: 52rem;
}

/* Conservation response cards */
.response-section {
    padding-block: 4rem;
}

.response-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    text-align: center;
}

.response-heading h2 {
    margin: 0;
}

.response-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.response-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    padding: 1.25rem;
    border: 1px solid rgb(49 87 70 / 16%);
    border-top: 4px solid var(--sage);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 24px rgb(38 59 48 / 7%);
}

.response-row:nth-child(2) {
    border-top-color: var(--rose);
}

.response-row:nth-child(3) {
    border-top-color: var(--orange);
}

.response-index {
    align-self: flex-start;
    color: var(--action-text);
    font-size: 1rem;
    text-transform: capitalize;
}

.response-row img {
    order: -1;
    width: 100%;
    height: 190px;
    margin-bottom: 1rem;
    border-radius: 5px;
    object-fit: cover;
}

.response-row .sprinkles-number {
    margin-bottom: 0.85rem;
}

.response-row h3 {
    margin: 0 0 0.5rem;
    color: var(--slate);
    font-family: "Gorditas", Georgia, serif;
    font-size: 1.3rem;
}

/* Conservation closing message and shared page footer */
.conservation-note {
    padding: clamp(1.5rem, 4vw, 3.5rem);
    border-left: 6px solid var(--leaf);
    background: #e7eddc;
}

.conservation-note h2 {
    max-width: 36rem;
}

.conservation-note a {
    display: inline-block;
    margin-top: 1.25rem;
}

.conservation-note .conservation-return {
    color: #fff;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem clamp(1rem, 4vw, 3rem);
    background: #20372b;
    color: #fff;
}

.site-footer a {
    color: var(--sage);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem 1.25rem;
}

.footer-nav a[aria-current="page"] {
    color: #fff;
    text-decoration-thickness: 2px;
}

/* Small-screen layout adjustments */
@media (max-width: 575.98px) {
    .navbar {
        padding-inline: 0.75rem;
    }

    .title {
        min-height: 42vh;
    }

    .title h1 {
        font-size: 2.55rem;
    }

    .section img {
        height: 220px;
    }

    .gallery-heading {
        grid-template-columns: 1fr;
        row-gap: 1rem;
    }

    .gallery-heading h2 {
        grid-column: 1;
    }

    .gallery-top-button {
        grid-column: 1;
        justify-self: center;
    }

    .sprinkles-dialog-content {
        padding: 1.5rem 1rem;
    }

    .regions-hero {
        min-height: 56vh;
        padding: 2rem 1.25rem 5rem;
    }

    .regions-hero-note {
        bottom: 1.25rem;
    }

    .habitat-row,
    .conservation-hero,
    .conservation-statement {
        grid-template-columns: 1fr;
    }

    .world-region-list {
        grid-template-columns: 1fr;
    }

    .habitat-index {
        justify-content: start;
        overflow-x: auto;
    }

    .habitat-index a {
        flex: 0 0 auto;
    }

    .habitat-row-reverse .habitat-image {
        order: 0;
    }

    .conservation-hero,
    .conservation-hero-copy {
        min-height: 38vh;
    }

    .conservation-hero-copy {
        width: calc(100% - 2.5rem);
        padding-block: 2rem 2.5rem;
    }

    .conservation-statement .section-number {
        grid-row: auto;
    }

    .response-heading {
        display: block;
    }

    .response-list {
        grid-template-columns: 1fr;
    }

    .response-row img {
        height: 180px;
    }

    .site-footer {
        flex-direction: column;
    }

    .footer-nav {
        justify-content: flex-start;
    }
}

/* Tablet response-card layout */
@media (min-width: 576px) and (max-width: 991.98px) {
    .response-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .world-region-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Homepage gallery heading accent */
.subdesign {
    text-decoration: underline;
    text-decoration-color: var(--leaf);
    text-decoration-thickness: 3px;
    text-underline-offset: 6px;
}