/* =========================================================================
   Utopia — the members' side: sign-in, the Paths questionnaire, and the
   members' area (map and feed). Uses the colours, type and buttons from
   style.css.
   ========================================================================= */

.page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column;
  padding-top: var(--header-h);
}
.page .site-header { position: fixed; }
.page__main { flex: 1; padding: clamp(2rem, 6vh, 4rem) var(--gutter) clamp(3rem, 8vh, 5rem); }
.page__foot {
  padding: 1rem var(--gutter) calc(1rem + env(safe-area-inset-bottom));
  text-align: center;
  font-family: var(--ui); font-weight: 500; font-size: .8rem; color: var(--pencil);
}
.page__foot p { margin: 0; }

/* rays of light behind the small pages */
.page__rays {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-conic-gradient(from 180deg at 50% -30%, rgb(122 90 46 / .12) 0deg .3deg, transparent .3deg 3.2deg);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 75%);
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}

/* ---------- Sign in ---------- */
.gate {
  max-width: 30rem; margin: 0 auto;
  text-align: center;
}
.gate__logo { width: min(22rem, 80vw); height: auto; margin: 0 auto clamp(1rem, 3vh, 2rem); display: block; }
.gate__title { font-size: var(--step-3); margin-bottom: .35em; }
.gate__lede { margin-bottom: 1.75rem; text-wrap: pretty; }
.gate__form {
  display: grid; gap: .9rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--paper);
  border: 1.5px solid var(--ink);
  box-shadow: 0 0 0 6px var(--paper), 0 0 0 7px rgb(0 0 0 / .25);
  text-align: left;
}
.gate__label { font-family: var(--ui); font-weight: 500; font-size: .95rem; color: var(--ink); }
.gate__input {
  width: 100%; min-height: 3rem; padding: .6rem .9rem;
  border: 1.5px solid var(--pencil); border-radius: 6px;
  font: inherit; color: var(--ink); background: #fff;
}
.gate__input:focus { outline: none; border-color: var(--bronze); box-shadow: 0 0 0 3px rgb(122 90 46 / .2); }
.gate__error { margin: 0; color: #9b2c1f; font-family: var(--ui); font-weight: 500; font-size: .95rem; }
.gate__error[hidden] { display: none; }
.gate__form .button { width: 100%; }
.gate__hint { margin: .2rem 0 0; font-size: .92rem; color: var(--pencil); text-wrap: pretty; }
.gate__alt { margin-top: 1.5rem; font-family: var(--ui); font-weight: 500; }

/* ---------- The Paths questionnaire ---------- */
.paths { max-width: 46rem; margin: 0 auto; }
.paths__head { text-align: center; max-width: 36rem; margin: 0 auto clamp(1.25rem, 3vh, 2rem); }
.paths__head .gate__title { margin-bottom: .3em; }
.paths__frame {
  padding: clamp(.75rem, 3vw, 1.5rem);
  background: var(--paper);
  border: 1.5px solid var(--ink);
  box-shadow: 0 0 0 6px var(--paper), 0 0 0 7px rgb(0 0 0 / .25);
}
.paths__frame iframe { display: block; width: 100%; min-height: 32rem; border: 0; }
.paths__next {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .9rem 1.5rem;
  margin-top: clamp(1.5rem, 4vh, 2.25rem);
  text-align: center;
}
.paths__later { font-family: var(--ui); font-weight: 500; font-size: .95rem; color: var(--pencil); }
.paths__later a { color: var(--pencil); }
.paths__later small { display: block; font-size: .85rem; font-style: italic; font-family: var(--text); font-weight: 400; }

/* ---------- The members' area ---------- */
.members__intro { max-width: 76rem; margin: 0 auto clamp(1.5rem, 4vh, 2.5rem); }
.members__title { font-size: var(--step-3); margin-bottom: .2em; }
.members__intro p { margin: 0; max-width: 40rem; }
.members__intro a { font-weight: 500; }
.members__grid {
  max-width: 76rem; margin: 0 auto;
  display: grid; gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: start;
}
@media (min-width: 960px) {
  .members__grid { grid-template-columns: minmax(19rem, 4fr) minmax(0, 7fr); }
  .feed { position: sticky; top: calc(var(--header-h) + 1.25rem); max-height: calc(100vh - var(--header-h) - 2.5rem); overflow: auto; }
}
.members__grid > * { min-width: 0; }

/* The feed */
.feed {
  padding: clamp(1rem, 2.5vw, 1.5rem);
  background: var(--paper);
  border: 1.5px solid var(--ink);
  box-shadow: 0 0 0 6px var(--paper), 0 0 0 7px rgb(0 0 0 / .25);
}
.feed__title { font-size: var(--step-2); margin-bottom: .2em; }
.feed__group + .feed__group { margin-top: 1.5rem; }
.feed__group-title {
  font-size: var(--step-1); font-style: italic;
  padding-bottom: .35rem; margin-bottom: .6rem;
  border-bottom: 1px solid var(--ink);
}
.feed__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.feed__empty { color: var(--pencil); font-style: italic; margin: 0; }
.link-card {
  display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .8rem; align-items: start;
  padding: .55rem;
  border: 1px solid rgb(0 0 0 / .16); border-radius: 8px;
  color: var(--graphite); text-decoration: none;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s var(--ease-out);
}
.link-card:hover { border-color: var(--bronze); box-shadow: 0 8px 18px -12px rgb(60 40 10 / .45); transform: translateY(-1px); color: var(--graphite); }
.link-card__image {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  border-radius: 5px; background: var(--bone);
}
.link-card__image--blank { display: grid; place-items: center; color: var(--pencil); font-family: var(--display); font-style: italic; font-size: .85rem; }
.link-card__title { display: block; font-family: var(--display); font-size: 1.1rem; line-height: 1.2; color: var(--ink); }
.link-card__text {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: .2rem; font-size: .9rem; line-height: 1.4; color: var(--pencil);
}
.link-card__where { display: block; margin-top: .25rem; font-family: var(--ui); font-weight: 500; font-size: .78rem; color: var(--bronze); }

/* The map */
.map {
  padding: clamp(.6rem, 1.5vw, .9rem);
  background: var(--paper);
  border: 1.5px solid var(--ink);
  box-shadow: 0 0 0 6px var(--paper), 0 0 0 7px rgb(0 0 0 / .25);
}
.map__title { font-size: var(--step-2); margin: .2rem 0 .1em .4rem; }
.map__hint { margin: 0 0 .6rem .4rem; font-size: .95rem; color: var(--pencil); }
.map__land {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid rgb(0 0 0 / .18);
  background: #fff;
}
.map__land > img.map__picture { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.map__paths { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map__paths path { fill: none; stroke: var(--bronze); stroke-width: 2; stroke-dasharray: 1 9; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: .7; }
.map__tree { position: absolute; left: 50%; top: 52%; width: 46%; transform: translate(-50%, -50%); pointer-events: none; }

/* each place is a hotspot: a small framed vignette with a name plate */
.map__place {
  position: absolute; left: var(--x); top: var(--y);
  width: var(--w, 17%);
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center;
  text-decoration: none; color: var(--ink);
}
.map__vignette {
  display: block; width: 100%; aspect-ratio: 5 / 6;
  border: 1.5px solid var(--ink); border-radius: 999px 999px 6px 6px;
  background: #fff;
  box-shadow: 0 0 0 4px #fff, 0 0 0 5px rgb(0 0 0 / .25);
  overflow: hidden;
  transition: transform .35s var(--ease-out), box-shadow .35s ease;
}
.map__vignette img { width: 100%; height: 100%; object-fit: cover; }
.map__place--tree .map__vignette { aspect-ratio: 1; border-radius: 50%; }
.map__name {
  margin-top: .45rem; padding: .2rem .7rem;
  background: var(--paper); border: 1px solid var(--ink); border-radius: 999px;
  font-family: var(--display); font-size: clamp(.8rem, .6rem + .6vw, 1.05rem); line-height: 1.15; text-align: center;
  white-space: nowrap;
}
.map__what { margin-top: .2rem; font-family: var(--ui); font-weight: 500; font-size: clamp(.65rem, .55rem + .3vw, .8rem); color: var(--bronze); text-align: center; white-space: nowrap; }
.map__place:hover .map__vignette, .map__place:focus-visible .map__vignette {
  transform: translateY(-4%) scale(1.04);
  box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--bronze), 0 14px 24px -12px rgb(60 40 10 / .5);
}
.map__place:hover .map__name { border-color: var(--bronze); color: var(--bronze); }
@media (max-width: 599px) {
  .map__land { aspect-ratio: 4 / 5; }
  .map__place { width: calc(var(--w, 17%) * 1.3); }
  .map__what { display: none; }
  .map__name { white-space: normal; max-width: 8rem; }
  .link-card { grid-template-columns: 5rem minmax(0, 1fr); }
}

/* Battle Grounds: two ways in */
.map__choices { display: flex; gap: .3rem; margin-top: .3rem; }
.map__choice {
  padding: .15rem .65rem;
  border: 1px solid var(--bronze); border-radius: 999px; background: #fff;
  font-family: var(--ui); font-weight: 500; font-size: clamp(.68rem, .55rem + .35vw, .85rem); line-height: 1.3;
  color: var(--bronze); text-decoration: none; white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;
}
.map__choice:hover, .map__choice:focus-visible { background: var(--bronze); color: #fff; }
.map__place:focus-within .map__vignette {
  transform: translateY(-4%) scale(1.04);
  box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--bronze), 0 14px 24px -12px rgb(60 40 10 / .5);
}

/* Fast travel: the places again as big cards */
.travel {
  margin-top: clamp(1.25rem, 3vh, 2rem);
  padding: clamp(.6rem, 1.5vw, .9rem);
  background: var(--paper);
  border: 1.5px solid var(--ink);
  box-shadow: 0 0 0 6px var(--paper), 0 0 0 7px rgb(0 0 0 / .25);
}
.travel__title { font-size: var(--step-2); margin: .2rem 0 .5rem .4rem; }
.travel__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fill, minmax(8.25rem, 1fr));
}
.travel__card {
  display: flex; flex-direction: column; height: 100%;
  padding: .5rem .5rem .7rem;
  background: #fff; border: 1px solid rgb(0 0 0 / .16); border-radius: 8px;
  color: var(--ink); text-decoration: none; text-align: center;
  transition: border-color .2s ease, box-shadow .2s ease, transform .25s var(--ease-out);
}
.travel__card img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  border: 1px solid var(--ink); border-radius: 999px 999px 5px 5px; background: #fff;
}
.travel__card--tree img { object-fit: contain; }
.travel__name { margin-top: .55rem; font-family: var(--display); font-size: 1.05rem; line-height: 1.15; }
.travel__what { margin-top: .25rem; font-family: var(--ui); font-weight: 500; font-size: .78rem; line-height: 1.3; color: var(--bronze); }
.travel__card:hover, .travel__card:focus-visible {
  border-color: var(--bronze); color: var(--ink);
  box-shadow: 0 10px 20px -12px rgb(60 40 10 / .5); transform: translateY(-2px);
}
@media (max-width: 599px) {
  .travel__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The Paths questionnaire: once the form is sent, the way in lights up */
.paths__next.is-done .button { box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--bronze), 0 0 28px 6px rgb(122 90 46 / .35); }
.paths__done { flex-basis: 100%; margin: 0; font-family: var(--display); font-size: var(--step-1); font-style: italic; color: var(--ink); }
.paths__done[hidden] { display: none; }

/* on phones and tablets the map comes first */
@media (max-width: 959px) {
  .members__grid .members__places { order: -1; }
}
