﻿:root {
  --heian-bg: #f4efe6;
  --heian-paper: #f8eddc;
  --heian-paper-border: rgba(191, 161, 122, 0.54);
  --heian-ink: #1f2937;
  --heian-muted: #6b5b49;
  --heian-accent: #9a4a1b;
  --heian-purple: #6d28d9;
  --heian-purple-hover: #5b21b6;
}

body.heian-site {
  background: var(--heian-bg);
  color: var(--heian-ink);
}

.font-yuji {
  font-family: 'Yuji Syuku', serif;
}

.heian-page {
  padding: 2rem 1rem 3.5rem;
}

.heian-container {
  width: min(100%, 72rem);
  margin-inline: auto;
}

.heian-paper {
  background-image: linear-gradient(rgba(247, 239, 224, 0.28), rgba(247, 239, 224, 0.28)), url('../../img/白練色の清楚な感じの和紙.webp');
  background-size: cover;
  background-position: center;
  border: 1px solid var(--heian-paper-border);
  border-radius: 1rem;
  box-shadow: 0 10px 28px rgba(68, 48, 28, 0.08);
}

.heian-section {
  margin: 2rem auto;
}

.heian-kicker,
.section-kicker {
  letter-spacing: 0.22em;
  color: rgba(154, 74, 27, 0.74);
  font-size: 0.875rem;
  font-weight: 600;
}

.heian-title {
  font-family: 'Yuji Syuku', serif;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.16;
  font-weight: 600;
  color: #111827;
}

.heian-subtitle {
  font-size: clamp(1.125rem, 2.2vw, 1.5rem);
  line-height: 1.8;
  color: var(--heian-ink);
}

.heian-card {
  background: rgba(248, 237, 220, 0.5);
  border: 1px solid rgba(191, 161, 122, 0.45);
  border-radius: 0.875rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset;
}

.heian-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--heian-purple);
  color: white;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 8px 16px rgba(91, 33, 182, 0.16);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.heian-button:hover {
  background: var(--heian-purple-hover);
  transform: translateY(-1px);
}

.heian-prose {
  max-width: 56rem;
  margin-inline: auto;
  font-size: clamp(1.125rem, 1.9vw, 1.25rem);
  line-height: 1.9;
}

.heian-prose p {
  background: rgba(248, 237, 220, 0.38);
  border-left: 4px solid rgba(194, 117, 49, 0.42);
  border-radius: 0.75rem;
  padding: 1.05rem 1.2rem;
}

.heian-prose p + p {
  margin-top: 1.25rem;
}

.heian-media-card {
  background: rgba(248, 237, 220, 0.55);
  border: 1px solid rgba(191, 161, 122, 0.5);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(68, 48, 28, 0.08);
}

.heian-media-caption {
  background: rgba(248, 237, 220, 0.72);
  color: var(--heian-ink);
  text-align: center;
  padding: 0.75rem;
}

.timeline-list dl {
  display: grid;
  grid-template-columns: minmax(11rem, 15rem) 1fr;
  gap: 1rem 1.5rem;
  align-items: start;
  padding: 1.15rem 0;
  border-bottom: 1px solid rgba(194, 117, 49, 0.28);
  margin: 0;
}

.timeline-list dl:nth-child(odd) {
  background: rgba(255, 250, 242, 0.34);
  margin-left: -0.5rem;
  margin-right: -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: 0.65rem;
}

.timeline-list dt {
  color: #8a3f16;
  line-height: 1.6;
}

.timeline-list dd {
  line-height: 1.8;
}

.timeline-list hr {
  display: none;
}

.heian-split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

@media (max-width: 767px) {
  .heian-page {
    padding: 1.5rem 1rem 2.5rem;
  }

  .heian-paper {
    border-radius: 0.875rem;
  }

  .timeline-list dl,
  .heian-split-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) {
  #main-header .header-text-link {
    font-size: 1.0625rem !important;
    font-weight: 600;
    letter-spacing: 0.01em;
  }

  #main-header .special-button {
    font-size: 1.0625rem !important;
    font-weight: 700;
  }
}


.desktop-break {
  display: none;
}

@media (min-width: 768px) {
  .desktop-break {
    display: block;
  }
}


.protected-title-slot {
  min-height: 84px;
}

.protected-title-slot-lg {
  min-height: 96px;
}

.protected-action-link {
  color: #1d4ed8;
  font-size: 1.125rem;
  line-height: 1.75rem;
}

