/* Service Page Specific Styles */

/* Section Heading - Service Page Specific */
.service-details-content .section-heading {
    margin: 0 auto 80px;
}

/* Page Header */
.page-header {
    margin-top: 0;
    height: 450px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.page-header-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-header-content {
    position: absolute;
    top: 50%;
    left: 200px;
    transform: translateY(-50%);
    z-index: 2;
    text-align: left;
}

.page-title {
    font-family: 'Noto Serif JP', serif;
    font-size: 32px;
    font-weight: 700;
    color: #522601;
    margin: 0;
}

/* Service Overview */
.service-overview {
    background: #FFF8F4;
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.service-overview-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.service-overview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.service-overview-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
    text-align: center;
}

.service-overview-text {
    color: #522601;
    text-align: center;
    font-family: "Noto Sans JP";
    font-size: 24px;
    font-style: normal;
    font-weight: 400;
    line-height: 30px; /* 125% */
    margin: 0;
    max-width: 900px; 
    margin: 0 auto;
}

/* Service Details */
.service-details {
    background: #FFF8F4;
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.service-details-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('img/bg_texture.png');
    background-repeat: repeat;
    background-size: auto;
    background-position: top left;
}

.service-details-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.service-list {
    display: flex;
    flex-direction: column;
    gap: 100px;
    margin-top: 60px;
}

:root{
  --icon-size: clamp(72px, 8vw, 120px);
  --icon-gap: 20px;            /* アイコン下の余白（見た目用） */
  --card-radius: 12px;
  --card-border-color: #C9A37A;
  --card-border-width: 1px;
}

/* セクションに左右の安全パディングを付与（SPで端切れ防止） */
.services-section{
  padding-inline: clamp(16px, 4vw, 32px);
}

/* 外側の箱（装飾なし・アンカーの祖先） */
.service-item{
  position: relative;
  overflow: visible;
  background: transparent;
  border: none;
  margin: 0;                   /* 余計なすき間を作らない */
  display: flex;
  justify-content: center;
}

/* 外側に使っていた装飾用疑似要素があれば無効化 */
.service-item::before,
.service-item::after {
    content: none !important;
    display: none !important;
}

/* 左側配置のアイテム */
/* 右側配置のアイテム */

/* 正式なカード */
.service-card{
  position: relative;
  background: #fff;
  border: var(--card-border-width) solid var(--card-border-color);
  border-radius: var(--card-radius);
  /* アイコンが半分かぶる分 + ゆとり を上側に確保（テキストが被らない） */
  padding: 40px 40px 40px;
  margin: 0;
  overflow: visible;           /* はみ出し許可 */
  max-width: 1004px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items: center;
  text-align: center;
  z-index: 1;
}

.service-header {
    display: flex;
    align-items: center;
    gap: 22px;
    justify-content: flex-start;
}

.service-title {
    font-size: 24px;
    font-weight: 700;
    color: #522601;
    margin: 0;
    text-align: left;
}

.service-line {
    width: 137px;
    height: 1px;
    background: #522601;
}

.service-description {
    font-size: 18px;
    line-height: 1.56;
    color: #522601;
    margin: 0;
    max-width: 878px;
}

/* アイコンの共通スタイル */
.service-icon{
  position: absolute;
  top: 0;
  width: 200px;
  height: 200px;
  background: #F7F4F0;
  border: 1px solid #8F4100;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  margin: 0;
  transform: none;
}

/* アンカー要素のスタイル */
.service-card__corner-anchor{
  position:absolute; 
  inset:0;  /* カードと同じ位置・サイズを持つ透明アンカー */
}

/* PC角重ね：このアンカーに対して配置する */
@media (min-width: 1024px) {
  .service-item-left .service-icon {
    position: absolute; 
    top: -50px; 
    left: -50px; 
    transform: none;
  }
  .service-item-right .service-icon {
    position: absolute; 
    top: -50px; 
    right: -50px; 
    transform: none;
  }
}

/* タブレット/スマホ（≤1023px）：上辺で左右交互。端切れ防止 */
@media (max-width: 1023px) {
  .service-card { 
    padding-top: 100px; 
  }

  .service-icon {
    top: -60px; /* 上に半分だけはみ出す */
    width: 120px;
    height: 120px;
  }

  .service-item-left .service-icon { 
    left: 16px; 
    right: auto; 
    transform: none; 
  }
  .service-item-right .service-icon { 
    right: 16px; 
    left: auto; 
    transform: none; 
  }
}

/* 754px以下：アイコンがテキストに被らないよう上部paddingを追加 */
@media (max-width: 754px) {
  .service-card { 
    padding-top: 100px; /* アイコン分の余白を増やす */
  }
}

.service-icon-img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}


