/* Cookie consent banner (inc/consent.php, assets/consent.js). A full-width bar along the bottom of the page, set like
   the rest of the site (DESIGN.md): Cycladic Ivory surface (the colour of forms) under one Kamari Night hairline and
   no shadow; the brand's serif sentence with italic words as its title; outline buttons only, because on this site
   filled means book; content on the site's own frame (80rem + margins), so it lines up with the header and the page.
   Logical properties, so Hebrew mirrors itself. */
.ep-cc {
  --cc-ink: var(--night, #162749);
  --cc-card: var(--ivory, #f2efed);
  --cc-line: color-mix(in srgb, var(--cc-ink) 18%, transparent);
  --cc-ease: var(--ease-ui, cubic-bezier(.23, 1, .32, 1));
  position: fixed;
  z-index: 90;
  inset-inline: 0;
  inset-block-end: 0;
  max-block-size: calc(100dvh - 24px);
  overflow: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  padding-block: clamp(20px, 2.4vw, 32px) calc(clamp(20px, 2.4vw, 32px) + env(safe-area-inset-bottom));
  background: var(--cc-card);
  color: var(--cc-ink);
  border-block-start: 1px solid var(--cc-line);
  font: 400 1rem/1.55 var(--sans, system-ui, sans-serif);
  transform: none;
  transition: transform .28s var(--cc-ease);
}
.ep-cc[hidden] { display: none; }
.ep-cc[data-enter] { transform: translateY(100%); }
.ep-cc *, .ep-cc *::before, .ep-cc *::after { box-sizing: border-box; }

/* Copy on the start side, buttons on the end side; the switches open as a full row underneath. */
.ep-cc-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "copy actions" "prefs prefs";
  align-items: center;
  column-gap: clamp(32px, 5vw, 96px);
  max-inline-size: calc(80rem + 2 * var(--margin, 24px));
  margin-inline: auto;
  padding-inline: var(--margin, 24px);
}
.ep-cc-copy { grid-area: copy; min-inline-size: 0; }
.ep-cc-prefs { grid-area: prefs; }
.ep-cc-actions { grid-area: actions; }
/* With the switches open, the buttons move below them, where the eye ends up. */
.ep-cc-inner:has(.ep-cc-prefs:not([hidden])) { grid-template-areas: "copy copy" "prefs prefs" ". actions"; }

/* The serif sentence: sentence case, the words after the comma in italic (in Hebrew and Chinese the site's own
   rule sets them upright at weight 500). */
.ep-cc-title {
  margin: 0 0 10px;
  font: 400 clamp(1.5rem, 1.25rem + .9vw, 2.1875rem)/1.1 var(--serif, Georgia, serif);
  font-optical-sizing: auto;
  letter-spacing: -.005em;
  text-wrap: balance;
  color: var(--cc-ink);
  outline: none;
}
.ep-cc-text { margin: 0; max-inline-size: 64ch; color: var(--cc-ink); text-wrap: pretty; }
.ep-cc-text a {
  color: var(--aegean, #4f6499);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  white-space: nowrap;
}

.ep-cc-prefs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(24px, 3vw, 48px);
  margin-block: 20px 8px;
  border-block-start: 1px solid var(--cc-line);
}
.ep-cc-prefs[hidden] { display: none; }
.ep-cc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 16px;
  cursor: pointer;
}
div.ep-cc-row { cursor: default; }
.ep-cc-row-text { display: grid; gap: 2px; min-inline-size: 0; }
.ep-cc-row-text strong { font-weight: 500; font-size: 1rem; letter-spacing: .01em; }
.ep-cc-row-text span { font-size: .875rem; line-height: 1.43; letter-spacing: .01em; color: var(--ep-volcanic-black, #303033); }
.ep-cc-always { flex: none; font-size: .875rem; font-weight: 500; color: var(--ep-volcanic-black, #303033); }

/* Switch: a real checkbox, so keyboard and screen readers get it for free. Night when on, hairline track when off. */
.ep-cc-switch {
  appearance: none;
  flex: none;
  position: relative;
  inline-size: 44px;
  block-size: 26px;
  margin: 0;
  border: 1px solid var(--cc-ink);
  border-radius: 13px;
  background: transparent;
  cursor: pointer;
  transition: background-color .2s var(--cc-ease);
}
.ep-cc-switch::before {
  content: "";
  position: absolute;
  inset-block-start: 3px;
  inset-inline-start: 3px;
  inline-size: 18px;
  block-size: 18px;
  border-radius: 50%;
  background: var(--cc-ink);
  transition: transform .2s var(--cc-ease), background-color .2s var(--cc-ease);
}
.ep-cc-switch:checked { background: var(--cc-ink); }
.ep-cc-switch:checked::before { background: var(--cc-card); transform: translateX(18px); }
[dir="rtl"] .ep-cc-switch:checked::before { transform: translateX(-18px); }

.ep-cc-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}
/* The site's outline button. Accept and reject look the same: saying no is as easy as saying yes. */
.ep-cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 52px;
  min-inline-size: 11rem;
  padding-inline: 28px;
  border: 1px solid currentColor;
  border-radius: 6px;
  background: transparent;
  color: var(--cc-ink);
  font: 500 1rem/1.1 var(--sans, system-ui, sans-serif);
  letter-spacing: .02em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s var(--cc-ease), transform .16s var(--cc-ease);
}
.ep-cc-btn:hover { background: rgb(22 39 73 / .06); }
.ep-cc-btn:active { transform: scale(.97); }
.ep-cc-btn[hidden] { display: none; }
/* "Choose" is the site's underlined text link (like "Explore"), not a third button. */
.ep-cc-more {
  min-block-size: 44px;
  margin-inline-start: 12px;
  padding: 0;
  border: 0;
  background: none;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  color: var(--cc-ink);
  font: 500 1rem/1 var(--sans, system-ui, sans-serif);
  letter-spacing: .01em;
  white-space: nowrap;
  cursor: pointer;
  transition: color .2s var(--cc-ease);
}
.ep-cc-more[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) { .ep-cc-more:hover { color: var(--aegean, #4f6499); } }

.ep-cc :focus-visible,
.ep-cc-open:focus-visible {
  outline: 2px solid var(--aegean, #4f6499);
  outline-offset: 2px;
}
.ep-cc-title:focus-visible { outline: none; }

/* Footer: "Cookie settings" sits with the legal links and looks like them. */
.ep-cc-open {
  display: inline-flex;
  align-items: center;
  min-block-size: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}
.ep-cc-open:hover { text-decoration: underline; text-underline-offset: 3px; }
.ep-cc-open:focus-visible { outline-color: var(--first, #f2efed); }

/* Tablets: buttons drop under the text. */
@media (max-width: 1023px) {
  .ep-cc-inner,
  .ep-cc-inner:has(.ep-cc-prefs:not([hidden])) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "prefs" "actions"; }
  .ep-cc-actions { justify-content: flex-start; margin-block-start: 20px; }
  .ep-cc-prefs { grid-template-columns: minmax(0, 1fr); }
  .ep-cc-row + .ep-cc-row { border-block-start: 1px solid var(--cc-line); }
}

/* Phones: two equal buttons side by side, 56px tall like every button on the site at this size. */
@media (max-width: 767px) {
  .ep-cc { padding-block: 20px calc(12px + env(safe-area-inset-bottom)); }
  .ep-cc-text { font-size: .9375rem; }
  .ep-cc-actions { display: grid; grid-template-columns: 1fr 1fr; margin-block-start: 16px; }
  .ep-cc-btn { min-block-size: 56px; min-inline-size: 0; padding-inline: 12px; white-space: normal; }
  .ep-cc-save, .ep-cc-more { grid-column: 1 / -1; }
  .ep-cc-more { justify-self: center; margin-inline-start: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ep-cc, .ep-cc-btn, .ep-cc-more, .ep-cc-switch, .ep-cc-switch::before { transition: none; }
}

@media print { .ep-cc { display: none; } }
