/* Caoba: the brand book board (marca slot). */

.d-marca { height: 100%; background: var(--b-line); }
.m-board { height: 100%; display: grid; gap: 12px; padding: 12px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, .95fr) minmax(0, .95fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "logo logo pal type" "apps apps pal icon"; }
.m-tile { position: relative; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; border-radius: var(--b-radius); background: var(--b-surface); }
.m-l { color: var(--b-muted); font-weight: 700; font-size: 13px; }

.m-logo { grid-area: logo; background: var(--b-primary); transition: background-color .35s; }
.m-logo .m-l, .m-logo .m-tag { color: var(--b-on-primary); }
.m-lock { flex: 1; min-height: 0; display: grid; place-items: center; }
.m-lock .m-lg { height: auto; width: min(50%, 400px); max-height: 100%; object-fit: contain; }
/* the campaign line, as the brand sets it: Cormorant Garamond italic */
.m-tag { text-align: center; font: italic 500 27px/1.15 var(--b-font-display); }
.m-bg { position: absolute; right: 14px; top: 12px; display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--b-surface); }
.m-bg button { min-height: 34px; padding: 0 14px; border-radius: 999px; font-weight: 700; font-size: 12px; color: var(--b-ink); }
.m-bg button[aria-checked="true"] { background: var(--b-secondary); color: var(--b-on-secondary); }
.m-logo.light { background: var(--b-paper); }
.m-logo.light .m-l { color: var(--b-muted); }
.m-logo.light .m-tag { color: var(--b-primary); }

.m-pal { grid-area: pal; }
.m-sw { flex: 1; min-height: 0; display: grid; grid-auto-rows: minmax(0, 1fr); gap: 8px; }
.m-c { display: grid; grid-template-columns: 1fr auto; align-content: end; gap: 2px 8px; padding: 10px 14px; border-radius: calc(var(--b-radius) * .8); background: var(--c); color: var(--fg); text-align: left; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--b-ink) 10%, transparent); }
.m-cn { font-weight: 800; font-size: 14px; }
.m-cv { justify-self: end; text-align: right; font-weight: 700; font-size: 13px; }
.m-cv small { display: block; max-height: 0; overflow: hidden; opacity: 0; font-weight: 600; font-size: 12px; transition: max-height .3s, opacity .3s; }
.m-c[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--b-surface), 0 0 0 2px var(--b-ink); }
.m-c[aria-pressed="true"] .m-cv small { max-height: 2em; opacity: 1; }

.m-type { grid-area: type; justify-content: space-between; }
.m-aa { display: flex; align-items: center; gap: 14px; }
.m-aa > b { width: 76px; flex: none; font-size: 58px; line-height: 1; color: var(--b-ink); }
.m-aa-d { font-family: var(--b-font-display); font-weight: var(--b-display-weight, 600); }
.m-aa-b { font-family: var(--b-font-body); font-weight: 700; }
.m-aa span b { display: block; font-size: 15px; }
.m-aa small { color: var(--b-muted); font-size: 13px; }
.m-sample { font-size: 17px; }

/* applications: each scene runs to the card's edges, on the colour design-lead set it on */
.m-apps { grid-area: apps; }
.m-apps-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.m-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.m-tabs button { min-height: 36px; padding: 0 14px; border-radius: 999px; font-weight: 700; font-size: 13px; background: var(--b-surface); box-shadow: inset 0 0 0 1.5px var(--b-line); }
.m-tabs button[aria-selected="true"] { background: var(--b-secondary); color: var(--b-on-secondary); box-shadow: none; }
.m-art { position: relative; flex: 1; min-height: 0; margin: 0 -20px -18px; background: var(--b-paper); }
.m-art[data-app-view="etiquetas"] { background: var(--b-c4); }
.m-art[data-app-view="letrero"] { background: var(--b-c3); }
.m-art .x-cut { position: absolute; inset: 0; width: 100%; height: 100%; padding: 10px 0 0; object-fit: contain; object-position: 50% 0; }
.m-art .x-cut:not([src]) { visibility: hidden; }
.m-set { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 7%; padding: 6% 8%; }
.m-set img { min-width: 0; max-width: 100%; max-height: 100%; }
.m-set .m-label, .m-set .m-bag { height: 100%; width: auto; }
.m-set .m-neckLabel { width: 34%; max-width: 300px; height: auto; }
.m-art[data-app-view="letrero"] .m-set { padding: 0; }
.m-set .m-sign { height: 100%; width: auto; }
.motion .m-art.in > * { animation: m-in .5s cubic-bezier(.2, .7, .2, 1); }
@keyframes m-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }

