/* Harbor › Library (public/library.mjs). Story-mode look from play-theme.css tokens (ink, cream, sun, Anton),
   with fallbacks for other shells. Phone first: one column at 390px, two from 640px, three from 1100px. */
.lib { display: grid; gap: 18px; min-width: 0; }

.lib-head { display: grid; gap: 10px; padding: 26px 24px 24px; border-radius: 26px; box-shadow: inset 0 0 0 2px var(--ink, #16130a); }
.lib-head .gc-kicker { margin: 0; }
.lib-h1 { margin: 0; font-size: clamp(34px, 6vw, 58px); line-height: .95; overflow-wrap: anywhere; }
.lib-sub { margin: 0; max-width: 60ch; font-size: 15.5px; line-height: 1.5; color: var(--ink-2, rgb(22 19 10 / 72%)); }

.lib-preview { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; padding: 12px 16px;
  border-radius: 18px; background: var(--cream, #fffbe6); border: 2px dashed var(--ink, #16130a); }
.lib-preview-text { margin: 0; flex: 1 1 260px; font-size: 14.5px; line-height: 1.45; }
.lib-preview-done { font-size: 13.5px; font-weight: 700; color: var(--green, #167a43); }

.lib-tabs { margin: 0; }
.lib-count { display: inline-flex; min-width: 20px; justify-content: center; padding: 0 6px; border-radius: 999px; background: var(--ink, #16130a); color: var(--sun, #ffe14a); font-size: 11px; font-weight: 800; line-height: 18px; }
.lib-body { display: grid; gap: 22px; min-width: 0; }
.lib-collection { display: grid; gap: 12px; }
.lib-h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; line-height: 1.2; }

.lib-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .lib-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.lib-card { position: relative; display: grid; gap: 8px; align-content: start; padding: 10px 10px 16px; border: 0; border-radius: 22px; background: #fff; text-align: left; color: inherit; font: inherit;
  box-shadow: inset 0 0 0 1px var(--line, rgb(22 19 10 / 10%)), var(--shadow-card, 0 10px 24px -18px rgb(0 0 0 / 50%)); transition: transform .18s var(--spring, ease), box-shadow .18s; }
.lib-card:hover, .lib-card:focus-within { transform: translateY(-2px) rotate(-.3deg); box-shadow: inset 0 0 0 2px var(--ink, #16130a), 6px 6px 0 var(--ink, #16130a); }
/* The card opens the sheet; Download sits under it as its own link (a link can't live inside a button). */
.lib-open { display: grid; gap: 8px; align-content: start; min-width: 0; padding: 0; border: 0; background: none; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.lib-open:focus-visible { outline: 3px solid var(--ink, #16130a); outline-offset: 4px; border-radius: 16px; }
.lib-card-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 4px 0; }
.lib-dl { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--cream, #fffbe6); color: var(--ink, #16130a);
  font-size: 14.5px; font-weight: 800; text-decoration: none; box-shadow: inset 0 0 0 1.5px var(--ink, #16130a); }
.lib-dl:hover, .lib-dl:focus-visible { background: var(--sun, #ffe14a); outline: none; }
.lib-dl svg, .lib-get-btn svg { flex: none; }
.lib-card.is-draft { box-shadow: inset 0 0 0 2px var(--hot, #ff5c8a); }
/* The frame is the media's own shape (thumbMediaHtml): a vertical video gets a vertical frame, never a square or a crop.
   Tall ones are capped by height and centered in the card. */
.lib-thumb { position: relative; display: block; width: fit-content; max-width: 100%; margin-inline: auto; border-radius: 16px; background: var(--ink, #16130a); overflow: hidden; }
.lib-thumb-media { display: block; width: auto; max-width: 100%; height: auto; max-height: min(68svh, 600px); aspect-ratio: auto 9 / 16; }
.lib-thumb--blank { width: 100%; aspect-ratio: 16 / 9; }
.lib-thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(0 0 0 / 0) 55%, rgb(0 0 0 / 45%)); }
/* Play sits in the bottom corner, not the middle: our covers put their headline in the middle (Andy's screenshot, 2026-10-10). */
.lib-play { position: absolute; left: 12px; bottom: 12px; z-index: 1; width: 50px; height: 50px; border-radius: 50%; background: var(--sun, #ffe14a); box-shadow: 0 0 0 3px var(--ink, #16130a), 0 12px 26px -10px rgb(0 0 0 / 70%); }
.lib-play::before { content: ''; position: absolute; left: 19px; top: 15px; border-left: 15px solid var(--ink, #16130a); border-top: 10px solid transparent; border-bottom: 10px solid transparent; }
.lib-dur { position: absolute; right: 12px; bottom: 26px; z-index: 1; padding: 2px 8px; border-radius: 999px; background: rgb(0 0 0 / 70%); color: #fff; font-size: 12px; font-weight: 800; }
.lib-stickers { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px; }
.lib-title { padding: 0 4px; font-size: 16.5px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.lib-summary { padding: 0 4px; font-size: 14px; line-height: 1.45; color: var(--ink-2, rgb(22 19 10 / 72%));
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; } /* the sheet shows all of it */
.lib-card--soon { cursor: default; background: var(--cream, #fffbe6); box-shadow: inset 0 0 0 2px dashed var(--ink, #16130a); border: 2px dashed var(--ink, #16130a); }
.lib-card--soon:hover { transform: none; box-shadow: none; }
.lib-thumb--soon { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; background: var(--grape-soft, #ece6ff); }
.lib-thumb--soon::after { display: none; }
.lib-thumb--soon img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink, #16130a); }

.lib-empty { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; padding: 20px 22px; }
.lib-empty img { width: 72px; height: 72px; }
.lib-empty p { margin: 0; font-size: 15px; line-height: 1.5; }

/* The item sheet */
.lib-sheet { display: grid; gap: 14px; }
/* The player hugs the video: its frame is the video's own shape (vertical stays vertical), centered in the sheet. */
.lib-video { display: block; width: auto; max-width: 100%; height: auto; max-height: 70svh; margin-inline: auto; border-radius: 16px; background: #000; object-fit: contain; }
.lib-video:fullscreen { border-radius: 0; object-fit: contain; }
.lib-video:-webkit-full-screen { border-radius: 0; object-fit: contain; }
.lib-audio { width: 100%; }
.lib-image { display: block; width: 100%; border-radius: 16px; }
.lib-ai-note { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--cream, #fffbe6); font-size: 13.5px; line-height: 1.45; }
.lib-sheet-summary { margin: 0; font-size: 15px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
/* Download / Download cover / Share under the player: thumb-sized, wrap on a phone. */
.lib-get { display: flex; flex-wrap: wrap; gap: 10px; }
.lib-get-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; white-space: nowrap; text-decoration: none; }
.lib-get-hint { margin: -4px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink-3, rgb(22 19 10 / 60%)); }
.lib-get-btn[hidden] { display: none; }
@media (max-width: 600px) { .lib-get-btn { flex: 1 1 140px; } }
.lib-ads-line { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lib-ads-link { justify-self: start; font-size: 14.5px; font-weight: 800; color: inherit; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--sun, #ffe14a); }
.lib-answer { display: grid; gap: 10px; }
.lib-answer-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.lib-ask { display: grid; gap: 10px; }
.lib-answered { margin: 0; font-size: 14px; font-weight: 700; }
.lib-operator { display: grid; gap: 8px; padding-top: 6px; border-top: 1px dashed var(--line, rgb(22 19 10 / 18%)); }

/* Elcano (AI) on Home */
.lib-home-slot:empty { display: none; }
.lib-home-slot { margin: 0 8px 26px 0; } /* room for the card's 8px sun shadow, so it never touches the greeting under it */
.lib-elcano { display: grid; gap: 14px; padding: 20px 22px; box-shadow: inset 0 0 0 2px var(--ink, #16130a), 8px 8px 0 var(--sun, #ffe14a); }
.lib-elcano-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; }
.lib-elcano-head .gc-kicker { margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lib-elcano-title { margin: 0; font-size: clamp(22px, 3.6vw, 32px); line-height: 1; overflow-wrap: anywhere; }
.lib-tasks { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.lib-task { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; }
.lib-check { width: 30px; height: 30px; margin-top: 1px; border-radius: 50%; border: 2.5px solid var(--ink, #16130a); background: #fff; cursor: pointer; position: relative; }
.lib-check[aria-pressed='true'] { background: var(--green, #167a43); border-color: var(--green, #167a43); }
.lib-check[aria-pressed='true']::after { content: ''; position: absolute; left: 8px; top: 3px; width: 8px; height: 14px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.lib-check:disabled { cursor: not-allowed; opacity: .6; }
.lib-task-text { display: grid; gap: 2px; font-size: 15.5px; line-height: 1.4; }
.lib-task-text a { font-weight: 800; color: inherit; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--sun, #ffe14a); }
.lib-task-text > span { font-size: 13.5px; color: var(--ink-2, rgb(22 19 10 / 72%)); }
.lib-task.is-done .lib-task-text { opacity: .55; text-decoration: line-through; }
.lib-caught-up { margin: 0; font-weight: 700; }
.lib-new { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--cream, #fffbe6); color: inherit; text-decoration: none; box-shadow: inset 0 0 0 1.5px var(--ink, #16130a); }
.lib-new strong { display: block; font-size: 15.5px; }
.lib-new span span { font-size: 13.5px; font-weight: 700; }
.lib-stack { display: flex; flex: none; }
.lib-stack-img { width: 40px; height: 50px; margin-right: -12px; border-radius: 8px; background: var(--ink, #16130a) center / cover; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--ink, #16130a); transform: rotate(-4deg); }
.lib-stack-img:nth-child(2) { transform: rotate(3deg); }
.lib-stack-img:last-child { margin-right: 6px; }

@media (prefers-reduced-motion: reduce) {
  .lib-card, .lib-card:hover { transition: none; transform: none; }
  .lib-stack-img { transform: none; }
}

/* "Send us your photos and videos" (public/harbor-uploads.mjs): one big button under the header; opens HQ's upload page. */
.lib-upload { display: grid; gap: 6px; justify-items: start; margin: 16px 0 6px; }
.lib-upload-button { gap: 10px; min-height: 52px; padding: 12px 22px; font-size: 16px; }
.lib-upload-button svg { width: 22px; height: 22px; }
.lib-upload-note { margin: 0; font-size: 13.5px; color: var(--ink-3, rgb(22 19 10 / 60%)); }
@media (max-width: 600px) { .lib-upload { justify-items: stretch; } }
