:root {
  --text: #53504f;
  --text-strong: #000000;
  --bg: #ffffff;
  --nav-width: 160px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Open Sans", sans-serif;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--text); text-decoration: none; }
a:hover, a:focus-visible { color: var(--text-strong); }
a:hover { text-decoration: underline; }

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

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

/* Header and side menu */

.header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 3;
  padding: 20px;
  font-size: 15px;
  font-weight: bold;
  line-height: 20px;
  background: var(--bg);
}

.sidenav {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2;
  width: var(--nav-width);
  max-height: 100vh;
  overflow-y: auto;
  padding-top: 80px;
  background: var(--bg);
}

.sidenav ul { list-style: none; margin: 0 0 18px; padding: 0; }

.sidenav a {
  display: block;
  padding: 6px 8px 6px 16px;
  font-size: 12px;
}

.sidenav a[aria-current="page"] { color: var(--text-strong); }

.main {
  margin-left: var(--nav-width);
  padding: 70px 10px 20px;
}

/* Gallery pages */

.par {
  max-width: 800px;
  margin: 20px auto;
  padding: 0 15px;
  font-size: 13px;
}

.images figure {
  max-width: var(--max, 800px);
  margin: 40px auto 70px;
}

.images img { width: 100%; }

.footer {
  padding: 10px 0 30px;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
}

/* Contact page */

.contact {
  max-width: 600px;
  margin: 20px auto;
  text-align: center;
  font-size: 13px;
}

.contact p { margin: 0 0 1.6em; }

.contact img {
  margin: 40px auto 5px;
  border: 10px solid #000;
}

/* Home page: the tiles are the menu */

.home .main { margin-left: 0; padding: 80px 4% 40px; }

.home-contact {
  position: fixed;
  top: 20px;
  right: 45px;
  z-index: 3;
  font-size: 15px;
  line-height: 20px;
}

.tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 35px 10px;
}

.tile a { display: block; }

.tile-title {
  display: block;
  padding: 0 0 4px 5px;
  font-size: 14px;
}

.tile a:hover { text-decoration: none; }
.tile a:hover .tile-title { color: var(--text-strong); }

.tile img {
  height: clamp(150px, 20vh, 260px);
  width: auto;
}

/* Phones and small tablets */

@media (max-width: 768px) {
  .header { position: static; text-align: center; }

  .sidenav {
    position: static;
    width: 100%;
    max-height: none;
    padding: 0 10px 10px;
    text-align: center;
  }

  .sidenav ul { display: inline; margin: 0; }
  .sidenav li { display: inline-block; }
  .sidenav a { padding: 8px 10px; }

  .main { margin-left: 0; padding-top: 0; }

  .images figure { margin: 20px auto; }

  .home .main { padding: 10px 10px 40px; }
  .home-contact { position: static; display: block; text-align: center; margin-bottom: 20px; }
}

@media (max-width: 560px) {
  .tile, .tile img { width: 100%; height: auto; }
}
