@layer base, layout, components;
@import url('https://fonts.googleapis.com/css2?family=Macondo&display=swap');

@layer base {
  :root {
    --accent: #6772e5;
    --accent-hover: #5469d4;
  }

  body {
    color: #121212;
    margin: 0;
    background: #b37474;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
    font-family: "Macondo", cursive;
    font-weight: 400;
    font-style: normal;

    &::before {
      content: "";
      border: 0.7rem solid #580000;
      position: fixed;
      left: 0;
      top: 0;
      bottom: 0;
      right: 0;
      z-index: 12;
      pointer-events: none;
      transition: 1s;
    }
  }

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

  h1, h2, h3 {
    font-weight: 500;
  }

  h2 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.1rem;
    margin: 1rem;
    color: #580000;
  }
  h3 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.1rem;
    margin: 0.5rem;
    color: #251010;
  }
}

@layer layout {
  header, footer {
    position: fixed;
    left: 0;
    width: 100%;
    z-index: 999;
    /* background: radial-gradient(circle at -16% -16%, hotpink, slateblue); */
    /* box-shadow: 0 2px 5px rgba(0,0,0,0.1); */
    /* padding: 1rem; */

    a, p {background-color: #580000; border-radius: 0.5rem; padding: 0.3rem 2rem; color: #fff;}
  }
  header {
    top: 0.5rem;

    nav {text-align: center;}
  }

  footer {bottom: 0; p {position: absolute; bottom: -1rem; right: 0;}}

  nav a {
    margin: 0 1rem;
    color: #eee;
  }

  main {
    max-width: 1600px;
    margin: auto;
    height: 100%;
    padding: 2rem;
    flex: 1;
    padding: 2rem;
    text-align: center;
    animation: fadeIn 0.3s ease;
  }

  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .container {

    .top {
      width: 100%;
      height: 100%;

      .menu {
        display: flex;
        justify-content: space-evenly;
        gap: 2.5rem;
        width: 100%;

        a { font-size: 2rem; color: #8a1f1d;
          &:hover {color: #c84946; text-shadow: 0 0 1rem #ffffff;}}

          @media (max-width: 1200px) {
            display: flex;
            width: 100%;
            flex-direction: column;
            align-items: center;
          }
        }

      img {height: 20rem; margin: 8rem 0 4rem;}
    }

    .spacer {
      width: 100%;
      height: 30vh;
    }

    .arch {
      width: 100%;
      display: flex;
      gap: 3rem;
      justify-content: space-between;
      max-width: 1100px;
      margin-inline: auto;
    }

    .arch__left {
      display: flex;
      flex-direction: column;
      width: 45%;

      .arch__info {
        /* max-width: 356px; */
        height: 100vh;
        display: grid;
        place-items: center;

        p.desc {
          color: rgba(18, 18, 18, 0.8);
          font-size: 1.3rem;
          /* letter-spacing: -0.54px; */
          margin-block: 6px 28px;
          line-height: normal;
        }

        a.link {
          text-decoration: none;
          padding: 0.8rem 2rem;
          margin: auto;
          color: inherit;
          border-radius: 2rem;
          display: flex;
          gap: .5rem;
          width: fit-content;
          align-items: center;
        }
      }
    }

    .arch__right {
      flex-shrink: 1;
      height: 100vh;
      width: 100%;
      max-width: 540px;
      position: relative;
      display: flex;
      flex-direction: column;

      .img-wrapper {
        position: absolute;
        top: 50%;
        left: 0;
        transform: translateY(-50%);
        height: 34rem;
        width: 100%;
        border-radius: 2rem;
        overflow: hidden;
        background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.3), transparent, rgba(255, 255, 255, 0.3));
        box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);

         @media (min-width: 770px) {
          padding: 3rem;
          &::before, &::after {
            content: "";
            position: absolute;
            z-index: 1;
            width: 3rem;
            height: 3rem;
        }

        &::before {
            bottom: 1rem;
            left: 1rem;
            border-radius: 0 0 0 1rem;
            background-image: linear-gradient(225deg, transparent 50%, rgba(255, 255, 255, 0.5));
        }

        &::after {
            top: 1rem;
            right: 1rem;
            border-radius: 0 1rem 0 0;
            background-image: linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.5));
        }

        img {
          /*       border: 1px solid red; */
          width: 100%;
          height: 100%;
          object-fit: cover;
          object-position: center;
        }
         }
      }
    }

    @media (max-width: 900px) {
      .arch {
        gap: 30px;
      }
    }

    @media (max-width: 768px) {
      .arch {
        max-width: 85vw;
        flex-direction: column;
        gap: 20px;
      }

      .arch__left,
      .arch__right {
        display: contents;
      }

      .arch__right {
        height: auto;
        max-width: 100%;
      }

      .arch__right .img-wrapper {
        position: static;
        transform: none;
        height: 360px;
        width: 100%;
        margin-bottom: 20px;
      }

      .arch__left .arch__info {
        height: auto;
        padding: 20px 0;
      }
    }

    @media (max-width: 560px) {
      .arch {
        gap: 12px;
      }

      .container {
        padding: 10px;
      }

      .arch__right .img-wrapper {
        border-radius: 10px;
        height: 280px;
      }
    }
  }
  .contact {
    position: relative;
    margin: 6rem;
    padding: 2rem;
    border-radius: 2rem;
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.3), transparent, rgba(255, 255, 255, 0.3));
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
  }
}

@layer components {
  .btn {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 4px;
    margin-top: 1rem;
    transition: background 0.2s;
    &:hover {
      background: var(--accent-hover);
    }
  }

  .book {
    display: grid;
    place-items: center;
    gap: 2rem;
    img {
      border-radius: 6px;
      box-shadow: 0 4px 8px #0001;
      width: 300px;
      height: auto;
    }
  }

  .center {
    text-align: center;
    padding: 3rem;
  }

  .loader {
    position: fixed;
    inset: 0;
    background: #ffffffcc;
    display: grid;
    place-items: center;
    backdrop-filter: blur(2px);
    z-index: 1000;
    transition: opacity 0.3s ease;
  }

  .loader.hidden {
    opacity: 0;
    pointer-events: none;
  }

  .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ccc;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
  }

  @keyframes spin {
    to { transform: rotate(360deg); }
  }
}
