html {
  scroll-behavior: smooth;
}

html,
body {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  font-family: "Montserrat", sans-serif;
  font-size: 18px;
  margin: 0 auto;
  min-height: 100vh;
}

body {
  background-image: linear-gradient(to bottom,
      #bda485 0%,
      #bda485 5%,
      #f4eddc 100%);
  background-attachment: scroll;
  background-repeat: no-repeat;
  background-size: cover;
  margin: 0;
  min-height: 100vh;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

header {
  align-items: center;
  background-color: rgba(189, 164, 133, 0.821);
  color: white;
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
}

.main-menu-item {
  cursor: pointer;
  font-size: 0.7rem;
  padding: 12px 20px;
  text-transform: uppercase;
}

.main-menu-item.active {
  border: 1px solid white;
}

.logo {
  margin: 0 1rem 0 8px;
}

.logo-container {
  align-items: center;
  display: flex;
  gap: 0.25rem;
}

.logo-img {
  height: 80px;
}

.logo-text {
  font-weight: 400;
  text-transform: uppercase;
  white-space: nowrap;
}

.burger-menu {
  background: none;
  border: none;
  cursor: pointer;
  display: none;
  margin-right: 1.5rem;
  padding: 0;
}

.burger-menu img {
  height: 28px;
  width: 28px;
}

nav {
  align-items: center;
  display: flex;
  justify-content: center;
  margin: 0 24px 0 0;
}

nav span {
  margin: 0 40px;
}

main {
  flex: 1 0 auto;
  margin: 0 auto;
  max-width: 75rem;
  width: 100%;
}

main:after {
  background: linear-gradient(to bottom,
      rgba(0, 0, 0, 0.3) 0%,
      rgba(0, 0, 0, 0.15) 40%,
      rgba(0, 0, 0, 0) 100%);
  content: '';
  height: 300px;
  left: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
}

h1 {
  display: flex;
  justify-content: center;
  margin: 0 auto;
}

section {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0;
}

section:first-of-type {
  margin-top: 64px;
}

.section-title {
  margin: 48px 0 24px 0;
  text-align: center;
}

.section-content {
  display: flex;
  font-family: inherit;
  font-size: 0.9rem;
}

section.announcements .section-content {
  align-items: center;
  flex-wrap: wrap;
  font-family: inherit;
  justify-content: center;
  line-height: 1.5rem;
  text-align: center;
  white-space: pre-line;
}

section.announcements .announcement-text {
  margin: 16px 24px;
}

section.announcements .announcement-image {
  max-width: 400px;
}

section.about-masa .section-content {
  flex-direction: row;
  margin: 24px 0 0 0;
  max-width: 1100px;
}

.masa-photo img {
  border-radius: 1rem;
  height: 100%;
  object-fit: cover;
}

.masa-description {
  color: rgba(0, 0, 0, 0.87);
  font-size: 0.9rem;
  line-height: 1.5rem;
  margin: 0 64px 0 128px;
}

.masa-description p {
  /* Allow newlines from the source code to be rendered */
  white-space: pre-line;
}

section.location .section-content {
  display: flex;
  justify-content: space-between;
}

section.location .contacts p {
  text-align: center;
}

footer {
  background-color: #333;
  color: white;
  margin-top: 5rem;
  padding: 2rem 0;
  width: 100%;
}

.footer-container {
  align-items: start;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr 1.5fr 1.5fr;
  margin: 0 auto;
  max-width: 1200px;
  padding: 0 1rem;
}

.footer-column h3 {
  color: #bda485;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.footer-column p {
  line-height: 1.6;
  margin: 0.5rem 0;
}

.footer-image {
  align-items: center;
  display: flex;
  justify-content: center;
}

.footer-image img {
  height: auto;
  max-width: 300px;
}

@media (max-width: 768px) {
  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  section.about-masa .section-content {
    align-items: center;
    flex-direction: column;
    padding: 0 1rem;
  }

  .masa-photo {
    max-width: 400px;
    width: 100%;
  }

  .masa-description {
    margin: 2rem 0 0 0;
    text-align: center;
  }

  .burger-menu {
    display: block;
    z-index: 1001;
  }

  /* When the menu is open, ensure the header is on top of other page content */
  header.menu-open {
    z-index: 1002;
  }

  nav {
    /* Use opacity and visibility for a smooth transition */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(189, 164, 133, 0.98);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  header.menu-open nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  header.menu-open .main-menu-item {
    font-size: 1.5rem;
    padding: 1.5rem 0;
  }
}
