/* ============================================================
   Defect & Appearance Gallery — shared styles for the index and
   entry pages generated by scripts/build-defect-gallery.mjs.
   Extends the site tokens in /styles.css; never forks them.
   ============================================================ */

.dg-wrap { max-width: 1000px; margin-inline: auto; }
.dg-crumb { display: flex; gap: 8px; color: var(--text-3); font-size: .85rem; padding-top: 26px; }
.dg-crumb a { color: var(--text-3); }
.dg-crumb a:hover { color: var(--accent-hot); }

.dg-hero { padding-block: clamp(22px, 4vh, 40px) 8px; }
.dg-hero .eyebrow { margin-bottom: 14px; }
.dg-hero h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.2rem, 5.2vw, 3.6rem); line-height: .95; margin-bottom: 14px; }
.dg-hero h1 .hl { color: var(--accent); }
.dg-hero p { color: var(--text-2); font-size: 1.1rem; max-width: 64ch; line-height: 1.55; }

/* ---- verdict badges ---- */
.dg-badge { display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.dg-badge.accept    { background: rgba(200,216,168,.15); color: var(--zinc);      border: 1px solid rgba(200,216,168,.5); }
.dg-badge.repairable{ background: rgba(232,99,10,.15);   color: var(--accent-hot); border: 1px solid rgba(232,99,10,.5); }
.dg-badge.reject    { background: rgba(220,60,40,.15);   color: #ff8674;          border: 1px solid rgba(220,60,40,.55); }
.dg-badge.notdefect { background: rgba(46,74,106,.3);    color: #8fb4dd;          border: 1px solid rgba(90,140,190,.5); }

/* ---- index ---- */
.dg-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 34px; }
.dg-filter-label { color: var(--zinc); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.dg-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.dg-chip { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: #0b0e13; color: var(--text-2); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.dg-chip:hover { border-color: var(--zinc-dim); }
.dg-chip.on { border-color: var(--accent); background: rgba(232,99,10,.14); color: #fff; }

.dg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-top: 22px; }
.dg-card { display: block; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; transition: border-color .18s var(--ease), transform .18s var(--ease); }
.dg-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.dg-card figure { margin: 0; aspect-ratio: 3 / 2; background: #0b0e13; }
/* <picture> is display:inline by default — without this the card img's height:100%
   has no sized parent to resolve against and only works by accident. */
.dg-card picture, figure.dg-hero picture { display: block; width: 100%; height: 100%; }
.dg-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* portrait sources (phone shots) crop from the centre by default, which can cut the
   defect out of a 3:2 card — bias to the top where the subject usually sits. */
.dg-card img.portrait-src { object-position: center top; }
.dg-card-body { padding: 18px 20px 22px; }
/* Non-linked teasers for entries awaiting their plant photo. Divs, not anchors —
   their pages do not exist on the live server. Muted so they read as pipeline,
   not as broken links. */
.dg-card-soon { cursor: default; opacity: .75; }
.dg-card-soon:hover { border-color: var(--line); transform: none; }
.dg-soon-tile { width: 100%; height: 100%; display: grid; place-items: center; background: repeating-linear-gradient(135deg, #0b0e13, #0b0e13 14px, #10141b 14px, #10141b 28px); color: var(--text-3); font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; }
.dg-badge.soon { background: rgba(174,183,197,.12); color: var(--text-3); border: 1px solid var(--line); }
.dg-card-body h2 { font-size: 1.15rem; color: var(--text); margin: 10px 0 6px; line-height: 1.3; }
.dg-card-body p { color: var(--text-2); font-size: .9rem; line-height: 1.5; }

.dg-empty { background: var(--bg-2); border: 1px dashed var(--line); border-radius: var(--r-lg); padding: 34px 30px; margin-top: 30px; text-align: center; }
.dg-empty b { color: var(--text); font-size: 1.1rem; display: block; margin-bottom: 8px; }
.dg-empty p { color: var(--text-3); font-size: .95rem; max-width: 60ch; margin-inline: auto; line-height: 1.6; }

/* ---- draft preview banner (never shown on a published entry) ---- */
.dg-draft { background: rgba(232,99,10,.1); border: 1px solid var(--accent); border-radius: var(--r); padding: 16px 20px; margin-top: 20px; color: var(--text-2); font-size: .88rem; line-height: 1.6; }
.dg-draft b { color: var(--accent-hot); }
.dg-draft code { background: #0b0e13; border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; font-size: .85em; color: var(--zinc); }
.dg-draft-state { display: block; margin-top: 8px; color: var(--text); font-weight: 600; }

/* ---- entry ---- */
.dg-entry { max-width: 820px; margin: 0 auto; padding-bottom: 20px; }
.dg-head { padding-block: clamp(20px, 4vh, 36px) 0; }
.dg-head h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: .98; margin: 12px 0 6px; }
.dg-aka { color: var(--text-3); font-size: .9rem; }

.dg-hero-img, .dg-hero { margin: 0; }
figure.dg-hero { margin: 22px 0 0; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: #0b0e13; }
figure.dg-hero img { width: 100%; height: auto; display: block; }

/* Optional context shot — _photo_spec's "1 hero close-up + optionally 1 context
   shot". Deliberately subordinate to the hero: narrower, quieter border, captioned.
   It answers "where was this?", so it must not compete with the defect close-up. */
figure.dg-context { margin: 14px 0 0; max-width: 70%; }
/* min() not a bare 340px: the cap must hold at EVERY width. The mobile rule below
   deliberately does not touch .portrait — a portrait shot released to 100% on a
   600px screen renders taller than the viewport and buries the text under it, so
   it would have grown as the screen shrank. .dg-context.portrait (0-2-1) outranks
   .dg-context (0-1-1) and media queries add no specificity, so this survives it. */
figure.dg-context.portrait { max-width: min(340px, 100%); }
figure.dg-context picture { display: block; }
figure.dg-context img {
  width: 100%; height: auto; display: block;
  border-radius: var(--r); border: 1px solid var(--line); background: #0b0e13;
}
figure.dg-context figcaption {
  margin-top: 8px; color: var(--text-3); font-size: .85rem; line-height: 1.5; font-style: italic;
}
@media (max-width: 640px) {
  figure.dg-context { max-width: 100%; }
}
.dg-nophoto { margin-top: 22px; border: 1px dashed var(--accent); border-radius: var(--r-lg); background: rgba(232,99,10,.06); color: var(--accent-hot); font-weight: 700; font-size: .92rem; padding: 34px 24px; text-align: center; line-height: 1.6; }
.dg-nophoto code { background: #0b0e13; border: 1px solid var(--line); border-radius: 4px; padding: 2px 7px; color: var(--zinc); font-weight: 400; }
.dg-nophoto small { display: block; margin-top: 10px; color: var(--text-3); font-weight: 400; font-style: italic; }

.dg-sec { margin-top: clamp(26px, 4vh, 38px); }
.dg-sec h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.4rem, 3vw, 1.9rem); color: var(--text); margin-bottom: 12px; }
.dg-sec p { color: var(--text-2); font-size: 1.02rem; line-height: 1.7; }

.dg-verdict { background: var(--bg-2); border: 1px solid var(--zinc-dim); border-left: 3px solid var(--accent); border-radius: var(--r-lg); padding: 24px 26px; }
.dg-acc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dg-acc-std { display: block; color: var(--zinc); font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 7px; }
.dg-acc-grid p, .dg-acc-combined p { color: var(--text-2); font-size: .96rem; line-height: 1.6; }
.dg-verdict-note { color: var(--text-3); font-size: .85rem; font-style: italic; margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }

.dg-refs { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.dg-refs li { background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; color: var(--text-2); font-size: .85rem; font-weight: 600; }
.dg-ip { color: var(--text-3); font-size: .82rem; line-height: 1.6; margin-top: 14px; }
.dg-ip a { color: var(--accent-hot); }

.dg-links { display: flex; flex-direction: column; gap: 9px; }
.dg-links a { display: block; background: var(--bg-2); border: 1px solid var(--line); border-radius: 11px; padding: 14px 18px; color: var(--text-2); font-size: .95rem; font-weight: 600; transition: border-color .15s var(--ease), color .15s var(--ease); }
.dg-links a:hover { border-color: var(--accent); color: #fff; }

@media (max-width: 640px) {
  .dg-acc-grid { grid-template-columns: 1fr; gap: 16px; }
}
