/*!
 * We Remember · Femicide Watch memorial page (design version) · Women's Aid
 * Built to the black & white option of the web layout (pages 6–7), updated to the client's
 * "Desktop update" and "Mobile update" mock-ups. Every rule is scoped under .fw (the memorial) or
 * .fw-site-header (the demo page header), so it can sit inside a WordPress theme.
 *
 * Sizes are multiples of --ns, the size of a name in the list, measured from the mock-ups:
 * phone 375 px frame:    names 20 px, rows 2.7 × name, bio 0.8 × name, heading 1 × name
 * desktop 1440 px frame: names 26 px (1.806 vw), rows 2.77 × name, bio and dates 0.731 × name, heading 1 × name
 * Names, stories and "We Remember" are Taviraj Light (the phone heading is Taviraj Regular); dates are Montserrat.
 */

/* ---------------------------------------------------------------- tokens */
.fw,
.fw-site-header,
.fw-skip {
  --fw-bg: #000;
  --fw-ink: #e6e7e8;        /* off-white text */
  --fw-ink-strong: #fff;    /* the open name, as in the desktop mock-up */
  --fw-muted: #747578;      /* greyed-out names: the darkest grey that keeps WCAG AA (4.5:1) for 20 px names */
  --fw-purple: #5c2e91;     /* Women's Aid purple */
  --fw-dot: #7d60a9;        /* dot purple from the layout */
  --fw-focus: #cbb8ef;
  --fw-serif: "Taviraj", Georgia, "Times New Roman", serif;
  --fw-sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --fw-base: max(16px, 1rem);
  --fw-gutter: clamp(20px, 7.4vw, 40px);
  --fw-ease: cubic-bezier(.22, .61, .36, 1);
  --fw-ease-out: cubic-bezier(.16, 1, .3, 1);
}

.fw {
  --ns: clamp(calc(var(--fw-base) * 1.125), 5.33vw, calc(var(--fw-base) * 1.3));
  --fw-top: var(--fw-header-h, 0px);  /* a fixed site header above the memorial, while it shows */
  position: relative;
  isolation: isolate;
  background: var(--fw-bg);
  color: var(--fw-ink);
  font-family: var(--fw-sans);
  font-size: var(--fw-base);
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html.fw-header-hidden .fw { --fw-top: 0px; }

/* Full-bleed inside a narrow WordPress content column (class fw--breakout) */
.fw.fw--breakout {
  width: var(--fw-vw, 100vw);
  max-width: none;
  margin-left: calc(50% - var(--fw-vw, 100vw) / 2);
  margin-right: calc(50% - var(--fw-vw, 100vw) / 2);
}

/* ----------------------------------------------------- neutralise theme styles */
.fw *,
.fw *::before,
.fw *::after { box-sizing: border-box; }

.fw h1, .fw h2, .fw h3, .fw p, .fw ul, .fw li, .fw figure {
  margin: 0;
  padding: 0;
  border: 0;
  font: inherit;
  color: inherit;
  letter-spacing: normal;
  text-transform: none;
  background: none;
}
.fw ul { list-style: none; }
.fw ul li,
.fw .fw-person { list-style: none; margin: 0; padding: 0; }
.fw li::before, .fw li::marker { content: none; }
.fw img { max-width: 100%; height: auto; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; }

.fw .fw-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-align: inherit;
  text-decoration: none;
  text-shadow: none;
  text-transform: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.fw :focus { outline: none; }
.fw :focus-visible {
  outline: 2px solid var(--fw-focus);
  outline-offset: 4px;
  border-radius: 4px;
}

.fw .fw-sr,
.fw-site-header .fw-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Skip link: only visible when focused */
.fw-skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: .75em 1.1em;
  border-radius: 999px;
  background: #fff;
  color: var(--fw-purple);
  font: 600 15px/1 var(--fw-sans);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .3s var(--fw-ease-out);
}
.fw-skip:focus { transform: none; outline: 2px solid var(--fw-purple); outline-offset: 3px; }

