.iw-community {
  /* --- ブランド変数（実サイトの値に合わせて調整） --- */
  --iwc-navy: #12305b;
  --iwc-navy-deep: #0b2142;
  --iwc-orange: #e8710a;
  --iwc-text: #1f2a3a;
  --iwc-muted: #4b5b72;
  --iwc-bg: #fafbfd;
  --iwc-panel: #e9eef5;
  --iwc-line: #c9d3e0;
  --iwc-serif:
    YakuHanJP, "游ゴシック体", "Yu Gothic", "YuGothic", "Yu Gothic UI",
    "ＭＳ ゴシック", "Noto Sans JP", sans-serif;

  /* --- 背景画像（各1枚） --- */
  --iwc-bg-left: url("../assets/img/top/community-left.png");
  --iwc-bg-left-sp: url("../assets/img/top/community-left-sp.png"); /* スマホ用（599px以下） */
  --iwc-bg-map: url("../assets/img/top/map-shimane-yamaguchi.svg");

  box-sizing: border-box;
  background: var(--iwc-bg);
  color: var(--iwc-text);
  padding: clamp(40px, 6vw, 72px) 20px;
  line-height: 1.7;
}

.iw-community *,
.iw-community *::before,
.iw-community *::after {
  box-sizing: border-box;
}

.iw-community__inner {
  max-width: 1120px;
  margin: 0 auto;
}
.iw-community ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.iw-community a {
  color: inherit;
  text-decoration: none;
}

/* 画面には出さず、スクリーンリーダー・クローラー向けに残す説明文 */
.iw-community__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 日本語の不自然な折り返しを抑える */
.iw-community__title,
.iw-community__lead,
.iw-community__hero-copy,
.iw-community__sub,
.iw-community__facility-name {
  word-break: keep-all;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

/* ---------- 見出し ---------- */
.iw-community__head {
  text-align: center;
  margin-bottom: clamp(28px, 4vw, 44px);
}

.iw-community__eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 0 0 14px;
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--iwc-navy);
}
.iw-community__eyebrow::before,
.iw-community__eyebrow::after {
  content: "";
  flex: 0 1 160px;
  height: 1px;
  background: var(--iwc-navy);
}

.iw-community__title {
  margin: 0;
  font-family: var(--iwc-serif);
  font-weight: 700;
  font-size: clamp(22px, 3.6vw, 38px);
  line-height: 1.4;
  letter-spacing: 0.06em;
  color: var(--iwc-navy);
  border: 0;
  background: none;
  padding: 0;
}
.iw-community__title::before,
.iw-community__title::after {
  content: none;
}

.iw-community__lead {
  position: relative;
  display: inline-block;
  margin: 14px 0 0;
  padding-bottom: 14px;
  font-family: var(--iwc-serif);
  font-size: clamp(14px, 1.9vw, 19px);
  letter-spacing: 0.08em;
  color: var(--iwc-navy);
}
.iw-community__lead::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 120px;
  height: 3px;
  transform: translateX(-50%);
  background: var(--iwc-orange);
}

/* ---------- 2カラム ---------- */
.iw-community__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

@media (min-width: 900px) {
  .iw-community__grid {
    grid-template-columns: 1.15fr 1fr;
    gap: 48px;
    align-items: start;
  }
}

/* ============================================================
   左：背景画像1枚（推奨 1600×1084px ／ 縦横比 800:542）
   画像の構図：左に選手、左下に施設外観、右上は暗めの青（白文字用）、右下は白（紺文字用）
   ============================================================ */
.iw-community__visual {
  position: relative;
  border-radius: 120px;
  container-type: inline-size;
  aspect-ratio: 800 / 700;
  overflow: hidden;
}

.iw-community__visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--iwc-bg-left) center / cover no-repeat;
}

/* 右上：スポンサー文言（白） */
.iw-community__hero-body {
  position: absolute;
  top: 65%;
  left: 40%;
  right: 4%;
  color: #fff;
}

.iw-community__hero-copy {
  margin: 0 0 1cqw;
  font-family: var(--iwc-serif);
  font-weight: 700;
  font-size: 1.8rem;
}

.iw-community__hero-text {
  margin: 0;
  font-size: max(11px, 1.75cqw);
  line-height: 1.8;
}

/* 右下：施設名（紺） */
.iw-community__facility-body {
  position: absolute;
  top: 90%;
  left: 40%;
  right: 3%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 4cqw;
  border-left: 1px solid var(--iwc-line);
  color: var(--iwc-navy);
}

.iw-community__facility-name {
  margin: 0 0 1cqw;
  font-size: max(14px, 2.7cqw);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--iwc-navy);
  border: 0;
  background: none;
  padding: 0;
}
.iw-community__facility-name::before,
.iw-community__facility-name::after {
  content: none;
}

.iw-community__facility-meta {
  margin: 0;
  font-size: max(12px, 2cqw);
  letter-spacing: 0.04em;
}

/* ============================================================
   右：背景画像1枚（地図）＋ HTMLのピン
   ============================================================ */
