:root {
    --white: #f5f5f5;
    --green: #b9b993;
    --dark-green: #676654;
    --black: #353533;
    --background: var(--white);
    --text-neutral: var(--black);
    --text-accent-strong: var(--green);
    --text-accent-subtle: var(--dark-green);
    --accent-strong: var(--green);
    --accent-subtle: var(--dark-green);
    --neutral: var(--black);
    --accent-subtle-10: rgba(185, 185, 147, 0.1);
    --accent-subtle-20: rgba(185, 185, 147, 0.2);
    --accent-subtle-30: rgba(185, 185, 147, 0.3);
    --accent-subtle-40: rgba(185, 185, 147, 0.4);
    --bg: var(--background);
    --olive: var(--accent-subtle);
    --sage: var(--accent-strong);
    --ink: var(--text-neutral);
    --sage-10: var(--accent-subtle-10);
    --sage-20: var(--accent-subtle-20);
    --sage-30: var(--accent-subtle-30);
    --sage-line: var(--accent-subtle-40);
    --pad: 14px;
    --gap: 12px;
    --cols: 2;
    --logo-h: 30px;
    --font: "Kulim Park", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
}

button,
input {
    font-family: inherit;
}

a {
    color: inherit;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site {
    min-height: 100vh;
    background: var(--bg);
}

.sidebar {
    background: var(--olive);
    color: var(--sage);
    padding: 22px 14px 40px;
}

.sidebar__inner,
.sidebar__brand,
.brand {
    display: flex;
    flex-direction: column;
}

.sidebar__inner,
.sidebar__top {
    align-items: center;
}

.sidebar__inner {
    gap: 40px;
}

.sidebar__top {
    display: flex;
    flex-direction: column;
    gap: 60px;
    width: 100%;
}

.sidebar__brand {
    align-items: center;
    gap: 24px;
    width: 100%;
}

.nav {
    display: flex;
    justify-content: center;
    gap: 28px;
}

.nav a {
    color: var(--sage);
    text-decoration: none;
    text-transform: uppercase;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
}

.nav a.is-current {
    border-bottom-color: var(--sage-line);
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    align-self: center;
    gap: 8px;
    width: calc(var(--logo-h) * 308.769 / 30);
    max-width: 100%;
}

.brand__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.brand__canister,
.brand__archive {
    display: block;
    flex: none;
    height: var(--logo-h);
    object-fit: fill;
}

.brand__canister {
    width: calc(var(--logo-h) * 308.769 / 30);
    max-width: 100%;
}

.brand__archive {
    width: calc(var(--logo-h) * 274.846 / 30);
    margin-left: auto;
}

.brand__est,
.brand__updated {
    margin: 0;
    color: var(--sage-line);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.brand__updated {
    align-self: stretch;
    text-align: right;
}

.lede {
    margin: 0;
    max-width: 396px;
    text-align: center;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.04em;
    opacity: 0.8;
}

.latest {
    display: none;
    width: 100%;
}

.latest__title {
    margin: 0 0 16px;
    text-align: center;
    color: var(--sage);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.latest__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
}

.latest__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    min-height: 144px;
    padding: 14px 8px;
    border: 0;
    color: var(--sage);
    text-align: center;
    text-decoration: none;
}

.latest__card:nth-child(1) {
    background-color: #88866d;
}

.latest__card:nth-child(2) {
    background-color: #808068;
}

.latest__card:nth-child(3) {
    background-color: #77775f;
}

.latest__card:nth-child(4) {
    background-color: #707058;
}

.latest__date,
.latest__more {
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.latest__name {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.latest__more {
    margin-top: auto;
}

.site-main {
    min-width: 0;
}

.results {
    padding: 60px var(--pad) 0;
    text-align: center;
}

.results h1 {
    margin: 0 auto;
    max-width: 332px;
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.results h1 span {
    color: var(--olive);
}

.toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "search search"
        "filters switcher";
    gap: 12px;
    margin-top: 12px;
    padding: 12px var(--pad);
    background: rgba(245, 245, 245, 0.5);
    backdrop-filter: blur(6px);
}

.search {
    grid-area: search;
}

.filters {
    grid-area: filters;
    justify-self: start;
}

.switcher {
    grid-area: switcher;
    justify-self: end;
}

.search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--sage-20);
    border-radius: 80px;
    background: var(--sage-20);
}

.search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--olive);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.04em;
}