/* =============================================================== WE REMEMBER */
.fw .fw-remember { padding: 0 var(--fw-gutter) calc(var(--ns) * 2.5); }
.fw .fw-remember__inner { position: relative; max-width: 1600px; margin: 0 auto; }

/* "We Remember": a bar that stays at the top on phones */
.fw .fw-remember__head {
  position: sticky;
  top: var(--fw-top);
  z-index: 3;
  margin: 0 calc(-1 * var(--fw-gutter));
  padding: calc(var(--ns) * 1.5) var(--fw-gutter) calc(var(--ns) * 1.15);
  background: var(--fw-bg);
  text-align: center;
  transition: top .5s var(--fw-ease-out);
}
.fw .fw-remember__head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: calc(var(--ns) * .9);
  background: linear-gradient(var(--fw-bg), rgba(0, 0, 0, 0));
  pointer-events: none;
}
.fw .fw-title {
  font-family: var(--fw-serif);
  font-weight: 400;
  font-size: var(--ns);
  line-height: 1.2;
}

/* Letters of the heading rise in on load */
.fw .fw-split__char { display: inline-block; white-space: pre; }
.fw-js .fw .fw-split .fw-split__char {
  opacity: 0;
  transform: translateY(.45em);
  filter: blur(4px);
  transition:
    opacity .9s var(--fw-ease) calc(var(--c) * 45ms),
    transform 1s var(--fw-ease-out) calc(var(--c) * 45ms),
    filter .9s var(--fw-ease) calc(var(--c) * 45ms);
}
.fw-js .fw .fw-split.is-revealed .fw-split__char { opacity: 1; transform: none; filter: none; }

/* The list */
.fw .fw-list {
  position: relative;
  max-width: 36em;
  margin: 0 auto;
  transition: padding-bottom .6s var(--fw-ease-out);
}
.fw .fw-list__state {
  padding: 3em 0;
  color: var(--fw-muted);
  text-align: center;
}
.fw .fw-list__state strong { display: block; margin-bottom: .4em; color: var(--fw-ink); font-weight: 400; }

.fw .fw-person {
  position: relative;
  font-family: var(--fw-serif);
  font-size: var(--ns);
  font-weight: 300;
}
.fw .fw-person__toggle.fw-btn {
  display: grid;
  /* the names start in line with the centred "We Remember" (the script measures --fw-name-x) */
  grid-template-columns: max(1.9em, calc(var(--fw-name-x, 4.1em) - 1.55em)) 1.55em minmax(0, 1fr);
  grid-template-areas: "year dot name";
  align-items: baseline;
  width: 100%;
  padding: .675em 0;
  color: var(--fw-ink);
  line-height: 1.35;
  text-align: left;
}
.fw .fw-person__name { grid-area: name; }
/* dates are set smaller, so their figures stand as tall as the names' x-height */
.fw .fw-person__year {
  grid-area: year;
  font-family: var(--fw-sans);
  font-size: .731em;
  font-weight: 400;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.fw .fw-person__dot {
  grid-area: dot;
  position: relative;
  justify-self: center;
  align-self: start;
  margin-top: .56em;        /* centred on the x-height of the name's first line */
  width: .3em;
  height: .3em;
  border-radius: 50%;
  background: var(--fw-dot);
  transition: transform .5s var(--fw-ease-out);
}
.fw .fw-person__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--fw-dot);
  border-radius: 50%;
  opacity: 0;
}
.fw .fw-person__toggle:hover .fw-person__dot { transform: scale(1.5); }
.fw .fw-person.is-open .fw-person__dot::after { animation: fw-ripple 1.6s var(--fw-ease-out) .05s 1; }
@keyframes fw-ripple { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(6); opacity: 0; } }

