/* Statement Content — Storyboard Tracker
   Styling follows the Statement brand guide: Black / Charcoal / Bone / White,
   Arizona Flare for headings and body, Social Condensed (all caps) for small details. */

@font-face { font-family: "Arizona Flare"; src: url("/fonts/ABCArizonaFlare-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Arizona Flare"; src: url("/fonts/ABCArizonaFlare-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Social Condensed"; src: url("/fonts/ABCSocialCondensed-Light.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --black: #000; --charcoal: #2F2F2F; --bone: #F6F5F1; --white: #FFF;
  --hair: rgba(47, 47, 47, .18); --mute: rgba(47, 47, 47, .6);
  --pending: #B8B5AD; --submitted: #C4A24A; --needs_changes: #B4594A; --approved: #5F8B6A;
  --serif: "Arizona Flare", Optima, Candara, "Gill Sans", Georgia, serif;
  --caps: "Social Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --side: 300px; --gutter: 32px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bone); color: var(--charcoal);
  font: 300 16px/1.2 var(--serif); font-synthesis: none; text-align: left;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
[hidden] { display: none !important; }

/* Type */
.h-large { font: 400 48px/1 var(--serif); color: var(--black); text-transform: uppercase; margin: 0; overflow-wrap: anywhere; }
.h-small { font: 300 24px/1.1 var(--serif); color: var(--black); text-transform: uppercase; margin: 0; }
.caps, .btn, .link, label, select, .status, th {
  font: 400 12px/1.2 var(--caps); text-transform: uppercase; letter-spacing: .001em;
}
.mute { color: var(--mute); }
p { margin: 0 0 1em; }

/* Running header */
.run {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 20px var(--gutter); border-bottom: 1px solid var(--charcoal); background: var(--bone);
  position: sticky; top: 0; z-index: 20;
}
.run .logo { display: block; padding: 2px 0; }
.run .logo img { height: 15px; width: auto; }
.run nav { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* Page: text column, thin rule, content — as in the guide's layouts */
.page { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: calc(100vh - 60px); }
.side { padding: var(--gutter); }
.side-in { position: sticky; top: 92px; display: grid; gap: 28px; }
.main { border-left: 1px solid var(--charcoal); padding: var(--gutter); min-width: 0; }
.stack { display: grid; gap: 8px; justify-items: start; }

/* Buttons and links */
.btn {
  display: inline-block; padding: 12px 18px; border: 1px solid var(--charcoal); background: transparent;
  color: var(--charcoal); cursor: pointer; text-decoration: none; border-radius: 0; font-size: 13px;
}
.btn:hover { background: var(--charcoal); color: var(--white); }
.btn.solid { background: var(--black); border-color: var(--black); color: var(--white); }
.btn.solid:hover { background: var(--charcoal); }
.btn[disabled] { opacity: .35; pointer-events: none; }
.link { background: none; border: 0; padding: 0; color: var(--charcoal); cursor: pointer; text-decoration: none; border-bottom: 1px solid transparent; }
.link:hover, .link.on { border-bottom-color: var(--charcoal); }
.link.danger:hover { color: var(--needs_changes); border-bottom-color: var(--needs_changes); }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px 14px; }

/* Forms */
label { display: block; color: var(--mute); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], textarea {
  width: 100%; font: 300 16px/1.2 var(--serif); color: var(--charcoal); background: transparent;
  border: 0; border-bottom: 1px solid var(--hair); border-radius: 0; padding: 6px 0; outline: none; resize: none;
}
input:focus, textarea:focus { border-bottom-color: var(--charcoal); }
textarea { overflow: hidden; display: block; }
::placeholder { color: rgba(47, 47, 47, .38); }
select {
  appearance: none; background: transparent; border: 0; border-bottom: 1px solid var(--hair); border-radius: 0;
  padding: 6px 16px 6px 0; color: var(--charcoal); cursor: pointer; outline: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--charcoal) 50%), linear-gradient(135deg, var(--charcoal) 50%, transparent 50%);
  background-position: calc(100% - 5px) 55%, 100% 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
.field { margin-bottom: 20px; }

/* Status */
.status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pending); flex: none; }
.dot.submitted { background: var(--submitted); } .dot.needs_changes { background: var(--needs_changes); } .dot.approved { background: var(--approved); }

/* Summary */
.summary { display: grid; gap: 14px; }
.summary .pct { font: 400 48px/1 var(--serif); color: var(--black); }
.bar { height: 1px; background: var(--hair); position: relative; }
.bar i { position: absolute; left: 0; top: -1px; height: 3px; background: var(--black); }
.counts { display: grid; gap: 6px; }
.counts button { display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: 0; padding: 3px 0; cursor: pointer; color: inherit; border-bottom: 1px solid transparent; }
.counts button.on { border-bottom-color: var(--charcoal); }

/* Sections */
.section { margin-bottom: 64px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--charcoal); scroll-margin-top: 92px; }
.group-head { padding: 28px 0 10px; border-bottom: 1px solid var(--hair); display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.empty { padding: 28px 0; color: var(--mute); }

/* Admin item rows */
.item { display: grid; grid-template-columns: 64px 420px minmax(180px, 1fr) 150px; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--hair); align-items: start; }
.item .code { font: 400 24px/1.1 var(--serif); color: var(--black); }
.item input.code { padding: 0 0 4px; border-bottom-color: transparent; }
.item input.code:hover { border-bottom-color: var(--hair); }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.slot .frame {
  aspect-ratio: 16 / 9; background: var(--white); border: 1px solid var(--hair); position: relative;
  display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; width: 100%; padding: 0;
}
.slot .frame img { width: 100%; height: 100%; object-fit: contain; }
.slot.empty-slot .frame { background: transparent; border-style: dashed; color: var(--mute); }
.slot.locked .frame { cursor: default; }
.slot.drop .frame { border: 1px solid var(--black); background: var(--white); }
.slot.archived .frame img { opacity: .3; }
.slot.busy .frame::after { content: "UPLOADING"; position: absolute; inset: 0; background: rgba(246, 245, 241, .88); display: flex; align-items: center; justify-content: center; font: 400 12px/1.2 var(--caps); }
.slot .cap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 6px; padding-top: 6px; }
.slot .cap > * { white-space: nowrap; }
.item .text { display: grid; gap: 10px; }
.item .text .notes { font-size: 14px; }
.client-note { border-left: 1px solid var(--charcoal); padding-left: 10px; font-size: 14px; }
.item .state { display: grid; gap: 12px; justify-items: start; }
.item .state .status-wrap { display: flex; align-items: center; gap: 7px; }
.history { grid-column: 2 / -1; background: var(--white); padding: 16px 20px; display: grid; gap: 14px; }
.history ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.history li { display: grid; grid-template-columns: 150px 60px 1fr; gap: 12px; font-size: 14px; }
.versions { display: flex; gap: 10px; flex-wrap: wrap; }
.versions button { width: 96px; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; color: inherit; }
.versions img { aspect-ratio: 16 / 9; object-fit: contain; background: var(--bone); width: 100%; }

