/* ========================================
   CSS変数の定義
======================================== */
:root {
  --primary-color: #93CC99;
  --primary-dark: #508F5D;
  --primary-light: #7ba88533;
  --primary-accent: #4CBF65;
  --secondary-color: #E58958;
  --text-dark: #424641;
  --text-medium: #4a5565;
  --text-light: #364153;
  --primary-accent: #50B06D;
  --gray-normal: #A4A4A4;
  --gray-dark: #2c3e50;
  --gray-dark-secondary: #6b7280;
  --gray-medium: #99a1af;
  --gray-light: #f3f4f6;
  --background-gray: #f8f8f5;
  --background-dark: #383e39;
  --white: #ffffff;
}

/* ========================================
   基本設定
======================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Noto Sans JP', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

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

a,
button {
  cursor: pointer;
}

.container {
  width: 90%;
  margin: 0 auto;
}

/* ========================================
   ヘッダー
======================================== */
.site-header {
  background: var(--white);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 15px 32px;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: all 0.3s ease;

  &.scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 10px 32px;

    .header-container {
      & .site-logo {

        img,
        svg {
          height: 40px;
          transition: all 0.3s ease;
        }
      }
    }
  }

  .header-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;

    .site-logo {
      display: flex;
      align-items: center;
      gap: 10px;

      a {
        display: block;
        line-height: 0;
      }

      img,
      svg {
        display: block;
        height: 50px;
        width: auto;
      }
    }

    .site-logo-text {
      font-size: 24px;
      font-weight: 900;
      color: var(--primary-color);
    }

    .main-nav {
      display: flex;
      align-items: center;
      gap: 40px;

      ul {
        display: flex;
        list-style: none;
        gap: 32px;
        margin: 0;
        padding: 0;
      }

      a:not(.header-btn) {
        font-size: 15px;
        font-weight: 500;
        color: var(--text-dark);
        transition: color 0.3s ease;
        position: relative;

        &::after {
          content: '';
          position: absolute;
          bottom: -5px;
          left: 0;
          width: 0;
          height: 2px;
          background: var(--primary-color);
          transition: width 0.3s ease;
        }

        &:hover {
          color: var(--primary-color);

          &::after {
            width: 100%;
          }
        }
      }

      .header-cta {
        display: flex;
        gap: 16px;

        ul {
          display: flex;
          gap: 16px;
          margin: 0;
          padding: 0;
          list-style: none;
        }

        li {
          margin: 0;
        }

        .header-btn {
          display: inline-flex;
          align-items: center;
          justify-content: center;
          text-decoration: none !important;
          border-radius: 9999px;
          padding: 7px 24px;
          font-size: 14px !important;
          font-weight: 600;
          cursor: pointer;
          transition: all 0.3s ease;

          .img-center {
            padding-top: 2px;
          }

          &:hover {
            background: var(--primary-accent);
            border: 2px solid var(--primary-accent);
            transform: translateY(-2px);
            text-decoration: none !important;
          }

          &.secondary {
            background: transparent;
            color: var(--primary-color);

            &:hover {
              background: var(--primary-accent);
              border: 2px solid var(--primary-accent);
              color: var(--white) !important;
            }
          }
        }
      }
    }

    .mobile-menu-toggle {
      display: none;
      flex-direction: column;
      gap: 5px;
      background: var(--white);
      border: none;
      cursor: pointer;
      padding: 5px 7px;

      span {
        display: block;
        width: 25px;
        height: 3px;
        background: var(--text-dark);
        border-radius: 3px;
        transition: all 0.3s ease;
        transform-origin: center;
        backface-visibility: hidden;
      }

      &.active {
        span:nth-child(1) {
          transform: rotate(45deg) translate(5px, 5px);
        }

        span:nth-child(2) {
          opacity: 0;
          visibility: hidden;
          transform: scaleX(0);
          background: var(--white);
        }

        span:nth-child(3) {
          transform: rotate(-45deg) translate(7px, -6px);
        }
      }
    }
  }

  .mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--white);
    border-bottom: 1px solid var(--gray-light);
    padding: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    margin-top: 50px;
    height: 100%;

    &.active {
      display: block;
    }

    ul {
      list-style: none;
      margin: 0;
      display: flex;
      padding: 30px 20px;
      font-size: 16px;
      font-weight: 500;
      color: var(--text-dark);
      border-radius: 8px;
      transition: all 0.3s ease;
      flex-direction: column;
      gap: 20px;
      text-align: center;
    }

    li {
      margin-bottom: 16px;
    }

    .btns {
      ul {
        padding: 0;

        li {
          margin-bottom: 0;
        }
      }
    }
  }
}

