/* Attleborough Players. Values taken from the old site; see reference/notes.md. */

@font-face {
  font-family: "Almarai";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/almarai-400.woff2") format("woff2");
}

@font-face {
  font-family: "Almarai";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/almarai-700.woff2") format("woff2");
}

:root {
  --purple: #7049ba;
  --pink: #e95095;
  --text: #333333;
  --heading: #1a1a1a;
  --button: #066aab;
  --error: #d63637;
  --column: 1140px;
  --gutter: 40px;
  --section-pad: 64px;
  --font-body: "Almarai", sans-serif;
  --font-display: "Trebuchet MS", Helvetica, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #ffffff;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 28px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--pink);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--purple);
}

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

p {
  margin: 0 0 24px;
}

h1,
h2,
h3 {
  margin: 0 0 24px;
  color: var(--heading);
  font-weight: 400;
}

h1 {
  font-size: 48px;
  line-height: 1.2;
}

h2 {
  font-size: 32px;
  line-height: 1.2;
}

h3 {
  font-size: 27.2px;
  line-height: 1.2;
}

ul {
  margin: 0 0 24px 40px;
  padding: 0;
}

li {
  margin-bottom: 8px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Layout */

.section {
  padding: var(--section-pad) var(--gutter);
}

.section + .section {
  padding-top: 0;
}

.column {
  max-width: var(--column);
  margin: 0 auto;
}

.center {
  text-align: center;
}

.gap {
  height: 48px;
}

.rule {
  height: 96px;
  display: flex;
  align-items: center;
}

.rule::before {
  content: "";
  flex: 1;
  border-top: 1px solid var(--pink);
}

.rule + .rule {
  margin-top: -48px;
}

.img-center {
  margin-left: auto;
  margin-right: auto;
}

.hero-img {
  width: 1024px;
}

/* Header and footer, shared by every page: see frontend/includes/. */

.site-header {
  padding-top: 16px;
  padding-bottom: 16px;
}

.site-header + main > .section:first-child,
.site-footer {
  padding-top: 0;
}

.site-footer__links {
  margin: 0 0 8px;
  font-weight: 700;
}

.site-footer__links span {
  margin: 0 8px;
  color: var(--text);
  font-weight: 400;
}

.site-footer__note {
  margin: 0;
  font-size: 14px;
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.masthead__logo {
  width: 300px;
}

.socials {
  display: flex;
  margin: 0;
  list-style: none;
}

.socials li {
  margin: 0;
}

.socials a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
}

.socials svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Home: content */

.shadow {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.welcome {
  color: var(--purple);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.stage-photo {
  width: 100%;
  aspect-ratio: 1140 / 562;
  object-fit: cover;
}

.noda {
  display: block;
  width: 300px;
  max-width: 100%;
  margin: 0 auto;
}

.section-title {
  margin: 0;
  color: var(--purple);
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  line-height: 1.2;
}

.poster {
  width: 1080px;
}

.licence {
  margin: 0;
  font-style: italic;
}

.ticket-shop {
  width: 100%;
  min-height: 1px;
}

/* Home: past shows carousel */

.carousel {
  position: relative;
}

.carousel__track {
  display: flex;
  gap: 30px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.carousel__track::-webkit-scrollbar {
  display: none;
}

.carousel__track li {
  flex: 0 0 calc((100% - 90px) / 4);
  margin: 0;
  scroll-snap-align: start;
}

.carousel__track img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.carousel__button {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-top: -28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s;
}

.carousel__button:hover {
  background: var(--pink);
}

.carousel__button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.carousel__button--prev {
  left: 8px;
}

.carousel__button--next {
  right: 8px;
}

/* Home: social */

.follow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 0;
  list-style: none;
}

.follow li {
  margin: 0;
}

.follow a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
  font-weight: 700;
}

.follow svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.feed {
  columns: 3;
  column-gap: 34px;
}

.feed__post {
  display: block;
  break-inside: avoid;
  margin: 0 0 30px;
  padding: 20px 15px 15px;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
  color: rgba(0, 0, 0, 0.8);
}

.feed__post p {
  margin: 0 0 12px;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.feed__post img {
  width: 100%;
  margin-bottom: 12px;
}

.feed__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  line-height: 1.4;
}

.feed__meta time {
  color: rgba(0, 0, 0, 0.55);
}

.feed__more {
  display: block;
  margin-top: 4px;
  padding: 10px;
  border-radius: 4px;
  background: var(--purple);
  color: #ffffff;
  font-weight: 700;
  text-align: center;
}

.feed__more:hover {
  background: var(--pink);
  color: #ffffff;
}

/* Forms */

.form {
  margin: 0;
}

.field {
  margin: 0 0 30px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field > label,
.field > legend {
  display: block;
  margin: 0 0 15px;
  padding: 0;
  color: rgba(0, 0, 0, 0.85);
  font-weight: 700;
  line-height: 19px;
}

.required {
  color: var(--error);
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  display: block;
  width: 100%;
  margin: 0;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 3px;
  background: #ffffff;
  color: rgba(0, 0, 0, 0.7);
  font: inherit;
}

.field input,
.field select {
  height: 45px;
  padding: 0 14px;
  line-height: 1;
}

.field textarea {
  height: 120px;
  padding: 14px;
  line-height: 1.3;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--button);
  outline: 2px solid var(--button);
  outline-offset: -1px;
}

.field--medium > input,
.field--medium > select,
.field--medium > .name-row {
  max-width: 60%;
}

.name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.sublabel {
  display: block;
  margin-top: 5px;
  color: rgba(0, 0, 0, 0.55);
  font-size: 14px;
  line-height: 17px;
}

.field__error {
  display: block;
  margin-top: 8px;
  color: var(--error);
  font-size: 14px;
  line-height: 1.4;
}

.field [aria-invalid="true"] {
  border-color: var(--error);
}

/* The honeypot: people never see or reach it, bots fill it in. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.button {
  display: inline-block;
  padding: 11px 28.8px;
  border: 0;
  border-radius: 4.8px;
  background: var(--button);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.2s;
}

.button:hover {
  background: #05588e;
  color: #ffffff;
}

.button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.human-check:not(:empty) {
  margin: 0 0 20px;
}

.form-note {
  margin: 0 0 20px;
  font-weight: 700;
}

.form-status {
  margin: 24px 0 0;
  font-weight: 700;
}

.form-status--error {
  color: var(--error);
}

.form-status--success {
  color: var(--purple);
  font-size: 20px;
}

/* Text pages */

.page-title {
  text-align: center;
}

.doc-heading {
  color: var(--purple);
  text-align: center;
}

.doc-list {
  margin: 0 0 24px;
  list-style: none;
  text-align: center;
}

.doc-list li {
  margin: 0;
}

.doc-list a {
  font-weight: 700;
}

.prose a {
  overflow-wrap: anywhere;
}

/* Back to top */

.to-top {
  position: fixed;
  right: 15px;
  bottom: 15px;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.3);
  color: #ffffff;
  transition: background 0.2s, opacity 0.3s;
}

.to-top:hover {
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
}

.to-top svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.js .to-top:not(.is-visible) {
  opacity: 0;
  pointer-events: none;
}

/* Smaller screens */

@media (max-width: 1024px) {
  .feed {
    columns: 2;
  }
}

@media (max-width: 600px) {
  :root {
    --gutter: 24px;
    --section-pad: 24px;
  }

  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 27px;
  }

  h3 {
    font-size: 22px;
  }

  .section-title {
    font-size: 36px;
  }

  .welcome {
    font-size: 26px;
  }

  .masthead {
    flex-direction: column;
    gap: 0;
  }

  .socials {
    align-self: flex-end;
  }

  .noda {
    width: 150px;
  }

  .carousel__track {
    gap: 30px;
  }

  .carousel__track li {
    flex-basis: calc((100% - 30px) / 2);
  }

  .carousel__button {
    width: 44px;
    height: 44px;
    margin-top: -22px;
  }

  .feed {
    columns: 1;
  }

  .field--medium > input,
  .field--medium > select,
  .field--medium > .name-row {
    max-width: none;
  }

  ul {
    margin-left: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