.m-icon { grid-area: icon; }
.m-icons { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 18px; }
.m-app { width: 96px; height: 96px; border-radius: 22px; }
.m-pat { width: 96px; height: 96px; border-radius: 50%; background-size: 64px 64px; background-color: var(--b-paper); box-shadow: inset 0 0 0 1px var(--b-line); }
.m-idea { color: var(--b-muted); font-size: 13px; }

.m-glyphs, .m-field { display: none; }

/* very wide (2560, and maximised windows): bigger samples, and the pattern runs to the card's edges */
@container demo (min-width: 1500px) {
  .m-board { gap: 16px; padding: 16px; }
  .m-tile { gap: 14px; padding: 24px 28px; }
  .m-l { font-size: 15px; }
  .m-lock .m-lg { width: min(50%, 560px); }
  .m-tag { font-size: 36px; }
  .m-bg { right: 18px; top: 16px; }
  .m-bg button, .m-tabs button { min-height: 40px; padding: 0 18px; font-size: 14px; }
  .m-cn { font-size: 17px; }
  .m-cv { font-size: 16px; }
  .m-cv small { font-size: 14px; }
  .m-c { padding: 14px 18px; }
  .m-type { container: mtype / size; justify-content: space-between; }
  .m-aa { gap: 18px; }
  .m-aa > b { width: 1.3em; font-size: 78px; }
  .m-aa span b { font-size: 20px; }
  .m-aa small { font-size: 16px; }
  .m-sample { margin-top: 0; font-size: 22px; }
  .m-art { margin: 0 -28px -24px; }
  .m-art .x-cut { padding-top: 16px; }
  .m-icons { position: relative; margin: 0 -28px; }
  .m-field { display: block; position: absolute; inset: 0; background-color: var(--b-paper); background-size: 100px 100px; }
  .m-pat { display: none; }
  .m-app { position: relative; width: 168px; height: 168px; border-radius: 38px; }
  .m-idea { font-size: 15px; }
}
/* the type card shows each face's letters when it is tall enough */
@container mtype (min-height: 440px) {
  .m-aa > b { font-size: 96px; }
  .m-glyphs { display: block; color: var(--b-ink); font-size: 17px; line-height: 1.35; overflow-wrap: anywhere; }
  .m-glyphs.m-aa-d { font-size: 24px; line-height: 1.2; }
  .m-glyphs.m-aa-b { font-weight: 600; }
}

@container demo (max-width: 999px) {
  .m-board { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "logo logo" "pal type" "apps icon"; }
}
/* phones: one column, the board grows in height instead of shrinking */
@container demo (max-width: 599px) {
  .d-marca { height: auto; }
  .m-board { height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "logo" "pal" "type" "apps" "icon"; gap: 10px; padding: 10px; }
  .m-tile { padding: 16px; }
  .m-logo { min-height: 260px; }
  .m-bg { position: static; align-self: flex-start; order: 3; }
  .m-lock .m-lg { width: 64%; }
  .m-tag { font-size: 24px; }
  .m-sw { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(96px, auto); }
  .m-c:first-child { grid-column: 1 / -1; }
  .m-c { grid-template-columns: minmax(0, 1fr); }
  .m-cv { justify-self: start; text-align: left; }
  .m-aa > b { width: 58px; font-size: 46px; }
  .m-art { height: 280px; flex: none; margin: 0 -16px -16px; }
  .m-icons { padding: 8px 0; }
}

/* short windows (an unmaximised browser, about 1366x768): each panel keeps its size and the board scrolls inside the window instead of squeezing */
@media (max-height: 800px) {
  .win-demo:not(.is-max) .d-marca { overflow-y: auto; }
  @container demo (min-width: 600px) {
    .win-demo:not(.is-max) .m-board { height: auto; min-height: 100%; grid-template-rows: minmax(330px, 1fr) minmax(330px, 1fr); }
    .win-demo:not(.is-max) .m-sw { grid-auto-rows: minmax(54px, 1fr); }
  }
  @container demo (min-width: 600px) and (max-width: 999px) {
    .win-demo:not(.is-max) .m-board { grid-template-rows: minmax(320px, 1.1fr) minmax(390px, 1fr) minmax(340px, 1fr); }
  }
}
