:root {
    --jhmb-primary: #0b7189;
    --jhmb-primary-dark: #075365;
    --jhmb-aquatic: #087e8b;
    --jhmb-terrestrial: #708b3e;
    --jhmb-accent: #f2b84b;
    --jhmb-ink: #17323a;
    --jhmb-muted: #66777c;
    --jhmb-surface: #ffffff;
    --jhmb-soft: #f1f7f8;
    --jhmb-border: #dce9eb;
    --jhmb-radius: 18px;
    --jhmb-shadow: 0 12px 32px rgba(19, 61, 72, .10);
}

.jhmb-empty-state {
    width: 100%;
    padding: 24px;
    border: 1px dashed var(--jhmb-border);
    border-radius: 12px;
    background: var(--jhmb-soft);
    color: var(--jhmb-muted);
    text-align: center;
}

.jhmb-animals-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    width: 100%;
}

.jhmb-animals-grid.is-loading {
    opacity: .48;
    pointer-events: none;
}

.jhmb-animal-card {
    position: relative;
    display: flex;
    min-width: 0;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--jhmb-border);
    border-radius: var(--jhmb-radius);
    background: var(--jhmb-surface);
    box-shadow: 0 8px 24px rgba(19, 61, 72, .07);
    transition: transform .25s ease, box-shadow .25s ease;
}

.jhmb-animal-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--jhmb-shadow);
}

.jhmb-full-card-link {
    position: absolute;
    z-index: 4;
    inset: 0;
}

.jhmb-card-image {
    position: relative;
    height: 250px;
    overflow: hidden;
    background: var(--jhmb-soft);
}

.jhmb-card-image-bg {
    width: 100%;
    height: 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    transition: transform .55s ease;
}

.jhmb-animal-card:hover .jhmb-card-image-bg {
    transform: scale(1.04);
}

.jhmb-no-image {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 180px;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    background: linear-gradient(145deg, #e6f4f6 0%, #eef6f1 50%, #f5efe3 100%);
    color: var(--jhmb-primary);
}

.jhmb-no-image-icon {
    width: 88px;
    height: 88px;
    max-width: 42%;
    max-height: 42%;
    fill: rgba(11, 113, 137, .08);
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.jhmb-card-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 22px;
}

.jhmb-card-taxonomy,
.jhmb-profile-taxonomy {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 12px;
}

.jhmb-card-taxonomy span,
.jhmb-profile-taxonomy span {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--jhmb-soft);
    color: var(--jhmb-primary-dark);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.category-terrestrial .jhmb-card-taxonomy span:first-child {
    background: #eef4e4;
    color: #4f6a22;
}

.jhmb-card-title {
    margin: 0;
    color: var(--jhmb-ink);
    font-size: 24px;
    line-height: 1.15;
}

.jhmb-card-latin {
    margin: 5px 0 14px;
    color: var(--jhmb-muted);
    font-size: 14px;
}

.jhmb-card-description {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 0 18px;
    color: #41565c;
    font-size: 15px;
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.jhmb-card-read-more {
    margin-top: auto;
    color: var(--jhmb-primary);
    font-size: 14px;
    font-weight: 800;
}

/* Landing */
.jhmb-landing-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.jhmb-type-toggle {
    cursor: pointer;
}

.jhmb-type-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.jhmb-toggle-icon {
    display: inline-flex;
    padding: 10px 18px;
    border: 1px solid var(--jhmb-border);
    border-radius: 999px;
    background: #fff;
    color: var(--jhmb-ink);
    font-weight: 700;
    transition: all .2s ease;
}

.jhmb-type-toggle input:checked + .jhmb-toggle-icon {
    border-color: var(--jhmb-primary);
    background: var(--jhmb-primary);
    color: #fff;
}

/* Catalog */
.jhmb-catalog-container {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 36px;
    align-items: start;
}

.jhmb-catalog-sidebar {
    position: sticky;
    top: 24px;
}

.jhmb-catalog-filters {
    padding: 22px;
    border: 1px solid var(--jhmb-border);
    border-radius: var(--jhmb-radius);
    background: #fff;
    box-shadow: 0 8px 24px rgba(19, 61, 72, .06);
}

.jhmb-filter-group {
    min-width: 0;
    margin: 0 0 22px;
    padding: 0 0 20px;
    border: 0;
    border-bottom: 1px solid var(--jhmb-border);
}

.jhmb-filter-group legend {
    margin-bottom: 13px;
    color: var(--jhmb-ink);
    font-size: 15px;
    font-weight: 800;
}

.jhmb-custom-radio,
.jhmb-custom-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 9px 0;
    color: #40545a;
    cursor: pointer;
    font-size: 14px;
}

.jhmb-custom-radio input,
.jhmb-custom-checkbox input {
    position: absolute;
    opacity: 0;
}

.jhmb-radio-mark,
.jhmb-checkbox-mark {
    position: relative;
    display: inline-block;
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    border: 2px solid #8ba0a5;
    background: #fff;
    margin-top: 1px;
}

.jhmb-filter-label {
    min-width: 0;
    flex: 1;
    line-height: 1.35;
}

.jhmb-subcategory-group {
    display: none;
}

.jhmb-radio-mark {
    border-radius: 50%;
}

.jhmb-checkbox-mark {
    border-radius: 5px;
}

.jhmb-custom-radio input:checked + .jhmb-radio-mark,
.jhmb-custom-checkbox input:checked + .jhmb-checkbox-mark {
    border-color: var(--jhmb-primary);
    background: var(--jhmb-primary);
    box-shadow: inset 0 0 0 4px #fff;
}

.jhmb-filter-reset {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--jhmb-border);
    border-radius: 9px;
    background: var(--jhmb-soft);
    color: var(--jhmb-primary-dark);
    cursor: pointer;
    font-weight: 700;
}

