/*
 * トップページ（index.html）だけのスタイル
 * クラス名は top- で始める
 */

/* ---------- 矢印（「土屋興業ってどんな会社？」・カード） ---------- */

.top-arrow {
  display: block;
  width: 50px;
  height: 22px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 22' fill='none' stroke='%23000' stroke-width='3'%3E%3Cpath d='M0 11h47M38 1.5l9.5 9.5L38 20.5'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 22' fill='none' stroke='%23000' stroke-width='3'%3E%3Cpath d='M0 11h47M38 1.5l9.5 9.5L38 20.5'/%3E%3C/svg%3E") no-repeat center / contain;
  transition: transform 0.3s;
}

/* ---------- メインの写真 ---------- */

.top-hero {
  position: relative;
  height: 618px;
  overflow: hidden;
  background: var(--color-beige);
}

.top-hero__slides {
  position: absolute;
  inset: 0;
}

.top-hero__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.top-hero__slide.is-active {
  opacity: 1;
}

.top-hero__slide--01 { object-position: 50% 55%; }

/* 右下を白くぼかして、キャッチコピーを読みやすくする */
.top-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 62% 70% at 82% 100%, rgba(255, 255, 255, 0.95) 30%, rgba(255, 255, 255, 0.75) 55%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.top-hero__copy {
  position: absolute;
  right: 24px;
  bottom: 44px;
  z-index: 1;
  font-family: var(--font-serif);
  text-align: right;
  color: #34261f;
}

.top-hero__catch {
  font-size: 32px;
  font-weight: 500;
  line-height: 1.72;
  letter-spacing: 0.06em;
}

.top-hero__sub {
  margin-top: 26px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.top-hero__dots {
  position: absolute;
  left: 50%;
  bottom: 4px;
  z-index: 1;
  display: flex;
  translate: -50% 0;
}

/* JS で切り替えられるときだけ出す */
.top-hero__dots[hidden] {
  display: none;
}

.top-hero__dot {
  position: relative;
  width: 20px;
  height: 20px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.top-hero__dot::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid var(--color-brown);
  border-radius: 50%;
  transition: background-color 0.3s;
}

.top-hero__dot[aria-current="true"]::before,
.top-hero__dot:hover::before {
  background: var(--color-brown);
}

/* ---------- 土屋興業ってどんな会社？・会社案内 ---------- */

.top-intro {
  display: grid;
  gap: 40px;
  padding: 80px 0;
  background: var(--color-beige);
}

.top-intro__item {
  display: grid;
  grid-template-columns: minmax(0, 600fr) minmax(0, 840fr);
}

.top-intro__item--reverse {
  grid-template-columns: minmax(0, 840fr) minmax(0, 600fr);
}

.top-intro__photo {
  order: 2;
  overflow: hidden;
}

.top-intro__item--reverse .top-intro__photo {
  order: 0;
}

.top-intro__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.top-intro__body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 40px 60px;
  text-align: center;
}

/* 見出し：左に家の屋根の半分、右へ下線（会社案内は左右を反対に） */
.top-intro__title {
  --top-intro-roof-w: 36px;
  position: relative;
  min-width: min(458px, 100%);
  padding: 0 24px 8px calc(var(--top-intro-roof-w) + 4px);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.03em;
  color: var(--color-text);
}

.top-intro__title::before,
.top-intro__title::after {
  content: "";
  position: absolute;
  bottom: 0;
}

.top-intro__title::before {
  left: 0;
  width: var(--top-intro-roof-w);
  height: 63px;
  background-color: var(--color-text);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 63' fill='none' stroke='%23000' stroke-width='1'%3E%3Cpath d='M35.5.5 1.5 37.5h16V63'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 63' fill='none' stroke='%23000' stroke-width='1'%3E%3Cpath d='M35.5.5 1.5 37.5h16V63'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}

.top-intro__title::after {
  left: 17px;
  right: 0;
  border-bottom: 1px solid var(--color-text);
}

.top-intro__item--reverse .top-intro__title {
  padding: 0 calc(var(--top-intro-roof-w) + 4px) 8px 24px;
}

.top-intro__item--reverse .top-intro__title::before {
  left: auto;
  right: 0;
  transform: scaleX(-1);
}

.top-intro__item--reverse .top-intro__title::after {
  left: 0;
  right: 17px;
}

.top-intro__title span {
  display: inline-block;
}

.top-intro__text {
  margin-top: 22px;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.95;
  letter-spacing: 0.06em;
}

.top-intro__body .top-arrow {
  position: absolute;
  right: 42px;
  bottom: 34px;
  color: var(--color-text);
}

.top-intro__item:hover .top-intro__photo img,
.top-card:hover .top-card__photo {
  transform: scale(1.05);
}

.top-intro__item:hover .top-arrow,
.top-card:hover .top-arrow {
  transform: translateX(6px);
}

/* ---------- カード ---------- */

.top-cards {
  padding-top: 80px;
}

.top-cards__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.top-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 345px;
  padding: 24px;
  overflow: hidden;
  color: var(--color-white);
  text-align: center;
  isolation: isolate;
}

.top-card__photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

/* 写真を暗くして文字を読みやすくする */
.top-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(30, 25, 20, 0.4);
  transition: background-color 0.3s;
}

.top-card:hover::before {
  background: rgba(30, 25, 20, 0.5);
}

.top-card__body {
  display: block;
}

.top-card__title {
  display: block;
  width: min(441px, 100%);
  margin-inline: auto;
  padding-bottom: 6px;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--color-white);
}

.top-card__text {
  display: block;
  margin-top: 14px;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.95;
  letter-spacing: 0.05em;
}

.top-card__br {
  display: none;
}

