/* AI Video Ad Library — page styles.
   Loads after /styles.css. The top of the page (promo bar, pill nav, footer)
   is the site's own brand furniture; everything below is deliberately quiet so
   the ad thumbnails carry the page. Neutral tokens below are tuned to sit on
   the site's warm --paper background rather than a cold grey. */

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 1000;
  font-display: swap;
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 1000;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

.library {
  --stroke: rgba(23, 19, 24, 0.11);
  --stroke-soft: rgba(23, 19, 24, 0.07);
  --box: #fff;
  --bg-media: #edece6;
  --title: #171318;
  --sub: #625c68;
  --faint: #8b8590;
  --tint-grey: #f0efeb;
  --tint-green: #eaf8e8;
  --ink-green: #1f8f1c;
  --tint-blue: #eaf1fd;
  --ink-blue: #0c5cb6;
  --card-shadow: 0 1px 2px rgba(23, 19, 24, 0.05), 0 10px 24px -20px rgba(23, 19, 24, 0.35);
}

/* Generous side gutters — 80px per side on desktop. The nav and footer use
   .container too, so the whole page stays on one vertical edge. */
.container {
  width: min(1600px, calc(100% - 160px));
}

@media (max-width: 1200px) {
  .container {
    width: calc(100% - 80px);
  }
}

@media (max-width: 800px) {
  .container {
    width: calc(100% - 48px);
  }
}

@media (max-width: 560px) {
  .container {
    width: calc(100% - 32px);
  }
}

/* ---------- page header ---------- */

.library-head {
  padding: 38px 0 0;
}

/* Restrained page title, not the site's display type. */
.library-head h1 {
  max-width: 820px;
  font-size: clamp(1.4rem, 1.7vw, 1.75rem);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.012em;
  text-transform: none;
  color: var(--title);
}

.library-sub {
  max-width: 680px;
  margin: 10px 0 0;
  font-size: 0.94rem;
  font-weight: 450;
  line-height: 1.55;
  color: var(--sub);
}

.library-meta {
  margin-top: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--faint);
}

.library-body {
  padding: 26px 0 90px;
}

/* ---------- tag filter bar ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin-bottom: 24px;
}

.filters[hidden] {
  display: none;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--box);
  color: var(--sub);
  padding: 7px 14px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.filter-chip span {
  color: var(--faint);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.filter-chip:hover {
  border-color: rgba(23, 19, 24, 0.28);
}

.filter-chip.is-active {
  background: var(--title);
  border-color: var(--title);
  color: #fff;
}

.filter-chip.is-active span {
  color: rgba(255, 255, 255, 0.6);
}

.filter-chip.more {
  background: transparent;
  border-style: dashed;
  color: var(--faint);
}

/* ---------- masonry columns ---------- */

.grid {
  display: flex;
  gap: 20px;
  width: 100%;
  margin-bottom: 20px;
}

.grid-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1 1 0;
  min-width: 0;
}

/* ---------- card ---------- */

.ad-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--box);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.ad-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 2px rgba(23, 19, 24, 0.06), 0 18px 32px -22px rgba(23, 19, 24, 0.45);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px;
}

.card-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--tint-grey);
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.brand-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

a.brand-name:hover {
  text-decoration: underline;
}

.card-dates {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--faint);
}

.card-dates .range {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-dates .sep,
.card-dates .days {
  flex-shrink: 0;
}

.status-dot {
  flex-shrink: 0;
}

/* ---------- media ---------- */

.media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-media);
  overflow: hidden;
}

.media > img,
.media > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.media-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.media-play span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: var(--ink-blue);
  box-shadow: 0 6px 18px -6px rgba(12, 92, 182, 0.6);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.media:hover .media-play span {
  transform: scale(1.06);
  filter: brightness(1.08);
}

.media-play svg {
  width: 26px;
  height: 26px;
  margin-left: 3px;
  color: #fff;
}

.media-duration {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: max-content;
  border-radius: 8px;
  background: rgba(23, 19, 24, 0.62);
  color: #fff;
  padding: 3px 8px;
  font-size: 0.74rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.media-note {
  position: absolute;
  inset: auto 10px 10px 10px;
  border-radius: 8px;
  background: rgba(23, 19, 24, 0.75);
  color: #fff;
  padding: 8px 10px;
  font-size: 0.72rem;
  line-height: 1.35;
  text-align: center;
}

/* ---------- pills ---------- */

.ad-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 12px 14px 0;
}

.ad-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  border: 0;
  border-radius: 999px;
  background: var(--tint-grey);
  color: var(--sub);
  padding: 4px 9px;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.ad-pill svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  /* Icon paths carry fill="inherit"; this overrides their svg fill="none". */
  fill: currentColor;
}

.ad-pill-grey {
  background: var(--tint-grey);
  color: var(--sub);
}

.ad-pill-green {
  background: var(--tint-green);
  color: var(--ink-green);
}

.ad-pill-blue {
  background: var(--tint-blue);
  color: var(--ink-blue);
}

.eu-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 2px;
  border-radius: 999px;
  background: var(--ink-blue);
  color: #fff;
  padding: 2px 7px 2px 3px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.5;
}

.eu-chip svg {
  width: 11px;
  height: 11px;
}

.stars {
  display: block;
  height: 22px;
}

/* ---------- copy ---------- */

.card-title {
  padding: 12px 14px 0;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--title);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: break-word;
}