@media (max-width: 1024px) {
  .site-header {
    padding: 16px 24px;

    .header-container {
      .main-nav {
        ul {
          gap: 24px;
        }
      }
    }
  }
}

@media (max-width: 768px) {
  .site-header {
    padding: 12px 16px;

    .header-container {
      .site-logo {

        img,
        svg {
          height: 32px;
        }
      }

      .main-nav,
      .header-cta {
        display: none;
      }

      .mobile-menu-toggle {
        display: flex;
      }
    }

    &.scrolled {
      .header-container {
        .site-logo {

          img,
          svg {
            height: 28px;
          }
        }
      }
    }
  }

  body.keepy-context-mypage .mypage-wrapper {
    margin-top: 53px;
  }
}

@media (min-width: 769px) {
  .site-header.site-header-mobile-only {
    display: none;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 10px 16px;

    .header-container {
      .site-logo-text {
        font-size: 20px;
      }
    }
  }
}

/* ========================================
   section-title
======================================== */
.section-title {
  text-align: center;
  font-size: 38px;
  font-weight: bold;
  line-height: 1.3;
  color: var(--text-dark);
  margin-bottom: 60px;
  position: relative;
  padding-bottom: 30px;

  span {
    display: block;
    font-size: 18px;
    font-weight: 300;
    padding-top: 25px;
    color: var(--gray-dark-secondary);
  }

  &::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 76px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 9999px;
  }
}

@media (max-width: 1024px) {
  .section-title {
    font-size: 32px;

    span {
      font-size: 15px;
      line-height: 1.4;
    }
  }
}

@media (max-width: 768px) {
  .section-title {
    font-size: 28px;
    margin-bottom: 40px;

    span {
      font-size: 14px;
      line-height: 1.5;
    }
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 24px;
  }
}

/* ========================================
   login page
======================================== */
body.keepy-context-login,
body.keepy-context-mypage {
  background: var(--background-gray);
}

/* ========================================
   page
======================================== */
.page-container {
  width: 90%;
  margin: 80px auto 0;
  padding: 70px 0 120px;

  .page-content {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 0;

    h1.wp-block-heading {
      margin: 0 0 20px;
    }

    h2.wp-block-heading {
      margin: 20px 0 10px;
    }

    p {
      margin-bottom: 10px;
    }
  }
}

@media (max-width: 768px) {
  .page-container {
    margin: 60px auto 0;
    padding: 40px 0 100px;

    .page-content {
      width: 100%;
      padding: 10px 0;

      h1.wp-block-heading {
        font-size: x-large;
      }

      h2.wp-block-heading {
        font-size: large;
      }

      p {
        font-size: small;
        margin-bottom: 10px;
      }
    }
  }
}

