/* The design tokens. Every site (root, art, data, admin) starts from these; a site changes its look by overriding any of
   them in its own assets/themes/<site>.css (loaded after this file). Nothing below should hold a literal color. */
:root {
  --fg:#1c1c1e; --muted:#6b6b70; --muted-2:#8a8a90; --bg:#fff; --line:#e3e3e6;
  --brand-blue:#3172D1; --brand-purple:#6A2EB8; --accent:var(--brand-blue); --accent-dark:#2659A2; --on-accent:#fff;
  --select-bg:#E9F0FA; --hover-bg:#F1EBFA; --card-hover-bg:#f1ecf8;
  --panel-bg:#f4f4f6; --surface-alt:#f2f2f4; --row-hover:#f6f6f8; --badge-bg:#eee; --drag-bg:#eef0fb; --image-border:#000;
  --btn2-shadow:#c9d5e8; --btn2-hover:#eef3fa;
  --ok:#1a7f37; --ok-bg:#e6f4ea; --err:#b42318; --err-bg:#fdecea; --err-dark:#8a1b11; --remove-bg:#c62828; --remove-bg-hover:#a31515;
  --font-body:system-ui, -apple-system, "Segoe UI", sans-serif; --font-heading:var(--font-body);
  --radius:6px; --radius-lg:8px; --radius-card:10px;
  --sidebar-w:250px;
}
* { box-sizing: border-box; }
body { margin:0; font:16px/1.5 var(--font-body); color:var(--fg); background:var(--bg); }
a { color:var(--accent); }
h1, h2, h3 { font-family:var(--font-heading); }
h1, h2 { color:var(--brand-blue); }
.accent { color:var(--brand-purple); }
/* Page shell: left sidebar + content column */
.app { display:flex; flex-direction:column; min-height:100vh; }
.body { display:flex; flex:1; min-height:0; }
.sidebar { width:var(--sidebar-w); flex:none; align-self:stretch; display:flex; flex-direction:column; padding:8px 16px 20px; border-right:3px solid var(--brand-blue); background:var(--bg); }
.sidebar-nav { display:flex; flex-direction:column; gap:2px; margin-top:12px; }
.sidebar-nav a { display:block; padding:8px 12px; border-radius:var(--radius); color:var(--brand-blue); text-decoration:none; font-weight:700; }
.sidebar-nav a:hover { background:var(--hover-bg); color:var(--brand-purple); }
.sidebar-nav a.active { background:var(--select-bg); color:var(--brand-blue); font-weight:700; box-shadow:inset 4px 0 0 var(--brand-blue); }
.nav-sep { border:0; border-top:1px solid var(--line); margin:8px 4px; }
/* Unified menu: accordion sections (one open at a time, native <details name="nav">) */
.sidebar-nav summary { list-style:none; cursor:pointer; display:flex; justify-content:space-between; align-items:center; padding:8px 12px; border-radius:var(--radius); font-weight:700; color:var(--brand-blue); user-select:none; }
.sidebar-nav summary::-webkit-details-marker { display:none; }
.sidebar-nav summary:hover, .sidebar-nav details[open] > summary:hover { background:var(--hover-bg); color:var(--brand-purple); }
.sidebar-nav summary::after { content:""; width:7px; height:7px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(-45deg); transition:transform .15s; }
.sidebar-nav details[open] > summary::after { transform:rotate(45deg); }
.sidebar-nav details[open] > summary { color:var(--brand-blue); }
.sidebar-nav .sub { display:flex; flex-direction:column; gap:2px; margin:2px 0 6px 14px; padding-left:8px; border-left:2px solid var(--line); }
.sidebar-nav .sub a { padding:6px 12px; }
.topbar { display:flex; align-items:center; gap:24px; padding:10px 24px; min-height:70px; border-bottom:3px solid var(--brand-blue); background:var(--bg); }
.topbar .brand { display:block; flex:none; }
.topbar .brand-logo { height:50px; width:auto; display:block; }
.topbar-tabs { flex:1; display:flex; justify-content:center; gap:4px; }
.topbar-tabs a { padding:8px 20px; border-radius:var(--radius); color:var(--brand-blue); text-decoration:none; font-weight:700; }
.topbar-tabs a:hover { color:var(--brand-purple); background:var(--hover-bg); }
.topbar-tabs a.active { color:var(--brand-blue); background:var(--select-bg); box-shadow:inset 0 -3px 0 var(--brand-blue); border-radius:var(--radius) var(--radius) 0 0; }
.topbar-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; margin-left:auto; }
.tabs { display:flex; gap:4px; flex-wrap:wrap; border-bottom:1px solid var(--line); margin:16px 0 24px; }
.tabs a { padding:10px 18px; margin-bottom:-1px; border:1px solid transparent; border-radius:var(--radius) var(--radius) 0 0; color:var(--brand-blue); text-decoration:none; font-weight:700; }
.tabs a:hover { color:var(--fg); background:var(--panel-bg); }
.tabs a.active { color:var(--accent); background:var(--bg); border-color:var(--line); border-bottom-color:var(--bg); }
.settings { max-width:520px; }
.settings section { margin-bottom:32px; padding-bottom:8px; border-bottom:1px solid var(--line); }
.settings section:last-of-type { border-bottom:0; }
.settings h2 { font-size:1.15rem; margin:0 0 8px; }
.field-row { display:flex; flex-wrap:wrap; gap:12px; align-items:flex-end; }
.field-row .field { flex:1 1 140px; min-width:0; }
.field-row .btn { flex:none; margin-bottom:1px; }
label.check { display:flex; align-items:center; gap:8px; font-weight:400; }
.checklist { max-height:11em; overflow-y:auto; border:1px solid var(--line, #ccc); border-radius:var(--radius); padding:4px 10px; }
.checklist label.check { margin:6px 0; }
.small { font-size:.85rem; }
.nav-toggle { display:none; }
.nav-burger { display:block; padding:10px 6px 10px 0; cursor:pointer; }
.nav-burger span, .nav-burger span::before { display:block; width:24px; height:2px; background:var(--fg); position:relative; }
.nav-burger span::before { content:""; top:-7px; position:absolute; box-shadow:0 14px 0 var(--fg); }
@media (min-width:801px) { .nav-toggle:checked ~ .body .sidebar, .nav-toggle:checked ~ .sidebar { display:none; } } /* desktop: the menu is open by default; the burger hides it */
.content { flex:1; min-width:0; display:flex; flex-direction:column; }
main { flex:1; width:100%; max-width:1000px; margin:0; padding:24px 24px 64px; }
.narrow { max-width:380px; }
.nav-backdrop { display:none; }
@media (max-width:800px) {
  .body { flex-direction:column; }
  .topbar { position:sticky; top:0; z-index:30; flex-wrap:wrap; gap:6px 10px; padding:8px 16px; min-height:0; }
  .topbar-tabs { display:none; } /* on a phone, the logo leads to the root site and the cards there lead to the sections */
  .topbar-actions { margin-left:auto; }
  .topbar .brand-logo { height:36px; }
  .topbar-actions { flex-wrap:nowrap; gap:6px; }
  .topbar-actions .btn { padding:7px 11px; font-size:.9rem; white-space:nowrap; }
  .nav-burger { display:block; order:-1; padding:10px 6px 10px 0; cursor:pointer; }
  .nav-burger span, .nav-burger span::before { display:block; width:24px; height:2px; background:var(--fg); position:relative; }
  .nav-burger span::before { content:""; top:-7px; position:absolute; box-shadow:0 14px 0 var(--fg); }
  /* The menu slides in from the left over 80% of the page, below the header so the burger stays tappable. */
  .sidebar { position:fixed; top:var(--header-h, 70px); left:0; z-index:20; width:80%; height:calc(100vh - var(--header-h, 70px)); max-height:none; padding:8px 16px 20px;
             border-right:1px solid var(--line); box-shadow:2px 0 12px rgba(0,0,0,.2);
             transform:translateX(-100%); visibility:hidden; transition:transform .25s ease, visibility 0s linear .25s; }
  .nav-toggle:checked ~ .sidebar { transform:none; visibility:visible; transition:transform .25s ease, visibility 0s; }
  .nav-backdrop { display:block; position:fixed; top:var(--header-h, 70px); right:0; bottom:0; left:0; z-index:15; background:rgba(0,0,0,.35);
                  opacity:0; pointer-events:none; transition:opacity .25s ease; }
  .nav-toggle:checked ~ .nav-backdrop { opacity:1; pointer-events:auto; }
  main { padding:16px 16px 48px; }
}
.site-footer { text-align:center; color:var(--muted); padding:24px; border-top:1px solid var(--line); font-size:.9rem; }
.grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:24px; }
.card { text-decoration:none; color:inherit; }
.card img, .placeholder { width:100%; aspect-ratio:1; object-fit:cover; background:var(--surface-alt); border-radius:var(--radius-lg); display:block; }
.card h3 { margin:8px 0 0; font-size:1rem; }
.price { color:var(--muted); }
.product { display:grid; grid-template-columns:1fr 1fr; gap:32px; }
@media (max-width:700px) { .product { grid-template-columns:1fr; } }
.product img { width:100%; border-radius:var(--radius-lg); }
label { display:block; margin:12px 0 4px; font-weight:600; }
input, select, textarea { width:100%; padding:10px; border:1px solid var(--line); border-radius:var(--radius); font:inherit; }
input[type=radio], input[type=checkbox] { width:auto; }
.btn { display:inline-block; padding:7px 14px; background:var(--brand-blue); color:var(--on-accent); border:0; border-radius:var(--radius); font:inherit; font-weight:600; cursor:pointer; text-decoration:none; box-shadow:0 2px 0 var(--accent-dark), 0 2px 5px rgba(0,0,0,.18); transition:background .1s, transform .05s, box-shadow .05s; }
.btn:hover { background:var(--accent-dark); }
.btn:active { transform:translateY(2px); box-shadow:none; }
.btn.secondary { background:var(--bg); color:var(--brand-blue); border:1px solid var(--brand-blue); box-shadow:0 2px 0 var(--btn2-shadow), 0 2px 5px rgba(0,0,0,.1); }
.btn.secondary:hover { background:var(--btn2-hover); }
.btn:disabled { box-shadow:none; }
.btn.danger { background:var(--err); box-shadow:0 2px 0 var(--err-dark), 0 2px 5px rgba(0,0,0,.18); }
table { width:100%; border-collapse:collapse; }
th, td { text-align:left; padding:8px; border-bottom:1px solid var(--line); vertical-align:middle; }
td.num, th.num { text-align:right; }
.flash { padding:10px 14px; border-radius:var(--radius); margin-bottom:16px; }
.flash.success { background:var(--ok-bg); color:var(--ok); }
.flash.error { background:var(--err-bg); color:var(--err); }
.row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.totals { max-width:320px; margin-left:auto; }
.muted { color:var(--muted); }
.badge { padding:2px 8px; border-radius:var(--radius-card); background:var(--badge-bg); font-size:.85rem; }
.inline { display:inline; }
.inline input[type=number] { width:70px; }
/* Piece Gallery */
/* Each piece is a card (picture, title, and for the administrator the price and an Edit button). The cards wrap into
   rows of up to three, fewer on a narrower window; the minimum width is a third of the row so three is the maximum. */
.gallery-list { display:grid; grid-template-columns:repeat(auto-fill, minmax(max(190px, calc((100% - 32px) / 3)), 1fr)); gap:16px; }
@media (max-width:600px) { .gallery-list { grid-template-columns:1fr; } } /* phones: one piece per row */
.gallery-row { position:relative; display:flex; flex-direction:column; gap:10px; padding:12px; border:1px solid var(--line); border-radius:var(--radius-card); background:var(--bg); }
.gallery-row:hover { background:var(--card-hover-bg); border-color:var(--brand-purple); } /* a light tint of the brand purple */
.sq { position:relative; overflow:hidden; aspect-ratio:1; border-radius:var(--radius); background:var(--surface-alt); flex:none; }
.sq img { width:100%; height:100%; object-fit:cover; display:block; }
.gallery-thumb { display:block; width:100%; border:1px solid var(--image-border); }
.gallery-thumb .placeholder { width:100%; height:100%; aspect-ratio:auto; border-radius:0; }
.gallery-text { display:flex; flex-direction:column; align-items:flex-start; gap:4px; min-width:0; }
.gallery-text h2 { margin:0; font-size:1rem; font-weight:700; line-height:1.3; }
.gallery-text p { margin:0; color:var(--muted); }
/* /art Home: the left column holds one card per Theme Group (the group name on top, then a row of three thumbnails), stacked. */
.showcase-cards { display:grid; grid-template-columns:1fr; gap:16px; }
.showcase-card { gap:0; }
.showcase-card h3 { margin:0; font-size:1rem; } /* same size, weight and spacing as the service labels on the Data Home page (the text sits right under the label) */
.showcase-card h3 strong { font-weight:700; }
.showcase-card p { margin:0 0 8px; font-size:.9rem; }
.showcase-card p:last-child { margin-bottom:0; }
.info-card:hover { background:var(--bg); border-color:var(--line); } /* text-only cards are not links, so no hover tint */
.info-card p { font-size:1rem; color:var(--fg); }
.info-card .info-btn { align-self:flex-start; } /* button at the bottom of a text card */
.showcase-grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; }
.showcase-grid .sq { z-index:2; } /* above the card-wide heading link */
.home-app-name { display:flex; align-items:center; justify-content:center; background:var(--brand-blue); color:var(--on-accent); font-size:1.6rem; font-weight:700; text-decoration:none; }
.home-cards { grid-template-columns:1fr; } /* horizontal cards: one per row, picture square at the left */
.home-cards .gallery-row { flex-direction:row; align-items:center; gap:16px; }
.home-cards .gallery-thumb { width:120px; }
.home-cards .gallery-text { align-self:stretch; justify-content:center; }
.home-split .home-cards h2 { margin-top:0; margin-bottom:0; } /* undo the column's heading gap, which pushed the title down */
.home-cards .home-app-name { font-size:1.3rem; }
.gallery-text .row-edit { position:relative; z-index:2; margin-top:6px; } /* above the card-wide title link so it stays clickable */
.gallery-desc { flex:1; min-height:0; overflow:hidden; }
.gallery-meta { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:8px; }
.gallery-meta .tags { margin:0; }
.gallery-number { margin-left:auto; flex:none; font-size:.75rem; color:var(--muted-2); }
.row-link { color:var(--fg); text-decoration:none; }
.row-link::after { content:""; position:absolute; inset:0; }
.row-link:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.tags { display:flex; gap:6px; flex-wrap:wrap; }
.prose { max-width:70ch; }
/* Gallery admin */
.img-admin { display:grid; grid-template-columns:repeat(auto-fill, minmax(170px, 1fr)); gap:12px; margin:8px 0 16px; }
.img-admin figure { margin:0; padding:8px; border:1px solid var(--line); border-radius:var(--radius-lg); }
.img-admin figure.is-primary { border-color:var(--accent); box-shadow:0 0 0 2px var(--accent); }
.img-admin img { width:100%; aspect-ratio:1; object-fit:cover; border-radius:var(--radius); display:block; }
.img-admin label { margin:6px 0 0; font-weight:400; font-size:.9rem; }
.admin-form { max-width:none; } /* as wide as the page header above it */
.row3 { display:grid; grid-template-columns:repeat(3, 1fr); gap:12px; }
/* Piece editor: Title and Piece # on top; Year, Price and the picklists together below the text fields. */
.piece-top { grid-template-columns:150px 1fr; }
/* Three columns: Price, Year, Origin and Tradition (equal width) on the left, Product in the middle, Theme on the right.
   Product and Theme list all their values, with no scroll bar. */
