/* =========================================================
   KITT Study
   layout.css v1.0
   ---------------------------------------------------------
   Purpose:
   - サイト全体の横幅
   - ヘッダー
   - メイン領域
   - セクション
   - フッター
   - 基本レイアウト
   ========================================================= */


/* ---------------------------------------------------------
   1. Layout tokens
   --------------------------------------------------------- */

:root {
  --layout-wide: 1200px;
  --layout-content: 920px;

  --layout-gutter: 24px;

  --section-space: 80px;
  --section-space-small: 48px;

  --header-height: 72px;
}


/* ---------------------------------------------------------
   2. Site
   --------------------------------------------------------- */

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1 0 auto;
}


/* ---------------------------------------------------------
   3. Common containers
   --------------------------------------------------------- */

/*
 * ヘッダー・フッター・横幅の広い領域
 */
.container {
  width: min(
    calc(100% - (var(--layout-gutter) * 2)),
    var(--layout-wide)
  );
  margin-inline: auto;
}


/*
 * 通常の本文ページ
 */
.content-container {
  width: min(
    calc(100% - (var(--layout-gutter) * 2)),
    var(--layout-content)
  );
  margin-inline: auto;
}


/* ---------------------------------------------------------
   4. Header
   --------------------------------------------------------- */

.site-header {
  width: 100%;
}

.site-header__inner {
  min-height: var(--header-height);

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 24px;
}

.site-header__brand {
  flex: 0 0 auto;
}

.site-header__nav {
  flex: 1 1 auto;

  display: flex;
  align-items: center;
  justify-content: flex-end;

  gap: 24px;
}

.site-header__cta {
  flex: 0 0 auto;
}


/* ---------------------------------------------------------
   5. Main content
   --------------------------------------------------------- */

.site-main {
  width: 100%;
}

.page-main {
  padding-block: var(--section-space);
  font-size: 18px;
  line-height: 1.8;
}


/* ---------------------------------------------------------
   6. Sections
   --------------------------------------------------------- */

.section {
  padding-block: 60px;
}

.section--small {
  padding-block: var(--section-space-small);
}

.section--no-top {
  padding-top: 0;
}

.section--no-bottom {
  padding-bottom: 0;
}


/* ---------------------------------------------------------
   7. Section inner layouts
   --------------------------------------------------------- */

.section__inner {
  width: min(
    calc(100% - (var(--layout-gutter) * 2)),
    var(--layout-content)
  );
  margin-inline: auto;
}

.section__inner--wide {
  width: min(
    calc(100% - (var(--layout-gutter) * 2)),
    var(--layout-wide)
  );
  margin-inline: auto;
}


/* ---------------------------------------------------------
   8. Vertical content flow
   --------------------------------------------------------- */

/*
 * 本文中の要素同士の基本間隔。
 * 個別に margin-bottom を大量指定するのを防ぐ。
 */
.flow > * + * {
  margin-top: 24px;
}

.flow--small > * + * {
  margin-top: 16px;
}

.flow--large > * + * {
  margin-top: 40px;
}


/* ---------------------------------------------------------
   9. Basic split layout
   --------------------------------------------------------- */

/*
 * PCで文章＋画像などを横並びにするときの基本形。
 * スマホ化は responsive.css で行う。
 */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);

  align-items: center;
  gap: 48px;
}


/* ---------------------------------------------------------
   10. Basic grid
   --------------------------------------------------------- */

.grid {
  display: grid;
  gap: 24px;
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}


/* ---------------------------------------------------------
   11. Full-width area
   --------------------------------------------------------- */

/*
 * 背景色をページ横幅いっぱいに広げたい場合。
 * 中身は container / content-container を使用する。
 */
.full-width {
  width: 100%;
}


/* ---------------------------------------------------------
   12. Footer
   --------------------------------------------------------- */

.site-footer {
  flex-shrink: 0;
  width: 100%;
}

.site-footer__inner {
  padding-block: 56px;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));

  gap: 40px;
}

.site-footer__bottom {
  margin-top: 48px;
  padding-top: 24px;
}


/* ---------------------------------------------------------
   13. Utility alignment
   --------------------------------------------------------- */

.center {
  margin-inline: auto;
}

.text-center {
  text-align: center;
}

.align-start {
  align-items: start;
}

.align-center {
  align-items: center;
}