@charset "utf-8";

/* ==========================================
   CSS 変数
   ========================================== */

:root {
  /* ブランドカラー */
  --c-blue:   #0e84ce;
  --c-purple: #94a2cf;
  --c-orange: #ec9148;
  --c-green:  #9abe14;

  /* 共通カラー */
  --c-text:           #333;
  --c-bg-inner:       #efefef;
  --c-news-bg:        #eceff0;
  --c-news-border:    #c7d9e0;
  --c-news-link:      #069;
  --c-news-dark-navy: #0a3456;

  /* フォント */
  --f-mincho: 'Noto Serif JP', 'Yu Mincho', '游明朝', serif;
  --f-gothic: 'Noto Sans JP', 'ヒラギノ角ゴ Pro W3', 'ＭＳ Ｐゴシック', 'MS PGothic', 'Osaka', sans-serif;
  --f-en: Arial, sans-serif;

  /*
   * フォントサイズ変数
   * 変数名の数値 = 元のピクセル値
   * em 換算基準：html 62.5% = 10px → body 1.2em = 12px → #container 初期値 110% = 13.2px
   * ※ 13.2px がちょうど 1em のため、その他の値は 対象px ÷ 13.2 で算出
   */
  --fs-32: 2.42em;  /* 32px */
  --fs-28: 2.13em;  /* 28px */
  --fs-24: 1.82em;  /* 24px */
  --fs-22: 1.67em;  /* 22px */
  --fs-20: 1.52em;  /* 20px */
  --fs-18: 1.36em;  /* 18px */
  --fs-16: 1.21em;  /* 16px */
  --fs-15: 1.14em;  /* 15px */
  --fs-14: 1.06em;  /* 14px */
  --fs-13: 0.98em;  /* 13px */
  --fs-12: 0.91em;  /* 12px */
  --fs-10: 0.76em;  /* 10px */
}

/* 事業アイテムごとのカラー変数 */
.top-business__item--water       { --item-color: var(--c-blue); }
.top-business__item--fire        { --item-color: var(--c-purple); }
.top-business__item--product     { --item-color: var(--c-orange); }
.top-business__item--maintenance { --item-color: var(--c-green); }

/* ==========================================
   #body
   ========================================== */

#body {
  padding-top: 0;
}

/* ==========================================
   top-mainvisual
   ========================================== */

.top-mainvisual {
  position: relative;
  height: 315px;
  overflow: hidden;
  margin-inline: calc(50% - 50vw);

  @media (width < 768px) {
    height: 335px;
  }
}

.top-mainvisual__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;

  @media (width < 768px) {
    inset: auto;
    top: 41.65%;
    left: -190.81%;
    width: 481.62%;
    height: 58.35%;
  }

  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
}

.top-mainvisual__slide {
  margin: 20px auto 0;
  height: 295px;
  position: relative;

  @media (width < 768px) {
    margin-bottom: 40px;
  }
}

.top-mainvisual__slide__item {
  @media (width < 768px) {
    box-shadow: 0 10px 13px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    height: 295px;
  }
}

.top-mainvisual__slide__link {
  display: block;
  width: 100%;
  height: 295px;
  overflow: hidden;

  @media (width < 768px) {
    height: 100%;
  }

  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
}

.top-mainvisual {
  .splide__track {
    @media (width < 768px) {
      overflow: visible;
    }
  }

  .splide__arrow {
    top: 115px;
    transform: none;
    width: 30px;
    height: 30px;
    background: transparent;
    border-radius: 0;
    opacity: 1;

    @media (width < 768px) {
      top: 50%;
      transform: translateY(-50%);
    }

    &:hover:not(:disabled) {
      opacity: 0.8;
    }

    svg {
      display: none;
    }

    img {
      width: 100%;
      height: 100%;
      display: block;
    }
  }

  .splide__arrow--prev {
    left: calc(50% - 445px);

    @media (width < 768px) {
      left: calc(50% - 162.5px);
    }
  }

  .splide__arrow--next {
    left: calc(50% + 415px);
    right: auto;

    @media (width < 768px) {
      left: calc(50% + 132.5px);
      right: auto;
    }
  }
}

/* ==========================================
   top-outer
   ========================================== */

.top-outer {
  overflow: hidden;
}

/* ==========================================
   top-wrap
   ========================================== */