.search input::placeholder {
    color: var(--olive);
}

.toolbar__tools {
    display: contents;
}

.filters {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 0 2px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.04em;
    cursor: pointer;
}

.filters img {
    width: 24px;
    height: 24px;
}

.switcher {
    display: flex;
    align-items: center;
    padding: 2px;
    border: 1px solid var(--sage-20);
    border-radius: 40px;
    background: var(--sage-20);
}

.switcher__btn {
    border: 0;
    border-radius: 40px;
    background: transparent;
    color: var(--ink);
    padding: 6px 10px 8px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.04em;
    white-space: nowrap;
    cursor: pointer;
}

.switcher__btn.is-active {
    background: var(--olive);
    color: var(--sage);
}

.cards {
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    gap: var(--gap);
    padding: 12px var(--pad) 0;
}

.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--sage-20);
    background: var(--sage-10);
    color: var(--ink);
    text-decoration: none;
    text-align: center;
    vertical-align: top;
}

.card.is-extra {
    display: none;
}

.card__photo {
    display: block;
    width: 100%;
    max-height: 530px;
    object-fit: cover;
}

.card__heading,
.card__body {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.card__heading {
    gap: 8px;
}

.card__body {
    gap: 12px;
}

.card__title,
.card__meta,
.card__text {
    margin: 0;
}

.card__title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.04em;
}

