/* RojasCo website examples catalogue. Tokens match the live estimator page (SPEC section 6). */

/* 1. Tokens and base */
:root {
  --bg: #FAF7F2; --text: #171310; --muted: #8A7F72; --hair: #E7E0D6; --card: #FFFFFF;
  --accent: #1F4B99; --accent-hover: #183B79; --sel: #DFE6F3;
  --ink-2: #57504A;            /* every informational label, count and caption (7.4:1 on --bg) */
  --line: #8A7F72;             /* control borders (3.7:1 on --bg). --muted is for decorative marks only; --hair for rules */
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --r-ctl: 4px; --r-card: 6px; --wrap: 1280px; --pad: 24px; --side: 264px; --hdr: 60px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-padding-top: calc(var(--hdr) + 12px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
html.lock, body.lock { overflow: hidden; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
ul { list-style: none; margin: 0; padding: 0; }
::selection { background: var(--sel); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--card); border-radius: var(--r-ctl); }
.skip:focus { top: 12px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }
.micro { font: 400 11px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }

/* 2. Buttons and links */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--text); font: 500 14px/1.2 var(--sans); text-decoration: none; transition: background .16s, border-color .16s, transform .16s var(--ease); }
.btn:hover { border-color: var(--text); color: var(--text); text-decoration: none; transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn.mini { min-height: 32px; padding: 5px 13px; font-size: 13px; }
.btn[aria-pressed="true"] { background: var(--sel); border-color: var(--accent); color: var(--accent); }
.link { padding: 4px 0; border: 0; background: none; color: var(--accent); font: 500 13px/1.2 var(--sans); text-decoration: underline; text-underline-offset: 3px; }

/* 3. Header (wraps to two lines on narrow screens instead of clipping) */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(250,247,242,.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--hair); }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; min-height: 60px; padding-top: 6px; padding-bottom: 6px; }
.brand { display: flex; flex-direction: column; gap: 3px; color: var(--text); }
.brand:hover { color: var(--text); text-decoration: none; }
.wm { font: 400 20px/1 var(--serif); letter-spacing: -.01em; }
.brand .micro { font-size: 10px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; font-size: 14px; }
.nav a:not(.btn) { padding: 4px 0; color: var(--ink-2); }
.nav a:not(.btn):hover { color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); font-weight: 500; box-shadow: inset 0 -2px 0 var(--accent); }

