/* The demo directory (/ and /demos): the demo guide's colours, its own page. */
:root {
    --fme-orange: #e47143;
    --fme-orange-deep: #db4d2d;
    --fme-ink: #141414;
    --fme-text: #424242;
    --fme-muted: #686868;
    --fme-tint: #fff7f2;
    --fme-tint-line: #ffdbc6;
    --fme-line: #ebebeb;
    --fme-page: #f7f7f7;
}

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

.fme-d-body {
    margin: 0;
    background: var(--fme-page);
    color: var(--fme-text);
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.fme-d-wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.fme-d-icon { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }

/* --- header ---------------------------------------------------------------------------------------- */
.fme-d-head {
    background: #fff;
    border-top: 4px solid var(--fme-orange);
    box-shadow: 0 1px 0 var(--fme-tint-line), 0 6px 16px rgba(20, 20, 20, .05);
    padding: 28px 0 22px;
    margin-bottom: 28px;
}
.fme-d-head__inner { display: flex; gap: 32px; align-items: center; margin-bottom: 22px; }
.fme-d-logo img { display: block; width: 180px; height: auto; }
.fme-d-head__text { border-left: 1px solid var(--fme-line); padding-left: 32px; }
.fme-d-eyebrow { margin: 0 0 6px; color: var(--fme-muted); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.fme-d-live {
    display: inline-block; margin-right: 6px; padding: 2px 9px; border-radius: 999px;
    background: var(--fme-orange-deep); color: #fff; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
}
.fme-d-title { margin: 0 0 6px; color: var(--fme-ink); font-size: 30px; line-height: 1.2; font-weight: 750; }
.fme-d-lead { margin: 0; font-size: 16px; max-width: 720px; }

/* --- search ---------------------------------------------------------------------------------------- */
.fme-d-search { display: flex; gap: 10px; }
.fme-d-search__label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.fme-d-search__field {
    flex: 1; display: flex; align-items: center; gap: 10px; padding: 0 16px;
    background: #fff; border: 2px solid var(--fme-line); border-radius: 10px; color: var(--fme-muted);
}
.fme-d-search__field:focus-within { border-color: var(--fme-orange); box-shadow: 0 0 0 4px var(--fme-tint); }
.fme-d-search__input {
    flex: 1; min-width: 0; height: 50px; border: 0; outline: 0; background: transparent;
    color: var(--fme-ink); font: inherit; font-size: 17px;
}
.fme-d-search__go {
    padding: 0 26px; border: 0; border-radius: 10px; background: var(--fme-orange-deep); color: #fff;
    font: inherit; font-weight: 700; cursor: pointer;
}
.fme-d-search__go:hover { background: #c4421f; }
.fme-d-status { margin: 12px 0 0; color: var(--fme-muted); font-size: 14px; min-height: 21px; }

/* --- cards ----------------------------------------------------------------------------------------- */
.fme-d-grid {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 22px;
}
.fme-d-card {
    min-width: 0;
    display: flex; flex-direction: column; overflow: hidden;
    background: #fff; border: 1px solid var(--fme-line); border-radius: 14px;
    transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.fme-d-card:hover { border-color: var(--fme-tint-line); box-shadow: 0 10px 26px rgba(20, 20, 20, .09); transform: translateY(-2px); }
.fme-d-card__media { aspect-ratio: 480 / 352; background: var(--fme-tint); border-bottom: 1px solid var(--fme-line); }
.fme-d-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fme-d-card__placeholder {
    display: flex; width: 100%; height: 100%; align-items: center; justify-content: center;
    color: var(--fme-orange); font-size: 64px; font-weight: 800;
}
.fme-d-card__body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px; }
.fme-d-card__name { margin: 0; color: var(--fme-ink); font-size: 17px; line-height: 1.3; font-weight: 700; }
.fme-d-card__text {
    margin: 0; font-size: 14px; color: var(--fme-text);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
/* Two equal columns that can never be wider than the card: minmax(0, 1fr), and a label may wrap. */
.fme-d-card__demos {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px;
    margin-top: auto; padding-top: 4px;
}
.fme-d-btn {
    display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 36px;
    padding: 6px 8px; border: 1px solid var(--fme-orange); border-radius: 7px;
    color: var(--fme-orange-deep); background: #fff; font-size: 13px; line-height: 1.2; font-weight: 650;
    text-align: center; text-decoration: none; overflow-wrap: anywhere;
}
.fme-d-btn:hover { background: var(--fme-tint); }
.fme-d-buy {
    display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px;
    padding: 7px 12px; border-radius: 7px; background: var(--fme-orange-deep); color: #fff;
    font-size: 14px; font-weight: 700; text-decoration: none;
}
.fme-d-buy .fme-d-icon { width: 16px; height: 16px; }
.fme-d-buy:hover { background: #c4421f; }
.fme-d-btn:focus-visible, .fme-d-buy:focus-visible, .fme-d-search__go:focus-visible, .fme-d-pages button:focus-visible {
    outline: 3px solid var(--fme-ink); outline-offset: 2px;
}

.fme-d-empty {
    margin: 10px 0 0; padding: 40px 20px; text-align: center; background: #fff;
    border: 1px dashed var(--fme-tint-line); border-radius: 14px; font-size: 16px;
}

/* --- pages ----------------------------------------------------------------------------------------- */
.fme-d-pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 34px 0 10px; }
.fme-d-pages button {
    min-width: 42px; height: 42px; padding: 0 12px; border: 1px solid var(--fme-line); border-radius: 8px;
    background: #fff; color: var(--fme-ink); font: inherit; font-weight: 600; cursor: pointer;
}
.fme-d-pages button:hover:not(:disabled) { border-color: var(--fme-orange); color: var(--fme-orange-deep); }
.fme-d-pages button[aria-current="page"] { background: var(--fme-orange-deep); border-color: var(--fme-orange-deep); color: #fff; }
.fme-d-pages button:disabled { opacity: .45; cursor: default; }

.fme-d-foot { margin-top: 40px; padding: 26px 0 34px; border-top: 1px solid var(--fme-line); color: var(--fme-muted); font-size: 14px; text-align: center; }
.fme-d-foot p { margin: 4px 0; }
.fme-d-foot a { color: var(--fme-orange-deep); }

/* --- phones ---------------------------------------------------------------------------------------- */
@media (max-width: 720px) {
    .fme-d-wrap { padding: 0 16px; }
    .fme-d-head { padding-top: 20px; }
    .fme-d-head__inner { flex-direction: column; align-items: flex-start; gap: 14px; }
    .fme-d-head__text { border-left: 0; padding-left: 0; }
    .fme-d-logo img { width: 140px; }
    .fme-d-title { font-size: 23px; }
    .fme-d-lead { font-size: 15px; }
    .fme-d-search__go { padding: 0 16px; }
    .fme-d-grid { grid-template-columns: 1fr; gap: 16px; }
    .fme-d-card__body { padding: 14px 16px 16px; }
    .fme-d-btn, .fme-d-buy { min-height: 42px; font-size: 14px; } /* a bigger finger target */
}

/* Phones turned sideways and small tablets: two cards to a row, not one stretched one. */
@media (min-width: 540px) and (max-width: 720px) {
    .fme-d-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
