/* site-footer — an optional TOP REGION of three zones over a one-line BOTTOM
 * ROW under a hairline. The same header-footer/ catalog everywhere. Element
 * paint lives on the parts; this sheet is band and zone geometry. */

/* The bar holds still across a page change: it names itself for the document's
 * view transition. */
.sk-footer {
  view-transition-name: sk-footer;
}

/* A NAMED group paints above the root snapshot the lightbox's scrim rides on,
 * so this bar drops its name while one is open. The lightbox stamps the root;
 * answering it is the bar's own business. */
html[data-sk-lightbox-vt] .sk-footer {
  view-transition-name: none;
}

/* The hairline rides the floored stroke, so a borderless theme keeps it. */
.sk-footer {
  --sk-footer-pad-y: var(--sk-inset-block);
  --sk-footer-art-cap: calc(var(--sk-screen-block) * 0.7);
  --sk-footer-art-feather: 35%;
  --sk-footer-art-ratio: 3;
  display: flex;
  flex-direction: column;
  gap: var(--kit-space-3);
  padding-block: var(--sk-footer-pad-y);
  border-top: var(--sk-border-width-min) solid var(--sk-stroke);
  background-color: var(--sk-bg);
}

/* The page's rail is on the ROWS, as a margin: a percentage padding on the
 * band would shrink the box the rail is read against (the header bar's rule). */
.sk-footer > :is(.sk-footer-top, .sk-footer-row) {
  margin-inline: var(--sk-page-rail);
}

/* HEIGHT, the section's postures (frame.css): Minimum hugs the copy, Full is
 * one screen, Custom a share of one in fives. A floor, never a cap: taller
 * content wins. The seam is the air a card owes outside itself, subtracted as
 * the frame subtracts a band's, so a Full card lands on the fold. */
.sk-footer {
  --sk-footer-seam: 0px;
}
/* Chrome's own pad, as the bar's is: a slim step, never more than the theme's
 * inset, so Minimum is never taller than Auto at any density. */
.sk-footer[data-footer-height="min"] {
  --sk-footer-pad-y: min(var(--kit-space-3), var(--sk-inset-block));
}
.sk-footer[data-footer-height="full"] {
  min-height: calc(var(--sk-screen-block) - var(--sk-footer-seam));
}
.sk-footer[data-footer-height="custom"] {
  min-height: calc(
    round(clamp(0, var(--sk-footer-height-share), 100), 5) * var(--sk-screen-block) / 100 -
      var(--sk-footer-seam)
  );
}
/* Registered, so a share the paint cannot read draws the default, as a missing
 * one does. */
@property --sk-footer-height-share {
  syntax: "<number>";
  inherits: true;
  initial-value: 70;
}

/* CONTENT POSITION places the room a height leaves. Spread opens it between
 * the lanes and the bottom row, so a lone row sits at the bottom. Keyed on the
 * heights that leave room, the knob's own gate: a value kept while it is
 * hidden places nothing. */
.sk-footer > .sk-footer-row {
  margin-top: auto;
}
.sk-footer:is([data-footer-height="full"], [data-footer-height="custom"]):is(
    [data-content-position="top"],
    [data-content-position="center"],
    [data-content-position="bottom"]
  )
  > .sk-footer-row {
  margin-top: 0;
}
.sk-footer:is(
    [data-footer-height="full"],
    [data-footer-height="custom"]
  )[data-content-position="center"] {
  justify-content: center;
}
.sk-footer:is(
    [data-footer-height="full"],
    [data-footer-height="custom"]
  )[data-content-position="bottom"] {
  justify-content: flex-end;
}

/* A card is a floating object: it owes the air above and below it, and the
 * gutter at its sides. */
.sk-footer[data-style="card"] {
  --sk-footer-seam: calc(2 * var(--sk-air-block));
  /* The page's rail as the card reads it, for its rows to floor on: a row
   * redeclaring the rail cannot read its own. */
  --sk-footer-card-rail: var(--sk-page-rail);
  margin-block: var(--sk-air-block);
  margin-inline: var(--sk-gutter);
  border-top: 0;
  border-radius: var(--sk-card-radius);
}
.sk-footer[data-style="card"][data-width="page"] {
  margin-inline: var(--sk-page-rail);
}
/* At least a framing box's air, or the page column where the card is wider.
 * Declared on the rows, so the card's own edge still reads the page's rail. */
.sk-footer[data-style="card"] > :is(.sk-footer-top, .sk-footer-row) {
  --sk-page-rail: max(calc(var(--sk-gutter) * var(--sk-air)), var(--sk-footer-card-rail));
}

/* Border is ON by default, so it is keyed on its OFF value: a sidecar that
 * omits the prop serves its token verbatim and must read as on. On a card the
 * edge is the outline. */
.sk-footer[data-border=""] {
  border-top: 0;
}
.sk-footer[data-style="card"]:not([data-border=""]) {
  border: var(--sk-border-width-min) solid var(--sk-stroke);
}
.sk-footer[data-style="card"][data-shadow="true"] {
  box-shadow: var(--sk-panel-shadow);
}

/* BACKGROUND: an image, or a video the serve swaps in, on the kit's own media
 * vocabulary. COVER fills the band under the on-media dress (parts.css); the
 * dress wins over the tone. BOTTOM runs the art under the copy, edge to edge,
 * feathered into the tone above. */
/* A footer the body floor holds down is sticky, which already positions it;
 * a relative position there would turn the floor's `top` into an offset. */
