:root {
  /* --- Palette: Authentic Japan (Film-like Tones) --- */
  --c-base: #F9F8F4;
  /* 生成り (Kinari) - Background */
  --c-surface: #FFFFFF;
  /* 和紙の白 - Cards */
  --c-text-main: #2B2B2B;
  /* 墨色 - Main Text */
  --c-text-muted: #6D6D6D;
  /* 鈍色 - Sub Text */

  --c-accent-indigo: #1E314D;
  /* 藍色 - Primary Accent */
  --c-accent-matcha: #6A7F60;
  /* 抹茶色 - Secondary Accent */
  --c-accent-gold: #C2A878;
  /* 枯草色 - Highlights */

  /* --- Typography --- */
  --font-serif: "Shippori Mincho", "Yu Mincho", serif;
  --font-sans: "Helvetica Neue", "Arial", sans-serif;

  /* --- Spacing & Layout --- */
  --container-width: 1240px;
  --header-height: 80px;
  --sidebar-width: 320px;
  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: 2rem;
  --space-l: 4rem;
  --space-xl: 8rem;
}

/* --- Resets & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--c-base);
  color: var(--c-text-main);
  font-family: var(--font-sans);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--c-text-main);
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.3s ease, color 0.3s ease;
}

a:hover {
  color: var(--c-accent-indigo);
  opacity: 0.8;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Layout Utilities --- */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-m);
}

.layout-grid {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--space-l);
  margin-top: var(--space-l);
  align-items: start;
}

@media (max-width: 900px) {
  .layout-grid {
    grid-template-columns: 1fr;
  }
}

.grid {
  display: grid;
  gap: var(--space-m);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}



/* --- Hero Section (Cinematic) --- */
.hero-cinematic {
  height: 100vh;
  width: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-surface);
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  filter: brightness(0.7) contrast(1.1);
  /* Cinematic look */
  animation: slowZoom 20s infinite alternate ease-in-out;
}

@keyframes slowZoom {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.1);
  }
}

.hero-content {
  text-align: center;
  max-width: 1000px;
  /* Widened to prevent wrapping */
  width: 100%;
  padding: var(--space-m);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 1s ease 0.5s forwards;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-eyebrow {
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  margin-bottom: var(--space-s);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1.2;
  margin-bottom: var(--space-m);
}

.hero-description {
  font-size: 1.1rem;
  line-height: 1.6;
  opacity: 0.9;
  font-family: var(--font-serif);
}

/* --- Section Styling --- */
.section {
  padding: var(--space-xl) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-l);
}

.section-title {
  font-size: 2rem;
  margin-bottom: var(--space-s);
}

.section-subtitle {
  font-family: var(--font-sans);
  color: var(--c-accent-matcha);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* --- Cards (Magazine Style) --- */
.card-magazine {
  display: flex;
  flex-direction: column;
  background-color: transparent;
  transition: transform 0.3s ease;
}

.card-magazine:hover {
  transform: translateY(-5px);
}

.card-image-wrapper {
  aspect-ratio: 3/2;
  overflow: hidden;
  margin-bottom: var(--space-s);
  position: relative;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card-magazine:hover .card-image {
  transform: scale(1.05);
}

.card-meta {
  font-size: 0.75rem;
  color: var(--c-text-muted);
  margin-bottom: var(--space-xs);
  display: flex;
  gap: var(--space-xs);
}

.card-tag {
  color: var(--c-accent-indigo);
  font-weight: 600;
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
  line-height: 1.4;
}

.card-excerpt {
  font-size: 0.9rem;
  color: var(--c-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Matrix Navigation --- */
.matrix-nav {
  background-color: var(--c-surface);
  padding: var(--space-l);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  justify-content: center;
  margin-top: var(--space-m);
}

.tag-pill {
  padding: 0.5rem 1rem;
  border: 1px solid var(--c-text-muted);
  border-radius: 20px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.tag-pill:hover {
  background-color: var(--c-accent-indigo);
  color: #fff;
  border-color: var(--c-accent-indigo);
}



/* --- Sidebar Widgets --- */
.sidebar {
  position: sticky;
  top: 100px;
  /* Header height + spacing */
}

.widget {
  margin-bottom: var(--space-xl);
}

.widget-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-left: 6px solid #000;
  padding-left: 1rem;
  margin-bottom: var(--space-m);
  line-height: 1.4;
  color: #000;
}

/* Ranking List */
.ranking-list {
  list-style: none;
}

.ranking-item {
  display: flex;
  gap: var(--space-s);
  margin-bottom: var(--space-m);
  align-items: start;
}

.ranking-index {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--c-accent-gold);
  line-height: 1;
}

.ranking-content {
  flex: 1;
}

.ranking-title {
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 0.2rem;
  font-weight: 500;
}

.ranking-meta {
  font-size: 0.75rem;
  color: var(--c-text-muted);
}

/* Sidebar Categories (AREA) */
.category-list {
  list-style: none;
}

.category-item {
  border-bottom: 1px solid #000;
}

.category-link {
  display: flex;
  justify-content: space-between;
  padding: 1rem 0;
  font-size: 1rem;
  font-family: var(--font-serif);
}

.category-link:hover {
  opacity: 0.6;
}

.arrow {
  font-family: monospace;
}

/* Sidebar Tags (HASHTAG) */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-pill {
  display: inline-block;
  padding: 0.6rem 1rem;
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 0;
  font-size: 0.9rem;
  color: #000;
  transition: all 0.2s ease;
  font-weight: 500;
}

.tag-pill:hover {
  border-color: #000;
  background-color: #fff;
  color: #000;
}

/* =========================================
   Added Styles (Refactoring Phase)
   ========================================= */

/* --- Slideshow (Index) --- */
.slideshow-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  animation: slideAnimation 24s infinite;
}

.slide:nth-child(1) {
  animation-delay: 0s;
}

.slide:nth-child(2) {
  animation-delay: 6s;
}

.slide:nth-child(3) {
  animation-delay: 12s;
}

.slide:nth-child(4) {
  animation-delay: 18s;
}

@keyframes slideAnimation {
  0% {
    opacity: 0;
    transform: scale(1);
  }

  5% {
    opacity: 1;
  }

  25% {
    opacity: 1;
  }

  30% {
    opacity: 0;
    transform: scale(1.1);
  }

  100% {
    opacity: 0;
    transform: scale(1);
  }
}

/* --- Cinematic Button (Index) --- */
.btn-cinematic {
  display: inline-block;
  margin-top: 3rem;
  padding: 1rem 3rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #fff;
  text-decoration: none;
  font-family: "Shippori Mincho", serif;
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  position: relative;
  overflow: hidden;
  transition: all 0.5s ease;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(2px);
}

.btn-cinematic:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.btn-line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: #fff;
  transition: width 0.5s ease;
}

.btn-cinematic:hover .btn-line {
  width: 100%;
}

/* --- Cinematic Controller / Map Overlay (Index) --- */
.map-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #F9F8F4;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  overflow: hidden;
}

