@import url('https://fonts.googleapis.com/css2?family=Poiret+One&family=Raleway:ital,wght@0,300;0,500;1,300&family=Yrsa:ital,wght@0,300;0,500;1,300&display=swap');

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

html {
  font-family: 'Yrsa', serif;
  color: #29303b;
  background-color: #fff6f5;
}

body {
  display: flex;
  flex-flow: column nowrap;
  min-height: 100vh;
  margin: 0;
}

h1 {
  font-family: 'Poiret One', sans-serif;
  font-weight: 400;
}

a {
  color: inherit;
}

.page-section {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.page-section__inner {
  max-width: 72rem;
  margin: 0 auto;
}

.page--admin .page-header {
  position: relative;
}

.page--admin .page-header::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  right: 0;
  height: 0.5rem;
  background: linear-gradient(120deg, #00438e, #007332);
}

.page-header__nav {
  display: flex;
  flex-flow: column;
  justify-content: space-between;
  height: 10rem;
  color: #3771a2;
}

@media (min-width: 50rem) {
  .page-header__nav {
    flex-flow: row nowrap;
    align-items: center;
    height: 5rem;
  }
}

.page-header__title {
  margin: 1rem 0;
  font-size: 2rem;
}

@media (min-width: 50rem) {
  .page-header__title {
    margin: 0 auto 0 0;
    font-size: 3rem;
  }
}

.page-header__title a {
  text-decoration: none;
}

.page-header__menu {
  display: flex;
  flex-flow: row wrap;
  margin: 0 0 0.5rem;
  padding: 0;
  font-size: 1.25rem;
  text-transform: lowercase;
  list-style-type: none;
}

@media (min-width: 50rem) {
  .page-header__menu {
    align-self: flex-end;
    flex-flow: row nowrap;
    margin: 0 0 1rem;
  }
}

.page-header__menu-item:not(:last-of-type) {
  margin-right: 1.5rem;
}

.page-header__menu-item a {
  text-decoration: none;
}

.page-banner {
  height: calc(100vh - 10rem);
  min-height: 75vw;
  margin: 0 -1.5rem;
  padding: 1rem 1.5rem 0;
  color: #e3cbc9;
  background:
    linear-gradient(120deg, #00438e80, #00733280),
    url('/img/header-bg-blurred.jpg') no-repeat center center / cover;
}

@media (min-width: 50rem) {
  .page-banner {
    height: calc(100vh - 5rem);
    min-height: auto;
  }
}

.page-banner__crochet-hook {
  height: 12px;
  border: 2px solid #e3cbc9;
  border-radius: 100vw;
}

.page-title {
  margin: 1.5em 0;
  text-align: center;
  font-size: 3rem;
}

.page--admin .page-title {
  margin: 1em 0;
  text-align: left;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-gap: 0.75rem;
  --item-size: ((100% - 3 * 0.75rem) / 2);
  --third-item-size: ((var(--item-size) - 2 * 0.75rem) / 3);
  margin-top: calc(-1 * var(--item-size) - 2 * 0.75rem);
  margin-bottom: calc(var(--third-item-size) + 0.75rem + 2rem);
  padding: 0.75rem;
  list-style-type: none;
}

@media (min-width: 50rem) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
    --item-size: ((100% - 4 * 0.75rem) / 3);
    --quarter-item-size: ((var(--item-size) - 3 * 0.75rem) / 4);
    margin-top: calc(-1 * var(--item-size) - 2 * 0.75rem);
    margin-bottom: calc(2 * (var(--quarter-item-size) + 0.75rem) + 2rem);
  }
}

.gallery__item {
  position: relative;
  outline: 0.75rem solid #f6e1df;
}

.gallery__item:nth-child(2n + 1) {
  top: calc((100% - 2 * 0.75rem) / 3 + 0.75rem);
}

@media (min-width: 50rem) {
  .gallery__item:nth-child(2n + 1) {
    top: auto;
  }

  .gallery__item:nth-child(3n + 1) {
    top: calc((100% - 3 * 0.75rem) / 2 + 2 * 0.75rem);
  }
  
  .gallery__item:nth-child(3n + 2) {
    top: calc((100% - 3 * 0.75rem) / 4 + 0.75rem);  
  }
}

.gallery__item-link {
  display: block;
  text-decoration: none;
}

.gallery__item-photo {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center center;
}

.page-footer {
  margin-top: auto;
  padding-top: 6rem;
  overflow: hidden;
}