/* While one is open, it turns white and the other names and dates are greyed out */
.fw .fw-person.is-open .fw-person__toggle { color: var(--fw-ink-strong); }
.fw .fw-list.has-open .fw-person:not(.is-open) .fw-person__toggle { color: var(--fw-muted); }
.fw .fw-list.has-open .fw-person:not(.is-open) .fw-person__toggle:hover { color: #b8b9bc; }

/* Scroll reveal: names rise from below on the way down and settle from above on the way back up */
.fw-js .fw .fw-person__toggle.fw-btn {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition:
    opacity .7s var(--fw-ease) var(--fw-delay, 0ms),
    transform .9s var(--fw-ease-out) var(--fw-delay, 0ms),
    color .8s var(--fw-ease);
}
.fw-js .fw .fw-person__toggle.from-above { transform: translate3d(0, -18px, 0); }
.fw-js .fw .fw-person__toggle.is-visible { opacity: 1; transform: none; }

/* The story: unfolds under the name on phones */
.fw .fw-person__detail {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows .55s var(--fw-ease-out), visibility 0s linear .55s;
}
.fw .fw-person.is-open .fw-person__detail {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows .9s var(--fw-ease-out), visibility 0s;
}
.fw .fw-person__clip { min-height: 0; overflow: hidden; }
.fw .fw-person__inner {
  position: relative;
  padding: .1em 0 1.6em;
  font-size: .8em;
}
.fw .fw-person__inner > * {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .22s var(--fw-ease), transform .3s var(--fw-ease);
}
.fw .fw-person.is-open .fw-person__inner > * {
  opacity: 1;
  transform: none;
  transition:
    opacity 1s var(--fw-ease) calc(.25s + var(--i, 0) * 140ms),
    transform 1.2s var(--fw-ease-out) calc(.25s + var(--i, 0) * 140ms);
}
.fw .fw-no-anim,
.fw .fw-no-anim * { transition: none !important; animation: none !important; }

.fw .fw-person__bio p { line-height: 1.5; }
.fw .fw-person__bio p + p { margin-top: .9em; }

/* Photo: wipes open, the image settles in */
.fw .fw-photo__frame {
  position: relative;
  width: 52.6%;
  aspect-ratio: 1.097;
  margin: .1em 0 1.45em;
  overflow: hidden;
  background: #111113;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.3s var(--fw-ease-out) .15s;
}
.fw .fw-photo.is-in .fw-photo__frame { clip-path: inset(0 0 0 0); }
.fw .fw-photo__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  transition: transform 2s var(--fw-ease-out) .15s;
}
.fw .fw-photo.is-in .fw-photo__frame img { transform: none; }
.fw[data-photo-tone="mono"] .fw-photo__frame img { filter: grayscale(1); }

/* ====================================================================== DESKTOP */
@media (min-width: 1024px) {
  .fw {
    --ns: clamp(calc(var(--fw-base) * 1.2), 1.806vw, calc(var(--fw-base) * 1.75));
    --fw-gutter: 5%;
    /* The line "We Remember" sits on and the open name comes level with, measured from the top of the
       window. Low enough to leave room above it for the photo (353 px in the 1440 × 840 mock-up). */
    --fw-line: max(calc(var(--fw-header-h, 0px) + var(--ns) * 2), min(24.5vw, 50vh));
  }
  .fw .fw-remember { padding-top: calc(var(--ns) * .91); }

  /* "We Remember" sits in the left column and stays on the line of the open name */
  .fw .fw-remember__head {
    position: absolute;
    top: calc(var(--ns) * .786);   /* (row height − heading height) / 2: level with the first name at rest */
    bottom: 0;
    left: 0;
    width: 20%;
    margin: 0;
    padding: 0;
    background: none;
    text-align: left;
    z-index: 1;
  }
  .fw .fw-remember__head::after { content: none; }
  .fw .fw-title {
    position: sticky;
    top: calc(var(--fw-line) - var(--ns) * .6);
    font-weight: 300;
  }

  .fw .fw-list { max-width: none; }

  /* name right-aligned up to the centre line, the dot on it, the year after it */
  .fw .fw-person__toggle.fw-btn {
    width: calc(30% + .61em + 2.2em);
    margin-left: 20%;
    grid-template-columns: minmax(0, 1fr) 1.22em 2.2em;
    grid-template-areas: "name dot year";
    padding: .711em 0;
  }
  .fw .fw-person__name { text-align: right; }
  .fw .fw-person__year { text-align: left; }

  /* the story hangs to the right, its first line level with the name */
  .fw .fw-person__detail {
    position: absolute;
    top: 0;
    left: 59.4%;
    right: 1%;
    z-index: 2;
    grid-template-rows: 1fr;
    opacity: 0;
    /*transform: translateX(-10px);*/
    pointer-events: none;
    transition: opacity .35s var(--fw-ease), transform .45s var(--fw-ease), visibility 0s linear .45s;
  }
  .fw .fw-person.is-open .fw-person__detail {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    transition: opacity 1s var(--fw-ease) .2s, transform 1.4s var(--fw-ease-out) .2s, visibility 0s;
  }
  .fw .fw-person__clip { overflow: visible; }
  .fw .fw-person__inner { padding: 1.275em 0 1em; font-size: .731em; }
  .fw .fw-person__bio p { line-height: 1.474; }

  .fw .fw-photo__frame { width: 41.5%; margin: 0 0 1em; }
  /* with room above the row, the photo sits above the story as in the layout */
  .fw .fw-person.photo-above .fw-photo {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% - .316em);
  }
  .fw .fw-person.photo-above .fw-photo__frame { margin: 0; }
}

