/* Cookie notice, bottom right on every page (after inkfishnyc.com): a slim bar with Manage and
   Accept; Manage opens the options above it. Built by cookies.js. */

.cookie {
  position: fixed;
  right: 16px;
  /* Sits above the scrolling banner at the foot of the homepage and the service pages */
  bottom: calc(var(--cookie-lift, 0px) + 14px);
  z-index: 80;
  width: min(350px, calc(100vw - 32px));
  border-radius: 8px;
  background: var(--navy);
  color: var(--white);
  font-family: var(--grotesk);
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 2px 4px rgba(16, 40, 76, .12), 0 18px 44px rgba(16, 40, 76, .32);
  transition: opacity .35s ease, transform .45s var(--ease), visibility .35s;
}
.cookie[hidden] { display: block; opacity: 0; visibility: hidden; transform: translateY(16px); pointer-events: none; }

/* The × in the top-right corner, only when the box was reopened after a choice */
.cookie-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  display: none;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: .75;
  transition: opacity .2s ease, background-color .2s ease;
}
.cookie.can-close .cookie-close { display: grid; }
.cookie-close:hover { opacity: 1; background: rgba(255, 255, 255, .12); }
.cookie-close:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
.cookie-close svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
/* Room for the × beside the panel's title */
.cookie.can-close .cookie-panel-body { padding-right: 40px; }

/* The options open upwards from the bar, like a drawer */
.cookie-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .45s var(--ease);
}
.cookie.is-open .cookie-panel { grid-template-rows: 1fr; }
.cookie-panel-inner { min-height: 0; overflow: hidden; }
.cookie-panel-body {
  max-height: min(62vh, 520px);
  overflow-y: auto;
  padding: 14px 14px 2px;
}
.cookie h2,
.cookie h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.cookie p { margin: 6px 0 0; opacity: .86; }
.cookie-options { margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .18); }
.cookie-option { padding: 10px 0; }
.cookie-option + .cookie-option { border-top: 1px solid rgba(255, 255, 255, .12); }
.cookie-option-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cookie-always { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .7; }

/* The analytics switch: a leaning track with a sliding block, like the theme switch */
.cookie-switch {
  position: relative;
  flex: none;
  width: 40px;
  height: 20px;
  padding: 0;
  border: 1.5px solid rgba(255, 255, 255, .55);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  transform: skewX(var(--lean));
  transition: background-color .3s ease, border-color .3s ease;
}
.cookie-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 13px;
  border-radius: 2px;
  background: var(--white);
  transition: transform .35s var(--ease), background-color .3s ease;
}
.cookie-switch[aria-checked="true"] { border-color: var(--white); background: var(--white); }
.cookie-switch[aria-checked="true"]::after { transform: translateX(19px); background: var(--navy); }
.cookie-switch:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }

/* The bar, and the buttons under the open options */
.cookie-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 8px 14px;
}
.cookie-row-text { flex: 1; margin: 0; font-weight: 600; white-space: nowrap; }
.cookie.is-open .cookie-bar,
.cookie:not(.is-open) .cookie-foot { display: none; }
.cookie-foot { justify-content: flex-end; padding-top: 6px; }

/* Leaning buttons, like the menu pills: a quiet one and a white one */
.cookie-btn {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border: 1.5px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: 600 11px/1 var(--grotesk);
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transform: skewX(var(--lean));
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}
.cookie-btn > span { transform: skewX(calc(-1 * var(--lean))); }
.cookie-btn-quiet { opacity: .75; }
.cookie-btn-quiet:hover { opacity: 1; border-color: rgba(255, 255, 255, .45); }
.cookie-btn-main { background: var(--white); color: var(--navy); }
.cookie-btn-main:hover { background: var(--sun); }
.cookie-btn:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }

/* Links elsewhere that reopen the options look like the privacy links beside them */
button[data-cookie-settings] {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

body:has(.human-band) .cookie { --cookie-lift: 26px; }
body:has(.story-banner) .cookie { --cookie-lift: var(--banner-h, 26px); }

@media (max-width: 560px) {
  .cookie { right: 12px; bottom: calc(var(--cookie-lift, 0px) + 10px); width: calc(100vw - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  .cookie, .cookie-panel, .cookie-switch, .cookie-switch::after, .cookie-btn { transition: none; }
}