@media (min-width: 768px) {
  .protected-action-link {
    font-size: 1.25rem;
    line-height: 1.75rem;
  }
}


.protected-media-box {
  aspect-ratio: 16 / 9;
}

.protected-media-box iframe,
.protected-media-box img {
  display: block;
  width: 100%;
  height: 100%;
}

.protected-notice-kuma {
  display: block;
  max-width: min(100%, 28rem);
  margin-inline: auto;
}

@media (max-width: 767px) {
  .protected-notice-kuma {
    max-width: min(100%, 21rem);
    transform: translateX(0.45rem);
  }
}


.youtube-inline-icon {
  display: inline-block;
  width: 1.45em;
  height: 1em;
  margin: 0 0.2em;
  vertical-align: -0.12em;
  border-radius: 0.28em;
  background: #d7d7d7;
  position: relative;
}

.youtube-inline-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-38%, -50%);
  width: 0;
  height: 0;
  border-top: 0.28em solid transparent;
  border-bottom: 0.28em solid transparent;
  border-left: 0.46em solid #222;
}


.keyword-panel {
  width: min(100%, 58rem);
}

.keyword-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  background: rgba(30, 64, 175, 0.78);
  padding: 0.55rem 1.1rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.keyword-label p {
  font-size: clamp(1.65rem, 4vw, 3rem);
  line-height: 1.18;
  letter-spacing: 0.03em;
}

.keyword-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.75rem, 2vw, 1.4rem);
  align-items: stretch;
}

.keyword-values span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(4.8rem, 8vw, 7rem);
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(30, 64, 175, 0.96), rgba(30, 58, 138, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-weight: 800;
  font-size: clamp(2.4rem, 5.4vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  padding: 0.75rem 0.8rem;
}

@media (max-width: 767px) {
  .keyword-panel {
    width: 100%;
  }

  .keyword-values {
    grid-template-columns: 1fr;
  }

  .keyword-values span {
    min-height: 4.4rem;
  }
}


/* Mobile menu button refinement */
@media (max-width: 767px) {
  #mobile-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid rgba(31, 41, 55, 0.32);
    border-radius: 0.55rem;
    padding: 0.38rem 0.58rem;
    background: rgba(255, 255, 255, 0.76);
    color: #1f2937;
    box-shadow: 0 1px 4px rgba(31, 41, 55, 0.12);
  }

  #mobile-menu-button::after {
    content: "\30E1\30CB\30E5\30FC";
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
  }

  #mobile-menu-button .mobile-menu-icon {
    color: #1f2937;
  }
}


/* Keyword section final refinement */
.keyword-label {
  background: rgba(30, 64, 175, 0.86);
}

.keyword-values {
  width: min(100%, 72rem);
  margin-inline: auto;
}

.keyword-values span {
  background: linear-gradient(180deg, rgba(30, 64, 175, 0.99), rgba(30, 58, 138, 0.99));
  white-space: nowrap;
}

@media (min-width: 768px) {
  .keyword-panel {
    width: min(100%, 76rem);
  }

  .keyword-values {
    grid-template-columns: 1fr 1fr 1.25fr;
  }

  .keyword-values span {
    font-size: clamp(2.9rem, 4.3vw, 4.15rem);
    padding-inline: 1.1rem;
  }
}


/* Keyword section contrast and optical centering */
.keyword-label {
  background: rgba(30, 64, 175, 0.94);
}

.keyword-values span {
  background: linear-gradient(180deg, rgba(30, 64, 175, 1), rgba(23, 48, 124, 1));
  border-color: rgba(255, 255, 255, 0.52);
  align-items: center;
  padding-top: 0.9rem;
  padding-bottom: 0.7rem;
}

.keyword-values span::before {
  content: "";
  display: block;
  height: 0.08em;
}


/* Keyword section color reset and text optical adjustment */
.keyword-label {
  background: rgba(30, 64, 175, 0.94);
}

.keyword-values span {
  background: linear-gradient(180deg, rgba(30, 64, 175, 0.96), rgba(30, 58, 138, 0.96));
  border-color: rgba(255, 255, 255, 0.45);
  padding-top: 0.55rem;
  padding-bottom: 0.95rem;
}

.keyword-values span::before {
  content: none;
  display: none;
}


/* Keyword title optical adjustment */
.keyword-label {
  padding-top: 0.42rem;
  padding-bottom: 0.68rem;
}

.keyword-label p {
  transform: translateY(-0.04em);
}