/* Names are 24 px or more from here, so WCAG's large-text rule (3:1) applies: use the mock-up's own grey */
@media (min-width: 1330px) {
  .fw { --fw-muted: #6d6e71; }
}

/* ================================================================ ABOUT PAGE */
/* "We Remember" with the campaign text beside it, set like a story (about.html) */
.fw .fw-about { padding: calc(var(--ns) * 1.5) var(--fw-gutter) calc(var(--ns) * 2.5); }
.fw .fw-about__inner { max-width: 1600px; margin: 0 auto; }
.fw .fw-title.fw-about__title { position: static; text-align: center; }
.fw .fw-about__text {
  max-width: 36em;
  margin: calc(var(--ns) * 1.15) auto 0;
  font-family: var(--fw-serif);
  font-size: calc(var(--ns) * .8);
  font-weight: 300;
}
.fw .fw-about__text p { line-height: 1.5; }
.fw .fw-about__text p + p { margin-top: .9em; }
.fw-js .fw .fw-about__text p {
  opacity: 0;
  animation: fw-rise 1.1s var(--fw-ease-out) forwards;
  animation-delay: calc(.35s + var(--i, 0) * 110ms);
}
@keyframes fw-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (min-width: 1024px) {
  /* Desktop: measured from the About layout. "We Remember" on the left at the gutter, the text from 31 % of
     the window, about 40 % of the content width wide, its first line on the baseline of "We Remember". */
  /* "We Remember" sits on the same line as on the list pages (--fw-line) and stays there while the text scrolls */
  .fw .fw-about { padding-top: calc(var(--fw-line) - var(--fw-header-h, 0px) - var(--ns) * .6); }
  .fw .fw-about__inner {
    display: grid;
    grid-template-columns: 29% minmax(0, 40%);
    align-items: baseline;
  }
  .fw .fw-title.fw-about__title {
    position: sticky;
    top: calc(var(--fw-line) - var(--ns) * .6);
    text-align: left;
  }
  .fw .fw-about__text { max-width: none; margin: 0; font-size: calc(var(--ns) * .731); }
  .fw .fw-about__text p { line-height: 1.474; }
}

/* ============================================================ MENU: current page */
.fw-menu a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .25em; }

/* ====================================================================== FOOTER */
.fw.fw-footer { padding: calc(var(--ns) * 1.5) var(--fw-gutter) calc(var(--ns) * 2.5); }
.fw .fw-footer__inner { max-width: 1600px; margin: 0 auto; }
.fw .fw-footer__logo { display: block; width: clamp(150px, 14.5vw, 200px); height: auto; }