/* ========================================
   フッター
======================================== */
.site-footer {
  background: var(--background-dark);
  color: var(--white);
  padding: 64px 62px;

  .footer-container {
    max-width: 1280px;
    margin: 0 auto;

    .footer-top {
      display: grid;
      grid-template-columns: 1.5fr 1fr 1fr 1fr;
      gap: 48px;
      margin-bottom: 48px;

      .footer-brand {
        display: flex;
        flex-direction: column;
        gap: 10px;

        .footer-logo {
          width: 171px;
          height: auto;
        }

        .footer-tagline {
          font-size: 17px;
          color: var(--white);
          opacity: 0.9;
        }

        .footer-social {
          display: flex;
          gap: 12px;
          margin-top: 15px;

          a {
            background-color: rgb(255 255 255 / 10%);
            padding: 10px;
            border-radius: 10px;
            width: 40px;
            height: 40px;

            img {
              vertical-align: baseline;
            }
          }
        }
      }

      .social-link {
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;

        &:hover {
          background: rgba(255, 255, 255, 0.2);
          transform: translateY(-3px);
        }

        svg {
          width: 20px;
          height: 20px;
          stroke: var(--white);
        }
      }

      .footer-section {
        display: flex;
        flex-direction: column;
        gap: 16px;

        .footer-title {
          font-size: 18px;
          font-weight: bold;
          color: var(--white);
          margin-bottom: 8px;
        }

        .footer-links {
          list-style: none;
          padding: 0;
          margin: 0;
          display: flex;
          flex-direction: column;
          gap: 12px;

          a {
            font-size: 14px;
            color: var(--gray-medium);
            transition: color 0.3s ease;

            &:hover {
              color: var(--white);
            }
          }
        }
      }
    }

    .footer-bottom {
      padding-top: 33px;
      border-top: 1px solid rgba(255, 255, 255, 0.1);
      display: flex;
      justify-content: space-between;
      align-items: center;

      .footer-copyright,
      .footer-credit {
        font-size: 14px;
        color: var(--gray-medium);
      }
    }
  }
}

@media (max-width: 1024px) {
  .site-footer {
    .footer-container {
      .footer-top {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
      }
    }
  }
}

@media (max-width: 768px) {
  .site-footer {
    padding: 48px 24px;

    .footer-container {
      .footer-top {
        grid-template-columns: 1fr;
        gap: 32px;
      }

      .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
      }
    }
  }
}

@media (max-width: 480px) {
  .site-footer {
    padding: 40px 16px;

    .footer-container {
      .footer-top {
        .footer-brand {
          .footer-social {
            justify-content: flex-start;
          }
        }
      }
    }
  }
}

/* ========================================
   FLOAT CTA FINAL
======================================== */
.float-cta {
  position: fixed;
  right: 16px;
  bottom: 16px;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 999;
  pointer-events: auto;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: 200px;

  &.is-hidden,
  &.is-closed {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
  }

  .float-cta__link {
    position: relative;
    display: inline-block;
    line-height: 0;
    border-radius: 18px;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    z-index: 1;

    .cta-img {
      display: block;
      width: 100%;
      height: auto;
      transition: opacity 0.25s ease;
    }

    .is-default {
      position: relative;
      z-index: 1;
    }

    .is-hover {
      position: absolute;
      inset: 0;
      opacity: 0;
      z-index: 2;
    }

    &:hover {
      .is-hover {
        opacity: 1;
      }

      .is-default {
        opacity: 0;
      }
    }
  }

  .float-cta__close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #545454;
    cursor: pointer;
    z-index: 20;
    pointer-events: auto;

    &::before,
    &::after {
      content: "";
      position: absolute;
      left: 50%;
      top: 50%;
      width: 16px;
      height: 2px;
      background: #fff;
      transform-origin: center;
    }

    &::before {
      transform: translate(-50%, -50%) rotate(45deg);
    }

    &::after {
      transform: translate(-50%, -50%) rotate(-45deg);
    }
  }
}

@media (prefers-reduced-motion: reduce) {

  .float-cta,
  .cta-img {
    transition: none;
  }
}

@media (max-width: 768px) {
  .float-cta {
    max-width: 93%;


    .float-cta__link {
      max-width: 100%;
    }
  }
}

@media (max-width: 450px) {
  .float-cta {
    width: 93%;

    .float-cta__link {
      pointer-events: auto;
    }

    .float-cta__close {
      z-index: 9999;
      pointer-events: auto;
    }
  }
}

/* ========================================
   company-page
======================================== */
.company-table-wrapper {
  max-width: 900px;
  margin: 0 auto;

  .company-table {
    width: 100%;
    border-collapse: collapse;

    .company-row {
      display: table-row;

      .company-label,
      .company-content {
        font-family: 'Noto Sans JP', sans-serif;
        font-weight: 500;
        font-size: 16px;
        line-height: 24px;
        color: #424641;
        padding: 24px;
        border-bottom: 1px solid #e5e7eb;
        vertical-align: top;
      }

      &:last-child {

        .company-label,
        .company-content {
          border-bottom: none;
        }
      }

      .company-label {
        width: 160px;
        text-align: left;
        padding-left: 24px;
        background-color: transparent;
      }

      .company-content {
        padding-left: 24px;
        text-align: left;

        p {
          margin: 0;
          line-height: 24px;

          &+p {
            margin-top: 0;
          }
        }

        .company-office-title {
          font-weight: 500;
          margin-bottom: 0 !important;
        }

        .company-address {
          margin-top: 0 !important;
        }
      }

      &.company-row-large {

        .company-label,
        .company-content {
          padding-top: 24px;
          padding-bottom: 24px;
        }
      }
    }
  }
}

