/*
Theme Name: jiritsu_gaku
Version: 1.0.0
*/

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

body {
  margin: 0;
}

a {
  word-break: break-all;
}

.page {
  .entry-title {
    text-align: center;
  }
}

.site-header {
  position: relative;
  z-index: 10;
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;

  & .site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    width: 100%;
    min-height: 96px;
    padding: 14px 32px;
  }

  & .site-branding {
    flex: 0 0 auto;
  }

  & .site-branding__link {
    display: inline-flex;
    align-items: center;
    color: #17212b;
    text-decoration: none;
  }

  & .custom-logo-link {
    display: inline-flex;
    align-items: center;
  }

  & .custom-logo {
    display: block;
    width: auto;
    max-width: 180px;
    max-height: 72px;
  }

  & .site-title {
    display: block;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
  }

  & .site-description {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.4;
  }

  & .site-navigation {
    display: flex;
    justify-content: flex-end;
    flex: 1 1 auto;
  }

  & .site-menu {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;

    & li {
      position: relative;
      margin: 0;

      &:hover > .sub-menu,
      &:focus-within > .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
      }
    }

    & a {
      display: flex;
      align-items: center;
      min-height: 68px;
      padding: 0 18px;
      color: #111;
      font-size: 13px;
      font-weight: 500;
      line-height: 1.4;
      text-decoration: none;
      transition:
        background-color 0.2s ease,
        color 0.2s ease;

      &:hover,
      &:focus-visible {
        background: #f4f5f4;
        color: #000;
      }
    }

    & > li:last-child > a {
      min-width: 96px;
      justify-content: center;
      background: #5b625d;
      color: #fff;
      text-align: center;

      &:hover,
      &:focus-visible {
        background: #414842;
        color: #fff;
      }
    }
  }

  & .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #e8e8e8;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition:
      opacity 0.2s ease,
      transform 0.2s ease,
      visibility 0.2s ease;

    & a {
      min-height: auto;
      padding: 10px 16px;
      white-space: nowrap;
    }
  }

  & .site-nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #d7d7d7;
    background: #fff;
    cursor: pointer;
  }

  & .site-nav-toggle__line {
    display: block;
    width: 20px;
    height: 2px;
    margin: 5px auto;
    background: #17212b;
  }
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.single-post {
  & .single-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 48px;
    width: min(1120px, calc(100% - 40px));
    margin: 56px auto;
  }

  & .single-layout__content {
    min-width: 0;
  }

  & .entry-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 18px;
    margin-bottom: 32px;
    font-size: 14px;
    line-height: 1.4;
  }

  & .entry-meta__category {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 16px;
    background: #000;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
  }

  & .entry-meta__category:hover,
  & .entry-meta__category:focus-visible {
    background: #333;
    color: #fff;
  }

  & .entry-meta__date {
    color: #111;
    font-size: 14px;
  }

  & .post-navigation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid #e5e5e5;
  }

  & .post-navigation__link {
    display: block;
    min-height: 96px;
    padding: 18px;
    color: #111;
    text-decoration: none;
    border: 1px solid #e5e5e5;
    transition:
      background-color 0.2s ease,
      border-color 0.2s ease;

    &:hover,
    &:focus-visible {
      background: #f7f7f7;
      border-color: #cfcfcf;
    }
  }

  & .post-navigation__link--next {
    text-align: right;
  }

  & .post-navigation__label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
  }

  & .post-navigation__title {
    display: block;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.6;
  }

  & .single-sidebar {
    min-width: 0;
  }

  & .sidebar-section {
    margin-bottom: 28px;
  }

  & .sidebar-heading {
    margin: 0 0 16px;
    padding: 7px 12px;
    background: #000;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
  }

  & .recent-posts {
    display: grid;
    gap: 22px;
  }

  & .recent-post {
    margin: 0;
  }

  & .recent-post__thumbnail {
    display: block;
    margin-bottom: 8px;
    background: #f0f0f0;
    text-decoration: none;

    & img {
      display: block;
      width: 100%;
      height: auto;
      aspect-ratio: 16 / 9;
      object-fit: cover;
    }
  }

  & .recent-post__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 12px;
    line-height: 1.4;
  }

  & .recent-post__category {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 3px 8px;
    background: #000;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
  }

  & .recent-post__category:hover,
  & .recent-post__category:focus-visible {
    background: #333;
    color: #fff;
  }

  & .recent-post__date {
    color: #111;
    font-size: 12px;
  }

  & .recent-post__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.55;

    & a {
      color: #111;
      text-decoration: none;
    }

    & a:hover,
    & a:focus-visible {
      text-decoration: underline;
    }
  }

  & .sidebar-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
    line-height: 1.5;

    & a {
      color: #111;
      text-decoration: none;
    }

    & a:hover,
    & a:focus-visible {
      text-decoration: underline;
    }
  }
}