/* ============================================================ DEMO SITE HEADER */
.fw-site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  color: var(--fw-purple);
  font-family: var(--fw-sans);
  font-size: 16px;
  transition: transform .5s var(--fw-ease-out);
}
.fw-site-header.is-hidden { transform: translateY(-100%); }
.fw-site-header__bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 var(--fw-gutter);
  background: #fff;
}
.fw-site-header__brand { display: flex; align-items: center; line-height: 0; }
.fw-site-header__brand:focus-visible,
.fw-site-header .fw-burger:focus-visible,
.fw-menu a:focus-visible { outline: 2px solid var(--fw-purple); outline-offset: 4px; border-radius: 4px; }
.fw-logo--wide { display: none; width: clamp(150px, 14.5vw, 200px); height: auto; }
.fw-logo--stacked { display: block; width: 46px; height: auto; }
.fw-site-header .fw-burger {
  appearance: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin: 0 -8px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  cursor: pointer;
}
.fw-site-header .fw-burger i {
  position: absolute;
  left: 10px;
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: var(--fw-purple);
  transition: transform .45s var(--fw-ease-out), opacity .3s;
}
.fw-site-header .fw-burger i:nth-of-type(1) { top: 14px; }
.fw-site-header .fw-burger i:nth-of-type(2) { top: 21px; }
.fw-site-header .fw-burger i:nth-of-type(3) { top: 28px; }
.fw-site-header .fw-burger[aria-expanded="true"] i:nth-of-type(1) { transform: translateY(7px) rotate(45deg); }
.fw-site-header .fw-burger[aria-expanded="true"] i:nth-of-type(2) { opacity: 0; transform: scaleX(.2); }
.fw-site-header .fw-burger[aria-expanded="true"] i:nth-of-type(3) { transform: translateY(-7px) rotate(-45deg); }

.fw-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1;
  padding: 1.25em var(--fw-gutter) 2em;
  background: #fff;
  box-shadow: 0 24px 40px rgba(0, 0, 0, .35);
  visibility: hidden;
  clip-path: inset(0 0 100% 0);
  transition: clip-path .55s var(--fw-ease-out), visibility 0s linear .55s;
}
.fw-site-header.menu-open .fw-menu { visibility: visible; clip-path: inset(0 0 -60px 0); transition: clip-path .7s var(--fw-ease-out), visibility 0s; }
.fw-menu ul { display: grid; gap: .25em; margin: 0; padding: 0; list-style: none; }
.fw-menu li { margin: 0; padding: 0; }
.fw-menu a {
  display: inline-block;
  padding: .35em 0;
  color: var(--fw-purple);
  font-size: clamp(1.25em, 1em + 1vw, 1.6em);
  font-weight: 500;
  text-decoration: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .25s, transform .3s, color .3s;
}
.fw-site-header.menu-open .fw-menu a {
  opacity: 1;
  transform: none;
  transition: opacity .6s var(--fw-ease) calc(.12s + var(--i, 0) * 60ms), transform .7s var(--fw-ease-out) calc(.12s + var(--i, 0) * 60ms), color .3s;
}
.fw-menu a:hover { color: #000; }

@media (min-width: 768px) {
  .fw-site-header__bar { height: 64px; }
  .fw-logo--wide { display: block; }
  .fw-logo--stacked { display: none; }
}
@media (min-width: 1024px) {
  .fw-site-header { --fw-gutter: 5%; }
}

/* ============================================================ preferences */
@media (prefers-reduced-motion: reduce) {
  .fw *,
  .fw *::before,
  .fw *::after,
  .fw-site-header,
  .fw-site-header * {
    animation-duration: .001s !important;
    animation-iteration-count: 1 !important;
  }
  .fw-js .fw .fw-person__toggle.fw-btn,
  .fw-js .fw .fw-person__toggle.from-above,
  .fw .fw-person__inner > *,
  .fw .fw-person__detail,
  .fw .fw-photo__frame img,
  .fw-js .fw .fw-split .fw-split__char { transform: none !important; filter: none !important; }
}

@media (forced-colors: active) {
  .fw .fw-person__dot { background: CanvasText; forced-color-adjust: none; }
  .fw .fw-person.is-open .fw-person__toggle { text-decoration: underline; }
  .fw .fw-list.has-open .fw-person:not(.is-open) .fw-person__toggle { color: GrayText; }
}

@media print {
  .fw { background: #fff; color: #000; }
  .fw-js .fw .fw-person__toggle.fw-btn { opacity: 1; transform: none; color: #000; }
  .fw .fw-remember__head { position: static; background: none; }
}
