/* NOTE: BASE for the new page blocks (inc/new/sections). Design tokens, reset, layout helpers,
   buttons and the small shared pieces (tags, chips, stars, show more panels).
   Every block stylesheet in css/new/ expects this file to be loaded first. */

:root {
    --kmd-accent: #C63B37;
    --kmd-accent-hover: #A8302C;
    --kmd-ink: #161616;
    --kmd-text: #333333;
    --kmd-muted: #555555;
    --kmd-soft: #444444;
    --kmd-white: #FFFFFF;
    --kmd-black: #000000;
    --kmd-line: #E2DED8;
    --kmd-line-strong: #DCD6CE;
    --kmd-field-line: #9A9389;
    --kmd-chip-line: #B9B2A8;
    --kmd-bg-muted: #F4F4F4;
    --kmd-bg-sand: #F6F4F1;
    --kmd-bg-tan: #F3EEE7;
    --kmd-tan-ink: #5E4128;
    --kmd-gold: #D2AE88;
    --kmd-gold-hover: #E0C2A2;
    --kmd-success: #1F7A4D;
    --kmd-error: #B42318;
    --kmd-dark-card: #1A1A1A;
    --kmd-dark-line: #3A3A3A;
    --kmd-dark-text: #D6D6D6;
    --kmd-dark-soft: #C4C4C4;
    --kmd-star: #E8A317;
    --kmd-radius: 8px;
    /* buttons and other small pieces */
    --kmd-radius-small: 4px;

    --kmd-font: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --kmd-container: 1200px;
    --kmd-gutter: 24px;
    --kmd-section-space: 56px;
    --kmd-sticky-offset: 56px;
    /* heights of the sticky promo bar and header, kept up to date by javascript/new/sticky-offsets.js
       (0 when a page has no such bar) */
    --kmd-promo-bar-height: 0px;
    --kmd-header-height: 0px;
}

/* NOTE: RESET */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

/* the footer stays at the bottom of the screen on short pages (order, price request) */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: var(--kmd-white);
    color: var(--kmd-ink);
    font-family: var(--kmd-font);
    font-size: 16px;
    line-height: 1.5;
}

main {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
}

/* the last section takes the free height, so its background reaches the footer on short pages */
main > section:last-of-type {
    flex-grow: 1;
}

img,
svg,
iframe {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

h1,
h2,
h3,
p,
ul,
figure,
blockquote {
    margin: 0;
}

ul {
    padding: 0;
    list-style: none;
}

a {
    color: var(--kmd-accent-hover);
}

a:hover {
    color: #7E211E;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 3px solid var(--kmd-accent);
    outline-offset: 2px;
}

/* sections stop below the sticky promo bar + header + section nav when reached through an anchor */
[id] {
    scroll-margin-top: calc(var(--kmd-promo-bar-height) + var(--kmd-header-height) + var(--kmd-sticky-offset));
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
    }
}

/* NOTE: LAYOUT */

.kmd-container {
    width: 100%;
    max-width: var(--kmd-container);
    margin: 0 auto;
    padding-inline: var(--kmd-gutter);
}

.kmd-stack {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.kmd-center {
    display: flex;
    justify-content: center;
}

.kmd-section {
    padding-block: var(--kmd-section-space);
}

.kmd-section--flush-top {
    padding-top: 0;
}

.kmd-section--muted {
    background: var(--kmd-bg-muted);
}

.kmd-section--sand {
    background: var(--kmd-bg-sand);
}

.kmd-section--dark {
    background: var(--kmd-black);
    color: var(--kmd-white);
}

.kmd-section--ink {
    background: var(--kmd-ink);
    color: var(--kmd-white);
}

.kmd-section-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 760px;
}

.kmd-section-head__title {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
}

.kmd-section-head__text {
    color: var(--kmd-soft);
    font-size: 16px;
    line-height: 1.55;
}

.kmd-section--dark .kmd-section-head__text,
.kmd-section--ink .kmd-section-head__text {
    color: #CFCFCF;
}

.kmd-section-head--large {
    max-width: 820px;
}

.kmd-section-head--large .kmd-section-head__title {
    font-size: 40px;
    line-height: 1.15;
}

.kmd-section-head--large .kmd-section-head__text {
    font-size: 18px;
}

/* NOTE: BREADCRUMBS (inc/new/sections/breadcrumbs.php) */

.kmd-breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--kmd-muted);
    font-size: 13px;
}

.kmd-breadcrumbs li + li::before {
    margin-right: 4px;
    content: "/";
}

.kmd-breadcrumbs a {
    color: inherit;
}

.kmd-page-hero--image .kmd-breadcrumbs ol,
.kmd-section--dark .kmd-breadcrumbs ol {
    color: #BDBDBD;
}