/* 4. Title band, search, category rail */
.band { padding-top: 44px; padding-bottom: 12px; }
.eyebrow { margin: 0 0 14px; }
h1 { margin: 0 0 14px; font: 400 clamp(32px, 4vw, 48px)/1.1 var(--serif); letter-spacing: -.025em; }
.sub { max-width: 560px; margin: 0 0 26px; font-size: 17px; line-height: 1.55; color: var(--ink-2); }
.search-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.search { position: relative; flex: 1 1 320px; max-width: 560px; }
.search input { width: 100%; height: 48px; padding: 0 14px 0 42px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--card); font-size: 16px; -webkit-appearance: none; }
.search input::placeholder { color: var(--ink-2); opacity: 1; }
.search input:focus-visible { border-color: var(--accent); outline-offset: 0; }
.search-ico { position: absolute; left: 14px; top: 15px; color: var(--muted); pointer-events: none; }
.count, .toolbar-count { margin: 0; font: 400 12px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.toolbar-count:focus { outline: none; }
.rail { padding-top: 18px; padding-bottom: 6px; }
.chips { display: flex; gap: 8px; padding: 4px 32px 10px 4px; overflow-x: auto; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
.chip { display: inline-flex; flex: none; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text); font: 500 14px/1 var(--sans); white-space: nowrap; }
.chip .n { font-size: 11px; }
.chip[aria-pressed="true"], .group-style .opt.on { background: var(--sel); border-color: var(--accent); color: var(--accent); }
.chip[aria-pressed="true"]::before, .group-style .opt.on::before { content: "✓"; content: "✓" / ""; font-size: 12px; }
.chip[aria-pressed="true"] .n { color: var(--accent); }
.chip[data-n="0"]:not([aria-pressed="true"]) { color: var(--ink-2); border-style: dashed; }
.applied-chip { max-width: 100%; height: auto; min-height: 30px; padding: 4px 12px; background: var(--sel); border-color: var(--sel); color: var(--accent); white-space: normal; overflow-wrap: anywhere; }

/* 5. Two-column body and sidebar */
.layout { padding-top: 8px; padding-bottom: 72px; }
.results { min-width: 0; scroll-margin-top: calc(var(--hdr) + 12px); }
.filters-head { display: flex; align-items: baseline; gap: 12px; padding-bottom: 12px; }
.filters-title { flex: 1; margin: 0; font: 600 15px/1 var(--sans); }
.group { border-top: 1px solid var(--hair); }
.group summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; cursor: pointer; list-style: none; font: 400 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.group summary::-webkit-details-marker { display: none; }
.group summary::after { content: ""; width: 7px; height: 7px; margin-right: 4px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.group[open] summary::after { transform: rotate(-135deg); }
fieldset { min-width: 0; margin: 0; padding: 0 0 14px; border: 0; }
.capwrap > .link { margin-top: 6px; }
.rule { margin: 6px 0 0; font-size: 12px; line-height: 1.45; color: var(--ink-2); }
.n { margin-left: auto; font: 400 12px/1 var(--mono); color: var(--ink-2); }
.opt { position: relative; display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 4px 0; cursor: pointer; }
.opt input { position: absolute; left: 0; width: 18px; height: 18px; margin: 0; opacity: 0; }
.box { display: grid; flex: none; place-items: center; width: 18px; height: 18px; border: 1px solid var(--line); border-radius: 3px; background: var(--card); }
.opt input:checked + .box { background: var(--accent); border-color: var(--accent); }
.opt input:checked + .box::after { content: ""; width: 9px; height: 5px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); }
.opt input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt[data-n="0"]:not(.on) { color: var(--ink-2); cursor: default; }
.opt[data-n="0"]:not(.on) .box { border-style: dashed; }
.mk { margin-right: 4px; font: 500 12px/1 var(--mono); color: var(--ink-2); }
.group-style ul { display: flex; flex-wrap: wrap; gap: 8px; }
.group-style .opt { min-height: 32px; padding: 0 12px; gap: 6px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }
.group-style .box { display: none; }
.group-style .n { margin-left: 2px; font-size: 11px; }
.group-style .opt input:focus-visible + .box { display: block; position: absolute; inset: -3px; width: auto; height: auto; border: 2px solid var(--accent); border-radius: 999px; background: none; outline: 0; }
.group-style .opt input:focus-visible + .box::after { display: none; }
.row { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 4px 0; border: 0; background: none; color: var(--text); text-align: left; font: 400 15px/1.3 var(--sans); }
.row > span:first-child { flex: 1; min-width: 0; }
.row:hover { color: var(--accent); }
.row[aria-pressed="true"] { color: var(--accent); font-weight: 500; }
.row[data-n="0"]:not([aria-pressed="true"]) { color: var(--ink-2); }
.subs { margin: 0 0 6px 4px; padding-left: 14px; border-left: 1px solid var(--hair); }
.subs .row { min-height: 32px; font-size: 14px; }
.filters:focus, .drawer:focus, .results:focus { outline: none; }
.filters-foot { padding: 12px 0; background: var(--bg); border-top: 1px solid var(--hair); }
.filters-foot .btn { width: 100%; }

/* 6. Toolbar, applied filters, shortlist bar */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--hair); }
.toolbar-count { margin-right: auto; }
.sort { display: flex; align-items: center; gap: 8px; }
.sort select { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--card); font-size: 14px; }
.applied { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.shortlist p { margin: 0; }
.shortlist { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 20px; padding: 14px 16px; background: var(--sel); border-radius: var(--r-ctl); }
.shortlist-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* 7. Grid and cards */
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px 24px; }
.card { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-card); }
.card:hover { border-color: var(--accent); }
.media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1px solid var(--hair); border-radius: 5px 5px 0 0; background: rgba(23,19,16,.03); }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity .18s, transform .18s var(--ease); }
.media img.ok { opacity: 1; }
.card:hover .media img { transform: scale(1.02); }
.ph { position: absolute; inset: 0; display: grid; place-items: center; }
.ph b { display: grid; place-items: center; width: 22%; aspect-ratio: 1; border-radius: 50%; background: rgba(250,247,242,.9); color: var(--text); font: 500 clamp(20px, 3vw, 30px)/1 var(--sans); }
.badges { position: absolute; top: 10px; left: 10px; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 4px 8px; border: 1px solid var(--accent); border-radius: 999px; font: 500 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.b-top-performer { background: var(--accent); color: #fff; }
.b-editors-pick { background: var(--bg); color: var(--accent); }
/* Covers the screenshot area; the bar is its bottom 52px. Last in the DOM so Tab goes card, Visit, Save. */
.overlay { position: absolute; top: 0; left: 0; right: 0; z-index: 2; aspect-ratio: 16 / 10; display: flex; align-items: flex-end; justify-content: flex-end; gap: 8px; padding: 10px; background: linear-gradient(to top, rgba(250,247,242,.94) 52px, transparent 52px); opacity: 0; pointer-events: none; transition: opacity .16s; }
.card:hover .overlay, .card:focus-within .overlay { opacity: 1; }
.card:hover .overlay > *, .card:focus-within .overlay > * { pointer-events: auto; }
.info { display: flex; flex: 1; flex-direction: column; gap: 4px; padding: 14px 16px 16px; }
.name { margin: 0; font: 400 20px/1.2 var(--serif); letter-spacing: -.01em; }
.open { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; width: 100%; padding: 0; overflow: hidden; overflow-wrap: anywhere; border: 0; background: none; color: var(--text); text-align: left; font: inherit; letter-spacing: inherit; }
.open:hover { color: var(--accent); }
button.open::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--r-card); }
.open:focus-visible { outline: none; }
button.open:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }
.meta { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 10px; }
.tier { display: inline-flex; align-items: baseline; font: 400 11px/1 var(--mono); letter-spacing: .1em; white-space: nowrap; }
.tier .cap { margin-right: 8px; font-size: 10px; text-transform: uppercase; color: var(--ink-2); }
.tier b { font-weight: 500; color: var(--text); }
.tier i { font-style: normal; color: var(--muted); }
.dots { display: flex; gap: 6px; }
.dot { display: block; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(23,19,16,.18); }

