:root {
  --white: #fff;
  --black: #000;
  --dark-gray: #666;
  --medium-gray: #999;
  --light-gray: #eee;
  --grid-width: min(calc(100% - 2rem), 75rem);
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.75rem;
  --space-lg: 1rem;
  --space-xl: 1.5rem;
  --space-2xl: 1.75rem;
  --space-3xl: 2rem;
  --font-family-chivo-mono: "Chivo Mono", monospace;
  --font-family-frank-ruhl: "Frank Ruhl Libre", serif;
}

/* *********************************
  Resets & Globals
********************************* */

* {
  box-sizing: border-box;
}

*:focus-visible {
  outline: 0.25rem solid green;
  outline-offset: 0.375rem;
  border-radius: 1rem;
}

body {
  font-family: var(--font-family-chivo-mono);
  margin: 0;
  padding: 0;
}

section {
  width: 100%;
}

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

/* *********************************
  Typography
********************************* */

h1,
h2,
h3 {
  font-family: var(--font-family-frank-ruhl);
  line-height: 1.1;

  a & {
    color: var(--black);
  }
}

h1 {
  font-size: 2.65rem;
  letter-spacing: -0.05rem;
  font-weight: 400;
}

h3 {
  font-size: 1rem;
  font-weight: 500;

  @media (min-width: 768px) {
    font-size: 1.25rem;
  }
}

p {
  font-size: 1rem;
  line-height: 1.4;
}

/* *********************************
  Buttons
********************************* */

button {
  color: var(--black);
  background-color: transparent;
  border: 0.125rem solid var(--black);
  border-radius: 2.5rem;

  font-family: var(--font-family-chivo-mono);
  font-weight: 500;
  font-size: 0.85rem;

  padding: 0.625rem 1.5rem;
  cursor: pointer;
  transition: 0.25s ease-out;
  transition-property: background, box-shadow;

  @media (min-width: 768px) {
    font-size: 1rem;
  }

  &.is-selected {
    color: var(--white);
    background-color: var(--black);
  }

  &:hover:not(.is-selected) {
    background-color: var(--light-gray);
  }

  &:disabled {
    cursor: not-allowed;
    color: var(--medium-gray);
    border-color: var(--medium-gray);
  }
}

.button-group {
  display: flex;
  flex-direction: row;
  gap: var(--space-sm);
  overflow: auto;
  scroll-behavior: smooth;

  &::-webkit-scrollbar {
    display: none;
  }

  @media (min-width: 768px) {
    justify-content: center;
    overflow: visible;
  }

  @media (min-width: 1025px) {
    flex-flow: column wrap;
    align-items: center;
  }

  button {
    @media (max-width: 767px) {
      &:first-child {
        margin-left: var(--space-lg);
      }
      &:last-child {
        margin-right: var(--space-lg);
      }
    }

    @media (min-width: 1025px) {
      width: 100%;
      flex: 1 1 100%;
    }
  }
}

/* *********************************
  Forms
********************************* */
select {
  -webkit-appearance: none; /* For WebKit browsers */
  -moz-appearance: none; /* For Firefox */
  appearance: none; /* Removes native styling */

  background-color: transparent;
  background-image: url("images/arrow.svg"); /* Custom arrow icon */
  background-repeat: no-repeat;
  background-position: right 0 center;
  background-size: 0.875rem;
  padding-right: 0.875rem;

  font-family: "Chivo Mono";
  font-size: 0.75rem;
  color: var(--black);
  text-align: right;
  border: none;
  cursor: pointer;

  &:focus {
    outline: none;
  }

  @media (min-width: 768px) {
    font-size: 0.875rem;
  }
}

.select-label {
  font-family: "Chivo Mono";
  font-size: 0.75rem;
  @media (min-width: 768px) {
    font-size: 0.875rem;
  }
}

.search-parks {
  position: relative;

  label {
    display: flex;
    align-items: center;
  }

  label span {
    position: absolute;
    color: transparent;
    left: 1rem;
  }

  input {
    font-family: var(--font-family-chivo-mono);
    border: 1px solid var(--medium-gray);
    border-radius: 0.5rem;
    padding: 1rem;
    width: 100%;
    font-size: 1rem;
    transition: 0.25s ease-out;
    transition-property: border, box-shadow;

    &:focus {
      outline: none;
      border-color: var(--black);
      box-shadow: 0 0 0 0.25rem var(--light-gray);
    }
  }
}

/* *********************************
  Containers
********************************* */

.container {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: var(--space-xl);
  margin: var(--space-lg) auto;

  @media (min-width: 1025px) {
    flex-direction: row;
    align-items: flex-start;
    gap: calc(var(--space-3xl) * 2);
    width: var(--grid-width);
    padding: calc(var(--space-3xl) * 2) 0;
  }
}

/* *********************************
  Intro + Hero
********************************* */

.intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);

  @media (min-width: 1025px) {
    position: sticky;
    top: 2rem;
    max-width: 20rem;
  }
}

.hero {
  display: flex;
  position: relative;
  flex-direction: column;
  justify-content: flex-end;

  width: var(--grid-width);
  max-width: 22rem;
  min-height: 24rem;

  background-color: #ccc;
  border-top-left-radius: 12rem;
  border-top-right-radius: 12rem;
  border-bottom-left-radius: 1rem;
  border-bottom-right-radius: 1rem;

  padding: var(--space-3xl);
  overflow: hidden;

  @media (min-width: 1025px) {
    width: 100%;
  }

  &:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    height: 100%;
    width: 100%;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.75), transparent);
    z-index: 0;
  }

  .hero__title {
    color: var(--white);
    text-align: center;
    text-shadow: 0px 2px 3px rgba(0, 0, 0, 0.67);
    margin: 0;
    z-index: 1;
  }
}

.hero__image {
  position: absolute;
  top: 0;
  left: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
}

/* *********************************
  Meta information + Sorting
********************************* */
.park-content {
  display: flex;
  flex-flow: row wrap;
  gap: var(--space-md);
  width: var(--grid-width);

  @media (min-width: 1025px) {
    width: 100%;
  }

  > * {
    flex: 0 0 100%;
  }
}

.park-meta {
  display: flex;
  justify-content: space-between;
}

.park-results h3 {
  margin: 0;
}

/* *********************************
  Cards
********************************* */

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);

  @media (min-width: 768px) {
    grid-template-columns: repeat(3, 1fr);
  }

  @media (min-width: 1025px) {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3xl);
  }
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);

  text-decoration: none;
}

a.card {
  .card__image:hover {
    border: 0.25rem solid var(--black);
  }
}

.card__top {
  position: relative;
}

.card__bottom {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.card__badge {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);

  color: var(--black);
  background-color: var(--white);
  border-radius: var(--space-3xl);

  font-size: 0.75rem;
  padding: var(--space-xs) var(--space-sm);
}

.card__image {
  background-color: var(--light-gray);
  object-fit: cover;
  aspect-ratio: 5 / 6;
  border-radius: var(--space-lg);
  width: 100%;
  border: 0 solid transparent;
  transition: border 0.25s ease-out;
}

.card__title {
  margin: 0;
}

.card__info {
  color: var(--dark-gray);
  font-size: 0.75rem;
  line-height: 1.2;
  margin: 0;

  @media (min-width: 768px) {
    font-size: 0.875rem;
  }
}