/* Projects list */
.projects { width: 100%; border-collapse: collapse; }
.projects th { text-align: left; color: var(--mute); padding: 0 16px 10px 0; border-bottom: 1px solid var(--charcoal); font-weight: 400; }
.projects td { padding: 20px 16px 20px 0; border-bottom: 1px solid var(--hair); vertical-align: top; }
.projects .name { font: 300 24px/1.1 var(--serif); color: var(--black); text-transform: uppercase; text-decoration: none; }
.projects .name:hover { border-bottom: 1px solid var(--black); }
.projects .prog { min-width: 140px; display: grid; gap: 8px; }

/* Client dashboard */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 36px 24px; padding-top: 24px; }
.card { display: grid; gap: 8px; align-content: start; }
.card .frame { aspect-ratio: 16 / 9; background: var(--white); border: 0; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--mute); width: 100%; }
.card .frame img { width: 100%; height: 100%; object-fit: contain; }
.card .frame.none { cursor: default; background: transparent; border: 1px dashed var(--hair); }
.card .meta { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.card .desc { font-size: 14px; }

/* Client selection */
.review { max-width: 1500px; margin: 0 auto; padding: var(--gutter); }
.review-top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--charcoal); }
.review-title { padding: 28px 0 24px; display: grid; gap: 10px; max-width: 900px; }
.options { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 24px; }
.option { display: grid; gap: 8px; align-content: start; }
.option .frame { background: var(--white); border: 0; padding: 0; cursor: pointer; outline: 1px solid transparent; outline-offset: 5px; width: 100%; }
.option .frame img { width: 100%; height: auto; max-height: 68vh; object-fit: contain; }
.option.sel .frame { outline: 2px solid var(--black); }
.option.dim .frame img { opacity: .45; }
.option .cap { display: flex; justify-content: space-between; gap: 10px; }
.decide { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--hair); display: grid; gap: 16px; max-width: 720px; }
.decide .btns { display: flex; gap: 12px; flex-wrap: wrap; }
.done { padding: 80px 0; display: grid; gap: 24px; justify-items: start; }

