/* =========================================================
   まんぷくうさハム神社 CSS分割版 2026-06-29
   方針：スマホファースト / 高齢者にも読みやすい / 和紙・金・鳥獣戯画風 / アプリ化前提
========================================================= */

/* TOP専用 */
/* index.php専用：TOPと共通導線の最小上書き */
:root {
  --mh-ink: #2b180c;
  --mh-paper: #fffdf6;
  --mh-gold: #b19238;
  --mh-line: #e6dec5;
  --mh-shadow: 0 12px 28px rgba(58, 42, 21, 0.14);
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100000;
  padding: 0.6rem 1rem;
  background: #fff;
  color: #2b180c;
  border: 2px solid #b19238;
  border-radius: 10px;
}
.skip-link:focus {
  left: 8px;
}
.mh-top-hero {
  max-width: 1040px;
  margin: 0 auto 14px;
  padding: 10px 12px 4px;
  text-align: center;
}
.mh-hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(177, 146, 56, 0.38);
  background: radial-gradient(
      circle at 50% 0%,
      rgba(255, 238, 190, 0.42),
      transparent 44%
    ),
    rgba(255, 253, 246, 0.86);
  box-shadow: var(--mh-shadow);
}
.mh-hero-img {
  width: 100%;
  max-width: 760px;
  display: block;
  margin: 0 auto;
  border-radius: 18px;
}
.mh-copy {
  margin: 10px auto 14px;
  padding: 10px 14px;
  width: min(92%, 760px);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(230, 222, 197, 0.9);
  color: #2b180c;
  box-shadow: 0 8px 18px rgba(58, 42, 21, 0.08);
}
.mh-copy h1 {
  margin: 0 0 6px;
  font-family: "Yuji Syuku", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: clamp(26px, 7vw, 42px);
  line-height: 1.25;
  letter-spacing: 0.04em;
}
.mh-copy p {
  margin: 0;
  font-size: clamp(16px, 4.2vw, 19px);
  line-height: 1.75;
  font-weight: 800;
}
.mh-today {
  max-width: 1000px;
  margin: 0 auto 14px;
  padding: 0 12px;
}
.mh-today-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.mh-today-card {
  background: rgba(255, 253, 246, 0.92);
  border: 1px solid var(--mh-line);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 3px 12px rgba(58, 42, 21, 0.08);
}
.mh-today-card strong {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: #f4e8bd;
  color: #2b180c;
  margin-bottom: 5px;
}
.mh-today-card p {
  margin: 0;
  color: #2b180c;
  font-weight: 800;
  line-height: 1.65;
}
.mh-feature {
  max-width: 1050px;
  margin: 0 auto 18px;
  padding: 0 12px;
}
.mh-feature h2,
.mh-section-title {
  text-align: center;
  font-size: clamp(24px, 6vw, 34px);
  color: #2b180c;
  margin: 0 0 12px;
  letter-spacing: 0.04em;
}
.mh-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.mh-feature-link {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  min-height: 76px;
  padding: 12px;
  text-decoration: none;
  color: #2b180c;
  background: linear-gradient(180deg, #fffef8, #fff8df);
  border: 1px solid rgba(177, 146, 56, 0.38);
  border-radius: 18px;
  box-shadow: 0 4px 14px rgba(58, 42, 21, 0.1);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.mh-feature-link:active {
  transform: translateY(4px) scale(0.985);
  box-shadow: inset 0 6px 14px rgba(58, 42, 21, 0.16);
}
.mh-feature-link:hover,
.mh-feature-link:focus {
  color: #2b180c;
  filter: brightness(1.02);
  box-shadow: 0 8px 20px rgba(58, 42, 21, 0.14);
}
.mh-feature-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff1c8;
  border: 1px solid #ead9a1;
  font-size: 23px;
}
.mh-feature-main {
  font-size: clamp(16px, 4.4vw, 19px);
  line-height: 1.25;
  font-weight: 900;
}
.mh-feature-sub {
  display: block;
  margin-top: 3px;
  font-size: clamp(13px, 3.4vw, 15px);
  line-height: 1.35;
  color: #5f4932;
  font-weight: 800;
}
.mh-home-ema {
  max-width: 1050px;
  margin: 0 auto 18px;
  padding: 12px;
  background: rgba(255, 253, 246, 0.72);
  border: 1px solid rgba(177, 146, 56, 0.28);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(58, 42, 21, 0.08);
}
.mh-ema-lead {
  text-align: center;
  margin: -4px auto 10px;
  color: #4b351f;
  font-size: clamp(15px, 4vw, 17px);
  font-weight: 800;
}
.poster-name,
.poster-name--mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fbf4e6, #e0c27d, #f7ead0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}
.poster-name .name-text,
.poster-name--mini .name-text {
  display: inline-block;
  padding: 2px 8px 3px;
  border-radius: 999px;
  background: #fffdf8;
  color: #2b180c;
  font-weight: 900;
  font-size: 0.92rem;
  line-height: 1.3;
  font-family: "Yuji Syuku", "Hiragino Mincho ProN", "Yu Mincho", serif;
  letter-spacing: 0.04em;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta-row--mini {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.mh-home-ema .card-time-topleft {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff8dc;
  border: 1px solid #ead9a1;
  color: #4b351f;
  font-weight: 900;
  font-size: 0.9rem;
}
.mh-ema-cta {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}
.mh-primary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  text-decoration: none;
  color: #2b180c;
  background: linear-gradient(180deg, #fff2c7, #ffe49c);
  border: 1px solid rgba(177, 146, 56, 0.55);
  box-shadow: 0 8px 20px rgba(58, 42, 21, 0.12);
  font-weight: 900;
}
.mh-primary-cta:hover {
  color: #2b180c;
}
@media (min-width: 768px) {
  .mh-today-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .mh-feature-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 430px) {
  .mh-feature-grid {
    gap: 8px;
  }
  .mh-feature-link {
    padding: 10px;
    min-height: 72px;
  }
  .mh-feature-icon {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===================== [TOP] ===================== */
/* 今日の縁起（要約） */
.fortune-compact {
  max-width: var(--fortune-max-w);
  margin: 0 auto;
  padding: 12px;
  background: rgba(255, 255, 255, 0.52);
  border-radius: var(--fortune-radius);
}
.fortune-compact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.fortune-compact-list li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 0.75rem 0.9rem;
  margin: 0.4rem 0;
  border: 1px solid #e4deb9;
  border-radius: 12px;
  background: #fffdf6;
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
  min-height: 46px;
}
@media (min-width: 768px) {
  .fortune-compact-list li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    column-gap: 14px;
    row-gap: 6px;
    align-items: center;
  }
  .fortune-compact .fc-tag {
    grid-column: 1;
  }
  .fortune-compact .fc-main {
    grid-column: 2;
  }
  .fortune-compact .koma-mini {
    grid-column: 3;
    justify-self: end;
  }
  .fortune-compact .fc-sub {
    grid-column: 1 / -1;
    margin-top: 0.2rem;
  }
}
.fortune-compact .fc-tag {
  flex: 0 0 auto;
  padding: 0.16rem 0.65rem;
  border-radius: 999px;
  background: #f2e6bf;
  color: #2b180c;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.fortune-compact .fc-main {
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.fortune-compact .fc-sub {
  display: block;
  font-size: 0.95em;
  color: #4a6a4a;
  margin-top: 0.12rem;
}

/* 参拝指数 */
.pi {
  --pi: #6aa35b;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: #fffef8;
  border: 1px solid #e6dec5;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.06);
  font-weight: 900;
  line-height: 1.2;
}
.pi .pi-num {
  font-size: 1.1em;
}
.pi .pi-unit {
  font-size: 0.85em;
  opacity: 0.75;
  margin-left: 0.05em;
}
.pi .pi-label {
  font-weight: 900;
  color: #4b5d41;
}
.pi .pi-bar {
  position: relative;
  width: 130px;
  height: 8px;
  border-radius: 999px;
  background: #ede3cf;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.pi .pi-bar::after {
  content: "";
  display: block;
  height: 100%;
  width: calc(var(--v, 0) * 1%);
  background: linear-gradient(90deg, var(--pi), #b7d99f);
}
.pi.good {
  --pi: #6aa35b;
}
.pi.normal {
  --pi: #caa134;
}
.pi.low {
  --pi: #c05746;
}
@media (max-width: 430px) {
  .pi .pi-bar {
    width: 100px;
  }
}

/* 本日の叶絵馬（PCグリッド＋SPスライダー） */
.home-ema-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 12px;
}
.home-ema-section.calm {
  background: rgba(20, 12, 0, 0.06);
  border: 1px solid rgba(50, 32, 12, 0.1);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
.home-ema-section.shrine-section {
  padding-block: 12px;
}

/* “最新3件”切替用フック */
.home-ema-section .mode-latest {
  display: none;
}
.home-ema-section.is-latest-mode .mode-random {
  display: none;
}
.home-ema-section.is-latest-mode .mode-latest {
  display: block;
}
.mode-badge {
  display: inline-block;
  padding: 0.16rem 0.6rem;
  margin: 0 0 6px 2px;
  border-radius: 999px;
  background: #fff3cf;
  border: 1px solid #ead9a1;
  font-weight: 900;
  color: #4b360e;
}

.top-ema-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 1024.98px) {
  .top-ema-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 767.98px) {
  .top-ema-row {
    display: none;
  }
}

.ema-mini {
  display: block;
  background: transparent;
  border: 0;
  padding: 0;
}
.ema-mini__figure {
  position: relative;
  margin: 24px 0 0;
}
.ema-mini__img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--shadow-l);
  background: transparent;
}

/* 時間の右に名前（TOPミニ用） */
.ema-meta-top {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ema-meta-top .time-left {
  position: static;
  transform: none;
  order: 1;
}
.ema-meta-top .disp-name {
  position: static;
  transform: none;
  order: 2;
  margin-left: 0;
}
.ema-card .time-left + .disp-name,
.ema-card .time-left + .name-badge,
.ema-card .time-left + .name {
  margin-left: 6px;
}

.disp-name,
.name-badge,
.name {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}
.disp-name.center,
.name-badge.center {
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  transform: none !important;
  margin: 0 !important;
}

/* 絵馬テキスト（TOPミニ） */
.ema-mini__inside {
  position: absolute;
  top: 44%;
  right: 8%;
  bottom: 14%;
  left: 8%;
  display: grid;
  align-items: end;
  justify-items: center;
  pointer-events: none;
}
.ema-mini__text {
  width: 100%;
  max-height: 100%;
  overflow: hidden;
  text-align: center;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #5a3e2b;
  line-height: 1.55;
  word-break: break-all;
  overflow-wrap: anywhere;
  line-break: strict;
}
.ema-mini__text p {
  margin: 0;
}

/* SPスライダー */
@media (min-width: 768px) {
  .ema-slider--sp {
    display: none;
  }
}
.ema-slider--sp {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
  padding-inline: 8px;
}
.ema-slider--sp .ema-track {
  display: flex;
  transition: transform 0.6s ease;
  will-change: transform;
}
.ema-slider--sp .ema-slide {
  flex: 0 0 100%;
  position: relative;
  padding: 24px 8px 8px;
}
.ema-slider--sp .ema-slide figure {
  margin: 24px 0 0;
}
.ema-slider--sp .dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 10px 0 0;
}
.ema-slider--sp .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d7caa2;
  transition: transform 0.18s ease, background-color 0.18s ease;
}
.ema-slider--sp .dot.active {
  background: #b19238;
  transform: scale(1.15);
}

.page-top .mh-hero-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  pointer-events: none;
  background: radial-gradient(
      2px 2px at 20% 30%,
      rgba(255, 230, 170, 0.88),
      transparent 42%
    ),
    radial-gradient(
      2.5px 2.5px at 70% 60%,
      rgba(255, 210, 120, 0.86),
      transparent 45%
    ),
    radial-gradient(
      1.6px 1.6px at 40% 80%,
      rgba(255, 255, 210, 0.92),
      transparent 42%
    );
  animation: glitter 4.6s linear infinite;
}

.page-top .mh-feature-link {
  position: relative;
  overflow: hidden;
}
.page-top .mh-feature-link::after {
  content: "";
  position: absolute;
  left: -60%;
  top: -40%;
  width: 40%;
  height: 180%;
  transform: rotate(18deg);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.55),
    transparent
  );
  opacity: 0;
}
.page-top .mh-feature-link:active::after {
  animation: mhShine 0.72s ease-out;
}
@keyframes mhShine {
  0% {
    left: -60%;
    opacity: 0;
  }
  30% {
    opacity: 0.9;
  }
  100% {
    left: 120%;
    opacity: 0;
  }
}
