/* Nathan Greenberg — site styles.
   Sizes and spacing follow the Squarespace version this site replaced:
   - Type sizes use Squarespace's scale, 1rem + (step - 1) × 1.2 × unit, where the unit is
     1vw on desktop and 1% of the window height (capped at 900px) on phones.
   - Fonts: EB Garamond stands in for Adobe Caslon Pro (body) and Newsreader for
     Freight Text Pro (headings); font-size-adjust scales each to match the originals.
   - Page layout is a grid (see .fe below and layout.css). */

:root {
  --bg: #fff5e9;
  --menu-bg: #fff;
  --ink: #000;
  --body-font: "EB Garamond", "Adobe Caslon Pro", Georgia, serif;
  --heading-font: "Newsreader", "Freight Text Pro", Georgia, serif;
  --unit: calc(min(100vh, 900px) / 100);
  --fs-1-2: calc(1rem + 0.2 * 1.2 * var(--unit));
  --fs-1-6: calc(1rem + 0.6 * 1.2 * var(--unit));
  --fs-2: calc(1rem + 1 * 1.2 * var(--unit));
  --fs-2-2: calc(1rem + 1.2 * 1.2 * var(--unit));
  --fs-2-7: calc(1rem + 1.7 * 1.2 * var(--unit));
}
@media (min-width: 768px) {
  :root { --unit: 1vw; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body-font);
  font-size-adjust: 0.425;
  font-size: var(--fs-1-2);
  line-height: 1.2;
}
body.menu-open { overflow: hidden; }

/* Everything set in the heading face: small optical size and matched scale */
.site-title, h1, h2, h3, h4, .acc-title {
  font-family: var(--heading-font);
  font-weight: 400;
  font-size-adjust: 0.429;
  font-variation-settings: "opsz" 16;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Visually hidden, but read by screen readers and search engines */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 30; background: var(--ink); color: var(--bg); padding: 0.5em 1em; }
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Header ---------- */
.header {
  position: relative;
  z-index: 20;
  padding: 6vw;
}
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
}
.site-title {
  justify-self: start;
  font-size: var(--fs-1-2);
  line-height: 1.4;
  text-decoration: none;
}
.header-nav, .header .header-social { display: none; }

.burger {
  justify-self: end;
  position: relative;
  width: 47px;
  height: 37px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.burger span {
  position: absolute;
  left: 6px;
  width: 35px;
  height: 1px;
  background: currentColor;
  transition: transform 0.25s cubic-bezier(0.2, 0.6, 0.3, 1);
}
.burger span:first-child { top: 13px; }
.burger span:last-child { top: 23px; }
.menu-open .burger span:first-child { transform: translateY(5px) rotate(45deg); }
.menu-open .burger span:last-child { transform: translateY(-5px) rotate(-45deg); }

.social { display: flex; align-items: center; }
.social a { display: inline-flex; }
.social svg { width: 20px; height: 20px; }

/* Phone menu */
.menu {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--menu-bg);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s;
}
.menu-open .menu { visibility: visible; opacity: 1; }
.menu-nav { display: flex; flex-direction: column; align-items: center; gap: 0.7em; font-size: var(--fs-2-7); line-height: 1; }
.menu-nav a { text-decoration: none; }
.menu-social {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(23px + env(safe-area-inset-bottom, 0px));
  height: 55px;
  justify-content: center;
  gap: 19px;
}
.menu-social svg { width: 21px; height: 21px; }

/* The desktop header starts at 800px (text sizes switch at 768px). Its three columns are
   equal, so on narrower windows the page links wrap onto two lines, as on Squarespace. */
@media (min-width: 800px) {
  .header { padding: 1.8vw 4vw; }
  .header-inner { grid-template-columns: 1fr 1fr 1fr; }
  .site-title { font-size: var(--fs-2); }
  .header-nav { display: flex; flex-wrap: wrap; justify-content: center; }
  .header-nav a {
    margin: 0 0.55em;
    padding: 0.1em 0;
    text-decoration: none;
    background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  }
  .header-nav a:hover,
  .header-nav a[aria-current="page"] { background-size: 100% 1px; }
  .header .header-social { display: flex; justify-self: end; gap: 1.1em; }
  .burger, .menu { display: none; }
}

/* ---------- Sections and grid ---------- */
.section.padded { padding-block: calc(3.3 * var(--unit)); }
footer.section { margin-top: auto; }