/* Login */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 32px; }
.gate form { width: min(340px, 100%); display: grid; gap: 28px; }
.gate .logo { width: 220px; margin: 28px 0 44px; }
.msg { min-height: 1.2em; color: var(--needs_changes); }

/* Dialog, lightbox, toast */
dialog { border: 1px solid var(--charcoal); border-radius: 0; background: var(--bone); color: var(--charcoal); padding: 32px; width: min(460px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
dialog .h-small { margin-bottom: 20px; }
dialog .btns { display: flex; gap: 12px; margin-top: 28px; }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .94); z-index: 50; display: grid; grid-template-rows: auto 1fr auto; color: var(--white); }
.lightbox .bar-top, .lightbox .bar-bot { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 24px; }
.lightbox .link { color: var(--white); } .lightbox .link:hover { border-bottom-color: var(--white); }
.lightbox .stage { min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 24px; }
.lightbox .stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--black); color: var(--white); padding: 12px 18px; z-index: 60; max-width: calc(100vw - 32px); }

/* Smaller screens */
@media (max-width: 1180px) {
  .item { grid-template-columns: 56px minmax(0, 1fr) 140px; }
  .item .slots { grid-column: 2 / -1; grid-row: 2; }
  .item .text { grid-column: 2; grid-row: 1; }
  .item .state { grid-column: 3; grid-row: 1; }
  .history { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  :root { --gutter: 20px; }
  .h-large { font-size: 36px; } .h-small { font-size: 18px; }
  .run { padding: 16px var(--gutter); } .run .logo img { height: 12px; }
  .run .sec { display: none; }
  .page { grid-template-columns: 1fr; }
  .side-in { position: static; }
  .main { border-left: 0; border-top: 1px solid var(--charcoal); }
  .section-head { scroll-margin-top: 70px; }
  .item { grid-template-columns: 48px minmax(0, 1fr); gap: 14px; }
  .item .state { grid-column: 2; grid-row: 2; grid-auto-flow: column; align-items: center; justify-content: space-between; justify-items: stretch; }
  .item .slots { grid-column: 1 / -1; grid-row: 3; }
  .history li { grid-template-columns: 1fr; gap: 2px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; }
  .options { grid-template-columns: 1fr; gap: 28px; }
  .option .frame img { max-height: none; }
  .projects thead { display: none; }
  .projects td { display: block; border: 0; padding: 6px 0; }
  .projects tr { display: block; padding: 18px 0; border-bottom: 1px solid var(--hair); }
  .decide .btn { flex: 1 1 auto; text-align: center; }
}
