/* Static archive of michaelakerem.com.
   Replaces what Squarespace's scripts used to do, and styles the archive notice. */

/* EB Garamond (SIL Open Font License) stands in for Adobe Caslon Pro, which was
   licensed through Squarespace's Adobe Fonts kit and cannot be self-hosted. Of 65
   open serif italics compared against the original it is the closest in weight,
   x-height and letterforms. size-adjust matches each weight's width to Adobe
   Caslon's so lines break the same way, and the metric overrides reproduce Adobe
   Caslon's line box (1.0em above the baseline, 0.7em below), measured on the live
   site before it went offline. */
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  size-adjust: 105.9%;
  ascent-override: 94.4%;
  descent-override: 66.1%;
  line-gap-override: 0%;
  src: url(/assets/fonts/eb-garamond-roman.woff2) format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 501 800;
  font-display: swap;
  size-adjust: 100.2%;
  ascent-override: 99.8%;
  descent-override: 69.9%;
  line-gap-override: 0%;
  src: url(/assets/fonts/eb-garamond-roman.woff2) format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  size-adjust: 100.4%;
  ascent-override: 99.6%;
  descent-override: 69.7%;
  line-gap-override: 0%;
  src: url(/assets/fonts/eb-garamond-italic.woff2) format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 501 800;
  font-display: swap;
  size-adjust: 91.6%;
  ascent-override: 109.2%;
  descent-override: 76.4%;
  line-gap-override: 0%;
  src: url(/assets/fonts/eb-garamond-italic.woff2) format("woff2");
}

/* ---------- header offset ---------- */
html.archive {
  --header-height: 112px;
  --header-fixed-top-offset: var(--header-height);
  scroll-padding-top: var(--header-height);
}
@media (max-width: 799px) {
  html.archive {
    --header-height: 84px;
  }
}
.archive #page .page-section:first-child,
.archive .header-menu {
  padding-top: var(--header-height);
}
/* A full-screen first section stops above the archive strip, so the strip never covers its button. */
.archive #page .page-section:first-child[style*="100vh"] {
  min-height: calc(100vh - var(--archive-strip-height, 38px)) !important;
}

/* ---------- buttons ---------- */
/* On the live site, button labels wrapped onto two lines inside a short button at
   in-between widths (roughly 770 to 1000px). Kept on one line here. */
.archive .sqs-block-button-element {
  white-space: nowrap;
}

/* ---------- carousels (hobbies) ---------- */
.archive .user-items-list-carousel {
  --archive-cols: 3;
  --archive-peek: 0px;
}
/* "Show adjacent slides": the next slide peeks in from the page edge. */
.archive .user-items-list-carousel[data-show-adjacent-slides="true"] {
  --archive-peek: 40px;
}
.archive .user-items-list-carousel[data-show-adjacent-slides="true"] .user-items-list-carousel__slides {
  width: auto;
  margin-inline: calc(-1 * var(--pagePadding, 6vw));
  padding-inline: var(--pagePadding, 6vw);
  scroll-padding-inline: var(--pagePadding, 6vw);
}
.archive .user-items-list-carousel[data-max-columns="4"] {
  --archive-cols: 4;
}
.archive .user-items-list-carousel[data-max-columns="2"] {
  --archive-cols: 2;
}
.archive .user-items-list-carousel__slides {
  display: flex;
  gap: var(--archive-gap, 40px);
  opacity: 1;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.archive .user-items-list-carousel__slides::-webkit-scrollbar {
  display: none;
}
.archive .user-items-list-carousel__slide {
  flex: 0 0 calc((100% - var(--archive-peek) - (var(--archive-cols) - 1) * var(--archive-gap, 40px)) / var(--archive-cols));
  width: auto;
  transform: none;
  pointer-events: auto;
  user-select: auto;
  scroll-snap-align: start;
}
.archive .user-items-list-carousel__slides:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}
/* Column counts step down as on the live site (measured there at several widths). */
@media (max-width: 1060px) {
  .archive .user-items-list-carousel[data-max-columns="4"] {
    --archive-cols: 3;
  }
}
@media (max-width: 960px) {
  .archive .user-items-list-carousel[data-max-columns] {
    --archive-cols: 2;
  }
}
@media (max-width: 575px) {
  .archive .user-items-list-carousel[data-max-columns] {
    --archive-cols: 1;
    --archive-peek: 0px;
  }
  .archive .user-items-list-carousel__slides {
    --archive-gap: 20px !important;
  }
}

/* ---------- edits made after archiving (see tools/edits.mjs) ---------- */
.archive .archive-dated {
  font-style: italic;
  opacity: 0.7;
}
.archive .archive-measure p {
  max-width: 36em;
}

/* ---------- accordion ---------- */
.archive .accordion-item__click-target {
  cursor: pointer;
}
/* These titles used the font's own "normal" line height (1.7 for Adobe Caslon).
   Stated outright so Safari, which ignores the metric overrides above, agrees. */
.archive .accordion-item__title {
  line-height: 1.7;
}

/* ---------- archive notice ---------- */
.archive-strip {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.5em;
  padding: 9px 16px calc(9px + env(safe-area-inset-bottom));
  background: #20283a;
  color: #f4f4f1;
  font: 400 13px/1.5 "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.01em;
  text-align: center;
}
.archive-strip a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.archive-strip a:hover {
  text-decoration-thickness: 2px;
}
.archive body {
  padding-bottom: 38px;
}

.archive-dialog {
  box-sizing: border-box;
  width: min(92vw, 520px);
  max-height: 90vh;
  margin: auto;
  padding: 52px 52px 44px;
  border: 0;
  background: #fff;
  color: #1a1a1a;
  box-shadow: 0 24px 80px rgba(10, 14, 26, 0.35);
  font: 400 16px/1.6 "Helvetica Neue", Arial, sans-serif;
}
.archive-dialog:focus {
  outline: none;
}
.archive-dialog::backdrop {
  background: rgba(24, 28, 38, 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.archive-dialog__title {
  margin: 0 0 16px;
  font: italic 400 34px/1.2 "EB Garamond", Georgia, serif;
  letter-spacing: 0.01em;
  text-wrap: balance;
}
.archive-dialog__body {
  margin: 0 0 36px;
  color: #3b3b3b;
}
.archive-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.archive-dialog__btn {
  flex: 1 1 180px;
  box-sizing: border-box;
  margin: 0;
  padding: 19px 24px;
  border: 1px solid #25324f;
  border-radius: 0;
  background: transparent;
  color: #25324f;
  font: 700 15px/1.2 "Helvetica Neue", Arial, sans-serif;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.archive-dialog__btn--primary {
  background: #25324f;
  color: #fff;
}
.archive-dialog__btn:hover {
  background: #25324f;
  color: #fff;
}
.archive-dialog__btn--primary:hover {
  background: #1a2439;
}
.archive-dialog__btn:focus-visible {
  outline: 2px solid #25324f;
  outline-offset: 3px;
}
.archive-dialog__hint {
  margin: 28px 0 0;
  color: #6b6b6b;
  font-size: 13px;
}
@media (max-width: 480px) {
  .archive-dialog {
    padding: 40px 28px 32px;
  }
  .archive-dialog__actions {
    gap: 16px;
  }
  .archive-dialog__body {
    margin-bottom: 30px;
  }
  .archive-dialog__hint {
    margin-top: 24px;
  }
  .archive-dialog__title {
    font-size: 28px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .archive-dialog__btn {
    transition: none;
  }
}
