/*
 * PRESTOads demo styling, following castlabs.com.
 *
 * The custom properties mirror the `--cl-*` tokens the castLabs site
 * declares on :root, so the provenance stays obvious. The brand face
 * (NonNaturalGroteskInktrap) is licensed and not shipped here; the
 * stack below is the same fallback chain castlabs.com declares, so the
 * demo degrades exactly the way the site does without it.
 */
:root {
  --cl-color-background: #fbf9f2;
  --cl-color-text: #262a35;
  --cl-color-border: #262a35;
  --cl-color-hover: #fa423c;
  --cl-color-accent: #096174;
  --cl-color-active: #6e1c3b;
  --cl-color-line: #cfc8c8;
  --cl-color-link: #a0a0a0;
  --cl-color-input-border: #6d5e5e;
  --cl-color-disabled-background: #a0a0a0;
  --cl-color-disabled-text: #fbf9f2;
  --cl-color-surface: #f2eee3;
  --cl-opacity-active: 0.8;

  --cl-font: NonNaturalGroteskInktrap, arial, -apple-system,
    blinkmacsystemfont, 'Segoe UI', roboto, 'Helvetica Neue', arial,
    sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
  --cl-radius-pill: 999px;
}

body,
html {
  margin: 0;
  height: 100%;
}

body {
  background-color: var(--cl-color-background);
  color: var(--cl-color-text);
  font-family: var(--cl-font);
  font-size: 16px;
  line-height: 1.4;
}

h1,
h2,
h3,
h4,
a,
label,
button,
input,
select {
  font-family: var(--cl-font);
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
}

h1 {
  color: var(--cl-color-hover);
  letter-spacing: -0.02em;
}

h3 {
  margin-top: 4px;
  margin-bottom: 4px;
}

ul {
  margin-top: 4px;
  margin-bottom: 4px;
}

a {
  color: var(--cl-color-text);
}

a:hover {
  color: var(--cl-color-hover);
}

.text-center {
  text-align: center;
}

.section {
  margin-top: 36px;
  margin-left: 8px;
  margin-right: 8px;
}

.controlField {
  margin-bottom: 16px;
}

.controlInput {
  width: 100%;
  margin-top: 0;
  margin-bottom: 0;
  box-sizing: border-box;
  padding: 8px 12px;
  color: var(--cl-color-text);
  background-color: transparent;
  border: 1px solid var(--cl-color-input-border);
  border-radius: 4px;
  font-size: 14px;
}

.controlInput:focus-visible {
  outline: 2px solid var(--cl-color-hover);
  outline-offset: 1px;
}

label {
  font-weight: 700;
  font-size: 14px;
}

select {
  padding: 6px 10px;
  color: var(--cl-color-text);
  background-color: transparent;
  border: 1px solid var(--cl-color-input-border);
  border-radius: 4px;
}

/* castlabs.com buttons are pills: 1px border, bold, generous padding. */
.button {
  margin: 0;
  padding: 4px 16px;
  color: var(--cl-color-text);
  background-color: transparent;
  border: 1px solid var(--cl-color-border);
  border-radius: var(--cl-radius-pill);
  font-weight: 700;
  cursor: pointer;
}

.button:hover {
  color: var(--cl-color-hover);
  border-color: var(--cl-color-hover);
}

.button:active {
  opacity: var(--cl-opacity-active);
}

.button:disabled {
  color: var(--cl-color-disabled-text);
  background-color: var(--cl-color-disabled-background);
  border-color: var(--cl-color-disabled-background);
  cursor: default;
}

.button h3 {
  margin: 0;
  font-size: 14px;
}

#mainContainer {
  width: 320px;
  margin: auto;
}

#creativeContainer {
  width: 320px;
  height: 290px;
  background: #00990c;
  overflow: hidden;
}

#creativeIframe {
  width: 100%;
  height: 100%;
  background: #00990c;
  overflow: hidden;
  display: block;
  box-sizing: border-box;
  border: none;
  position: relative;
}

.testCaseBody {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  background-color: var(--cl-color-background);
}

#videoElement {
  width: 100%;
  aspect-ratio: 320 / 180;
  background: var(--cl-color-text);
}

#startButton {
  width: 100%;
}

#playbackControls {
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: stretch;
  gap: 8px;
}

.playbackButton {
  flex-grow: 1;
}

#volumeContainer {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  text-align: center;
  background-color: var(--cl-color-surface);
}

#adView {
  border: 0;
  height: 100%;
  width: 100%;
  position: absolute;
}

/* --- Landing page ------------------------------------------------- */

#demoContainer {
  max-width: 52rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

#demoContainer h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  line-height: 1;
}

.demoIntro {
  margin: 0 0 2.5rem;
  font-size: 1.125rem;
}

.demoGroup {
  margin: 0 0 3rem;
}

.demoGroupTitle {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
}

.demoGroupDescription {
  margin: 0 0 1.25rem;
  max-width: 46rem;
  line-height: 1.5;
  opacity: 0.75;
}

.demoVideo {
  width: 100%;
  max-width: 46rem;
  aspect-ratio: 16 / 9;
  background: var(--cl-color-text);
  border-radius: 8px;
}

.demoList,
.demoPackages {
  list-style: none;
  margin: 0;
  padding: 0;
}

.demoList {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.demoCard {
  display: block;
  padding: 1.5rem;
  color: inherit;
  text-decoration: none;
  background-color: transparent;
  border: 1px solid var(--cl-color-border);
  border-radius: 12px;
}

.demoCard:hover,
.demoCard:focus-visible {
  color: inherit;
  border-color: var(--cl-color-hover);
}

.demoCard:hover .demoTitle,
.demoCard:focus-visible .demoTitle {
  color: var(--cl-color-hover);
}

.demoTitle {
  margin: 0 0 0.75rem;
  font-size: 1.375rem;
  line-height: 1.2;
}

.demoSummary {
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.demoPackages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.demoPackages li {
  padding: 0.2rem 0.65rem;
  color: var(--cl-color-accent);
  border: 1px solid var(--cl-color-line);
  border-radius: var(--cl-radius-pill);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
}