.card__meta {
    display: flex;
    justify-content: center;
    gap: 2px;
    color: var(--olive);
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.card__text {
    font-size: 10px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.04em;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.badges li {
    padding: 3px 6px;
    background: var(--sage-20);
    color: var(--olive);
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.load-more {
    display: flex;
    justify-content: center;
    padding: 20px var(--pad) 32px;
}

.load-more[hidden] {
    display: none;
}

.load-more button,
.button {
    border: 0;
    border-radius: 26px;
    background: var(--olive);
    color: var(--sage);
    padding: 10px 24px 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.04em;
    cursor: pointer;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 0;
    padding: 12px var(--pad);
    background: var(--sage-30);
    color: var(--olive);
}

.site-footer p {
    flex: 1;
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}

.site-footer p:last-child {
    text-align: right;
}

.empty {
    padding: 48px var(--pad) 80px;
    text-align: center;
    color: var(--olive);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.04em;
}

.map-view {
    height: 520px;
    margin: 0 var(--pad) 12px;
    background: #eceae0;
}

.map-view[hidden] {
    display: none;
}

.page-copy {
    padding: 60px var(--pad) 80px;
}

.page-copy h1 {
    margin: 0 0 24px;
    color: var(--ink);
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
}

.page-copy__body,
.page-copy__back {
    max-width: 640px;
    font-size: 16px;
    line-height: 1.4;
    letter-spacing: -0.04em;
}

.page-copy__photo {
    display: block;
    width: min(100%, 480px);
    margin: 0 0 24px;
}

.page-copy__back a {
    color: var(--olive);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.04em;
    text-decoration: none;
    text-transform: uppercase;
}

body.admin-bar .toolbar {
    top: 32px;
}

@media (min-width: 768px) {
    :root {
        --pad: 34px;
        --gap: 20px;
        --cols: 3;
        --logo-h: 39px;
    }

    .results {
        padding-top: 80px;
    }

    .results h1 {
        max-width: 610px;
        font-size: 42px;
    }

    .toolbar {
        grid-template-columns: 1fr minmax(280px, 610px) 1fr;
        grid-template-areas: "filters search switcher";
        align-items: center;
        gap: 20px;
        padding: 20px var(--pad);
    }

    .search {
        padding: 11px 16px;
    }

    .nav a {
        font-size: 18px;
    }

    .search input,
    .filters,
    .switcher__btn {
        letter-spacing: -0.04em;
    }

    .switcher {
        justify-self: end;
    }

    .switcher__btn {
        padding: 8px 12px 10px;
    }

    .card {
        gap: 20px;
        padding: 12px;
    }

    .card__title {
        font-size: 16px;
    }

    .card__text {
        font-size: 12px;
    }

    .badges {
        gap: 4px;
    }

    .badges li {
        padding: 4px 8px;
    }

    .brand {
        align-self: center;
    }
}

@media (min-width: 1280px) {
    :root {
        --pad: 26px;
        --cols: 4;
        --logo-h: 35px;
    }

    .site {
        display: flex;
        align-items: flex-start;
    }

    .sidebar {
        position: sticky;
        top: 0;
        flex: 0 0 calc(100vw * 632 / 1920);
        width: calc(100vw * 632 / 1920);
        max-width: 632px;
        height: 100vh;
        height: 100dvh;
        padding: calc(100vw * 39 / 1920) calc(100vw * 25 / 1920) calc(100vw * 48 / 1920);
    }

    .sidebar__inner {
        height: 100%;
        justify-content: space-between;
        gap: 32px;
    }

    .sidebar__top {
        gap: 60px;
    }

    .latest {
        display: block;
    }

    .latest__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .latest__card:nth-child(3) {
        background-color: #707058;
    }

    .latest__card:nth-child(4) {
        display: none;
    }

    .brand {
        align-self: stretch;
        width: 100%;
        max-width: none;
        gap: 6px;
    }

    .brand__canister,
    .brand__archive {
        height: auto;
        object-fit: fill;
    }

    .brand__canister {
        width: 75.6%;
        max-width: none;
        aspect-ratio: 205.846 / 30;
    }

    .brand__archive {
        width: 67.4%;
        aspect-ratio: 183.231 / 30;
    }

    .brand__row {
        align-items: flex-start;
        gap: 12px;
    }

    .results {
        padding-top: 120px;
    }

    .site-main {
        flex: 1;
    }

    .card {
        gap: 24px;
        padding: 16px;
    }

    .card__heading {
        gap: 8px;
    }

    .card__body {
        gap: 16px;
    }

    .search input,
    .filters,
    .switcher__btn,
    .load-more button {
        font-size: 16px;
    }

    .card__meta {
        gap: 4px;
    }

    .load-more button {
        font-size: 16px;
        padding: 12px 24px 14px;
    }

    body.admin-bar .sidebar {
        top: 32px;
        height: calc(100vh - 32px);
        height: calc(100dvh - 32px);
    }
}

@media (min-width: 1920px) {
    :root {
        --pad: 22px;
        --logo-h: 53px;
    }

    .sidebar {
        flex-basis: 632px;
        width: 632px;
        padding: 39px 25px 48px;
    }

    .sidebar__top {
        gap: 60px;
    }

    .results {
        padding-top: 130px;
    }

    .latest__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .latest__card:nth-child(3) {
        background-color: #77775f;
    }

    .latest__card:nth-child(4) {
        display: flex;
    }

    .card__title {
        font-size: 20px;
    }

    .card__text,
    .card__meta,
    .badges li {
        font-size: 12px;
    }

    .card__text {
        font-size: 14px;
    }
}

@media (max-width: 782px) {
    body.admin-bar .toolbar {
        top: 46px;
    }
}

.cards.is-hidden {
    display: none;
}

.filters__mark {
    display: none;
    width: 24px;
    font-size: 22px;
    line-height: 1;
    text-align: center;
}

.filters.is-open img {
    display: none;
}

.filters.is-open .filters__mark {
    display: inline-block;
}

.filter-panel {
    margin: 0 var(--pad) 8px;
    padding: 16px 0 8px;
    border-top: 1px dotted var(--sage-line);
    border-bottom: 1px dotted var(--sage-line);
}

.filter-panel[hidden] {
    display: none;
}

.filter-panel__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px 20px;
}

.select {
    position: relative;
    min-width: 0;
}

.select__label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    color: var(--ink);
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.select__name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.select__name i {
    width: 12px;
    height: 12px;
    border: 1px solid var(--ink);
    border-radius: 50%;
    flex: none;
}

.select__name i::before {
    content: "i";
    display: block;
    font-style: normal;
    font-size: 8px;
    line-height: 10px;
    text-align: center;
}

.select__count {
    color: var(--olive);
}

.select__control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--sage-line);
    background: var(--sage-20);
    color: var(--olive);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.04em;
    text-align: left;
    cursor: pointer;
}

.select__chevron {
    width: 8px;
    height: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    flex: none;
}

.select__control[aria-expanded="true"] .select__chevron {
    transform: translateY(2px) rotate(225deg);
}