/* Flow Section */
.flow {
    background-image: url(img/bg-flow.png);
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.flow-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.flow-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flow-content {
    background: rgba(255, 255, 255, 0.44);
    border-radius: 16px;
    padding: 60px 40px;
    margin: 80px auto;
    max-width: 1000px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    position: relative;
    z-index: 2;
    text-align: center;
}

.flow-steps {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-top: 60px;
    position: relative;
}

.flow-steps::before {
    content: '';
    position: absolute;
    left: 46px;
    top: 67px;
    width: 1px;
    height: 480px;  /* STEP01からSTEP04まで（4つのステップ間）の接続線 */
    background: repeating-linear-gradient(
        to bottom,
        rgba(247, 132, 0, 0.6) 0px,
        rgba(247, 132, 0, 0.6) 4px,
        transparent 4px,
        transparent 8px
    );
}

.flow-step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    position: relative;
}

.step-number {
    flex-shrink: 0;
}

.step-circle {
    width: 93px;
    height: 93px;
    background: #F78400;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.step-text {
    font-size: 16px;
    font-weight: 700;
    color: #FFFFFF;
    text-align: center;
    margin-bottom: 5px;
}

.step-num {
    font-size: 28px;
    font-weight: 700;
    color: #FFFFFF;
    text-align: center;
}

.step-content {
    flex: 1;
    padding-top: 20px;
    text-align: left;
}

.step-title {
    font-size: 24px;
    font-weight: 700;
    color: #522601;
    margin: 0 0 10px 0;
}

.step-description {
    font-size: 18px;
    line-height: 1.67;
    color: #522601;
    margin: 0;
}

.flow-cta {
    background: linear-gradient(0deg, rgba(255, 5, 5, 1) 0%, rgba(247, 132, 0, 1) 100%);
    color: #F7F4F0;
    text-decoration: none;
    padding: 20px 30px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin: 60px auto 0;
    transition: transform 0.3s ease;
    text-align: center;
}

.flow-cta:hover {
    transform: translateY(-2px);
}

/* Area Section */
.area {
    background-image: url(img/bg-area.png);
    padding: 100px 0;
    position: relative;
    overflow: visible;
}

.area::before, .area::after {
    content: '';
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background: rgba(247, 132, 0, 0.3);
}

.area::before {
    left: 50px;
}

.area::after {
    right: 50px;
}


.area-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.area-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 4;
    text-align: center;
}

.area-content h2 {
    position: relative;
    z-index: 5;         /* 見出しは最前面 */
    margin-bottom: 24px;
}

.area-map {
    --circle: 1100px;                 /* ここを変えれば全体が追従 */
    position: relative;
    width: var(--circle);
    height: var(--circle);
    margin: 48px auto 80px;
    border-radius: 50%;
    border: 1px solid #F78400;
    background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(247,244,240,0.9) 100%);
    box-shadow: 0 0 30px rgba(0,0,0,0.05);
    overflow: hidden;
    z-index: 1;
}

.area-map-img {
    position: absolute;
    left: 50%;
    bottom: calc(var(--circle) * 0.10);
    transform: translateX(-50%);
    width: 68%;
    height: auto;
    object-fit: contain;
    z-index: 2;
}

.area-map {
  --circle: 1100px;
  position: relative;
  width: var(--circle);
  height: var(--circle);
  margin: 48px auto 80px;
  border-radius: 50%;
  border: 1px solid #F78400;
  background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(247,244,240,0.9) 100%);
  box-shadow: 0 0 30px rgba(0,0,0,0.05);
  overflow: hidden;
  z-index: 1;
}

/* テキストを円内で自然に改行させる */
.area-map .area-description {
  position: absolute;
  top: calc(var(--circle) * 0.13);
  left: 50%;
  transform: translateX(-50%);
  width: 90%;                   /* 親幅に対して可変に（固定max-widthを削除） */
  padding: 0 2%;
  box-sizing: border-box;
  margin: 0;
  text-align: center;
  font-size: clamp(16px, 2vw, 20px);  /* 画面幅でフォント可変 */
  line-height: 1.8;
  color: #522601;
  z-index: 3;
  word-break: normal !important;      /* ← keep-allを解除 */
  overflow-wrap: anywhere;            /* ← 自然な折返しを許可 */
  white-space: normal !important;     /* ← 改行・折返しを許可 */
  line-break: strict;     
}

