/*
 * Fixes and refinements layered on top of the Webflow export.
 * The exported Webflow CSS files are left untouched; everything we change lives here.
 */

/* ---------- Layout: no horizontal scrolling on small screens ---------- */

/* Grid cells default to min-width:auto, so a wide child (the 480px Substack
   iframe) forced the whole WHO grid wider than the phone screen. */
.w-layout-cell {
  min-width: 0;
}

img,
iframe,
video {
  max-width: 100%;
}

/* Substack signup: up to its designed 480px, narrower on small screens. */
.code-embed-6 {
  width: 100%;
  max-width: 480px;
}

.code-embed-6 iframe {
  width: 100%;
}

/* Launch page: the Google Doc embed is deliberately offset/oversized to crop
   the doc's own margins; clip it to its cell instead of widening the page. */
.w-layout-cell:has(> .code-embed-5) {
  overflow-x: clip;
}

/* Long URLs and email addresses in the privacy policy */
.code-embed-3 {
  overflow-wrap: anywhere;
}

/* ---------- Accessibility ---------- */

:focus-visible {
  outline: 2px solid var(--color--text);
  outline-offset: 3px;
}

/* Theme toggle is now a <button role="switch">; keep the Webflow look. */
.toggle_component {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  margin: 0;
  font: inherit;
  color: inherit;
}

/* Enlarge the tap area to ~44px without changing the visual size. */
.toggle_component .toggle_dot {
  flex: none;
}

.toggle_component::after {
  content: "";
  position: absolute;
  inset: -12px -4px;
}

.form-honeypot {
  display: none;
}

/* ---------- Dark mode ---------- */

/* Text that inherited Webflow's default body colour (#333) or was hard-coded
   to it stayed dark on the dark background (privacy policy, "Show only:",
   the homepage "Resources" heading). */
body.dark-mode,
.resources-heading,
.text-block-9 {
  color: var(--color--text);
}

/* Links in the privacy policy and licence embeds were browser-default blue. */
.code-embed-3 a,
.w-embed p a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Swap light/dark artwork from CSS so it's right before theme.js runs. */
body.dark-mode .image_container {
  display: none;
}

body.dark-mode .image_container2 {
  display: block;
}

body.dark-mode .w-input,
body.dark-mode .w-select {
  background-color: var(--dark--background-secondary);
  border-color: rgba(231, 230, 225, 0.25);
  color: var(--dark--text);
}

/* ---------- Footer ---------- */

.link-2 {
  display: inline-block;
  padding: 6px 0;
  line-height: 1.5;
}

/* ---------- Navigation: collapse to the menu below desktop width ---------- */

/* The full nav (What … FAQ + theme toggle) needs ~1105px; below that it was
   clipped, hiding Contact, FAQ and the toggle (e.g. iPad landscape, 1024px). */