.select__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.select__chips a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px;
    background: var(--sage-20);
    color: var(--ink);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-decoration: none;
    text-transform: uppercase;
}

.select__menu {
    position: absolute;
    z-index: 4;
    top: calc(100% - 8px);
    left: 0;
    right: 0;
    max-height: 180px;
    margin: 0;
    padding: 4px 0;
    overflow: auto;
    list-style: none;
    border: 1px solid var(--sage-line);
    background: #e4e4d4;
}

.select__menu[hidden] {
    display: none;
}

.select__menu a,
.select__empty {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 12px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.04em;
    text-decoration: none;
}

.select__menu a.is-on,
.select__menu a:hover {
    background: var(--olive);
    color: var(--white);
}

.filter-panel__reset {
    margin: 18px 0 8px;
    text-align: center;
}

.filter-panel__reset a {
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
}

.record {
    padding: 22px var(--pad) 48px;
}

.record__back {
    margin: 0 0 40px;
}

.record__back a {
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
}

.record__back a::before {
    content: "← ";
}

.record h1 {
    margin: 0 0 16px;
    max-width: 1084px;
    color: var(--ink);
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
}

.record__lead {
    max-width: 1084px;
    margin-bottom: 28px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.04em;
}

.record__lead p {
    margin: 0;
}

.record__layout {
    display: flex;
    flex-direction: column;
    gap: 28px;
    max-width: 1084px;
    padding-top: 28px;
    border-top: 1px solid var(--sage-line);
}

.record__slider {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.record__nav {
    display: flex;
    gap: 8px;
    flex: none;
}

.record__nav button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--sage-line);
    border-radius: 50%;
    background: var(--white);
    color: var(--ink);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.record__photo {
    display: block;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: 610px;
    aspect-ratio: 610 / 530;
    object-fit: cover;
    background: var(--sage-10);
}

.record__photo[hidden] {
    display: none;
}

.record__params {
    margin: 0;
}

.record__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin: 0;
    padding: 8px 0;
    border-bottom: 1px solid var(--sage-line);
}

.record__row dt {
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.record__row dd {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: var(--sage-20);
    color: var(--ink);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-decoration: none;
    text-transform: uppercase;
}

.record__arrow {
    color: var(--olive);
}

@media (min-width: 768px) {
    .filter-panel__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .record h1 {
        font-size: 42px;
    }

    .record__lead {
        font-size: 18px;
    }

    .record__layout {
        flex-direction: row;
        align-items: flex-start;
    }

    .record__slider {
        flex: 1 1 58%;
        min-width: 0;
    }

    .record__params {
        flex: 0 1 42%;
    }
}

@media (min-width: 1280px) {
    .filter-panel__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .select__control,
    .select__menu a {
        font-size: 16px;
    }

    .map-view {
        height: 530px;
    }
}

@media (min-width: 768px) and (max-width: 1279px) {
    .map-view {
        height: 680px;
    }
}

@media (min-width: 1920px) {
    .map-view {
        height: 800px;
    }
}

.ca-pin {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent url("../icons/pin.svg") center / 24px 24px no-repeat;
    cursor: pointer;
}

.ca-pin.is-active {
    filter: brightness(0.72);
}

.maplibregl-ctrl-group {
    border: 0 !important;
    box-shadow: none !important;
}

.maplibregl-ctrl-group button {
    width: 32px;
    height: 32px;
    background-color: var(--white);
    border: 1px solid var(--sage-line);
}

.maplibregl-ctrl-attrib {
    font-size: 10px;
}

.map-popup .maplibregl-popup-content {
    width: 178px;
    padding: 0;
    border-radius: 0;
    background: var(--white);
    box-shadow: 0 10px 28px rgba(53, 53, 51, 0.16);
}

.map-popup .maplibregl-popup-tip {
    display: none;
}

.map-popup .maplibregl-popup-close-button {
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    padding: 0;
    color: var(--ink);
    font-size: 16px;
    line-height: 16px;
}

.map-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 12px;
    color: var(--ink);
    text-align: center;
    text-decoration: none;
}

.map-card img {
    display: block;
    width: 100%;
    height: 110px;
    object-fit: cover;
}

.map-card strong {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.map-card__meta {
    color: var(--olive);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.map-card .badges li {
    font-size: 10px;
}