/* 地図画像は下側に寄せて中央配置 */
.area-map-img {
  position: absolute;
  left: 50%;
  bottom: calc(var(--circle) * 0.10);
  transform: translateX(-50%);
  width: 68%;
  height: auto;
  object-fit: contain;
  z-index: 2;
}

/* レスポンシブ：円のサイズとともにテキストも自動縮小 */
@media (max-width: 1200px) {
  .area-map {
    --circle: min(90vw, 1100px);
  }
  .area-map .area-description {
    width: 92%;
    top: calc(var(--circle) * 0.15);
    font-size: clamp(16px, 2.4vw, 18px);
  }
  .area-map-img {
    width: 74%;
  }
}

/* 900px以下：四角の中に確実に下余白を作る */
@media (max-width: 900px) {
  .area-map {
    --circle: 90vw;
    width: var(--circle);
    height: auto;
    aspect-ratio: 1 / 1;        /* 正方形キープ */
    border-radius: 12px;
    background: rgba(255,255,255,0.9);

    /* ここがポイント：中に確実な下余白を作る */
    padding: 40px 20px 60px;    /* ← 下60pxの余白 */

    /* 子のmarginが潰れないように＆はみ出し対策 */
    overflow: visible;          /* 既存でhiddenなら上書き */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 32px;                  /* テキストと地図の間隔も安定させる */
  }

  .area-map .area-description {
    position: static !important;  /* 念のため絶対配置を解除 */
    transform: none !important;
    width: 100%;
    font-size: 16px;
    line-height: 1.8;
    text-align: center;
    padding: 0;                   /* 余白は親のpaddingで管理 */
    margin: 0;
  }

  .area-map-img {
    position: static !important;
    transform: none !important;
    width: 90%;
    height: auto;
    display: block;

    /* 子にmargin-bottomを付けなくても親のpaddingで下余白が保証される */
    margin: 0 auto;
  }
}

/* 600px以下：高さを可変にしてはみ出し防止 */
@media (max-width: 600px) {
  .area-map {
    aspect-ratio: auto !important;  /* ← 固定正方形解除 */
    height: auto !important;        /* ← コンテンツ量に応じて伸ばす */
    overflow: hidden !important;    /* ← はみ出しを確実にカット */
    border-radius: 12px;
    padding: 32px 16px 64px;        /* ← 下に余白追加 */
    background: rgba(255, 255, 255, 0.9);
    display: block;                 /* ← flex解除で高さが詰まらないように */
  }

  .area-map .area-description {
    position: static !important;
    transform: none !important;
    width: 100%;
    margin: 0 0 24px;
    padding: 0;
    font-size: 16px;
    line-height: 1.8;
    text-align: center;
    word-break: keep-all;
  }

  .area-map-img {
    position: static !important;
    transform: none !important;
    width: 88%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
    .page-header {
        height: 100vh;
    }
    
    .page-header-content {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
    }
    
    .page-title {
        font-size: 28px;
    }
    
    .service-overview-text {
        font-size: 20px;
    }
    
    .service-list {
        gap: 60px;
    }
    
    .service-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-bottom: 60px;
    }
    
    .service-card {
        padding: 80px 20px;
        margin-top: 0;
    }
    
    .service-title {
        font-size: 20px;
    }
    
    .service-description {
        font-size: 16px;
    }
    
    .flow-steps::before {
        display: none;
    }
    
    .flow-step {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }
    
    .step-content {
        padding-top: 0;
    }
    
    .step-title {
        font-size: 20px;
    }
    
    .step-description {
        font-size: 16px;
    }
    
    .area-map {
        width: 90vw;
        height: 90vw;
    }
    
    .area-description {
        font-size: 16px;
    }
    
    .area-map-img {
        width: 80%;
    }
}


/* 480px以下：スマートフォン対応 */
@media (max-width: 480px) {
    .page-title {
        font-size: 24px;
    }
    
    .service-overview-text {
        font-size: 18px;
    }
    
    .service-card {
        padding: 60px 15px;
        margin-top: 0;
    }
    
    .service-title {
        font-size: 18px;
    }
    
    .service-description {
        font-size: 16px;
    }
    
    
    .step-circle {
        width: 80px;
        height: 80px;
    }
    
    .step-text {
        font-size: 16px;
    }
    
    .step-num {
        font-size: 24px;
    }
    
    .step-title {
        font-size: 18px;
    }
    
    .step-description {
        font-size: 16px;
    }
    
    .area-map {
        width: 90vw;
        height: 90vw;
    }
    
    .area-description {
        font-size: 16px;
    }
    
    .area-map-img {
        width: 80%;
    }
}
