/* Noto Sans Japanese */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@100..900&display=swap");

:root {
  --color-bg: #fff;
  --color-bg-sub: #f0f0f2;
  --color-text: #222;
  --color-text-sub: #777;
  --color-text-accent: #3678b3;
  --color-divider: #3341;
  --width-content: 990px;
}

/* ダークモード */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #222;
    --color-bg-sub: #2c2c2c;
    --color-text: #e3e3e4;
    --color-text-sub: #adadad;
    --color-text-accent: #8fb6d8;
    --color-divider: #2b2b2b;
  }
}

html {
  scroll-behavior: smooth;
  line-height: 1.15;
}

*, *::before, *::after {
  box-sizing: border-box;
}

h1, h2, h3, h4, h5, h6, li, p {
  overflow-wrap: break-word;
  line-height: 1.6;
}

a, a:visited {
  color: var(--color-text-accent);
  text-decoration: none;

  &:hover {
    text-decoration: underline;
  }
}

ul, ol {
  padding-left: 1.25rem;
}

/* layout */

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

  > nav, > header, > main, > footer {
    margin: 0 auto;
    max-width: var(--width-content);
    padding: 2rem 2.5rem;

    @media (max-width: 680px) {
      padding: 1.4rem 1.4rem;
    }
  }
}

/* nav */

body > nav {
  display: flex;
  align-items: center;
  gap: 1rem;

  > * {
    margin: 0;
  }

  h1 {
    margin-right: auto;
    font-size: 1.2em;
    font-weight: 800;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  a i.fa {
    color: var(--color-text);
    font-size: 1.5em;

    &:hover {
      opacity: 0.8;
    }
  }
}

/* header */

body > header {
  > * {
    margin: 0 0 1.5rem;
  }

  hgroup {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;

    > * {
      margin: 0;
    }

    img {
      width: 100%;
      max-width: 560px;
    }

    h2 {
      color: var(--color-text-sub);
      font-weight: 500;
      font-size: 1.2em;
    }

    p {
      padding: 0 1rem;
      text-align: center;
      font-size: 0.95em;
    }
  }

  .links {
    display: flex;
    justify-content: center;
    gap: 1.5em;
    text-transform: uppercase;

    /* TODO: リンクのデザイン(ロゴにするかボタンにするか) */
  }

  .cards {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;

    @media (max-width: 770px) {
      grid-template-columns: 1fr;
    }

    article {
      display: flex;
      flex-direction: column;
      background-color: var(--color-bg-sub);
      border-radius: 1rem;
      padding: 1.3rem;
      gap: 0.5rem;

      > * {
        margin: 0;
      }

      h3 {
        font-weight: 600;
        font-size: 1.1em;
      }

      p {
        font-weight: 400;
        color: var(--color-text-sub);
      }
    }
  }
}

/* main */

body > main {
  section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 0 auto 5rem;
    padding: 2rem 0 0;
    max-width: 740px;

    > * {
      margin: 0;
    }

    h2 {
      margin: 0 0 1rem;
      text-align: center;
      font-size: 2.2em;
      font-weight: 900;
      text-transform: uppercase;
    }

    h3 {
      font-size: 1.4em;
      font-weight: 700;

      &:not(:first-of-type) {
        margin-top: 1.5rem;
        padding-top: 1em;
        border-top: solid var(--color-divider) 1px;
      }
    }

    > img, > figure > img {
      max-width: 100%;
      margin: 0 auto;
    }

    > figure {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 1rem;

      figcaption {
        color: var(--color-text-sub);
        font-weight: 400;
      }
    }

    #magazine-container {
      display: grid;
      grid-template-columns: 1fr 1fr;
      width: 100%;
      gap: 2rem 1rem;

      @media (max-width: 680px) {
        font-size: 0.8em;
      }

      /* 子要素のスタイルは js/magazine.js 内で定義 (ShadowDOM) */
    }

    .magazine-more {
      display: flex;
      justify-content: center;
      width: 100%;
      padding: 1rem 0;
      border: solid var(--color-bg-sub) 3px;
      color: var(--color-text);
      transition: 200ms;

      &:hover {
        text-decoration: none;
        background: var(--color-bg-sub);
      }
    }

    .google-calendar > iframe {
      width: 100%!important;
    }
  }
}

/* footer */

body > footer {
  border-top: solid var(--color-divider) 2px;

  text-align: center;
  color: var(--color-text-sub);

  a, a:visited {
    color: inherit;
  }
}