.iw-community__sub {
  margin: 0 0 8px;
  padding: 0 0 0 14px;
  border: 0;
  border-left: 5px solid var(--iwc-orange);
  background: none;
  font-family: var(--iwc-serif);
  font-size: clamp(19px, 2.6vw, 28px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.05em;
  color: var(--iwc-navy);
}
.iw-community__sub::before,
.iw-community__sub::after {
  content: none;
}

.iw-community__sub-lead {
  margin: 0 0 12px;
  font-size: clamp(12px, 1.5vw, 15px);
  color: var(--iwc-muted);
}

.iw-community__map {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 600 / 400;
  background: var(--iwc-bg-map) center / contain no-repeat;
  left: -80px;
}

.iw-community__pref {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  font-family: var(--iwc-serif);
  font-size: max(15px, 4.4cqw);
  letter-spacing: 0.08em;
  color: #fff;
  pointer-events: none;
}

/* ピン：left/top が「先端」の位置 */
.iw-community__pin {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 0;
  height: 0;
  font-size: max(11px, 2.7cqw);
}

.iw-community__pin::before {
  /* しずく型 */
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 1.7em;
  height: 1.7em;
  background: var(--iwc-orange);
  border-radius: 50% 50% 50% 0;
  transform: translate(-50%, calc(-50% - 1.2em)) rotate(-45deg);
}

.iw-community__pin::after {
  /* 白い点 */
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 0.6em;
  height: 0.6em;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, calc(-50% - 1.2em));
}

.iw-community__pin span {
  /* 拠点名タグ */
  position: absolute;
  left: 1.2em;
  top: -2.15em;
  padding: 0.35em 0.95em;
  background: var(--iwc-navy);
  color: #fff;
  border-radius: 999px;
  font-size: 1em;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

.iw-community__pin:hover span,
.iw-community__pin:focus-visible span {
  background: var(--iwc-orange);
}

.iw-community__pin:focus-visible {
  outline: 2px solid var(--iwc-orange);
  outline-offset: 12px;
}

/* エリア補足リスト */
.iw-community__areas {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--iwc-muted);
}
@media (min-width: 300px) {
  .iw-community__areas {
    grid-template-columns: 1fr 1fr;
  }
}

.iw-community__areas a {
  display: block;
  padding: 8px;
  border: 1px solid var(--iwc-line);
  background: #fff;
  line-height: 1.5;
  transition: border-color 0.2s ease;
}
.iw-community__areas a:hover {
  border-color: var(--iwc-orange);
}
.iw-community__areas strong {
  display: block;
  color: var(--iwc-navy);
  font-size: 13px;
}

/* ---------- 下部バー ---------- */
.iw-community__bar {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: clamp(32px, 5vw, 48px);
  background: var(--iwc-panel);
  border-radius: 14px;
  overflow: hidden;
}

.iw-community__bar-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 22px 16px;
  font-family: var(--iwc-serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--iwc-navy);
  border-top: 1px solid var(--iwc-line);
}
.iw-community__bar-item:first-child {
  border-top: 0;
}

.iw-community__icon {
  flex: none;
  width: 36px;
  height: 30px;
  fill: var(--iwc-navy);
}

.iw-community__bar-item--link {
  font-family: inherit;
  font-size: 13px;
  padding: 0;
}

.iw-community__bar-item--link a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  padding: 22px 16px;
  transition: background-color 0.2s ease;
}
.iw-community__bar-item--link a:hover {
  background: rgba(18, 48, 91, 0.06);
}
.iw-community__bar-item--link a:focus-visible {
  outline: 2px solid var(--iwc-orange);
  outline-offset: -2px;
}

.iw-community__arrow {
  position: relative;
  flex: none;
  width: 22px;
  height: 2px;
  background: var(--iwc-orange);
  transition: transform 0.2s ease;
}
.iw-community__arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: -4px;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--iwc-orange);
  border-right: 2px solid var(--iwc-orange);
  transform: rotate(45deg);
}
.iw-community__bar-item--link a:hover .iw-community__arrow {
  transform: translateX(4px);
}

/* タブレット：上段3項目＋下段2リンク */
@media (min-width: 600px) and (max-width: 959px) {
  .iw-community__bar {
    grid-template-columns: repeat(6, 1fr);
  }
  .iw-community__bar-item {
    grid-column: span 2;
    border-top: 1px solid var(--iwc-line);
    border-left: 1px solid var(--iwc-line);
  }
  .iw-community__bar-item:nth-child(-n + 3) {
    border-top: 0;
  }
  .iw-community__bar-item:nth-child(1),
  .iw-community__bar-item:nth-child(4) {
    border-left: 0;
  }
  .iw-community__bar-item:nth-child(n + 4) {
    grid-column: span 3;
  }
}

/* PC */
@media (min-width: 960px) {
  .iw-community__bar {
    grid-template-columns: repeat(3, 1fr) repeat(2, 1.15fr);
  }
  .iw-community__bar-item {
    border-top: 0;
    border-left: 1px solid var(--iwc-line);
    padding: 28px 16px;
  }
  .iw-community__bar-item:first-child {
    border-left: 0;
  }
  .iw-community__bar-item--link a {
    padding: 28px 16px;
  }
}