.jhmb-catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.jhmb-catalog-header h2 {
    margin: 0;
    color: var(--jhmb-ink);
    font-size: clamp(28px, 4vw, 42px);
}

.jhmb-header-search {
    width: min(310px, 100%);
}

.jhmb-header-search-input {
    width: 100%;
    padding: 12px 16px !important;
    border: 1px solid var(--jhmb-border) !important;
    border-radius: 999px !important;
    background: #fff;
    box-shadow: none !important;
}

/* Animal profile */
.jhmb-profile {
    max-width: 1180px;
    margin: 0 auto;
    color: var(--jhmb-ink);
}

.jhmb-profile-back {
    display: inline-flex;
    margin-bottom: 26px;
    color: var(--jhmb-primary);
    font-weight: 700;
    text-decoration: none;
}

.jhmb-profile-header {
    margin-bottom: 28px;
}

.jhmb-profile-header h1 {
    margin: 0;
    color: var(--jhmb-ink);
    font-size: clamp(42px, 7vw, 74px);
    line-height: 1;
}

.jhmb-profile-latin {
    margin: 12px 0 0;
    color: var(--jhmb-muted);
    font-size: 20px;
}

.jhmb-profile-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr);
    gap: 42px;
    align-items: start;
}

.jhmb-profile-main-image {
    min-height: 520px;
    border-radius: var(--jhmb-radius);
    background-position: center;
    background-size: cover;
    box-shadow: var(--jhmb-shadow);
}

.jhmb-profile-swiper {
    position: relative;
}

.jhmb-swiper-button {
    position: absolute;
    z-index: 2;
    top: 50%;
    display: inline-flex;
    width: 46px;
    height: 58px;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    transform: translateY(-50%);
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: rgba(255, 255, 255, .95) !important;
    cursor: pointer;
    box-shadow: none !important;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .75));
    transition: color .2s ease, transform .2s ease;
    appearance: none;
}

.jhmb-swiper-button svg {
    width: 38px;
    height: 38px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.25;
}

.jhmb-swiper-button:hover,
.jhmb-swiper-button:focus-visible {
    transform: translateY(-50%) scale(1.14);
    background: transparent !important;
    color: #fff !important;
}

.jhmb-swiper-button:focus-visible {
    outline: 2px solid rgba(255, 255, 255, .9);
    outline-offset: 2px;
}

.jhmb-swiper-prev {
    left: 18px;
}

.jhmb-swiper-next {
    right: 18px;
}