@media screen and (max-width: 1119px) {
  .div-block-11 {
    display: none;
  }

  .menu-button {
    display: block;
  }

  .icon {
    display: block;
    width: 100%;
    height: 100%;
    color: var(--color--text);
  }

  .div-block-10 {
    grid-column-gap: 20px;
    justify-content: flex-start;
  }

  /* The navbar clipped its own menus (overflow:hidden), so the inner pages'
     menu opened invisibly. Its only hidden child is display:none anyway. */
  .navbar-2 {
    overflow: visible;
  }

  /* Homepage menu: a full-width panel instead of a 64px column. */

  .navbar-2 .menu-button.w-dropdown {
    position: static;
  }

  .dropdown-toggle-2 {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
  }

  .dropdown-toggle-2 .icon {
    padding-right: 0;
    font-size: 24px;
    line-height: 1;
  }

  .navbar-2 .dropdown-list.w--open {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: auto;
    height: auto;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    /* Left edge lines up with the logo mark (nav padding + the SVG's inner margin). */
    padding: 4px 60px 24px 83px;
    background-color: var(--color--background-secondary);
    box-shadow: 0 12px 24px -16px rgba(0, 0, 0, 0.35);
  }

  .nav-link.mob {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--color--text) 14%, transparent);
    font-size: 20px;
    letter-spacing: 0.5px;
  }

  .dropdown-list .navbar_menu-buttons {
    justify-content: flex-start;
    margin: 20px 0 0;
  }

  /* Inner pages' menu (Webflow nav overlay): same panel as the homepage. */
  .navbar-2 .w-nav-menu[data-nav-menu-open] {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    right: auto;
    padding: 4px 60px 24px 83px;
    background-color: var(--color--background-secondary);
    box-shadow: 0 12px 24px -16px rgba(0, 0, 0, 0.35);
    text-align: left;
  }

  .w-nav-menu[data-nav-menu-open] .nav-link {
    display: flex;
    align-items: center;
    align-self: stretch;
    min-height: 52px;
    padding: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--color--text) 14%, transparent);
    font-size: 20px;
  }

  .w-nav-menu[data-nav-menu-open] .navbar_menu-buttons {
    margin: 20px 0 0;
  }

  .menu-button.w-nav-button.w--open {
    background-color: transparent;
  }

  /* Inner pages' menu button (Webflow nav) */
  .menu-button.w-nav-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
  }

  .menu-button.w-nav-button .icon {
    padding-right: 0;
    font-size: 24px;
    line-height: 1;
  }
}

/* ---------- Tablets ---------- */

@media screen and (min-width: 480px) and (max-width: 991px) {
  /* "PLANETARY" at a fixed 90px ran off the right edge. */
  .landing .heading-3 {
    margin-left: 0;
    margin-right: 0;
    font-size: clamp(56px, 11vw, 90px);
  }
}

@media screen and (min-width: 992px) and (max-width: 1199px) {
  /* Desktop hero is a fixed 130px, wider than the column below ~1200px. */
  .landing .heading-3 {
    margin-left: 0;
    margin-right: 0;
    font-size: min(130px, 10.5vw);
  }
}

/* ---------- Phones ---------- */

@media screen and (max-width: 479px) {
  .navbar-2 {
    padding-left: 12px;
    padding-right: 8px;
  }

  .navbar-2 .dropdown-list.w--open,
  .navbar-2 .w-nav-menu[data-nav-menu-open] {
    padding-left: 35px;
    padding-right: 24px;
  }

  /* Webflow allowed the hero word to be 120% wide; on 320px phones it ran off
     screen. Same size as before at 360px+, scales down below that. */
  .landing .heading-3 {
    box-sizing: border-box;
    max-width: 100%;
    font-size: min(44.8px, 12.4vw);
  }

  /* Resources list and privacy policy kept 60px desktop gutters, leaving a
     240px column for text on a 360px phone. */
  .div-block-9 {
    padding-left: 20px;
    padding-right: 20px;
  }

  .div-block-9 ul {
    padding-left: 20px;
  }

  .landing.resourceslanding {
    padding-bottom: 0;
    margin-bottom: 0;
  }

  /* Meta text (institution, date) was 12px. */
  .h4-copy.location,
  .collection-item-7 .h4:not(.title),
  .div-block-2 .h4:not(.eventpage) {
    font-size: 14px;
  }
}

/* ---------- 404 page ---------- */

.not-found {
  padding-top: 20px;
  padding-bottom: 80px;
}

.not-found .button {
  margin-right: 12px;
}

/* ---------- Images ---------- */

/* width/height attributes reserve space before lazy images load, so in-page
   links (What, Contact, …) land on the right section. */
img[width][height] {
  height: auto;
}

/* ---------- Identity page ---------- */

.identity {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 60px 80px;
}

.identity-section {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 64px;
  padding: 64px 15px;
  border-top: 1px solid color-mix(in srgb, var(--color--text) 16%, transparent);
}

.identity-intro {
  border-top: 0;
  padding-top: 0;
}

.identity-label {
  container-type: inline-size;
}

.identity-body {
  max-width: 760px;
}

.identity-body--wide {
  max-width: none;
}