.top-card .top-arrow {
  position: absolute;
  right: 16px;
  bottom: 22px;
}

/* ---------- お知らせ ---------- */

.top-news {
  padding: 160px 0 80px;
}

.top-news__inner {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 25px;
  align-items: start;
}

.top-news__heading {
  --house-heading-gap: 12px;
  margin-top: -6px;
}

.top-news__item {
  padding: 0 40px 18px;
  border-bottom: 1px solid #8a8a8a;
}

.top-news__item + .top-news__item {
  padding-top: 26px;
}

.top-news__date {
  display: block;
  font-size: 14px;
  letter-spacing: 0.05em;
  color: #6b6b6b;
}

.top-news__title {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: var(--color-brown);
}

/* ---------- イベント情報 ---------- */

.top-event {
  padding: 80px 0;
  background: var(--color-beige);
}

.top-event__banner {
  display: block;
  width: min(884px, 100%);
  margin: 40px auto 0;
  transition: opacity 0.2s;
}

.top-event__banner:hover {
  opacity: 0.85;
}

.top-event__banner img {
  width: 100%;
}

/* PC のデザインにはボタンが無い。SP だけ出す */
.top-event__more {
  display: none;
}

/* ---------- 1199px 以下 ---------- */

@media (max-width: 1199px) {
  .top-hero__catch {
    font-size: 28px;
  }

  .top-intro__title {
    font-size: 28px;
  }

  .top-card__title {
    font-size: 28px;
  }

  .top-card__text {
    font-size: 18px;
  }
}

/* ---------- SP ---------- */

@media (max-width: 767px) {
  .top-hero__slide--01 { object-position: 42% 40%; }
  .top-hero__slide--04 { object-position: 47% 50%; }

  .top-hero::after {
    background:
      linear-gradient(to bottom, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.82) 66%, rgba(255, 255, 255, 0.95) 100%);
  }

  .top-hero__copy {
    left: var(--gutter);
    right: var(--gutter);
    bottom: 34px;
  }

  .top-hero__catch {
    font-size: 22px;
    line-height: 1.55;
    letter-spacing: 0.04em;
  }

  .top-hero__catch span,
  .top-hero__sub span {
    display: block;
  }

  .top-hero__catch br {
    display: none;
  }

  .top-hero__sub {
    margin-top: 18px;
    font-size: 13.5px;
    line-height: 1.85;
    letter-spacing: 0.06em;
  }

  .top-hero__dots {
    bottom: 1px;
  }

  .top-hero__dot {
    width: 16px;
    height: 16px;
  }

  .top-hero__dot::before {
    inset: 4px;
  }

  .top-intro {
    gap: 44px;
    padding: 60px 0 56px;
  }

  .top-intro__item,
  .top-intro__item--reverse {
    grid-template-columns: minmax(0, 1fr);
    width: min(var(--content-width), 100% - var(--gutter) * 2);
    margin-inline: auto;
  }

  .top-intro__photo,
  .top-intro__item--reverse .top-intro__photo {
    order: 0;
  }

  .top-intro__body {
    padding: 34px 0 30px;
  }

  /* SP は左右どちらも屋根を左に置く */
  .top-intro__title,
  .top-intro__item--reverse .top-intro__title {
    --top-intro-roof-w: 34px;
    min-width: 0;
    width: calc(100% - 50px);
    padding: 0 0 4px var(--top-intro-roof-w);
    font-size: 24px;
    line-height: 1.5;
  }

  .top-intro__title::before,
  .top-intro__item--reverse .top-intro__title::before {
    left: 0;
    right: auto;
    height: 61px;
    transform: none;
  }

  .top-intro__title::after,
  .top-intro__item--reverse .top-intro__title::after {
    left: 17px;
    right: 0;
  }

  .top-intro__text {
    margin-top: 12px;
    font-size: 18px;
    line-height: 2;
    letter-spacing: 0.08em;
  }

  .top-intro__body .top-arrow {
    right: 14px;
    bottom: 0;
    width: 48px;
    height: 16px;
  }

  .top-cards {
    padding-top: 37px;
  }

  .top-cards__list {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .top-card {
    padding: 16px;
  }

  /* 線は 197px。長い英字の見出しは線より広くてよい */
  .top-card__title {
    position: relative;
    width: auto;
    padding-bottom: 2px;
    font-size: 24px;
    letter-spacing: 0.06em;
    border-bottom: 0;
  }

  .top-card__title::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 197px;
    translate: -50% 0;
    border-bottom: 1px solid var(--color-white);
  }

  .top-card__text {
    margin-top: 8px;
    font-size: 18px;
    line-height: 2;
    letter-spacing: 0.04em;
  }

  .top-card__br {
    display: block;
  }

  .top-card .top-arrow {
    right: 14px;
    bottom: 16px;
    width: 36px;
    height: 16px;
  }

  .top-news {
    padding: 120px 0 60px;
  }

  .top-news__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .top-news__heading {
    margin-top: 0;
  }

  .top-news__item {
    padding: 0 12px 12px;
  }

  .top-news__item + .top-news__item {
    padding-top: 14px;
  }

  .top-news__date {
    font-size: 14px;
  }

  .top-news__title {
    margin-top: 12px;
    line-height: 1.2;
  }

  .top-event {
    padding: 60px 0 32px;
  }

  .top-event__banner {
    margin-top: 24px;
  }

  .top-event__more {
    display: flex;
    justify-content: center;
    margin-top: 25px;
  }
}

/* 動きを減らす設定のときは、動きを付けない */
@media (prefers-reduced-motion: reduce) {
  .top-hero__slide,
  .top-intro__photo img,
  .top-card__photo,
  .top-arrow {
    transition: none;
  }
}