.kmd-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media screen and (max-width: 767px) {
    :root {
        --kmd-gutter: 16px;
        --kmd-section-space: 44px;
    }

    .kmd-section-head__title {
        font-size: 24px;
    }

    .kmd-section-head--large .kmd-section-head__title {
        font-size: 30px;
    }
}

/* NOTE: BUTTONS */

.kmd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 20px;
    border: 2px solid transparent;
    background: none;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s, border-color .2s, color .2s;
}

.kmd-btn--accent {
    border-color: var(--kmd-accent);
    background: var(--kmd-accent);
    color: var(--kmd-white);
}

.kmd-btn--accent:hover {
    border-color: var(--kmd-accent-hover);
    background: var(--kmd-accent-hover);
    color: var(--kmd-white);
}

.kmd-btn--outline {
    border-color: var(--kmd-ink);
    background: var(--kmd-white);
    color: var(--kmd-ink);
}

.kmd-btn--outline:hover {
    background: var(--kmd-ink);
    color: var(--kmd-white);
}

.kmd-btn--dark {
    border-color: var(--kmd-ink);
    background: var(--kmd-ink);
    color: var(--kmd-white);
}

.kmd-btn--dark:hover {
    border-color: var(--kmd-black);
    background: var(--kmd-black);
    color: var(--kmd-white);
}

.kmd-btn--light {
    border-color: var(--kmd-white);
    background: var(--kmd-white);
    color: var(--kmd-ink);
}

.kmd-btn--light:hover {
    background: transparent;
    color: var(--kmd-white);
}

/* event CTA (Black Friday) on dark pages */
.kmd-btn--gold {
    border-color: var(--kmd-gold);
    background: var(--kmd-gold);
    color: var(--kmd-ink);
}

.kmd-btn--gold:hover {
    border-color: var(--kmd-gold-hover);
    background: var(--kmd-gold-hover);
    color: var(--kmd-ink);
}

/* white outline on dark sections */
.kmd-btn--ghost {
    border-color: var(--kmd-white);
    background: transparent;
    color: var(--kmd-white);
}

.kmd-btn--ghost:hover {
    background: var(--kmd-white);
    color: var(--kmd-ink);
}

.kmd-btn--small {
    min-height: 44px;
    padding: 0 16px;
    font-size: 14px;
}

.kmd-btn--large {
    min-height: 56px;
    font-size: 18px;
}

/* text-like button used for "read more" toggles */
.kmd-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 4px;
    border: 0;
    background: none;
    color: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.kmd-chevron {
    flex: 0 0 auto;
    transition: transform .2s;
}

[aria-expanded="true"] > .kmd-chevron,
details[open] > summary > .kmd-chevron {
    transform: rotate(180deg);
}

/* NOTE: SMALL SHARED PIECES */

.kmd-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--kmd-bg-tan);
    color: var(--kmd-tan-ink);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.kmd-chip {
    min-width: 96px;
    min-height: 44px;
    padding: 0 16px;
    border: 2px solid var(--kmd-chip-line);
    background: var(--kmd-white);
    color: var(--kmd-ink);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.kmd-chip[aria-pressed="true"] {
    border-color: var(--kmd-ink);
    background: var(--kmd-ink);
    color: var(--kmd-white);
    font-weight: 700;
}

/* five stars filled up to --kmd-rating (0-5) */
.kmd-stars {
    --kmd-rating: 5;
    display: inline-block;
    width: 90px;
    height: 18px;
    flex: 0 0 auto;
    background: linear-gradient(90deg, var(--kmd-star) calc(var(--kmd-rating) / 5 * 100%), #D9D3CA 0);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 2 3.1 6.3 6.9 1-5 4.9 1.2 6.8L12 17.8 5.8 21l1.2-6.8-5-4.9 6.9-1z'/%3E%3C/svg%3E") left / 18px 18px repeat-x;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 2 3.1 6.3 6.9 1-5 4.9 1.2 6.8L12 17.8 5.8 21l1.2-6.8-5-4.9 6.9-1z'/%3E%3C/svg%3E") left / 18px 18px repeat-x;
}

/* show more panels (javascript/new/disclosure.js) are plain wrappers: once open, their children
   join the parent layout, so the extra cards land in the same grid as the visible ones */
[data-disclosure-panel]:not([hidden]) {
    display: contents;
}

/* without javascript everything is visible and the toggles are useless */
html:not(.js) [data-disclosure-panel]:not([data-disclosure-inverse]) {
    display: contents !important;
}

html:not(.js) [data-disclosure-inverse],
html:not(.js) [data-disclosure] {
    display: none !important;
}