.map-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.background-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.8s ease, transform 6s linear;
  transform: scale(1.05);
  z-index: 0;
}

.background-screen.active {
  opacity: 1;
  transform: scale(1);
}

.overlay-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  transition: background 0.5s ease;
  z-index: 1;
  pointer-events: none;
}

.map-overlay.has-selection .overlay-gradient {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(2px);
}

.map-container {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.close-map-btn {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 3rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  /* border: 1px solid #ddd; */
  /* border-radius: 50%; */
  /* width: 60px; height: 60px; */
  z-index: 50;
  transition: all 0.3s;
}

.close-map-btn:hover {
  transform: rotate(90deg);
  color: #000;
}

.map-title-overlay {
  position: absolute;
  top: 3rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Shippori Mincho", serif;
  letter-spacing: 0.3em;
  font-size: 1.2rem;
  color: #333;
  text-transform: uppercase;
  transition: opacity 0.3s;
}

.cinematic-interface {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100vh;
  position: relative;
}

.region-title-display {
  position: absolute;
  top: 50%;
  left: 10%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  pointer-events: none;
  z-index: 20;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
  width: 300px;
}

.region-title-display .en {
  font-family: var(--font-serif);
  font-size: 4rem;
  line-height: 1;
  letter-spacing: 0.05em;
  color: #111;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
  font-weight: 300;
}

.region-title-display .jp {
  font-family: "Shippori Mincho", serif;
  font-size: 1.5rem;
  margin-top: 1rem;
  margin-left: 0.5rem;
  color: #111;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease 0.1s;
}

.guidance-text {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  margin-top: 2rem;
  opacity: 0;
  text-transform: uppercase;
  transform: translateY(20px);
  transition: all 0.5s ease 0.2s;
}

.region-title-display.default-active .guidance-text {
  opacity: 0.6;
  transform: translateY(0);
}

.map-overlay.has-selection .region-title-display .en,
.map-overlay.has-selection .region-title-display .jp {
  opacity: 1;
  transform: translateY(0);
}

.map-overlay.has-selection .guidance-text {
  opacity: 0;
}

.ink-map-wrapper {
  position: relative;
  width: 800px;
  height: 800px;
  max-width: 80vw;
  transition: none;
}

.ink-map-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  opacity: 0.9;
  transition: opacity 0.3s;
  filter: contrast(1.2);
}

.hotspots-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.hotspot {
  position: absolute;
  cursor: pointer;
  z-index: 10;
  border-radius: 50%;
}

.hotspot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  background-color: #B93A32;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0.8;
  box-shadow: 0 0 10px rgba(185, 58, 50, 0.5);
}

.hotspot:hover::after {
  transform: translate(-50%, -50%) scale(1);
}

@media (max-width: 768px) {
  .map-overlay.has-selection .ink-map-wrapper {
    transform: none;
    opacity: 0.3;
  }

  .ink-map-wrapper {
    width: 90vw;
    height: 90vw;
  }

  .region-title-display {
    left: 50%;
    top: 80%;
    transform: translate(-50%, -50%);
    align-items: center;
    text-align: center;
  }

  .region-title-display .en {
    font-size: 2.5rem;
  }
}