.fe {
  --gutter: calc(6vw - 11px);
  --cell: calc((2560px - 11px * 7) / 8);
  display: grid;
  grid-template-columns: minmax(var(--gutter), 1fr) repeat(8, minmax(0, var(--cell))) minmax(var(--gutter), 1fr);
  gap: 11px;
  overflow-x: clip;
}
@media (min-width: 768px) {
  .fe {
    --gutter: calc(4vw - 11px);
    --cell: calc((2560px - 11px * 23) / 24);
    --row: calc(min(2560px, 92vw) * 0.0215);
    grid-template-columns: minmax(var(--gutter), 1fr) repeat(24, minmax(0, var(--cell))) minmax(var(--gutter), 1fr);
  }
}

.blk { position: relative; min-width: 0; }
@media (min-width: 780px) {
  .hide-desktop { display: none; }
}

/* Text blocks */
.text > :first-child { margin-top: 0; }
.text > :last-child { margin-bottom: 0; }
h3, h1.h3 { font-size: var(--fs-2-2); line-height: 1.3328; margin: 2rem 0; }
h4 { font-size: var(--fs-1-6); line-height: 1.3664; margin: 2rem 0; }
p { margin: 1rem 0; }
p.large { font-size: var(--fs-1-6); }
.ta-center { text-align: center; }
.ta-right { text-align: right; }
.ta-justify { text-align: justify; }

/* Image block: the photo fits inside its grid area, centered */
.blk-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

/* Video and embeds */
.video { position: relative; width: 100%; background: #000; }
.video.r16-9 { aspect-ratio: 16 / 9; }
.video.r4-3 { aspect-ratio: 4 / 3; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Click-to-play thumbnail (site.js replaces it with the YouTube player) */
.video .yt { position: absolute; inset: 0; display: block; cursor: pointer; }
.video .yt img { width: 100%; height: 100%; object-fit: contain; }
.play-btn { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; transform: translate(-50%, -50%); }
.play-bg { fill: #212121; fill-opacity: 0.8; transition: fill 0.1s, fill-opacity 0.1s; }
.video .yt:hover .play-bg, .video .yt:focus-visible .play-bg { fill: #f00; fill-opacity: 1; }
/* A fixed 450px square, as on Squarespace, so Bandcamp shows only the album art (full width on phones).
   margin-bottom: the space Squarespace left under the inline player. */
.bandcamp { display: block; border: 0; width: 100%; aspect-ratio: 1; height: auto; margin-bottom: 0.4626em; }
@media (min-width: 768px) {
  .bandcamp { width: 450px; height: 450px; }
}
.instagram {
  display: block;
  border: 0;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.5), 0 1px 10px 0 rgba(0, 0, 0, 0.15);
  margin: 1px;
  width: calc(100% - 2px);
  max-width: 540px;
  height: 722px;
}
@media (min-width: 768px) {
  .instagram { height: 658px; }
}

/* Reviews (Teaching page): more space above them than Squarespace left on desktop */
@media (min-width: 768px) {
  .blk.review { margin-top: 2.25rem; }
}

/* Social icons under the page on phones */
.social-footer { justify-content: center; gap: 12px; }

/* Accordion (Teaching page) */
.accordion { border-top: 1px solid currentColor; }
.accordion details { border-bottom: 1px solid currentColor; }
.accordion summary {
  display: flex;
  align-items: center;
  padding: 8px 0 10px;
  cursor: pointer;
  list-style: none;
}
.accordion summary::-webkit-details-marker { display: none; }
.acc-title { flex: 1; padding-right: 14px; font-size: var(--fs-1-6); line-height: 1.25; }
.acc-icon { position: relative; flex: none; width: 14px; height: 14px; }
.acc-icon::before, .acc-icon::after {
  content: "";
  position: absolute;
  left: 0;
  top: calc(50% - 1px);
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform 0.25s;
}
.acc-icon::after { transform: rotate(90deg); }
details[open]:not(.closing) .acc-icon::after { transform: rotate(0deg); }
/* The panel's height is animated by site.js when a section opens or closes */
.acc-panel { overflow: hidden; }
.acc-desc {
  display: flow-root;
  width: max(80%, min(300px, 100%));
  margin: 16px auto;
  padding-bottom: 15px;
  font-size: var(--fs-1-6);
  line-height: 1.2;
}
.acc-desc p { margin: 0 0 16px; }
.acc-desc > :last-child { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  .menu, .burger span, .acc-icon::before, .acc-icon::after { transition: none; }
}
