/* トップの最初の画面（2026-11-27 河合さん）。index.html だけが読む。
   スマホ（767px 以下）：写真のカードの中に「弁護士費用特約付」・見出し・保険料の目安を重ね、申込ボタンは写真の下に置く。
     写真は 4:3 で上側に置き、下は濃い緑に溶かして白い文字を載せる。文字が増えても（文字拡大）カードが伸びる。
   下部バー：メニュー（右上と重複）を外して「保険料を見る」と申込の2つにし、写真の下の申込ボタンが見えているあいだは隠す（js/top-hero-20261127.js）。
   PC・タブレット（768px 以上）：見た目は変えない。包み直した div を display: contents にして、見出し → 申込ボタン → 保険料の目安 の並びを保つ。 */

@media (min-width: 768px) {
  .hero--refreshed .hero-visual,
  .hero--refreshed .hero-visual__text {
    display: contents;
  }
  .hero--refreshed .hero-price-link {
    order: 1;
  }
}

@media (max-width: 767px) {
  main .hero.hero--refreshed {
    display: block !important;
    padding: 12px 16px 8px !important;
  }
  main .hero--refreshed .hero-box {
    display: block !important;
    padding: 0 !important;
  }

  /* 写真のカード */
  .hero--refreshed .hero-visual {
    display: grid;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-radius: 16px;
    background: #12402b;
  }
  .hero--refreshed .hero-visual > *,
  .hero--refreshed .hero-visual::after {
    grid-area: 1 / 1;
  }
  .hero--refreshed .hero-visual .mobile-hero-photo {
    display: block;
    align-self: start;
    z-index: -2;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    margin: 0;
    border-radius: 0;
    object-fit: cover;
    /* 自転車と人が入るよう右寄りを見せる */
    object-position: 84% 50%;
    -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  }
  /* 文字の下に濃い緑のグラデーションを敷く */
  .hero--refreshed .hero-visual::after {
    content: "";
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(to top, #12402b 0%, rgba(18, 64, 43, 0.85) 40%, rgba(18, 64, 43, 0.2) 62%, rgba(18, 64, 43, 0) 75%);
  }
  .hero--refreshed .hero-visual__text {
    align-self: end;
    padding: 150px 16px 16px;
    color: #fff;
  }

  main .hero--refreshed .mobile-hero-eyebrow {
    display: inline-block;
    margin: 0 0 10px !important;
    padding: 4px 12px;
    border-radius: 999px;
    background: #fff;
    color: #1a5c3c;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1.5;
  }
  main .hero--refreshed .hero-visual h1 {
    margin: 0;
    color: #fff;
  }
  main .hero--refreshed .hero-visual .hero-mobile-title {
    color: #fff;
    font-size: clamp(21px, 7vw, 32px);
    font-weight: 800;
    line-height: 1.32;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  }

  /* 保険料の目安：白い箱に大きな数字 */
  main .hero--refreshed .hero-price-link {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 0.3em;
    width: fit-content;
    max-width: 100%;
    min-height: 44px;
    margin: 14px 0 0;
    padding: 10px 14px;
    box-sizing: border-box;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    color: #1f2a24;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
  }
  main .hero--refreshed .hero-price-link strong {
    color: #c2410c;
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
  }
  main .hero--refreshed .hero-price-link__note {
    flex-basis: 100%;
    color: #4b5650;
    font-size: 12px;
    font-weight: 500;
  }
  main .hero--refreshed .hero-price-link__arrow {
    display: none;
  }
  main .hero--refreshed .hero-price-link:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
  }

  main .hero--refreshed a.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 14px 0 4px;
  }

  /* タイプ別の年間保険料：外側の枠をなくし、カードを幅いっぱいに */
  main .mobile-plan-summary {
    margin: 0 16px 16px !important;
    padding: 8px 0 !important;
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
  }

  /* 下部バー */
  .floating-cta {
    display: grid !important;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) !important;
    gap: 8px;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }
  .floating-cta .menu-btn {
    display: none !important;
  }
  .floating-cta .cta-btn {
    width: auto !important;
    min-width: 0 !important;
  }
  .floating-cta .apply-btn,
  .floating-cta .apply-btn * {
    white-space: normal !important;
    overflow-wrap: anywhere;
    text-align: center;
  }
  .floating-cta.is-hero-cta-visible {
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .floating-cta {
    transition: none;
  }
}