.card-body {
  padding: 6px 14px 0;
  flex: 1;
  overflow: hidden;
}

.card-body p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  font-weight: 450;
  color: var(--sub);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: break-word;
}

.card-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 0;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--faint);
}

.card-links a {
  display: flex;
  align-items: center;
  min-width: 0;
  color: var(--faint);
}

.card-links .landing {
  gap: 5px;
  overflow: hidden;
}

.card-links .landing span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-links a:hover {
  color: var(--ink-blue);
}

.card-links .learn-more {
  gap: 4px;
  flex-shrink: 0;
  font-weight: 600;
  color: var(--sub);
}

.card-links svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.card-foot {
  display: flex;
  align-items: center;
  padding: 14px;
}

.btn-details {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--box);
  color: var(--sub);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-details:hover {
  background: var(--tint-blue);
  border-color: rgba(12, 92, 182, 0.3);
  color: var(--ink-blue);
}

.btn-details svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  fill: currentColor;
}

/* ---------- loading ---------- */

.sentinel {
  width: 100%;
  min-height: 8px;
}

.status {
  width: 100%;
  padding: 22px 0 0;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--faint);
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  margin-right: 8px;
  border: 2px solid rgba(23, 19, 24, 0.15);
  border-top-color: var(--ink-blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- sticky promo ---------- */

.promo {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  width: min(340px, calc(100% - 32px));
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--box);
  box-shadow: 0 20px 44px -20px rgba(23, 19, 24, 0.4);
  padding: 18px;
}

.promo[hidden] {
  display: none;
}

.promo strong {
  display: block;
  padding-right: 24px;
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.25;
  color: var(--title);
}

.promo p {
  margin: 8px 0 14px;
  font-size: 0.84rem;
  font-weight: 450;
  line-height: 1.5;
  color: var(--sub);
}

.promo .btn {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--ink-blue);
  color: #fff;
  box-shadow: none;
  font-size: 0.86rem;
  font-weight: 650;
  text-transform: none;
}

.promo .btn:hover {
  transform: none;
  box-shadow: none;
  filter: brightness(1.08);
}

.promo-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--tint-grey);
  color: var(--sub);
  cursor: pointer;
}

.promo-close:hover {
  background: rgba(23, 19, 24, 0.12);
}

.promo-close svg {
  width: 12px;
  height: 12px;
}

@media (max-width: 700px) {
  .promo {
    right: 16px;
    left: 16px;
    bottom: 16px;
    width: auto;
  }
}

/* ---------- details dialog ---------- */

.dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  padding: 24px;
  overflow: auto;
  background: rgba(23, 19, 24, 0.5);
}

.dialog[open] {
  display: block;
}

.dialog-panel {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  border-radius: 16px;
  background: #faf9f6;
  box-shadow: 0 30px 60px -24px rgba(23, 19, 24, 0.5);
  overflow: hidden;
}

.dialog-head {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--stroke);
  background: var(--box);
  padding: 15px 20px;
}

.dialog-head .avatar {
  width: 38px;
  height: 38px;
}

.dialog-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 750;
  line-height: 1.2;
  text-transform: none;
  color: var(--title);
}

.dialog-head .ad-id {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--faint);
}

.dialog-close {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--box);
  color: var(--sub);
  cursor: pointer;
}

.dialog-close:hover {
  background: var(--tint-grey);
}

.dialog-close svg {
  width: 16px;
  height: 16px;
}

.dialog-body {
  display: grid;
  grid-template-columns: 370px minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
  align-items: start;
}

.dialog-media {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--box);
  overflow: hidden;
}

.dialog-media .ad-pills {
  justify-content: flex-end;
  padding: 12px 12px 10px;
}

.dialog-copy {
  border-top: 1px solid var(--stroke);
  padding: 16px;
}

.dialog-copy pre {
  margin: 12px 0;
  max-height: 220px;
  overflow: auto;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 450;
  line-height: 1.55;
  color: var(--sub);
  white-space: pre-wrap;
}

.dialog-copy .headline {
  margin: 0 0 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--title);
}

.dialog-copy .copy-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.dialog-panel-right {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--box);
  padding: 20px;
}

.tabs {
  display: inline-flex;
  padding: 4px;
  border-radius: 10px;
  background: var(--tint-grey);
  margin-bottom: 20px;
}

.tabs span {
  border-radius: 7px;
  background: var(--box);
  color: var(--title);
  box-shadow: 0 1px 2px rgba(23, 19, 24, 0.08);
  padding: 6px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  text-transform: none;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px 28px;
  margin: 0;
}

.fact dt {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--faint);
  margin-bottom: 3px;
}

.fact dd {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--title);
  overflow-wrap: anywhere;
}

.fact dd a {
  color: var(--ink-blue);
  text-decoration: underline;
}

.ad-id-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}

.ad-id-link svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  opacity: 0.75;
}

.ad-id-link:hover svg {
  opacity: 1;
}

.fact-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--stroke);
  border-radius: 9px;
  background: var(--box);
  color: var(--sub);
  padding: 8px 12px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-ghost:hover {
  background: var(--tint-grey);
}

.btn-ghost svg {
  width: 13px;
  height: 13px;
}

@media (max-width: 900px) {
  .dialog {
    padding: 0;
  }

  .dialog-panel {
    border-radius: 0;
    min-height: 100%;
  }

  .dialog-body {
    grid-template-columns: minmax(0, 1fr);
  }
}