/* --- Article Hero (Kyoto & Future Templates) --- */
.hero-article {
  position: relative;
  height: 80vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-article .hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 0;
  filter: brightness(0.8);
}

.hero-title-group {
  position: relative;
  z-index: 10;
  color: #fff;
  height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.prefecture-label {
  font-family: var(--font-sans);
  letter-spacing: 0.3em;
  font-size: 1rem;
  margin-left: 2rem;
  opacity: 0.9;
  writing-mode: vertical-rl;
}

.article-title {
  font-size: 4rem;
  line-height: 1.5;
  font-family: var(--font-serif);
  writing-mode: vertical-rl;
  margin-right: 1rem;
}

.scroll-prompt {
  position: absolute;
  bottom: 2rem;
  color: #fff;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  opacity: 0.8;
}

/* --- Article Prologue (Vertical Text) --- */
.prologue-section {
  padding: 6rem 0;
  background-color: var(--c-base);
  display: flex;
  justify-content: center;
}

.vertical-lead {
  writing-mode: vertical-rl;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  line-height: 2.5;
  height: 400px;
  margin: 0 auto;
  color: var(--c-text-main);
}

/* --- Article Area Grid --- */
.area-nav-section {
  padding: 4rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.section-header-simple {
  text-align: center;
  margin-bottom: 3rem;
}

.area-grid {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.area-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 160px;
  height: 160px;
  border: 1px solid #ddd;
  border-radius: 50%;
  transition: all 0.3s ease;
  background: #fff;
}

.area-card:hover {
  background: var(--c-accent-indigo);
  border-color: var(--c-accent-indigo);
  color: #fff;
  transform: scale(1.05);
}

.area-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

.area-desc {
  font-size: 0.7rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* --- Article Magazine Layout --- */
.layout-magazine {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 4rem;
  margin-top: 4rem;
  margin-bottom: 6rem;
}

.article-text {
  font-size: 1.05rem;
  line-height: 2;
}

.article-text p {
  margin-bottom: 2rem;
  text-align: justify;
}

.chapter-title {
  font-size: 1.8rem;
  margin-top: 4rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--c-accent-gold);
  padding-bottom: 1rem;
  display: inline-block;
}

.article-image-full {
  margin: 3rem 0;
  width: 100%;
}

.article-image-full img {
  width: 100%;
  border-radius: 2px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.article-image-full figcaption {
  font-size: 0.85rem;
  color: var(--c-text-muted);
  margin-top: 0.8rem;
  font-family: var(--font-serif);
  text-align: right;
}

/* --- Article Sidebar --- */
.info-card {
  background: #fff;
  padding: 2rem;
  border: 1px solid #eee;
  margin-bottom: 2rem;
}

.info-card h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--c-accent-matcha);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.info-card dl dt {
  font-weight: bold;
  font-size: 0.8rem;
  color: var(--c-accent-indigo);
  margin-top: 1rem;
  text-transform: uppercase;
}

.info-card dl dd {
  margin-left: 0;
  margin-top: 0.3rem;
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .layout-magazine {
    grid-template-columns: 1fr;
  }

  .hero-title-group {
    flex-direction: row;
    height: auto;
  }

  .article-title,
  .prefecture-label {
    writing-mode: horizontal-tb;
    margin: 0;
  }

  .article-title {
    font-size: 2.5rem;
  }

  .vertical-lead {
    writing-mode: horizontal-tb;
    height: auto;
    text-align: center;
    padding: 0 2rem;
  }
}

/* --- Added Aesthetics (SAYOKO & MIA) --- */
.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.fade-in {
  opacity: 0;
  animation: simpleFadeIn 1s ease forwards;
}

@keyframes simpleFadeIn {
  to {
    opacity: 1;
  }
}

/* --- SVG Map Styles (Organic Interaction) --- */
.interactive-map-svg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  /* Ensure SVG is on top of image */
}

.map-area {
  fill: transparent;
  /* Hit area is transparent by default */
  stroke: transparent;
  cursor: pointer;
  transition: all 0.4s ease;
  vector-effect: non-scaling-stroke;
}

.map-area:hover {
  fill: rgba(185, 58, 50, 0.1);
  /* Akabeni highlight */
  stroke: rgba(185, 58, 50, 0.6);
  stroke-width: 2px;
  filter: drop-shadow(0 0 8px rgba(185, 58, 50, 0.3));
}

/* --- Map Teaser Section (Seamless Guidance) --- */
.section-teaser {
  position: relative;
  padding: 10rem 0;
  text-align: center;
  overflow: hidden;
  background-color: #F9F8F4;
  margin-top: 4rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.teaser-bg-map {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120%;
  height: 120%;
  transform: translate(-50%, -50%);
  background-image: url('../images/japan_map_ink_borders.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.05;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.teaser-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.teaser-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  margin-bottom: 2rem;
  letter-spacing: 0.1em;
}

.teaser-text {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--c-text-muted);
  margin-bottom: 3rem;
  line-height: 2;
}