@media (max-width: 1024px) {
  .company-table-wrapper {
    .company-table {
      .company-row {
        .company-label {
          width: 140px;
          padding: 20px 16px;
        }

        .company-content {
          padding: 20px 16px;
        }
      }
    }
  }
}

@media (max-width: 768px) {
  .company-main {
    padding: 60px 0 100px;
  }

  .company-title-section {
    padding: 0 20px;
    margin-bottom: 40px;
  }

  .company-title-bar {
    width: 60px;
    top: 50px;
  }

  .company-title {
    font-size: 28px;
    line-height: 36px;
  }

  .company-table-wrapper {

    .company-table,
    .company-row,
    .company-label,
    .company-content {
      display: block;
      width: 100%;
    }

    .company-table {
      .company-row {
        margin-bottom: 0;
        border-bottom: 1px solid #e5e7eb;

        .company-label {
          padding: 16px 16px 8px 16px;
          border-bottom: none;
          font-weight: 700;
        }

        .company-content {
          padding: 0 16px 16px 16px;
          border-bottom: none;
        }

        &.company-row-large {
          .company-label {
            padding-bottom: 8px;
          }

          .company-content {
            padding-top: 0;
            padding-bottom: 16px;
          }
        }
      }
    }
  }
}

@media (max-width: 480px) {
  .company-table-wrapper {
    .company-table {
      .company-row {

        .company-label,
        .company-content {
          font-size: 14px;
          line-height: 22px;
        }

        .company-label {
          padding: 12px 12px 6px 12px;
        }

        .company-content {
          padding: 0 12px 12px 12px;
        }
      }
    }
  }
}

/* ===================================
   Btn
=================================== */
.btns {
  display: flex;
  gap: 20px;
  justify-content: center;

  ul {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  li {
    margin: 0;
  }
}

.contact-page-container {
  .btns {
    .btn {
      margin: 0;
    }
  }
}

.btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-width: 300px;
  margin: 0 auto;
  padding: 17px 40px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.3s ease;

  &:hover {
    box-shadow: 0 10px 20px rgba(147, 204, 153, 0.3);
  }

  .img-center {
    padding-top: 2px;
  }
}

.btn-primary {
  border: 2px solid var(--primary-color);
  background: var(--primary-color);
  color: var(--white);
}

.btn-primary:hover {
  border: 2px solid var(--primary-accent);
  background: var(--primary-accent);
  transform: translateY(-2px);
}

.btn-secondary {
  border: 2px solid var(--primary-color);
  background: var(--white);
  color: var(--primary-color);
}

.btn-secondary svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.btn-secondary:hover {
  border: 2px solid var(--primary-accent);
  background: var(--primary-accent);
  color: #fff;
  transform: translateY(-2px);
}

.mypage-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-width: 250px;
  margin: 20px auto 0;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.3s ease;

  &.mypage-top-btn {
    min-width: 170px;
  }

  .img-center {
    padding-top: 2px;
  }
}

.nav-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0 auto;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.3s ease;
}

@media (max-width: 768px) {
  .btns {
    display: flex;
    flex-direction: column;

    ul {
      flex-direction: column;
      width: 100%;
    }
  }

  .btn {
    width: 100%;
    justify-content: center;
    padding: 14px 30px;
    min-width: auto;
  }

  .mypage-btns {
    width: 100%;
  }

  .mypage-btn {
    margin-top: 5px;
    padding: 10px 20px;
    font-size: 14px;
    width: 100%;
  }

  .nav-btn {
    padding: 15px 20px;
    font-size: 15px;
  }
}