.piece-cats { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:12px 24px; align-items:start; }
.piece-cats .checklist { max-height:none; overflow:visible; }
@media (max-width:800px) { .piece-cats { grid-template-columns:1fr; } }
@media (max-width:600px) { .piece-top { grid-template-columns:1fr; } }
@media (max-width:600px) { .row3 { grid-template-columns:1fr; } }
/* Gallery Pieces admin list: whole row clickable */
.admin-row { position:relative; display:flex; gap:14px; align-items:center; padding:10px 8px; border-bottom:1px solid var(--line); }
.admin-row:hover { background:var(--row-hover); }
.admin-row .sq { width:70px; border:1px solid var(--image-border); }
.admin-row .row-text { flex:1; min-width:0; }
.admin-row .title { font-weight:700; }
.admin-row .tags { margin:4px 0 0; }
.admin-list { border-top:1px solid var(--line); }/* Piece detail: thumbnail column + main image */
.piece-viewer { display:flex; gap:16px; align-items:flex-start; margin:8px 0 24px; }
.viewer-thumbs { display:flex; flex-direction:column; gap:10px; flex:none; width:84px; max-height:70vh; overflow-y:auto; padding:2px; }
.viewer-thumb { display:block; overflow:hidden; border:1px solid var(--image-border); background:var(--surface-alt); line-height:0; }
.viewer-thumb img { width:100%; aspect-ratio:1; object-fit:cover; display:block; }
.viewer-thumb.selected { outline:3px solid var(--accent); outline-offset:1px; }
.viewer-main { flex:0 1 auto; min-width:0; display:block; border:1px solid var(--image-border); line-height:0; }
.viewer-main img { width:auto; height:auto; max-width:100%; max-height:70vh; display:block; }
@media (max-width:600px) { .piece-viewer { flex-direction:column-reverse; } .viewer-thumbs { flex-direction:row; width:100%; max-height:none; overflow-x:auto; overflow-y:visible; } .viewer-thumb { width:72px; flex:none; } }
/* Toast: floats over the page (no layout shift), closable; success toasts fade out after 2 seconds via CSS */
.toast { position:fixed; top:16px; left:50%; transform:translateX(-50%); z-index:1000; display:flex; align-items:center; gap:14px; max-width:min(560px, 92vw); margin:0; box-shadow:0 4px 16px rgba(0,0,0,.18); }
.toast.success { animation:toast-out .3s ease 2s forwards; }
.toast-close { flex:none; background:none; border:0; padding:0 2px; font:inherit; font-size:1.4rem; line-height:1; color:inherit; cursor:pointer; }
@keyframes toast-out { to { opacity:0; visibility:hidden; } }
/* Page header with actions on the right */
.page-head { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.page-head h1 { margin:0; }
/* Names of records (detail pages) and of objects (list pages) sit in a light gray rounded box */
.page-head, h1.name-box { background:var(--panel-bg); border:1px solid var(--line); border-radius:var(--radius-lg); padding:6px 14px; margin:0 0 12px; }
h1.name-box { margin-top:0; }
.piece-head .page-head { background:none; border:0; padding:0; margin:0; }
.page-actions { display:flex; gap:8px; align-items:center; }
.tab-panel[hidden] { display:none; }/* Images tab of the piece editor: square editing frame on the left, thumbnail column on the right */
.edit-viewer { display:flex; gap:16px; align-items:flex-start; margin:20px 0 24px; }
.edit-main { flex:1; min-width:0; display:flex; gap:24px; align-items:flex-start; flex-wrap:wrap; }
/* Thumbnail framing: the whole picture with a movable, resizable square marking the thumbnail. */
.crop-wrap { flex:1; min-width:0; }
.crop-stage { position:relative; display:inline-block; max-width:100%; line-height:0; overflow:hidden; border:1px solid var(--image-border); touch-action:none; user-select:none; cursor:crosshair; }
.crop-stage img { display:block; max-width:100%; max-height:70vh; width:auto; height:auto; pointer-events:none; -webkit-user-drag:none; }
.crop-box { position:absolute; box-sizing:border-box; border:2px solid #fff; outline:1px solid var(--brand-blue); box-shadow:0 0 0 9999px rgba(0,0,0,.5); cursor:move; }
.crop-box[hidden] { display:none; }
.crop-grip { position:absolute; right:0; bottom:0; width:18px; height:18px; background:#fff; border:2px solid var(--brand-blue); box-sizing:border-box; cursor:nwse-resize; }
.add-images { margin:0 0 24px; }
.thumbs-col { flex:none; width:128px; }
.thumbs-col .viewer-thumbs { width:100%; }
.thumbs-col .add-row { margin:8px 2px 0; } /* the 2px side margins match the padding of the thumbnail list above */
.thumbs-col .add-row .drag-handle { visibility:hidden; }
.thumbs-col .add-row .btn { box-sizing:border-box; flex:1; min-width:0; width:100%; padding-left:0; padding-right:0; text-align:center; }
.thumbs-col .add-images { margin:6px 0 0; padding-left:2px; }
.add-status { display:block; font-size:.85rem; }
@media (max-width:600px) { .thumbs-col { width:100%; } }
button.viewer-thumb { position:relative; padding:0; cursor:pointer; width:100%; font:inherit; }
.thumb-badge { position:absolute; left:0; bottom:0; background:#000; color:#fff; font-size:.65rem; line-height:1.4; padding:0 5px; }
.edit-viewer[hidden], .edit-main[hidden], .viewer-thumbs[hidden], button.viewer-thumb[hidden], .thumb-badge[hidden] { display:none; }
@media (max-width:600px) { .edit-viewer { flex-direction:column; } .edit-viewer .viewer-thumbs { flex-direction:row; width:100%; max-height:none; overflow-x:auto; } .edit-viewer .viewer-thumb { width:72px; flex:none; } }
/* Editor thumbnails: a drag handle (same look as in Picklist Settings) to the left of each one. */
.thumb-row { display:flex; align-items:center; gap:6px; padding:0 6px 0 2px; } /* room for the selected thumbnail's 4px outline on both sides of the handle */
.thumb-row[hidden] { display:none; }
.thumb-wrap { position:relative; flex:1; min-width:0; }
.thumb-row .viewer-thumb { width:100%; }
/* Red X in the upper-right corner of a thumbnail, shown while the pointer is over it (always on touch screens). */
.thumb-x { position:absolute; top:3px; right:3px; width:20px; height:20px; padding:0; border:1px solid #fff; border-radius:3px; background:var(--remove-bg); color:#fff; font:700 16px/1 system-ui, sans-serif; cursor:pointer; display:none; z-index:2; }
.thumb-x:hover, .thumb-x:focus-visible { background:var(--remove-bg-hover); }
.thumb-wrap:hover .thumb-x, .thumb-wrap:focus-within .thumb-x { display:block; }
@media (hover:none) { .thumb-x { display:block; } }
.thumb-row .drag-handle { flex:none; padding:4px 4px; }
.thumb-row.dragging { opacity:.5; }
.thumb-row.dragging .drag-handle { cursor:grabbing; }
.edit-viewer .viewer-thumbs { width:128px; }
@media (max-width:600px) { .edit-viewer .viewer-thumbs { width:100%; } .thumb-row { flex:none; width:108px; } }
.steps { padding-left:1.4em; max-width:680px; }
.steps li { margin-bottom:12px; }
/* Gallery: owner-only Edit button on each list row (sits above the row's stretched link) */
/* Piece pages: the piece name + buttons in a light gray rounded box */
.piece-head { background:var(--panel-bg); border:1px solid var(--line); border-radius:var(--radius-lg); padding:5px 14px; margin:0 0 8px; }
.piece-head h1 { margin:0; font-size:1.5rem; }
/* Piece number and Origin / Product / Theme pills: one left-aligned row inside the header box */
.piece-meta { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-start; gap:8px; margin:2px 0 4px; }
.piece-meta .muted { margin-right:2px; }
/* Piece page header: the title row on the nav's selected-item blue, a light gray line, then the tags on white. */
.piece-head.split { background:var(--bg); padding:0; overflow:hidden; border-color:var(--brand-blue); margin-bottom:20px; } /* room between the panel and the page content below */
.piece-head.split .page-head { background:var(--select-bg); padding:8px 14px; border-radius:0; border-bottom:1px solid var(--brand-blue); } /* square corners: the halves abut */
.piece-head.split .piece-meta { margin:0; padding:10px 14px; align-items:flex-start; gap:10px 28px; }
/* Description on the left, Challenge on the right (view and edit pages); stacked on a narrow window. */
.two-col { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:0 28px; align-items:start; }
.two-col h2 { margin-top:1rem; }
@media (max-width:800px) { .two-col { grid-template-columns:1fr; } }
/* Piece # sits at the left of the blue title row, set off from the title by a thin blue line. */
.piece-head.split .page-head { padding:0 14px 0 0; align-items:stretch; box-sizing:border-box; min-height:57px; }  /* same row height on the Gallery list and every piece page */  /* no vertical padding here: the cells below carry it, so the line reaches the top and bottom borders */
.piece-head.split .head-main { display:flex; align-items:stretch; min-width:0; }
.piece-head.split .head-main h1 { align-self:center; padding:8px 0 8px 14px; }
.piece-head.split .page-head > .page-actions { align-self:center; margin:8px 0; }
.piece-number { display:flex; flex-direction:column; justify-content:center; padding:8px 14px; border-right:1px solid var(--brand-blue); }
.piece-number .meta-label { margin-bottom:0; line-height:1.2; }
.piece-number-value { font-size:.95rem; line-height:1.2; }
/* The highlights are equal-width columns, each with its name centered above its value(s). */
.piece-head.split .piece-meta { flex-wrap:wrap; }
.meta-field { flex:1 1 110px; min-width:0; text-align:center; }
.meta-label { display:block; margin-bottom:4px; font-size:.8rem; font-weight:700; }
.meta-values { display:flex; flex-wrap:wrap; justify-content:center; gap:6px; }
.piece-head.split .page-head:last-child { border-bottom:0; }

/* ---- Business Website additions ---- */
.table th, .table td { text-align:left; padding:8px 10px; border-bottom:1px solid var(--line); vertical-align:middle; }
.table th { font-size:.8rem; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.chip { padding:3px 10px; margin:0 4px 4px 0; border:1px solid var(--line); border-radius:999px; background:var(--bg); color:var(--muted); font:inherit; font-size:.85rem; cursor:pointer; }
.chip.on { background:var(--accent); border-color:var(--accent); color:#fff; }
.sections { grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); }
.grid.sections { grid-template-columns:1fr; gap:16px; }
.section-card { display:flex; padding:0; overflow:hidden; border:1px solid var(--brand-blue); border-radius:var(--radius-card); background:var(--select-bg); }
.section-card-path { flex:0 0 110px; display:flex; align-items:center; justify-content:center; background:var(--brand-blue); color:var(--on-accent); font-size:1.3rem; font-weight:700; }
.section-card-body { flex:1; display:flex; flex-direction:column; padding:0; line-height:1.35; }
.section-card-body h2 { padding:8px 16px; border-bottom:1px solid var(--brand-blue); background:var(--select-bg); }
.section-card-body p { flex:1; padding:8px 16px 10px; background:#fff; }
.section-card:hover { border-color:var(--brand-purple); }
.section-card h2 { margin:0; font-size:1.15rem; line-height:1.25; color:var(--accent); }
.section-card p { margin:0; color:var(--muted); }
.picklist { border:1px solid var(--line); border-radius:var(--radius-lg); padding:10px 14px; margin-bottom:12px; }
.picklist summary { cursor:pointer; }
.inline-input { width:auto; min-width:14em; }

/* Contact form honeypot: off-screen (not display:none, which some bots detect). People never see or reach it. */
.hp { position:absolute; left:-10000px; top:auto; width:1px; height:1px; overflow:hidden; }


.check-group { font-size:.8rem; font-weight:600; text-transform:uppercase; letter-spacing:.04em; color:var(--muted, #666); margin:10px 0 2px; }
.check-group:first-child { margin-top:4px; }
.gallery-row[hidden] { display:none; }

/* Gallery: filter column on the left (Amazon style), pieces on the right. On a phone the column folds above the
   list and the Show Filters button opens it. */
.gallery-layout { display:grid; grid-template-columns:210px minmax(0,1fr); gap:28px; align-items:start; }
.gallery-filters { padding-right:4px; }
.gallery-filters .filter-head { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:4px; }
.gallery-filters .link-button { background:none; border:0; padding:0; font:inherit; font-size:.9rem; color:var(--brand-blue); cursor:pointer; text-decoration:underline; }
.gallery-filters .link-button[hidden] { display:none; }
.filter-group { border-top:1px solid var(--line); margin:0; padding:10px 0 6px; min-width:0; }
.filter-group > summary { list-style:none; cursor:pointer; display:flex; align-items:center; gap:6px; font-weight:600; user-select:none; padding-bottom:4px; }
.filter-group > summary::-webkit-details-marker { display:none; }
.filter-group > summary::after { content:""; margin-left:auto; flex:none; width:7px; height:7px; border-right:2px solid var(--muted); border-bottom:2px solid var(--muted); transform:rotate(-135deg); transition:transform .15s; }
.filter-group:not([open]) > summary::after { transform:rotate(45deg); }
.filter-group:not([open]) { padding-bottom:10px; }
.filter-group:not([open]) > summary { padding-bottom:0; }
.filter-group > summary:focus-visible { outline:2px solid var(--brand-blue); outline-offset:2px; }
.filter-group .filter-count { font-weight:400; }
.filter-group label.check { margin:5px 0; }
.filter-num { margin-left:auto; flex:none; min-width:1.6em; text-align:center; font-size:.8rem; }  /* count pill, right-aligned */
.filter-num.zero { opacity:.45; }
.filter-group .check-group { margin:8px 0 2px; }
.filter-group .check-group:first-of-type { margin-top:4px; }
@media (max-width:800px) {
  .gallery-layout { grid-template-columns:1fr; gap:0; }
  .gallery-filters { display:none; margin-bottom:16px; }
  .gallery-filters.open { display:block; }
}
@media (min-width:801px) { #toggle-filters { display:none; } }

/* Price range filter (administrator only): two range inputs share one track. */
.price-fields { display:flex; align-items:center; gap:6px; margin:6px 0 8px; }
.price-input { display:flex; align-items:center; gap:3px; flex:1; min-width:0; margin:0; font-weight:400; }
.price-input input { width:100%; min-width:0; padding:6px 4px; text-align:right; -moz-appearance:textfield; }
.price-input input::-webkit-outer-spin-button, .price-input input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.price-range { position:relative; height:24px; }
.price-range .price-track, .price-range .price-fill { position:absolute; top:10px; height:4px; border-radius:2px; }
.price-range .price-track { left:0; right:0; background:var(--line); }
.price-range .price-fill { background:var(--brand-blue); }
.price-range input[type=range] { position:absolute; left:0; top:0; width:100%; height:24px; margin:0; padding:0; background:none; border:0; pointer-events:none; -webkit-appearance:none; appearance:none; }
.price-range input[type=range]::-webkit-slider-runnable-track { background:none; height:24px; }
.price-range input[type=range]::-moz-range-track { background:none; height:24px; }
.price-range input[type=range]::-webkit-slider-thumb { -webkit-appearance:none; pointer-events:auto; width:18px; height:18px; margin-top:3px; border-radius:50%; background:#fff; border:2px solid var(--brand-blue); cursor:grab; }
.price-range input[type=range]::-moz-range-thumb { pointer-events:auto; width:14px; height:14px; border-radius:50%; background:#fff; border:2px solid var(--brand-blue); cursor:grab; }
.price-range input[type=range]:focus-visible::-webkit-slider-thumb { outline:2px solid var(--brand-purple); outline-offset:2px; }
#clear-filters[hidden], #no-match[hidden] { display:none; }
/* Read-only until Edit: [data-editable] shows its .view-only parts, and its .edit-only parts once it has .editing */
[data-editable]:not(.editing) .edit-only { display:none; }
[data-editable].editing .view-only { display:none; }
.picklist-actions, .table td.picklist-actions { text-align:right; white-space:nowrap; }
.picklist-table .inline-input { min-width:9em; }
.picklist-table tr.editing td.picklist-actions .edit-only, .picklist-group-table tr.editing td.picklist-actions .edit-only { display:inline-flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
.picklist-table tr.editing td.picklist-actions .edit-only { max-width:9.5rem; } /* Save and Cancel side by side, Delete on a second line, so an editing row never outgrows the table */
.picklist-group-table { margin:8px 0 14px; }
.picklist-group-table select { width:auto; min-width:12em; }
.picklist-group-table td { vertical-align:middle; }
.picklist-table select { width:auto; }
.picklist-table td { vertical-align:middle; }
.picklist-table .drag-col, .picklist-group-table .drag-col { width:40px; min-width:40px; box-sizing:border-box; padding-left:6px; padding-right:4px; } /* same in both tables, so the group lines up with the Value column */
/* the rows are separated by horizontal lines and closed at both ends by a border; the header rows have no side borders */
.picklist-table tbody td:first-child, .picklist-table tfoot td:first-child, .picklist-group-table tbody td:first-child { border-left:1px solid var(--line); }
.picklist-table tbody td:last-child, .picklist-table tfoot td:last-child, .picklist-group-table tbody td:last-child { border-right:1px solid var(--line); }
/* hovering any row (value, Add row or group row) tints it with the brand purple, not gray (this overrides admin.css) */
.picklist-table tbody tr:hover, .picklist-table tfoot tr:hover, .picklist-group-table tbody tr:hover { background:var(--card-hover-bg); }
.drag-handle { cursor:grab; user-select:none; touch-action:none; color:var(--muted, #666); font-size:1.1rem; letter-spacing:-2px; padding:4px 6px; display:inline-block; }
.picklist-table tr.dragging { background:var(--drag-bg); box-shadow:0 2px 8px rgba(0,0,0,.15); }
.picklist-table tr.dragging .drag-handle { cursor:grabbing; }
.visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
/* About page portrait: floats right beside the text; full width above it on a phone */
.about-portrait { float:right; width:240px; height:auto; margin:0 0 16px 24px; border-radius:var(--radius-lg); box-shadow:0 3px 0 rgba(0,0,0,.12), 0 6px 14px rgba(0,0,0,.25); }
.home-split { display:grid; grid-template-columns:minmax(220px, 1fr) 2fr; gap:0 32px; align-items:start; }
.home-portrait { display:block; width:100%; height:auto; margin:0 0 8px; border-radius:var(--radius-lg); box-shadow:0 3px 0 rgba(0,0,0,.12), 0 6px 14px rgba(0,0,0,.25); }
.home-portrait-wrap { position:relative; margin:0 0 8px; container-type:inline-size; }
.home-portrait-wrap .home-portrait { margin:0; }
.home-portrait-name { position:absolute; left:0; right:0; bottom:0; padding:36px 8px 14px; border-radius:0 0 8px 8px; text-align:center; color:#fff;
  font-family:'Segoe Script','Lucida Handwriting','Brush Script MT','Apple Chancery',cursive; font-size:6.2cqi; white-space:nowrap; line-height:1.2; /* scales with the picture so the name stays on one line */
  background:linear-gradient(to top, rgba(0,0,0,.6), rgba(0,0,0,0)); text-shadow:0 1px 3px rgba(0,0,0,.7); }
.three-cols { display:grid; grid-template-columns:repeat(3, 1fr); gap:0 28px; }
@media (max-width:800px) { .three-cols { grid-template-columns:1fr; } }
.two-cols { display:grid; grid-template-columns:1fr 2fr; gap:0 28px; align-items:start; }
@media (max-width:800px) { .two-cols { grid-template-columns:1fr; } }
.two-cols > div > :first-child { margin-top:0; }
.plain-list { list-style:none; padding-left:0; }
.plain-list li { margin:0 0 .6em; }
.plain-list li > strong { display:block; }
.plain-list ul { list-style:disc; padding-left:1.4em; margin:.2em 0 0; } /* the examples keep their bullets */
.plain-list li li { margin:0; } /* the label sits on its own line, its text below */
.three-cols { margin-bottom:1.2em; }
.three-cols h2, .home-split > div > :first-child { margin-top:0; } /* grid items do not collapse margins: start flush under the header panel, as the Gallery does */
.tight-heads h2 { margin-bottom:.3em; }
.tight-heads h2 + p, .tight-heads h2 + ul { margin-top:0; } /* heading hugs its content */
.home-split h2 { margin-top:1.2em; }
.home-left h2 { margin-top:16px; }
@media (max-width:800px) { .home-split { grid-template-columns:1fr; } }
/* Tablets (601-800px): the menu is still a drawer, but there is room for the two-column Home layouts, so the picture stays a modest size */
@media (min-width:601px) and (max-width:800px) {
  .home-split { grid-template-columns:minmax(200px, 1fr) 2fr; }
  .two-cols { grid-template-columns:1fr 2fr; }
}
/* /art Home: Introduction, History and Contact as three equal columns (stacked on tablets and phones) */
.two-cols.three-cols { grid-template-columns:repeat(3, minmax(0, 1fr)); }
@media (max-width:800px) { .two-cols.three-cols { grid-template-columns:1fr; } }
.about-portrait.left { float:left; margin:0 24px 16px 0; }
@media (max-width:600px) { .about-portrait, .about-portrait.left { float:none; display:block; width:100%; max-width:360px; margin:0 auto 16px; } }

/* ---- Layout variants (chosen per site by 'layout' in core/section-list.php; the <body> carries layout-sidebar or layout-top) ----
   layout-sidebar is the default described above. layout-top turns the same menu into a horizontal bar under the header. */
@media (min-width:801px) {
  .layout-top .body { flex-direction:column; }
  .layout-top .nav-burger { display:none; }
  .layout-top .sidebar { width:auto; align-self:auto; flex-direction:row; padding:0 24px; border-right:0; border-bottom:1px solid var(--line); }
  .layout-top .sidebar-nav { flex-direction:row; align-items:stretch; flex-wrap:wrap; gap:4px; margin-top:0; }
  .layout-top .sidebar-nav a { padding:12px 18px; border-radius:var(--radius) var(--radius) 0 0; }
  .layout-top .sidebar-nav a.active { box-shadow:inset 0 -4px 0 var(--brand-blue); }
  .layout-top .nav-sep { border-top:0; border-left:1px solid var(--line); margin:8px 6px; }
}

/* ---- certification pages and forms (was data.css) ---- */
/* Loaded on /data pages (after core.css): tables, detail lists and forms used by the administrator's on-page tools. */
:root { --bg-alt: #f6f6f7; }
main table { margin: 1rem 0; }
main th, main td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
main th { color: var(--muted); font-weight: 600; font-size: .85rem; text-transform: uppercase; }
.actions { white-space: nowrap; }
.actions a, .actions button.link { margin-right: .75rem; }
form.stacked p { margin: 0 0 .9rem; }
form.stacked label { display: block; font-weight: 600; margin-bottom: .25rem; font-size: .9rem; }
form.stacked label.check { display: flex; font-weight: 400; }
form.stacked input, form.stacked select, form.stacked textarea { width: 100%; max-width: 420px; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 4px; font-size: 1rem; font-family: inherit; }
form.stacked input[type=checkbox] { width: auto; }
form.stacked textarea { max-width: 100%; }
button.link { background: none; border: none; padding: 0; color: var(--err); cursor: pointer; font-size: inherit; text-decoration: underline; width: auto; }
.empty { color: var(--muted); font-style: italic; }
.error { background: #fdecea; border: 1px solid var(--err); color: var(--err); padding: .6rem .8rem; border-radius: 4px; margin-bottom: 1rem; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; }
dl.detail { display: grid; grid-template-columns: 160px 1fr; gap: .4rem 1rem; margin: 1rem 0; }
dl.detail dt { color: var(--muted); font-size: .85rem; text-transform: uppercase; }
dl.detail dd { margin: 0; }
.related-box { background: var(--bg-alt); border: 1px solid var(--line); border-radius: 8px; padding: .25rem 1rem; margin-bottom: 1rem; }
.related-box table { margin: .75rem 0; }
.related-box .empty { margin: .75rem 0; }
/* Certification edit page: the same picture editor and form styles as the piece editor (core.css); only the field row is its own */
.cert-cats { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:0 24px; margin-top:8px; }
@media (max-width:800px) { .cert-cats { grid-template-columns:repeat(2, minmax(0,1fr)); } }
@media (max-width:600px) { .cert-cats { grid-template-columns:1fr; } }
.cert-public { margin-top:16px; }
/* List cards reuse the Gallery's card classes (core.css); the picture is framed by its thumbnail square like a piece's */
.cert-thumb { background:#fff; }

/* ---- this site's own overrides (was themes/data.css) ---- */
/* Look of salesforce.cmwagner.com (/data).
   Loaded after core.css (and after assets/data.css where that exists), only on this site, so anything here wins.
   Nothing is overridden yet, so the site looks exactly like core.css. Uncomment and edit what you want to change.

   1. Colors, fonts, corners: override the tokens defined at the top of core.css.
:root {
  --brand-blue:#3172D1;      main color: links, buttons, headings, menu text, header rule
  --brand-purple:#6A2EB8;    accent: menu hover text, card hover border
  --accent-dark:#2659A2;     button hover and button edge
  --select-bg:#E9F0FA;       selected menu item and title-panel top row
  --hover-bg:#F1EBFA;        menu hover background
  --bg:#fff;  --fg:#1c1c1e;  --muted:#6b6b70;  --line:#e3e3e6;
  --font-body:Georgia, serif;   --font-heading:Georgia, serif;
  --radius:6px;  --radius-lg:8px;  --radius-card:10px;
  --sidebar-w:250px;
}

   2. Menu position: set 'layout' => 'top' (or 'sidebar') for this site in core/section-list.php.
   3. Logo: set 'logo' in core/section-list.php (a path under assets/, e.g. img/artwork-logo.svg).
   4. Any rule: write it here; use  body.site-salesforce  in front of a selector to be explicit, e.g.
        body.site-salesforce .topbar { border-bottom-width:6px; }
   5. A completely different page structure: create sections/data/shell.php (see layout_custom_shell() in core/layout.php).
*/