.top-wrap {
  width: calc(100% - 40px);
  display: flex;
  flex-direction: column;
  gap: 64px;
  margin-top: 40px;
  margin-inline: auto;
  font-optical-sizing: auto;
  overflow-wrap: anywhere; /* 収まらない場合に折り返す */
  word-break: normal;      /* 単語の分割はデフォルトに依存 */
  line-break: strict;      /* 禁則処理を厳格に適用 */

  @media (width < 768px) {
    gap: 40px;
    margin-top: 32px;
  }
}

/* ==========================================
   top-contents
   ========================================== */

.top-contents {
  display: flex;
  flex-direction: column;
  gap: 48px;

  @media (width < 768px) {
    gap: 32px;
  }
}

/* ==========================================
   top-intro
   ========================================== */

.top-intro {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;

  @media (width < 768px) {
    padding: 0 16px;
    gap: 12px;
    align-items: flex-start;
  }
}

.top-intro__lead {
  width: 100%;
  word-break: keep-all;
  font-family: var(--f-mincho);
  font-weight: 600;
  font-size: var(--fs-24);  /* 24px */
  color: var(--c-blue);
  line-height: 1.8;
  margin: 0;

  @media (width < 768px) {
    font-size: var(--fs-18);  /* 18px */
  }
}

.top-intro__text {
  width: 100%;
  word-break: keep-all;
  font-family: var(--f-gothic);
  font-size: var(--fs-16);  /* 16px */
  color: var(--c-text);
  line-height: 1.8;
  margin: 0;

  @media (width < 768px) {
    font-size: var(--fs-13);  /* 13px */
  }
}

/* ==========================================
   top-business
   ========================================== */

.top-business {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-content: flex-start;

  @media (width < 768px) {
    flex-direction: column;
    gap: 0;
  }
}

.top-business__item {
  display: flex;
  flex-direction: column;
  width: calc((100% - 24px) / 2);

  @media (width < 768px) {
    width: 100%;
    padding-bottom: 20px;
  }
}

.top-business__inner {
  background: var(--c-bg-inner);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 40px;
  flex: 1;

  @media (width < 768px) {
    padding: 20px 16px;
    gap: 16px;
  }
}

.top-business__block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.top-business__box {
  display: flex;
  flex-direction: column;
}

.top-business__name {
  word-break: keep-all;
  font-family: var(--f-mincho);
  font-weight: 600;
  font-size: var(--fs-28);  /* 28px */
  color: var(--c-text);
  line-height: 1.8;
  margin: 0;

  @media (width < 768px) {
    font-size: var(--fs-22);  /* 22px */
  }
}

.top-business__en {
  font-family: var(--f-en);
  font-size: var(--fs-16);  /* 16px */
  color: var(--item-color);
  line-height: 1.8;
  margin: 0;

  @media (width < 768px) {
    font-size: var(--fs-13);  /* 13px */
  }
}

.top-business__text {
  font-family: var(--f-gothic);
  font-size: var(--fs-16);  /* 16px */
  color: var(--c-text);
  line-height: 1.8;
  margin: 0;

  @media (width < 768px) {
    font-size: var(--fs-13);  /* 13px */
  }
}

.top-business__img {
  position: relative;
  width: 100%;
  aspect-ratio: 100 / 62;
  overflow: hidden;

  > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.top-business__badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px 0;
  box-sizing: border-box;
  background: var(--item-color);
  filter: drop-shadow(4px 4px 4px rgba(0, 0, 0, 0.2));

  @media (width < 768px) {
    width: 100px;
    height: 100px;
    padding: 8px 0;
  }

  p {
    font-family: var(--f-gothic);
    font-size: var(--fs-14);  /* 14px */
    color: white;
    line-height: 1.6;
    margin: 0;

    @media (width < 768px) {
      font-size: var(--fs-10);  /* 10px */
      line-height: 1.4;
    }
  }
}

.top-business__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 10px 16px 0;
  color: white;
  text-decoration: none;
  background: var(--item-color);

  @media (width < 768px) {
    padding: 12px 8px 12px 0;
  }

  &:visited,
  &:link  { color: white; }
  &:hover { text-decoration: none; }

  span {
    font-family: var(--f-gothic);
    font-size: var(--fs-16);  /* 16px */
    line-height: 1.8;

    @media (width < 768px) {
      font-size: var(--fs-14);  /* 14px */
    }
  }
}