/* Mobile menu compact adjustment */
@media (max-width: 767px) {
  #mobile-menu-button {
    gap: 0.18rem;
    padding: 0.2rem 0.34rem;
    border-radius: 0.42rem;
  }

  #mobile-menu-button svg {
    width: 1rem;
    height: 1rem;
  }

  #mobile-menu-button::after {
    font-size: 0.76rem;
    letter-spacing: -0.01em;
  }
}


/* Desktop header compact height adjustment */
@media (min-width: 768px) {
  #main-header .container {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }

  #main-header .header-title {
    line-height: 1.05;
  }

  #main-header .special-button {
    padding-top: 0.42rem;
    padding-bottom: 0.42rem;
  }
}


.access-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.access-kuma-icon {
  width: clamp(4rem, 8vw, 6.25rem);
  height: auto;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 14px rgba(68, 48, 28, 0.18));
}

@media (max-width: 767px) {
  .access-heading-row {
    gap: 0.75rem;
  }

  .access-kuma-icon {
    width: 3.6rem;
  }
}


/* Access icon size refinement */
.access-kuma-icon {
  width: clamp(6rem, 11.5vw, 9.2rem);
}

@media (max-width: 767px) {
  .access-card-frame {
    overflow: visible !important;
  }

  .access-heading-row {
    position: relative;
    display: block;
    padding-right: clamp(4.8rem, 23vw, 6.4rem);
  }

  .access-heading-row h2 {
    font-size: clamp(2.35rem, 10.5vw, 3.25rem);
    white-space: nowrap;
  }

  .access-kuma-icon {
    position: absolute;
    top: 50%;
    right: clamp(-0.35rem, -1vw, 0rem);
    width: clamp(5.2rem, 20vw, 6.7rem);
    transform: translateY(-50%);
    z-index: 2;
  }
}

@media (max-width: 380px) {
  .access-heading-row {
    padding-right: clamp(4.2rem, 21vw, 5.4rem);
  }

  .access-heading-row h2 {
    font-size: clamp(2.05rem, 10vw, 2.75rem);
  }

  .access-kuma-icon {
    width: clamp(4.7rem, 19vw, 5.8rem);
    right: -0.15rem;
  }
}


/* YouTube playlist link card */
.youtube-link-card {
  min-height: 290px;
  background: #242424;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.35rem;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.youtube-link-card:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.youtube-card-icon {
  width: 4rem;
  height: 4rem;
  border: 0.35rem solid rgba(255, 255, 255, 0.7);
  border-radius: 9999px;
  position: relative;
  flex: 0 0 auto;
}

.youtube-card-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-38%, -50%);
  width: 0;
  height: 0;
  border-top: 0.8rem solid transparent;
  border-bottom: 0.8rem solid transparent;
  border-left: 1.15rem solid rgba(255, 255, 255, 0.86);
}

.youtube-card-text {
  display: grid;
  gap: 0.45rem;
  line-height: 1.5;
}

.youtube-card-title {
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 700;
  text-decoration: underline;
}

.youtube-card-subtitle {
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  font-weight: 600;
}

@media (max-width: 767px) {
  .youtube-link-card {
    min-height: 220px;
    gap: 1rem;
    padding: 1.25rem;
  }

  .youtube-card-icon {
    width: 3.3rem;
    height: 3.3rem;
  }
}


/* Ichibei mobile spacing refinement */
@media (max-width: 767px) {
  .ichibei-visual-card {
    padding-top: 1rem;
    padding-bottom: 1.15rem;
  }

  .ichibei-media-slot {
    min-height: 0 !important;
  }

  .ichibei-media-slot img {
    max-height: none;
  }

  .ichibei-detail-title {
    margin-top: 1.05rem;
    font-size: 1.6rem;
    line-height: 1.45;
  }

  .ichibei-detail-note {
    margin-top: 0.65rem;
    font-size: 1.05rem;
    line-height: 1.85;
  }
}

/* Tenrikyo mobile spacing refinement */
@media (max-width: 767px) {
  .tenrikyo-link-card {
    padding-bottom: 1.4rem;
  }

  .tenrikyo-link-card + .tenrikyo-link-card {
    padding-top: 1.15rem;
  }

  .tenrikyo-link-title {
    height: auto !important;
    min-height: 0;
    padding-bottom: 0.85rem;
  }

  .tenrikyo-link-title h2 {
    font-size: 2.35rem;
    line-height: 1.2;
  }

  .tenrikyo-link-media {
    margin-top: 0;
  }

  .tenrikyo-link-action {
    margin-top: 1.25rem;
  }
}