.jhmb-swiper-counter {
    position: absolute;
    z-index: 2;
    right: 18px;
    bottom: 18px;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(10, 38, 46, .78);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.jhmb-profile-image-credit {
    position: relative;
    z-index: 5;
    margin: 9px 4px 0;
    color: var(--jhmb-muted);
    font-size: 12px;
    line-height: 1.4;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jhmb-profile-image-credit a {
    position: relative;
    z-index: 6;
    display: inline-block;
    color: inherit;
    pointer-events: auto;
    text-decoration: none;
}

.jhmb-profile-image-credit a:hover {
    text-decoration: underline;
}

.jhmb-profile-intro {
    min-width: 0;
}

.jhmb-profile-short {
    color: #344c53;
    font-size: 18px;
    line-height: 1.8;
}

.jhmb-fun-fact {
    margin-top: 28px;
    padding: 22px 24px;
    border: 0;
    border-radius: 14px;
    background: #fff8e8;
}

.jhmb-fun-fact-label {
    color: #795b18;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.jhmb-fun-fact p {
    margin: 7px 0 0;
    color: #4e421f;
    line-height: 1.65;
}

.jhmb-animal-facts {
    display: flex;
    flex-direction: column;
    margin: 30px 0 0;
    border-top: 1px solid var(--jhmb-border);
}

.jhmb-fact {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 13px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--jhmb-border);
}

.jhmb-fact-icon {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    color: var(--jhmb-primary);
}

.jhmb-fact[data-fact='conservation'] .jhmb-fact-icon {
    color: #68843e;
}

.jhmb-fact[data-fact='danger'] .jhmb-fact-icon {
    color: #b36b30;
}

.jhmb-fact-icon svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.jhmb-fact p {
    margin: 0;
    color: #40545a;
    font-size: 14.5px;
    line-height: 1.55;
}

.jhmb-fact p strong {
    color: var(--jhmb-ink);
    font-weight: 800;
}

.jhmb-profile-section {
    margin: 60px 0;
}

.jhmb-profile-section h2,
.jhmb-related-animals h2 {
    margin: 0 0 22px;
    color: var(--jhmb-ink);
    font-size: clamp(28px, 4vw, 42px);
}

.jhmb-curious-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr);
    gap: clamp(38px, 5vw, 72px);
    align-items: start;
    margin: 60px 0;
}

.jhmb-curious-layout.has-map-only {
    grid-template-columns: minmax(0, 1fr);
}

.jhmb-curious-layout.has-map-only .jhmb-distribution-map {
    width: min(650px, 100%);
    margin-left: auto;
}

.jhmb-curious-layout .jhmb-profile-section {
    min-width: 0;
    margin: 0;
}

.jhmb-profile-long-description {
    font-size: 17px;
    line-height: 1.85;
}

.jhmb-distribution-map h2 {
    font-size: clamp(25px, 3vw, 34px);
}

.jhmb-region-map {
    --jhmb-region-north-america: #2584ce;
    --jhmb-region-south-america: #9bc600;
    --jhmb-region-europe: #df6170;
    --jhmb-region-africa: #f28a0b;
    --jhmb-region-asia: #84258f;
    --jhmb-region-oceania: #df1b00;
}

.jhmb-region-map-stage {
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
}

.jhmb-region-map-canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1497 / 911;
}

.jhmb-region-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 9px 16px;
    margin-top: 16px;
    color: #40545a;
    font-size: 13px;
    font-weight: 750;
}

.jhmb-region-map-legend span {
    display: inline-flex;
    gap: 7px;
    align-items: center;
}

.jhmb-region-map-legend span::before {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 50%;
    background: var(--jhmb-region-color, var(--jhmb-primary));
    content: '';
}

.jhmb-region-map-legend [data-region='north-america'] {
    --jhmb-region-color: var(--jhmb-region-north-america);
}

.jhmb-region-map-legend [data-region='south-america'] {
    --jhmb-region-color: var(--jhmb-region-south-america);
}

.jhmb-region-map-legend [data-region='europe'] {
    --jhmb-region-color: var(--jhmb-region-europe);
}

.jhmb-region-map-legend [data-region='africa'] {
    --jhmb-region-color: var(--jhmb-region-africa);
}