.top-business__arrow {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* ==========================================
   top-news
   ========================================== */

.top-news {
  display: flex;
  flex-direction: column;
}

.top-news__intro {
  background: var(--c-blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;

  @media (width < 768px) {
    padding: 10px 12px;
  }
}

.top-news__ttl {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-news__ttl-ja {
  font-family: var(--f-mincho);
  font-weight: 600;
  font-size: var(--fs-20);  /* 20px */
  color: white;

  @media (width < 768px) {
    font-size: var(--fs-18);  /* 18px */
  }
}

.top-news__ttl-en {
  font-family: var(--f-en);
  font-size: var(--fs-14);  /* 14px */
  color: var(--c-news-dark-navy);
}

.top-news__more {
  display: flex;
  align-items: center;
  gap: 4px;
  color: white;
  text-decoration: none;

  &:visited,
  &:link  { color: white; }
  &:hover { text-decoration: none; }
}

.top-news__more-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.top-news__more span {
  font-family: var(--f-mincho);
  font-weight: 600;
  font-size: var(--fs-16);  /* 16px */
  line-height: 1.8;
  white-space: nowrap;

  @media (width < 768px) {
    font-size: var(--fs-14);  /* 14px */
  }
}

.top-news__list {
  display: flex;
  flex-direction: column;

  /* CMS出力（dl/dt/dd）を新デザインに対応 */
  dl {
    display: grid;
    grid-template-columns: 84px 1fr;
    grid-template-areas:
      "thumb date"
      "thumb title";
    column-gap: 16px;
    align-items: start;
    padding: 16px;
    margin: 0;
    background: var(--c-news-bg);
    border-bottom: 1px dashed var(--c-news-border);

    @media (width < 768px) {
      grid-template-columns: 60px 1fr;
      column-gap: 10px;
      padding: 12px;
    }

    dt {
      grid-area: thumb;

      img {
        width: 84px;
        height: 63px;
        border: 1px solid white;
        display: block;
        object-fit: cover;

        @media (width < 768px) {
          width: 60px;
          height: 45px;
        }
      }
    }

    dd:first-of-type {
      grid-area: date;
      align-self: end;

      a {
        font-size: 1em;
        color: var(--c-news-link);
        padding-bottom: 8px;

        @media (width < 768px) {
          font-size: var(--fs-12);
        }
      }
    }

    dd:last-of-type {
      grid-area: title;
      align-self: start;

      a {
        font-family: var(--f-gothic);
        font-size: 1em;
        color: var(--c-news-link);
        line-height: 1.4;

        @media (width < 768px) {
          font-size: var(--fs-12);
        }
      }

      span {
        line-height: 1.4;
      }
    }

    a {
      display: block;
      text-decoration: none;
      color: inherit;

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

.top-news__red  { color: #e80000; }
.top-news__blue { color: #005aff; }

/* ==========================================
   top-info
   ========================================== */

.top-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding-bottom: 40px;

  @media (width < 768px) {
    gap: 24px;
    padding-bottom: 24px;
  }
}

/* ==========================================
   top-link
   ========================================== */

.top-link {
  display: flex;
  justify-content: center;
  gap: 24px;
  width: 100%;

  @media (width < 768px) {
    flex-wrap: wrap;
    gap: 8px;
  }
}

.top-link__item {
  flex: 1;
  display: block;
  aspect-ratio: 220 / 120;
  overflow: hidden;

  @media (width < 768px) {
    flex: 0 0 calc(50% - 4px);
  }

  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
}

/* ==========================================
   top-document
   ========================================== */

.top-document {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  align-items: center;

  @media (width < 768px) {
    gap: 12px;
  }
}

.top-document__item {
  width: 224px;

  @media (width < 768px) {
    width: 160px;
  }
}

.top-document__item--pdf{
  .top-document__link {
    border: 2px solid #fa0f00;
  }
}   
.top-document__item--excel{
  .top-document__link {
    border: 2px solid #107c41;
  }
}

.top-document__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 60px;
  background: white;
  text-decoration: none;
  box-sizing: border-box;

  @media (width < 768px) {
    height: 48px;
  }

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

.top-document__block {
  display: flex;
  align-items: center;
  gap: 6px;

  span {
    font-family: var(--f-mincho);
    font-weight: 600;
    font-size: var(--fs-15);  /* 15px */
    color: var(--c-text);

    @media (width < 768px) {
      font-size: var(--fs-13);  /* 13px */
    }
  }
}

.top-document__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
