:root{
  --clr-bg: #fff;
  --clr-bg-accent: #eee;
  --clr-anchor: #222;
  --clr-font-accent: #aaa;
  --accent: teal;
  --accent-focus: #135369;
  --brand-font: "Inter", sans-serif;
}

@layer reset {
  *, *::before, *::after {
    box-sizing: border-box;
  }
  * {
    margin: 0;
    padding: 0;
  }
  html {
    text-size-adjust: 100%;
    scrollbar-gutter: stable;
  }
  @media (prefers-reduced-motion: no-preference) {
    html { interpolate-size: allow-keywords; }
  }
  body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }
  h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
    line-height: 1.1;
    margin-bottom: 0.5em;
  }
  p {
    text-wrap: pretty;
  }
  img, video, canvas, svg {
    display: block;
    max-width: 100%;
  }
  input, button, textarea, select {
    font: inherit;
  }
}

body {
  font-family: "Inter", sans-serif;
  margin:0;
  color: var(--clr-anchor);
  line-height:1.4;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh;
}

.container{
  max-width:100vw;
  margin: auto;
  padding: 0;
}

.site-header {
  /* background:var(--clr-bg-accent); */
  border-bottom: 2px solid var(--clr-bg-accent);
}

.site-header .container{
  display: flex;
  padding:0.75rem 0.5rem;
  gap: 2em;
  align-items: center;
}

.nav-toggle {
  display: none;
}

.brand a {
  display: block;
  font-family: var(--brand-font);
  font-size: 2em;
  color:var(--accent);
  text-align: end;
  text-transform: uppercase;
  text-decoration:none;
  width: min-content;
  line-height: 1;
  transition: color 0.3s;
}

.menu {
  list-style:none;
  display: flex;
  gap: 1rem;
}

.site-nav a {
  text-decoration:none;
  color:var(--clr-anchor);
}

.site-nav a:hover {
  font-weight: 700;
}

.brand a:hover {
  color: var(--accent-focus)
}

a {
  transition: color 0.3s;
  transition: font-weight 0.2s;
}

main {
  padding:1.5rem;
}

p:not(:last-of-type) {
  margin-bottom: 1em;
}

.gallery-item {
  display: flex;
  gap: 1em;
  padding-block: 1rem;
  align-items: center;
}

.gallery-item img {
  width: clamp(200px, 33vw, 800px)
}

.about-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
  gap: 1rem;
}

.about-description {
  font-size: 1.25em;
}

figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 1.25em;
  color: var(--clr-font-accent)
}

.caption-title {
  color: var(--accent);
}

/* Gallery filter */

.main-section {
  display: grid;
  grid-auto-flow: row;
}

.gallery-filter {
  position: sticky;
  top: 0;
}

.gallery-filter fieldset {
  height: fit-content;
  border: 1px solid var(--clr-bg-accent);
  border-left: none;
  border-right: none;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min-content;
  gap: 1rem;
  padding: 1rem;
  margin: 0;
  background: var(--clr-bg);
}

.gallery-filter label {
  display: inline-flex;
  gap: 0.5rem;
  margin-right: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

label:hover {
  color: var(--accent);
}

.gallery-filter input[type="radio"]:checked + label,
.gallery-filter input:checked ~ label {
  display: none;
}

.gallery-filter input[type="radio"]:checked + label:has(+ input:checked),
.gallery-filter label:has(input[type="radio"]:checked) {
  color: var(--accent);
  font-weight: 600;
}

.gallery-filter input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  cursor: pointer;
}

/* Gallery grid */
.items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.item h2 {
  margin-bottom: 0.25rem;
  font-size: 1.1em;
}

.gallery-image {
  display: block;
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.gallery-image:hover {
  transform: scale(1.05);
}

.gallery-image img {
  width: 100%;
  height: auto;
  display: block;
}

.dimensions {
  font-size: 0.9em;
  color: var(--clr-font-accent);
  margin: 0;
}

.description {
  font-size: 0.95em;
  margin: 0;
  color: var(--clr-anchor);
}

/* Contact Form */

input {
  padding: 0.5rem;
  border: 1px solid var(--clr-bg-accent);
  border-radius: 4px;
  width: 100%;
}

textarea {
  padding: 0.5rem;
  border: 1px solid var(--clr-bg-accent);
  border-radius: 4px;
  width: 100%;
  min-height: 150px;
}

button {
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
  transition: background 0.3s;
}

button:hover {
  background: var(--accent-focus);
}

.site-footer{
  padding: 1rem 0.5rem;
  text-align: center;
  /* background: var(--clr-bg-accent); */
}

@media (max-width: 720px) {

  .gallery-filter {
    overflow-x: scroll;
  }

  .gallery-filter fieldset {
    padding-left: 50%;
    padding-right: 6rem;
    scroll-snap-type: x mandatory;

    & > * {
      scroll-snap-align: center;
      animation: scroller linear both;
      animation-timeline: view(x);
    }
  }

  @keyframes scroller {
    0%,
    100% {
      opacity: 0.25;
      scale: 0.5;
    }

    35%,
    65% {
      opacity: 1;
      scale: 1;
    }
  }

  .gallery-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .items {
    grid-template-columns: 1fr;
  }
}
