/*
 * BCOS templates — shared public styles for collection listings, detail pages,
 * forms and widgets. Uses the house tokens (--ink, --red, --line, --font) so
 * every UI style (BCOS / Cupertino / Vogue) restyles it by overriding tokens.
 *
 * Template-specific styles live in vx-<key>.css. Theme files may override
 * the --vx-* tokens below.
 */
:root {
  --vx-radius: 14px;
  --vx-radius-lg: 22px;
  --vx-gap: 1.4rem;
  --vx-card-bg: var(--bg, #fff);
  --vx-card-line: var(--line, #e6e6e6);
  --vx-card-shadow: 0 1px 0 rgba(0,0,0,.03), 0 12px 30px rgba(0,0,0,.05);
  --vx-accent: var(--red, #E10600);
  --vx-soft: var(--surface-3, #f4f4f4);
}

.vx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.vx-narrow { max-width: 760px; }
.vx-sec .vx-head { margin: 0 0 1.8rem; max-width: 720px; }
.vx-h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -.03em; margin: 0 0 .5rem; }
.vx-lead { color: var(--muted, #6b6b6b); font-size: 1.08rem; margin: 0; }
.vx-more { margin: 2rem 0 0; text-align: center; }
.vx-empty, .vx-muted { color: var(--muted, #6b6b6b); }
.vx-count { color: var(--muted, #6b6b6b); font-size: .9rem; margin: 0 0 1rem; }
.vx-tag { display: inline-block; padding: .15rem .55rem; border-radius: 999px; background: var(--vx-soft); font-size: .78rem; margin: 0 .25rem .25rem 0; }
.vx-badge { display: inline-block; padding: .18rem .55rem; border-radius: 999px; background: var(--ink, #111); color: var(--on-ink, #fff); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 650; }
.vx-swatch { display: inline-block; width: .9rem; height: .9rem; border-radius: 4px; vertical-align: middle; border: 1px solid var(--line); }
.vx-lines { margin: 0; padding-left: 1.1rem; }
.vx-lines li { margin: .25rem 0; }

/* ─── Grids and cards ─── */
.vx-grid { display: grid; gap: var(--vx-gap); }
.vx-grid-cards.vx-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vx-grid-cards.vx-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vx-grid-cards.vx-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.vx-grid-list, .vx-grid-compact { grid-template-columns: 1fr; gap: .8rem; }
@media (max-width: 960px) { .vx-grid-cards.vx-cols-3, .vx-grid-cards.vx-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .vx-grid-cards.vx-cols-2, .vx-grid-cards.vx-cols-3, .vx-grid-cards.vx-cols-4 { grid-template-columns: 1fr; } }

.vx-card { position: relative; display: flex; flex-direction: column; background: var(--vx-card-bg); border: 1px solid var(--vx-card-line); border-radius: var(--vx-radius); overflow: hidden; color: inherit; text-decoration: none; box-shadow: var(--vx-card-shadow); transition: transform .25s ease, box-shadow .25s ease, border-color .25s; }
a.vx-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(0,0,0,.09); border-color: transparent; }
a.vx-card:focus-visible { outline: 3px solid var(--vx-accent); outline-offset: 3px; }
.vx-card.is-featured { border-color: var(--ink, #111); }
.vx-card-media { display: block; aspect-ratio: 4 / 3; background: var(--vx-soft); overflow: hidden; }
.vx-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
a.vx-card:hover .vx-card-media img { transform: scale(1.04); }
.vx-card-body { display: flex; flex-direction: column; gap: .45rem; padding: 1.05rem 1.15rem 1.2rem; flex: 1; }
.vx-card-title { font-size: 1.08rem; letter-spacing: -.01em; line-height: 1.3; }
.vx-card-summary { color: var(--muted, #6b6b6b); font-size: .93rem; line-height: 1.5; }
.vx-card-body .vx-badge { align-self: flex-start; }
.vx-facts { list-style: none; margin: auto 0 0; padding: .65rem 0 0; border-top: 1px solid var(--vx-card-line); display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; }
.vx-facts li { display: flex; flex-direction: column; font-size: .82rem; }
.vx-facts span { color: var(--muted, #6b6b6b); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.vx-grid-list .vx-card { flex-direction: row; }
.vx-grid-list .vx-card-media { width: 260px; flex: 0 0 260px; aspect-ratio: auto; }
@media (max-width: 620px) { .vx-grid-list .vx-card { flex-direction: column; } .vx-grid-list .vx-card-media { width: auto; flex: none; aspect-ratio: 16/9; } }
.vx-grid-compact .vx-card { flex-direction: row; box-shadow: none; }
.vx-grid-compact .vx-card-body { flex-direction: row; align-items: center; flex-wrap: wrap; gap: .4rem 1rem; padding: .8rem 1rem; }
.vx-grid-compact .vx-facts { border: 0; margin: 0 0 0 auto; padding: 0; }

/* ─── Tables ─── */
.vx-table-wrap { overflow-x: auto; border: 1px solid var(--vx-card-line); border-radius: var(--vx-radius); background: var(--vx-card-bg); }
.vx-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.vx-table th { text-align: left; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #6b6b6b); font-weight: 600; padding: .75rem 1rem; border-bottom: 1px solid var(--vx-card-line); white-space: nowrap; }
.vx-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--vx-card-line); vertical-align: middle; }
.vx-table tr:last-child td { border-bottom: 0; }
.vx-table a { color: inherit; font-weight: 600; }
.vx-rows { width: 100%; border-collapse: collapse; font-size: .92rem; }
.vx-rows th, .vx-rows td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--vx-card-line); }
@media (max-width: 620px) {
  .vx-table thead { display: none; }
  .vx-table tr { display: block; border-bottom: 1px solid var(--vx-card-line); padding: .5rem 0; }
  .vx-table td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .3rem 1rem; }
  .vx-table td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; }
}

/* ─── Public filters, pager ─── */
.vx-public-filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .8rem; margin: 0 0 1.6rem; background: var(--vx-soft); border-radius: var(--vx-radius); }
.vx-public-filters input, .vx-public-filters select { font: inherit; padding: .6rem .75rem; border: 1px solid var(--vx-card-line); border-radius: 10px; background: #fff; min-height: 44px; }
.vx-pf-search { flex: 1 1 220px; }
.vx-pf-search input { width: 100%; }
.vx-pf-range { display: inline-flex; align-items: center; gap: .35rem; }
.vx-pf-range input { width: 7.5rem; }
.vx-pf-label { font-size: .8rem; color: var(--muted); }
.vx-clear { font-size: .9rem; color: var(--muted); }
.vx-pager { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; margin: 2rem 0 0; }
.vx-pager a { min-width: 40px; min-height: 40px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--vx-card-line); color: inherit; text-decoration: none; }
.vx-pager a.is-on { background: var(--ink, #111); color: var(--on-ink, #fff); border-color: var(--ink, #111); }
.vx-empty-state { display: grid; justify-items: center; gap: .5rem; padding: 3rem 1rem; text-align: center; color: var(--muted); border: 1px dashed var(--vx-card-line); border-radius: var(--vx-radius); }
.vx-empty-state strong { color: var(--ink); font-size: 1.1rem; }
.vx-empty-state .fas { font-size: 1.6rem; opacity: .5; }

/* ─── Detail page ─── */
.vx-preview-bar { background: #fff4d6; color: #6b4a00; text-align: center; padding: .6rem 1rem; font-size: .9rem; }
.vx-gallery-hero { display: grid; gap: .5rem; max-width: 1280px; margin: 1.2rem auto 0; padding: 0 1.25rem; grid-template-columns: 1fr; position: relative; }
.vx-gallery-hero.has-many { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 220px 220px; }
.vx-gallery-hero button { padding: 0; border: 0; background: var(--vx-soft); border-radius: var(--vx-radius); overflow: hidden; cursor: zoom-in; }
.vx-gallery-hero img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.vx-gallery-hero:not(.has-many) img { max-height: 520px; }
.vx-gallery-hero button:hover img { transform: scale(1.03); }
.vx-gallery-hero.has-many .vx-gh-0 { grid-row: span 2; }
.vx-gallery-hero .vx-gh-3, .vx-gallery-hero .vx-gh-4 { display: block; }
.vx-gh-more { position: absolute; right: 2rem; bottom: .9rem; background: rgba(0,0,0,.7); color: #fff; padding: .35rem .7rem; border-radius: 999px; font-size: .82rem; pointer-events: none; }
@media (max-width: 760px) {
  .vx-gallery-hero.has-many { grid-template-columns: 1fr 1fr; grid-template-rows: 240px 120px; }
  .vx-gallery-hero.has-many .vx-gh-0 { grid-column: span 2; grid-row: auto; }
  .vx-gallery-hero .vx-gh-3, .vx-gallery-hero .vx-gh-4 { display: none; }
}
.vx-item-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 3rem; padding: 2.4rem 0 3rem; align-items: start; }
@media (max-width: 960px) { .vx-item-grid { grid-template-columns: 1fr; gap: 2rem; } }
.vx-item-title { font-size: clamp(2rem, 4.4vw, 3.2rem); letter-spacing: -.04em; line-height: 1.05; margin: .4rem 0 1rem; }
.vx-headline { list-style: none; margin: 0 0 1.4rem; padding: 0; display: flex; flex-wrap: wrap; gap: 1.6rem; }
.vx-headline li { display: flex; flex-direction: column; }
.vx-headline strong { font-size: 1.35rem; letter-spacing: -.02em; }
.vx-headline span { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.vx-item-sec { margin: 2.2rem 0 0; }
.vx-item-sec h2 { font-size: 1.25rem; margin: 0 0 .7rem; letter-spacing: -.01em; }
.vx-prose { line-height: 1.7; color: var(--ink-2, #444); }
.vx-prose p { margin: 0 0 1rem; }
.vx-item-side { display: grid; gap: 1rem; position: sticky; top: 90px; }
@media (max-width: 960px) { .vx-item-side { position: static; } }
.vx-card-panel { background: var(--vx-card-bg); border: 1px solid var(--vx-card-line); border-radius: var(--vx-radius-lg); padding: 1.3rem 1.35rem; box-shadow: var(--vx-card-shadow); }
.vx-panel-h { font-size: 1.05rem; margin: 0 0 .9rem; letter-spacing: -.01em; }
.vx-dl { display: grid; grid-template-columns: auto 1fr; gap: .55rem 1rem; margin: 0; font-size: .93rem; }
.vx-dl dt { color: var(--muted); }
.vx-dl dd { margin: 0; text-align: right; font-weight: 550; }
.vx-dl dd img { max-width: 100%; border-radius: 8px; }
.vx-related { background: var(--surface-2, #fafafa); }

/* ─── Forms ─── */
.vx-form { display: grid; gap: 1rem; }
.vx-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1rem; }
.vx-item-side .vx-fields, .vx-w-full, .vx-t-textarea, .vx-t-richtext, .vx-t-lines, .vx-t-address, .vx-t-gallery, .vx-t-rows, .vx-t-multiselect, .vx-t-bool { grid-column: 1 / -1; }
.vx-item-side .vx-fields { grid-template-columns: 1fr; }
@media (max-width: 620px) { .vx-fields { grid-template-columns: 1fr; } }
.vx-field { display: grid; gap: .35rem; align-content: start; }
.vx-field.vx-w-half { grid-column: span 1; }
.vx-field > label { font-size: .84rem; font-weight: 600; }
.vx-field input:not([type=checkbox]):not([type=radio]):not([type=color]), .vx-field select, .vx-field textarea {
  font: inherit; width: 100%; padding: .65rem .8rem; border: 1px solid var(--vx-card-line); border-radius: 10px; background: #fff; min-height: 44px; color: var(--ink);
}
.vx-field textarea { min-height: 96px; resize: vertical; }
.vx-field input:focus, .vx-field select:focus, .vx-field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17,17,17,.08); }
.vx-field.has-err input, .vx-field.has-err select, .vx-field.has-err textarea { border-color: var(--red, #E10600); }
.vx-req { color: var(--red, #E10600); }
.vx-help { color: var(--muted); font-size: .8rem; }
.vx-err { color: var(--red, #E10600); font-size: .84rem; }
.vx-check { display: flex; align-items: center; gap: .5rem; font-size: .93rem; min-height: 32px; }
.vx-check input { width: 1.05rem; height: 1.05rem; accent-color: var(--ink); }
.vx-checks { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
.vx-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.vx-form-intro { color: var(--muted); margin: 0; }
.vx-form-foot { display: flex; gap: .6rem; align-items: center; }
.vx-item-side .vx-form-foot .bcos-btn { width: 100%; justify-content: center; }
.vx-success { display: grid; gap: .6rem; justify-items: start; padding: 1.4rem; border-radius: var(--vx-radius); background: #eaf7ef; color: #14532d; }
.vx-success strong { font-size: 1.05rem; }

/* ─── Lightbox ─── */
.vx-lb { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.92); display: none; place-items: center; }
.vx-lb.is-open { display: grid; }
.vx-lb img { max-width: min(92vw, 1400px); max-height: 86vh; object-fit: contain; border-radius: 6px; }
.vx-lb button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.vx-lb button:hover { background: rgba(255,255,255,.24); }
.vx-lb-x { top: 1rem; right: 1rem; }
.vx-lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.vx-lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
.vx-lb-n { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); color: #fff; font-size: .9rem; }

/* ─── Widgets: shared bits (templates add their own in vx-<key>.css) ─── */
.vx-w .vx-w-box { background: var(--vx-card-bg); border: 1px solid var(--vx-card-line); border-radius: var(--vx-radius-lg); padding: 1.6rem; box-shadow: var(--vx-card-shadow); }
.vx-w-out { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 750; letter-spacing: -.03em; }
.vx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.vx-kpi { padding: 1.1rem 1.2rem; border-radius: var(--vx-radius); background: var(--vx-soft); }
.vx-kpi strong { display: block; font-size: 1.7rem; letter-spacing: -.03em; }
.vx-kpi span { color: var(--muted); font-size: .85rem; }
.vx-progress { height: 10px; border-radius: 999px; background: var(--vx-soft); overflow: hidden; }
.vx-progress > span { display: block; height: 100%; background: var(--vx-accent); border-radius: inherit; transition: width .6s ease; }
.vx-field[hidden], .vx-fields [hidden] { display: none !important; }
/* Section theme "ink" on template modules */
.bcos-section-ink.vx-sec { background: var(--ink, #111); color: var(--on-ink, #fff); }
.bcos-section-ink.vx-sec .vx-lead, .bcos-section-ink.vx-sec .vx-empty, .bcos-section-ink.vx-sec .bcos-kicker { color: rgba(255,255,255,.72); }
.bcos-section-ink.vx-sec .vx-card, .bcos-section-ink.vx-sec .vx-w-box, .bcos-section-ink.vx-sec .vx-card-panel { color: var(--ink, #111); }
.bcos-section-ink.vx-sec .vx-kpi { background: rgba(255,255,255,.08); }
.bcos-section-ink.vx-sec .vx-kpi span { color: rgba(255,255,255,.7); }
.vx-item-main, .vx-item-side { min-width: 0; }