.site-footer {
  padding: 56px 40px 22px;
  background: #fff;
  color: #111;

  & .site-footer__inner {
    display: flex;
    justify-content: space-between;
    gap: 48px;
    width: min(1120px, 100%);
    margin: 0 auto;
  }

  & .site-footer__brand {
    flex: 0 1 420px;
  }

  & .site-footer__logo {
    display: inline-flex;
    align-items: center;
    margin-bottom: 18px;
    text-decoration: none;

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

  & .site-footer__name {
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.6;
  }

  & .site-footer__address {
    margin: 0;
    font-style: normal;
    font-size: 13px;
    line-height: 1.8;
  }

  & .site-footer__navigation {
    flex: 0 0 220px;
  }

  & .footer-menu {
    display: grid;
    gap: 22px;
    margin: 0;
    padding: 0;
    list-style: none;

    & a {
      color: #111;
      font-size: 13px;
      line-height: 1.5;
      text-decoration: none;
    }

    & a:hover,
    & a:focus-visible {
      text-decoration: underline;
    }
  }

  & .site-footer__copyright {
    margin: 48px 0 0;
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
  }
}

@media (max-width: 767px) {
  .site-header {
    & .site-header__inner {
      flex-wrap: wrap;
      gap: 0;
      min-height: 72px;
      padding: 10px 16px;
    }

    & .custom-logo {
      max-width: 148px;
      max-height: 52px;
    }

    & .site-nav-toggle {
      display: block;
    }

    & .site-navigation {
      flex-basis: 100%;
      display: grid;
      grid-template-rows: 0fr;
      overflow: hidden;
      transition: grid-template-rows 0.24s ease;

      &.is-open {
        grid-template-rows: 1fr;
      }
    }

    & .site-menu {
      display: block;
      min-height: 0;
      padding-top: 10px;
      border-top: 1px solid #e8e8e8;

      & a {
        min-height: 48px;
        padding: 12px 4px;
        font-size: 14px;
        border-bottom: 1px solid #eeeeee;
      }

      & > li:last-child > a {
        min-width: 0;
        margin-top: 10px;
        padding-right: 16px;
        padding-left: 16px;
        border-bottom: 0;
      }
    }

    & .sub-menu {
      position: static;
      min-width: 0;
      padding: 0 0 0 14px;
      border: 0;
      box-shadow: none;
      opacity: 1;
      visibility: visible;
      transform: none;

      & a {
        white-space: normal;
      }
    }
  }

  .single-post {
    & .single-layout {
      display: block;
      width: min(100% - 32px, 640px);
      margin: 36px auto;
    }

    & .entry-meta {
      gap: 14px;
      margin-top: 14px;
      margin-bottom: 24px;
      font-size: 13px;
    }

    & .entry-meta__category {
      min-height: 22px;
      padding: 4px 12px;
      font-size: 12px;
    }

    & .entry-meta__date {
      font-size: 13px;
    }

    & .post-navigation {
      grid-template-columns: 1fr;
      gap: 12px;
      margin-top: 40px;
      padding-top: 24px;
    }

    & .post-navigation__link {
      min-height: 0;
      padding: 14px;
    }

    & .post-navigation__link--next {
      text-align: left;
    }

    & .post-navigation__title {
      font-size: 14px;
    }

    & .single-sidebar {
      margin-top: 40px;
    }

    & .sidebar-heading {
      font-size: 13px;
    }

    & .recent-post__title {
      font-size: 14px;
    }
  }

  .site-footer {
    padding: 40px 24px 20px;

    & .site-footer__inner {
      display: block;
    }

    & .site-footer__brand {
      margin-bottom: 36px;
    }

    & .site-footer__logo {
      margin-bottom: 14px;

      & img {
        width: 132px;
      }
    }

    & .site-footer__name {
      margin-bottom: 16px;
      font-size: 13px;
    }

    & .site-footer__address {
      font-size: 12px;
    }

    & .site-footer__navigation {
      width: 100%;
    }

    & .footer-menu {
      gap: 14px;
    }

    & .site-footer__copyright {
      margin-top: 36px;
      text-align: left;
    }
  }
}

.custom-contact-form {
  max-width: 800px;
  margin: 0 auto;

  /* 各行のレイアウト（PCでは横並び） */
  .form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;

    /* テキストエリアの行は上揃えにする */
    &.align-top {
      align-items: flex-start;
    }
  }

  /* 左側のラベル部分 */
  dt {
    width: 35%;
    padding-right: 20px;
    box-sizing: border-box;
    font-weight: normal;
    display: flex;
    align-items: center;
  }

  /* 右側の入力エリア部分 */
  dd {
    width: 65%;
    margin: 0;
  }

  /* 必須・任意ラベルの共通スタイル */
  .label-req,
  .label-opt {
    display: inline-block;
    font-size: 0.85em;
    padding: 4px 8px;
    margin-right: 15px;
    white-space: nowrap;
    color: #333;
  }

  /* 入力フィールドのスタイル */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  select,
  textarea {
    width: 100%;
    padding: 10px;
    border: none;
    background-color: #e0e0e0; /* ワイヤーフレームのようなグレー背景 */
    box-sizing: border-box;
  }

  textarea {
    min-height: 200px;
    resize: vertical;
  }

  /* 送信ボタンのレイアウト */
  .form-submit {
    text-align: center;
    margin-top: 40px;

    input[type="submit"] {
      background-color: #d9d9d9;
      color: #333;
      border: none;
      padding: 15px 40px;
      font-size: 16px;
      cursor: pointer;
      transition: opacity 0.3s ease;

      &:hover {
        opacity: 0.8;
      }
    }
  }

  /* スマホ表示対応（縦並びに切り替え） */
  @media screen and (max-width: 768px) {
    .form-row {
      flex-direction: column;
      align-items: flex-start;
    }

    dt {
      width: 100%;
      margin-bottom: 10px;
    }

    dd {
      width: 100%;
    }
  }
}