.page-footer__inner {
  height: 3rem;
  text-align: right;
  background:
    linear-gradient(120deg, #00438e80, #00733280),
    url('/img/header-bg-blurred.jpg') no-repeat center center / cover;
}

.page-footer__penguin {
  height: 10rem;
  margin: -6rem -1rem 0 0;
}

.page-overlay {
  display: none;
}

.page-overlay--active {
  display: block;
}

.page-overlay__inner {
  position: fixed;
  z-index: 1000;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  overflow: auto;
  display: flex;
  flex-flow: column nowrap;
  padding: 2rem 0;
  background-color: #08111ec0;
}

@keyframes page-overlay__fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes page-overlay__fade-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.page-overlay[aria-hidden="false"] .page-overlay__inner {
  animation: page-overlay__fade-in 0.25s ease-in-out;
}

.page-overlay[aria-hidden="true"] .page-overlay__inner {
  animation: page-overlay__fade-out 0.25s ease-in-out;
}

.modal {
  width: 60rem;
  max-width: calc(100vw - 3rem);
  margin: auto;
  padding: 1.5rem;
  font-size: 1.25rem;
  background-color: #fff6f5;
}

.modal--small {
  width: 40rem;
}

.modal__header {
  position: relative;
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  padding-bottom: 2rem;
}

.modal__header::after {
  content: '';
  position: absolute;
  bottom: 0rem;
  left: -1.5rem;
  right: -1.5rem;
  height: 0.5rem;
  background: linear-gradient(120deg, #00438e, #007332);
}

.modal__title {
  margin: 0;
  font-family: 'Poiret One', sans-serif;
  font-size: 2rem;
  font-weight: 400;
  color: #3771a2;
}

.modal__close {
  width: 2rem;
  height: 2rem;
  line-height: 2rem;
  margin-left: auto;
  border: 1px solid #3771a2;
  padding: 0;
  font-size: 2rem;
  color: #fff;
  background-color: #3771a2;
}

.form-field:last-child {
  margin-bottom: 0;
}

.form-field--submit {
  text-align: right;
}

.form-field label,
.form-field input,
.form-field select,
.form-field textarea {
  display: block;
  width: 100%;
}

.form-field label {
  margin-bottom: 0.5rem;
}

.form-field input:not([type="checkbox"], [type="file"]),
.form-field select,
.form-field textarea {
  border: 1px solid #3771a2;
  padding: 0.25rem 0.5rem;
}

.form-field textarea {
  resize: vertical;
}

.form-field button {
  border: 1px solid #3771a2;
  padding: 0.25rem 1rem;
  color: #fff;
  background-color: #3771a2;
}

.item {
  display: grid;
  grid-gap: 1.5rem;
  grid-template-columns: 1fr;
  
}

@media (min-width: 48rem) {
  .item {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 90rem) {
  .item {
    grid-template-columns: 30rem auto;
  }
}

.item__header {
  grid-column: 1 / -1;
}

.item__photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center center;
}

.item__content {
  display: flex;
  flex-flow: column;
  min-width: 0;
}

.item__description {
  margin-bottom: 1em;
}

.item__description p {
  margin: 0;
}

.item__description * + p {
  margin-top: 1em;
}

.request-form {
  display: flex;
  flex-flow: row wrap;
  margin-top: auto;
}

.request-form__message {
  flex: 1 1 100%;
  border: 1px solid #3771a2;
  border-bottom: 0 none;
  padding: 0.25rem 0.5rem;
}

.request-form__email {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid #3771a2;
  padding: 0.25rem 0.5rem;
}

.request-form__submit {
  border: 1px solid #3771a2;
  padding: 0.25rem 1rem;
  color: #fff;
  background-color: #3771a2;
}

.login-form {
  max-width: 20rem;
  margin: 0 auto;
}

.page-actions {
  margin: 2rem 0;
}

.page-actions__button {
  border: 1px solid #3771a2;
  padding: 0.25rem 1rem;
  font-size: 1.25rem;
  color: #fff;
  background-color: #3771a2;
}

.inventory {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.inventory thead th {
  border-bottom: 1px solid;
  text-align: left;
}

.inventory thead th:last-child {
  text-align: right;
}

.inventory tbody > tr:nth-child(2n) {
  background-color: #f6e1df;
}

.inventory th,
.inventory td {
  padding: 0.5rem;
  vertical-align: baseline;
}

.inventory td.inventory-item__photo {
  vertical-align: top;
}

.inventory-item__photo img {
  width: 100%;
  vertical-align: bottom;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center center;
}

.photo-preview,
.croppr-container {
  width: 100%;
  background: linear-gradient(135deg, #0003 25%, #0000 0 50%, #0003 0 75%, #0000 0) top left / 1rem 1rem;
}

.modal .croppr-handle {
  width: 24px;
  height: 24px;
}