.jhmb-region-map-legend [data-region='asia'] {
    --jhmb-region-color: var(--jhmb-region-asia);
}

.jhmb-region-map-legend [data-region='oceania'] {
    --jhmb-region-color: var(--jhmb-region-oceania);
}

.jhmb-related-animals {
    margin-top: 76px;
    padding-top: 48px;
    border-top: 1px solid var(--jhmb-border);
}

/* Animal of the month */
.jhmb-monthly-animal {
    --jhmb-monthly-accent: var(--jhmb-primary);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    overflow: hidden;
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--jhmb-shadow);
}

.jhmb-monthly-image {
    position: relative;
    min-height: 540px;
    background: var(--jhmb-soft);
}

.jhmb-monthly-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jhmb-monthly-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(32px, 6vw, 72px);
}

.jhmb-monthly-eyebrow {
    margin-bottom: 14px;
    color: var(--jhmb-monthly-accent);
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.jhmb-monthly-content h2 {
    margin: 0;
    color: var(--jhmb-ink);
    font-size: clamp(40px, 6vw, 68px);
    line-height: 1;
}

.jhmb-monthly-latin {
    margin: 10px 0 22px;
    color: var(--jhmb-muted);
    font-size: 18px;
}

.jhmb-monthly-description {
    color: #40545a;
    font-size: 17px;
    line-height: 1.75;
}

.jhmb-monthly-fact {
    margin-top: 18px;
    padding: 18px 20px;
    border-radius: 13px;
    background: var(--jhmb-soft);
}

.jhmb-monthly-fact strong {
    color: var(--jhmb-monthly-accent);
}

.jhmb-monthly-fact p {
    margin: 6px 0 0;
    line-height: 1.6;
}

.jhmb-monthly-button {
    display: inline-flex;
    align-self: flex-start;
    gap: 10px;
    margin-top: 26px;
    padding: 13px 22px;
    border-radius: 999px;
    background: var(--jhmb-monthly-accent);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}

.jhmb-monthly-button:hover {
    color: #fff;
    filter: brightness(.9);
}

@media (max-width: 1024px) {
    .jhmb-animals-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .jhmb-profile-hero {
        grid-template-columns: 1fr;
    }

    .jhmb-curious-layout {
        grid-template-columns: 1fr;
    }

    .jhmb-distribution-map {
        width: min(720px, 100%);
    }

}

@media (max-width: 780px) {
    .jhmb-catalog-container {
        display: block;
    }

    .jhmb-catalog-sidebar {
        position: static;
        width: 100%;
        margin-bottom: 22px;
        box-sizing: border-box;
    }

    .jhmb-catalog-filters {
        display: block;
        width: 100%;
        max-width: none;
        padding: 20px;
        box-sizing: border-box;
        border-radius: 14px;
    }

    .jhmb-catalog-filters .jhmb-filter-group {
        margin-bottom: 18px;
        padding-bottom: 17px;
    }

    .jhmb-catalog-filters .jhmb-custom-radio,
    .jhmb-catalog-filters .jhmb-custom-checkbox {
        gap: 11px;
        margin: 8px 0;
        font-size: 15px;
    }

    .jhmb-catalog-filters .jhmb-filter-reset {
        min-height: 44px;
        padding: 10px 14px !important;
        border: 1px solid var(--jhmb-border) !important;
        border-radius: 10px !important;
        background: var(--jhmb-soft) !important;
        color: var(--jhmb-primary-dark) !important;
        box-shadow: none !important;
        appearance: none;
    }

    .jhmb-catalog-header {
        align-items: stretch;
        flex-direction: column;
    }

    .jhmb-header-search {
        width: 100%;
    }

    .jhmb-profile-main-image {
        min-height: 390px;
    }

    .jhmb-monthly-animal {
        grid-template-columns: 1fr;
    }

    .jhmb-monthly-image {
        min-height: 380px;
    }
}

@media (max-width: 560px) {
    .jhmb-animals-grid {
        grid-template-columns: 1fr;
    }

    .jhmb-card-image {
        height: 230px;
    }

    .jhmb-profile-main-image {
        min-height: 300px;
    }

    .jhmb-monthly-image {
        min-height: 300px;
    }
}