/* 8. Status, empty state, load more, footer, toast */
.status, .empty { padding: 48px 0; text-align: center; color: var(--ink-2); }
.status:empty { padding: 0; }
.empty p { margin: 0 0 6px; }
.empty .empty-title { margin-bottom: 8px; color: var(--text); font: 500 22px/1.2 var(--sans); }
.empty .btn { margin-top: 14px; }
.more { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 40px; }
.more .btn { min-height: 44px; padding: 0 28px; border-color: var(--accent); color: var(--accent); }
.site-footer { padding: 48px 0 40px; border-top: 1px solid var(--hair); background: #F5F0E8; }
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.cta-title { margin: 0; font: 500 clamp(22px, 3vw, 28px)/1.2 var(--sans); letter-spacing: -.01em; }
.legal { margin: 0; color: var(--ink-2); }
.toast { position: fixed; left: 50%; bottom: 20px; z-index: 60; max-width: min(92vw, 420px); margin: 0; padding: 10px 16px; transform: translateX(-50%); border-radius: var(--r-ctl); background: var(--text); color: var(--bg); font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .18s; }
.toast.on { opacity: 1; }

/* 9. Detail drawer and scrim */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(23,19,16,.38); opacity: 0; visibility: hidden; transition: opacity .18s, visibility 0s .18s; }
.scrim.on { opacity: 1; visibility: visible; transition: opacity .18s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: 480px; max-width: 100%; overflow-y: auto; background: var(--bg); border-left: 1px solid var(--hair); transform: translateX(100%); visibility: hidden; transition: transform .18s var(--ease), visibility 0s .18s; }
.drawer.open { transform: none; visibility: visible; transition: transform .18s var(--ease); }
.drawer-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; background: var(--bg); border-bottom: 1px solid var(--hair); }
.media.big { border-radius: 0; }
.d-pad { display: flex; flex-direction: column; gap: 14px; padding: 22px 24px 40px; overflow-wrap: anywhere; }
.d-pad > *, .d-blurb p, .d-tier p { margin: 0; }
.d-pad > .d-badges { display: flex; flex-direction: column; gap: 6px; margin-top: -8px; }
.d-badges .rule, .d-src p { margin: 0; }
.d-src { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding-top: 4px; font-size: 14px; }
.d-title { font: 400 32px/1.1 var(--serif); letter-spacing: -.02em; }
.d-blurb { display: flex; flex-direction: column; gap: 6px; }
.d-blurb p:last-child { font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.d-tier { display: flex; align-items: flex-start; gap: 14px; padding: 14px; border: 1px solid var(--hair); border-radius: var(--r-card); background: var(--card); }
.d-tier .tier { padding-top: 1px; font-size: 13px; }
.d-tier div p:last-child { margin-top: 6px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.tags, .pal { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { padding: 4px 10px; border: 1px solid var(--hair); border-radius: 999px; background: var(--card); font-size: 13px; }
.pal { gap: 8px 10px; }
.pal .dot { width: 20px; height: 20px; }
.d-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; }

/* 10. Responsive: rails, sidebar and grid columns */
@media (max-width: 1023px) {
  .filters { position: fixed; top: 0; bottom: 0; left: 0; z-index: 50; width: min(88vw, 360px); padding: 16px 20px 0; overflow-y: auto; background: var(--bg); border-right: 1px solid var(--hair); transform: translateX(-100%); visibility: hidden; transition: transform .18s var(--ease), visibility 0s .18s; }
  .filters.open { transform: none; visibility: visible; transition: transform .18s var(--ease); }
  .filters-foot { position: sticky; bottom: 0; margin-top: 8px; }
  .opt { min-height: 44px; }
  .group-style .opt { min-height: 38px; }
}
@media (min-width: 600px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) {
  .only-small { display: none !important; }
  .chips { flex-wrap: wrap; padding-right: 4px; overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 32px; align-items: start; }
  .filters { position: sticky; top: calc(var(--hdr) + 24px); max-height: calc(100vh - var(--hdr) - 48px); padding-right: 6px; overflow-y: auto; }
}
@media (min-width: 1200px) {
  .layout { grid-template-columns: var(--side) minmax(0, 1fr); gap: 40px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) { :root { --pad: 20px; } }
@media (max-width: 639px) { .brand .micro { display: none; } .nav { gap: 4px 12px; font-size: 13px; } .nav .btn { padding: 5px 11px; } }
@media (max-width: 479px) { .nav-home { display: none; } }
@media (max-width: 419px) { :root { --hdr: 96px; } }
@media (max-width: 599px) { .drawer { width: 100%; } .d-pad { padding: 20px; } }

/* 11. Touch and reduced motion */
@media (hover: none) { .overlay { opacity: 1; } .overlay > * { pointer-events: auto; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; scroll-behavior: auto !important; }
  .card:hover .media img, .btn:hover { transform: none; }
}