.identity-heading {
  margin: 0;
  color: var(--color--text);
  font-family: "Pci 2 Vf", sans-serif;
  /* Sized to the label column: TEMPLATES is ~8.3em wide at this weight. */
  font-size: min(84px, 11.8cqi);
  font-weight: 400;
  font-variation-settings: "wght" 754;
  line-height: 1;
  transition: font-variation-settings 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* The typeface moves from order to disorder as you reach each section. */
.identity-section:hover .identity-heading,
.identity-section:focus-within .identity-heading {
  font-variation-settings: "wght" 260;
}

.identity-kicker {
  margin: 0 0 8px;
  color: var(--color--text);
  font-family: Inter, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.identity-meta,
.identity-caption,
.identity-quote footer {
  margin: 0;
  color: var(--color--text);
  font-family: "Space Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
}

.identity-quote {
  margin: 0;
  padding: 0;
  border: 0;
}

.identity-quote p {
  margin: 0 0 16px;
  color: var(--color--text);
  font-family: Inter, sans-serif;
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 400;
  line-height: 1.35;
}

.identity .section-para + .section-para {
  margin-top: 16px;
}

.identity .section-para a,
.identity .text-block-3 a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.identity .text-block {
  margin: 0 0 20px;
  padding: 0;
}

.identity-subheading {
  margin-top: 64px;
}

.identity-figure {
  margin: 32px 0 0;
}

.identity-figure img {
  display: block;
  width: 100%;
  height: auto;
}

/* The logo and wordmark files are white on transparent. */
.identity-figure--dark {
  padding: clamp(16px, 3vw, 32px);
  background-color: #231f20;
}

.identity .button {
  margin-top: 32px;
}

/* Live type specimen */
.font-specimen {
  container-type: inline-size;
  margin-top: 32px;
  padding: clamp(20px, 3vw, 40px);
  background-color: var(--color--background-secondary);
}

.font-specimen-text {
  margin: 0 0 24px;
  color: var(--color--text);
  font-family: "Pci 2 Vf", sans-serif;
  /* Glyphs widen with weight: PLANETARY is ~9em wide at 900. */
  font-size: min(96px, 10.8cqi);
  line-height: 1.05;
  text-transform: uppercase;
  overflow-wrap: break-word;
  outline-offset: 8px;
}

.font-specimen-control {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  color: var(--color--text);
  font-family: Inter, sans-serif;
  font-size: 14px;
  font-weight: 600;
}

.font-specimen-control input {
  flex: 1;
  min-height: 44px;
  margin: 0;
  accent-color: #4aba77;
}

.font-specimen-control output {
  min-width: 3ch;
  font-family: "Space Mono", monospace;
  font-weight: 400;
  text-align: right;
}

.inter-specimen {
  margin: 24px 0 32px;
  color: var(--color--text);
  font-family: Inter, sans-serif;
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* Colour swatches */
.swatches {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.swatch {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--color--text);
}

.swatch-chip {
  display: block;
  aspect-ratio: 3 / 4;
  margin-bottom: 8px;
  border: 1px solid color-mix(in srgb, var(--color--text) 16%, transparent);
}

.swatch-hex {
  font-family: "Space Mono", monospace;
  font-size: 14px;
  font-weight: 700;
}

.swatch-rgb {
  font-family: "Space Mono", monospace;
  font-size: 12px;
}

.template-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.template-pair .identity-figure {
  margin-top: 0;
}

.template-pair img {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  .identity-heading {
    transition: none;
  }
}

@media screen and (max-width: 991px) {
  .identity-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 48px 0;
  }

  .identity-intro {
    padding-top: 0;
  }

  .swatches {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .swatch-chip {
    aspect-ratio: 4 / 3;
  }
}

@media screen and (max-width: 479px) {
  .identity {
    padding: 0 20px 48px;
  }

  .identity-subheading {
    margin-top: 48px;
  }

  .template-pair {
    grid-template-columns: minmax(0, 1fr);
  }
}