/* 2カラム直後（900〜1099px） */
@media (min-width: 900px) and (max-width: 1099px) {
  .iw-community__bar-item {
    font-size: 14px;
    gap: 10px;
  }
  .iw-community__icon {
    width: 30px;
  }
}

/* タブレット（600〜899px）：1カラムは中央寄せ */
@media (min-width: 600px) and (max-width: 899px) {
  .iw-community__area {
    order: -1;
  }
  .iw-community__main,
  .iw-community__area {
    max-width: 720px;
    margin-inline: auto;
    width: 100%;
  }
}

/* ============================================================
   スマホ（〜599px）
   左：背景画像は正方形に切り出し（選手＋施設が見える左側を表示）、文言は画像の下に積む
   ============================================================ */
@media (max-width: 599px) {
  .iw-community__area {
    order: -1;
  }
  .iw-community {
    padding-inline: max(16px, env(safe-area-inset-left))
      max(16px, env(safe-area-inset-right));
  }

  .iw-community__eyebrow {
    gap: 12px;
    font-size: 11px;
    letter-spacing: 0.2em;
  }
  .iw-community__eyebrow::before,
  .iw-community__eyebrow::after {
    flex-basis: 40px;
  }
  .iw-community__title {
    font-size: 21px;
    letter-spacing: 0.03em;
  }
  .iw-community__lead {
    font-size: 14px;
    letter-spacing: 0.04em;
  }
  .iw-community__grid {
    gap: 32px;
  }
  .iw-community__map {
    left: auto;
  }
  .iw-community__visual {
    aspect-ratio: auto;
    background: none;
    overflow: visible;
  }

  .iw-community__visual::before {
    position: static;
    display: block;
    border-radius: 0 120px 0 0;
    aspect-ratio: 4 / 2.5; /* スマホ用画像の縦横比 */
    background-image: var(--iwc-bg-left-sp); /* スマホ専用画像 */
    background-position: center;
  }

  .iw-community__hero-body {
    position: static;
    padding: 20px 0px 24px;
  }
  .iw-community__hero-copy {
    margin-bottom: 10px;
    font-size: 20px;
  }
  .iw-community__hero-text {
    font-size: 13px;
  }

  .iw-community__facility-body {
    position: static;
    padding: 16px 18px;
    border-left: 0;
    border-top: 1px solid var(--iwc-line);
    background: #fff;
  }
  .iw-community__facility-name {
    margin-bottom: 4px;
    font-size: 17px;
  }
  .iw-community__facility-meta {
    font-size: 13px;
  }

  /* 下部バー */
  .iw-community__bar {
    border-radius: 10px;
  }
  .iw-community__bar-item {
    justify-content: flex-start;
    padding: 16px 20px;
    min-height: 56px;
  }
  .iw-community__bar-item--link {
    padding: 0;
    justify-content: stretch;
  }
  .iw-community__bar-item--link a {
    justify-content: space-between;
    padding: 16px 20px;
    min-height: 56px;
    font-size: 14px;
  }
}

/* 極小画面（〜359px） */
@media (max-width: 359px) {
  .iw-community__title {
    font-size: 19px;
  }
  .iw-community__hero-copy {
    font-size: 18px;
  }
}

/* タッチ端末：ホバー演出を無効化 */
@media (hover: none) {
  .iw-community__bar-item--link a:hover {
    background: none;
  }
  .iw-community__bar-item--link a:hover .iw-community__arrow {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .iw-community *,
  .iw-community *::before,
  .iw-community *::after {
    transition: none !important;
  }
}

/* ===== LINE予約ボタン ===== */
.line-reserve {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* ボタン群を中央に */
  gap: 12px;
  margin: 24px 0;
}

.line-reserve .line-reserve__btn {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 240px;
  padding: 14px 52px; /* 左右対称でテキストを中央に */
  background: #06c755;
  color: #fff !important;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.4;
  transition: opacity 0.2s;
}

.line-reserve .line-reserve__btn:hover,
.line-reserve .line-reserve__btn:visited,
.line-reserve .line-reserve__btn:focus {
  color: #fff !important;
  opacity: 0.85;
}

/* LINEアイコン */
.line-reserve .line-reserve__btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  width: 24px;
  height: 22px;
  background: url(/wp-content/themes/iwanami/assets/img/fudosan/fudosan-icon-line.png)
    no-repeat center / contain;
}

.line-reserve .line-reserve__store {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.line-reserve .line-reserve__label {
  font-size: 16px;
  color: #fff;
}

/* スマホ:2列(上2つ・下2つ) */
@media (max-width: 600px) {
  .line-reserve {
    gap: 8px;
  }
  .line-reserve .line-reserve__btn {
    width: calc((100% - 8px) / 2); /* 2列 */
    min-width: 0;
    padding: 12px 8px 12px 34px; /* 左はアイコン分、右は少し */
    box-sizing: border-box;
  }
  .line-reserve .line-reserve__btn::before {
    left: 18px;
    width: 20px;
    height: 18px;
  }
  .line-reserve .line-reserve__label {
    font-size: 13px;
  }
}
