/* 公式サイト（トップ・6地域ページ）から「墓地・霊園案内（/reien/）」へつなぐ部品
 * tools/link-site-to-reien.mjs が css/reien-guide.css として公式サイトに置く。
 * どのページの書き方とも混ざらないよう、class はすべて rg- で始める。
 * 地域の色は style="--rg-c:…;--rg-deep:…;--rg-soft:…" で渡す（総合案内の地域の色と同じ）。 */

.rg { --rg-c: #2b4b65; --rg-deep: #2b4b65; --rg-soft: #f4f7fa;
  box-sizing: border-box; width: 100%; max-width: 1140px; margin: 44px auto 36px; padding: 0 20px;
  color: #2b3a4a; text-align: left; line-height: 1.7; font-size: 15px; }
.rg *, .rg *::before, .rg *::after { box-sizing: border-box; }
.rg p { margin: 0; }

.rg__box { position: relative; overflow: hidden; padding: 28px 28px 22px; border-radius: 28px;
  background: linear-gradient(180deg, #fff 0%, var(--rg-soft) 100%);
  border: 1px solid color-mix(in srgb, var(--rg-c) 24%, #fff);
  box-shadow: 0 18px 40px -28px color-mix(in srgb, var(--rg-deep) 70%, transparent); }
/* 右上のやわらかい丸の飾り（文字にかからないよう小さく・薄く） */
.rg__box::before { content: ""; position: absolute; right: -34px; top: -34px; width: 110px; height: 110px; border-radius: 50%;
  background: color-mix(in srgb, var(--rg-c) 12%, transparent); pointer-events: none; }
.rg--top .rg__box::before { background: rgba(197, 160, 89, .14); }
.rg__box > * { position: relative; }

.rg__eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 6px !important;
  font-size: 11px; font-weight: 700; letter-spacing: .24em; color: var(--rg-deep); }
.rg__eyebrow::before { content: ""; width: 18px; height: 1.5px; background: currentColor; opacity: .6; }
.rg__title { margin: 0; font-family: "Shippori Mincho", "Noto Serif JP", serif; font-weight: 700;
  font-size: clamp(19px, 2.3vw, 25px); line-height: 1.5; letter-spacing: .04em; color: var(--rg-deep); text-wrap: balance; }
.rg__nw { display: inline-block; }
.rg__lead { margin-top: 8px !important; font-size: 14px; line-height: 1.85; color: #4a5866; text-wrap: pretty; }

/* 霊園のカード（PCは横に並べ、スマホは横スクロール） */
.rg__list { list-style: none; margin: 20px 0 0; padding: 0 0 6px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.rg__card { margin: 0; padding: 0; }
.rg__card::before, .rg__card::marker { content: none; }
.rg__link { display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: 18px; background: #fff;
  border: 1px solid rgba(30, 50, 70, .07); box-shadow: 0 8px 20px -14px rgba(30, 45, 65, .55);
  color: inherit !important; text-decoration: none !important; transition: transform .25s ease, box-shadow .25s ease; }
.rg__link:hover { transform: translateY(-3px); box-shadow: 0 14px 26px -14px rgba(30, 45, 65, .6); }
.rg__link:focus-visible { outline: 3px solid color-mix(in srgb, var(--rg-c) 60%, #fff); outline-offset: 3px; }
.rg__photo { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--rg-soft); }
.rg__photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.rg__link:hover .rg__photo img { transform: scale(1.05); }
.rg__body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 10px 12px 12px; }
.rg__name { font-size: 14.5px; font-weight: 700; line-height: 1.45; color: #2b3a4a; word-break: auto-phrase; overflow-wrap: anywhere; }
.rg__more { display: inline-flex; align-items: center; gap: 4px; margin-top: auto; font-size: 12px; font-weight: 700; color: var(--rg-deep); }
.rg__btn::after { margin-top: -2px; }
.rg__more::after, .rg__btn::after { content: ""; width: 6px; height: 6px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); }

.rg__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-top: 14px; }
.rg__hint { display: none; font-size: 12px; color: #6b7785; }
/* 明朝の文字は上に寄って見えるので、上の余白を少し多くして見た目の中央にそろえる */
.rg__btn { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; padding: 13px 22px 10px; border-radius: 999px; line-height: 1.4; min-height: 48px;
  background: color-mix(in srgb, var(--rg-c) 14%, #fff); border: 1px solid color-mix(in srgb, var(--rg-c) 40%, #fff);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--rg-c) 35%, #fff);
  color: var(--rg-deep) !important; text-decoration: none !important; font-size: 14px; font-weight: 700; white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease; }
.rg__btn:hover { transform: translateY(1px); box-shadow: 0 2px 0 color-mix(in srgb, var(--rg-c) 35%, #fff); }

/* トップページ用：6地域まとめての案内 */
.rg--top .rg__box { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px 32px; padding: 30px 34px; }
.rg__regions { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 84px); gap: 10px 12px; }
.rg__region { margin: 0; text-align: center; font-size: 11.5px; font-weight: 700; color: #2b4b65; line-height: 1.3; }
.rg__region::before, .rg__region::marker { content: none; }
.rg__region img { display: block; width: 64px; height: 64px; margin: 0 auto 5px; border-radius: 18px; object-fit: cover;
  border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--rg-c), 0 6px 14px -8px rgba(30, 45, 65, .6); }
.rg--top .rg__foot { margin-top: 18px; justify-content: flex-start; }
.rg--top .rg__btn { margin-left: 0; background: #2b4b65; border-color: #2b4b65; color: #fff !important; box-shadow: 0 4px 0 #1b3246; }

@media (max-width: 900px) {
  .rg__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .rg { margin: 32px auto 28px; padding: 0 16px; }
  .rg__box { padding: 22px 18px 18px; border-radius: 22px; }
  .rg__box::before { width: 80px; height: 80px; right: -30px; top: -30px; }
  .rg__list { display: flex; gap: 12px; margin: 16px -18px 0; padding: 2px 18px 12px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-left: 18px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .rg__card { flex: 0 0 44%; scroll-snap-align: start; }
  .rg__name { font-size: 13.5px; }
  .rg__hint { display: inline-flex; align-items: center; gap: 6px; }
  .rg__hint::before { content: "\2194"; font-size: 14px; color: var(--rg-deep); }
  .rg__foot { flex-direction: column; align-items: stretch; }
  .rg__btn { justify-content: center; margin-left: 0; white-space: normal; text-align: center; }
  .rg--top .rg__box { grid-template-columns: minmax(0, 1fr); padding: 24px 20px; }
  .rg__regions { grid-template-columns: repeat(3, minmax(0, 1fr)); justify-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  .rg__link, .rg__photo img, .rg__btn { transition: none; }
  .rg__link:hover, .rg__link:hover .rg__photo img { transform: none; }
}