.sk-footer:has(> .sk-footer-media):where(:not(body > *)) {
  position: relative;
}
.sk-footer[data-media="cover"] > .sk-footer-media {
  position: absolute;
  inset: 0;
  height: 100%;
  border-radius: 0;
  background: none;
}
/* Above the wash (z-index 1), which sits above the picture. */
.sk-footer[data-media="cover"] > :is(.sk-footer-top, .sk-footer-row) {
  position: relative;
  z-index: 2;
}
.sk-footer[data-media="bottom"] > .sk-footer-media {
  order: 1;
  /* A definite width, so the height cap crops rather than narrows the art. */
  width: 100%;
  max-width: none;
  aspect-ratio: var(--sk-media-ratio, var(--sk-footer-art-ratio));
  max-height: var(--sk-footer-art-cap);
  margin-block-end: calc(-1 * var(--sk-footer-pad-y));
  border-radius: 0;
  background: none;
  mask-image: linear-gradient(to bottom, transparent, #000 var(--sk-footer-art-feather));
}
/* Under a chosen height the art reads the band, as a section's picture reads
 * its stage: it fills the room the copy leaves, cropped at its focal point, so
 * the band is the height picked. Auto and Minimum keep the art's proportions. */
.sk-footer:is([data-footer-height="full"], [data-footer-height="custom"])[data-media="bottom"]
  > .sk-footer-media {
  flex: 1 1 0;
  /* At least the band's own bottom pad, which it bleeds into: the copy keeps
   * its air even where the height leaves the art no room. */
  min-height: var(--sk-footer-pad-y);
  max-height: none;
  aspect-ratio: auto;
}
/* On a card the art takes the card's inner corners, whichever shape the theme
 * draws: the card clips, as the frame's cards do (frame.css). */
.sk-footer[data-style="card"]:has(> .sk-footer-media) {
  overflow: clip;
}

/* Three lanes that STACK their elements. A flex row, NOT a rigid 1fr auto 1fr
 * grid: a grid's empty tracks still eat their share of the band, so instead
 * empty lanes COLLAPSE. The exception: while the CENTER lane is populated,
 * empty side lanes stay as equal springs so it stays truly centred. */
.sk-footer-top {
  display: flex;
  align-items: flex-start;
  gap: var(--kit-space-4) var(--kit-space-5);
  margin-bottom: var(--kit-space-4);
}
.sk-footer-top:not(:has(.sk-footer-zone > *)) {
  display: none;
}
.sk-footer-zone[data-region="top"] {
  /* Auto basis: a lane's share follows its content (a brand lockup stays
   * narrow beside a wide sitemap), and free space tops both up equally. */
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}
.sk-footer-zone[data-region="top"][data-zone="center"] {
  flex: 0 1 auto;
  align-items: center;
}
.sk-footer-zone[data-region="top"][data-zone="right"] {
  align-items: flex-end;
}
/* An empty center lane always collapses (it would otherwise leave a
 * double gap between the sides); empty SIDE lanes collapse only while the
 * center lane is empty too — populated-center keeps them as springs. */
.sk-footer-zone[data-region="top"][data-zone="center"]:not(:has(> *)) {
  display: none;
}
.sk-footer-top:not(:has([data-zone="center"] > *)) > .sk-footer-zone:not(:has(> *)) {
  display: none;
}
/* A lane whose only content is a SITEMAP hugs its columns' natural row. */
.sk-footer-zone[data-region="top"] > .sk-el-sitemap {
  align-items: flex-start;
}

.sk-footer-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--kit-space-3) var(--kit-space-4);
}
/* An all-empty bottom row collapses like the top region does — otherwise its
 * rule + padding render a second, blank closing band under the real one. */
.sk-footer-row:not(:has(.sk-footer-zone > *)) {
  display: none;
}

.sk-footer-zone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--kit-space-3);
}

/* Small screens: the top region relaxes to one column, lanes in order. */
@media (max-width: 640px) {
  .sk-footer-top {
    flex-direction: column;
  }
  .sk-footer-zone[data-region="top"] {
    flex: none;
  }
  .sk-footer-zone[data-region="top"][data-zone="center"],
  .sk-footer-zone[data-region="top"][data-zone="right"] {
    align-items: flex-start;
  }
}

/* LOGO SIZE: the scale the logo element reads, on the logo's own size (the
 * theme's brand size for a wordmark, its Logo Height for an image). Unset is
 * the logo's own. */
.sk-footer {
  --sk-logo-scale: calc(var(--sk-footer-logo-scale, 100) / 100);
}

/* The customize surface stamps data-sk-editing while its session is open, so
 * collapsed empty lanes come back and keep a real footprint to target. Same
 * specificity tier as the hide rules, declared later so source order settles
 * the ties. */
.sk-footer[data-sk-editing] .sk-footer-top,
.sk-footer[data-sk-editing] .sk-footer-row {
  display: flex;
}
.sk-footer[data-sk-editing] .sk-footer-zone {
  display: flex;
  min-height: 28px;
}
.sk-footer[data-sk-editing] .sk-footer-zone:not(:has(> *)) {
  min-width: 96px;
}

/* Opt-in, and drawn only when the top region is populated: with nothing above
 * it the hairline floats over the band's own padding. Keyed on the toggle's ON
 * value, never `:not([…=""])`: a sidecar that omits the prop serves the token
 * verbatim, and a negative key would read that as on. The width is FLOORED,
 * because a line the author switched on must not vanish on a borderless
 * theme. */
.sk-footer[data-bottom-rule="true"]:has(.sk-footer-top .sk-footer-zone > *) .sk-footer-row {
  border-top: var(--sk-border-width-min) solid var(--sk-stroke);
  padding-top: var(--kit-space-4);
}
