/*
Theme Name: Paint Color Lab
Description: Lightweight theme for a paint colour database.
Version: 0.1.0
Requires PHP: 8.0
*/

:root {
  --ink: #1d1c1a;
  --ink-2: #5c5953;
  --line: #e4e1db;
  --paper: #ffffff;
  --paper-2: #f7f5f1;
  --accent: #2c5f8a;
  --radius: 10px;
  --wrap: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.6 var(--font); color: var(--ink); background: var(--paper); }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 .4rem; }
h2 { font-size: 1.45rem; margin: 2.2rem 0 .8rem; }
h3 { font-size: 1.1rem; margin: 1.4rem 0 .5rem; }
p { margin: 0 0 1rem; text-wrap: pretty; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }

/* Header / footer */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.logo { font-weight: 700; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo-mark { display: block; width: 30px; height: 30px; }
.nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: .95rem; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover { color: var(--accent); }
.site-footer { margin-top: 64px; border-top: 1px solid var(--line); background: var(--paper-2); padding: 32px 0; font-size: .9rem; color: var(--ink-2); }
.site-footer .cols { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.site-footer a { color: var(--ink-2); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 4px 0; }

/* Breadcrumbs */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; padding: 0; font-size: .875rem; color: var(--ink-2); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--ink-2); }

/* Swatch hero */
.swatch { border-radius: var(--radius); min-height: 260px; padding: 24px; display: flex; flex-direction: column; justify-content: flex-end; border: 1px solid rgba(0,0,0,.08); }
.swatch h1 { color: inherit; margin: 0; }
.swatch .sub { font-size: 1.05rem; opacity: .85; }
.lede { font-size: 1.1rem; margin: 20px 0; max-width: 70ch; }

/* Fact grid */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 20px 0; }
.fact { background: var(--paper); padding: 14px 16px; }
.fact dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.fact dd { margin: 4px 0 0; font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.fact dd small { font-weight: 400; color: var(--ink-2); font-size: .8rem; display: block; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); font-weight: 600; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.dot { width: 28px; height: 28px; border-radius: 6px; display: inline-block; vertical-align: middle; border: 1px solid rgba(0,0,0,.1); }

/* Cards grid */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); transition: box-shadow .15s; }
.card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.chip { height: 96px; display: block; box-shadow: inset 0 -1px 0 rgba(0,0,0,.08); }
.card-name { font-weight: 600; padding: 10px 12px 0; }
.card-meta { font-size: .8rem; color: var(--ink-2); padding: 2px 12px 12px; }

/* Room preview */
.room { margin: 0 0 8px; max-width: 760px; }
.room img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.room figcaption { margin-top: 8px; }
/* Colours close to the white page: a darker panel and a firm edge so the colour reads as a colour, not as blank space */
.swatch.is-light { border-color: rgba(0,0,0,.22); box-shadow: inset 0 0 0 1px rgba(255,255,255,.6), 0 2px 10px rgba(0,0,0,.08); }
.room.is-light { background: #E7E3DC; padding: 14px; border-radius: calc(var(--radius) + 6px); }
.room.is-light img { border-color: rgba(0,0,0,.18); box-shadow: 0 2px 12px rgba(0,0,0,.12); }

/* Notes */
.note { background: var(--paper-2); border-radius: var(--radius); padding: 14px 16px; font-size: .9rem; color: var(--ink-2); margin: 24px 0; }
.content { max-width: 72ch; }

/* Matcher */
.matcher { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--paper-2); }
.matcher label { font-weight: 600; display: block; margin-bottom: 6px; }
.matcher .row { display: flex; gap: 10px; flex-wrap: wrap; }
.matcher input[type=text] { flex: 1 1 260px; font: inherit; padding: 10px 12px; border: 1px solid #c9c5bd; border-radius: 8px; min-height: 44px; }
.matcher button { font: inherit; font-weight: 600; padding: 10px 18px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; min-height: 44px; }
.matcher button:hover { filter: brightness(1.1); }
.match-results { margin-top: 18px; }
.match-results .src { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.match-results .src .dot { width: 44px; height: 44px; }

/* Hero (home) */
.hero { padding: 40px 0 8px; }
.hero p { font-size: 1.15rem; color: var(--ink-2); max-width: 60ch; }
.stripes { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin: 18px 0 28px; }
.stripes i { flex: 1; }

.cover { margin: 0 0 20px; }
.cover img { width: 100%; height: auto; border-radius: 8px; display: block; }

/* Ad slots (only rendered once ads are on) */
.ad-slot { min-height: 280px; margin: 28px 0; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--paper); padding: 8px 12px; border-radius: 6px; }
@media (max-width: 600px) {
  body { font-size: 16px; }
  .swatch { min-height: 200px; }
}
