/* ===========================
   HAKUSO - Sub Page Styles
   =========================== */

/* --- Page Header (Hero Banner for sub pages) --- */
.page-hero {
  position: relative;
  padding: 160px 0 60px;
  background: linear-gradient(135deg, #1A1A2E 0%, #2D2D44 50%, #1A1A2E 100%);
  overflow: hidden;
  min-height: 300px;
  display: flex;
  align-items: flex-end;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(108, 60, 225, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(0, 201, 167, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(0, 0, 0, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

/* Page hero decorative shapes */
.page-hero-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.page-hero-shape {
  position: absolute;
  opacity: 0;
  animation: pageShapeIn 1.2s ease-out forwards;
}

@keyframes pageShapeIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pageHeroIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-hero-shape-1 {
  width: 600px;
  height: 600px;
  top: -200px;
  right: -150px;
  animation: pageShapeIn 1.2s ease-out 0.4s forwards, pageShapeFloat 20s ease-in-out 1.6s infinite;
}

.page-hero-shape-2 {
  width: 400px;
  height: 400px;
  bottom: -150px;
  left: -100px;
  animation: pageShapeIn 1.2s ease-out 0.7s forwards, pageShapeFloat 25s ease-in-out 1.9s infinite reverse;
}

.page-hero-shape-3 {
  width: 300px;
  height: 300px;
  top: 20%;
  left: 30%;
  animation: pageShapeIn 1.2s ease-out 1.0s forwards, pageShapeFloat 18s ease-in-out 2.2s infinite;
}

@keyframes pageShapeFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(10px, -8px) rotate(2deg); }
  66% { transform: translate(-5px, 12px) rotate(-1deg); }
}

.page-hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 30px;
  width: 100%;
  opacity: 0;
  transform: translateY(20px);
  animation: pageHeroIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

.page-hero-title {
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.page-hero-title .title-en {
  font-family: var(--font-en);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  line-height: 1.1;
}

.page-hero-title .title-ja {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
  letter-spacing: 0.1em;
}

/* --- Hero Ticker (Infinite Scrolling Text) --- */
.hero-ticker {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.15);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.hero-ticker-track {
  display: flex;
  width: max-content;
  animation: tickerScroll 30s linear infinite;
}

.hero-ticker-track:hover {
  animation-play-state: paused;
}

.hero-ticker-content {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 10px 0;
  flex-shrink: 0;
}

.hero-ticker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 28px;
  white-space: nowrap;
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
}

.hero-ticker-item .ticker-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.6;
  flex-shrink: 0;
}

.hero-ticker-item .ticker-dot--alt {
  background: var(--secondary);
}

.hero-ticker-item .ticker-label {
  font-family: var(--font-ja);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: none;
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (max-width: 768px) {
  .hero-ticker-item {
    font-size: 10px;
    padding: 0 20px;
  }
  .hero-ticker-item .ticker-label {
    font-size: 10px;
  }
  .hero-ticker-content {
    padding: 8px 0;
  }
}

/* --- Breadcrumb --- */
.breadcrumb {
  padding: 16px 0;
  background: var(--light-gray);
  border-bottom: 1px solid #e5e5e5;
}

.breadcrumb-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #888;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: #666;
  transition: color var(--transition);
}

.breadcrumb a:hover {
  color: var(--primary);
  opacity: 1;
}

.breadcrumb .separator {
  font-size: 10px;
  color: #ccc;
}

.breadcrumb .current {
  color: var(--dark);
  font-weight: 500;
}

/* --- Main Content Area --- */
.page-content {
  padding: 60px 0 80px;
  position: relative;
  background: var(--white);
}

.page-content .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 30px;
  position: relative;
}

/* Content with sidebar layout */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 50px;
  align-items: start;
}

.content-main {
  min-width: 0;
}

/* Full width content */
.content-full {
  max-width: 900px;
}

/* --- Section within page content --- */
.content-section {
  margin-bottom: 60px;
}

.content-section:last-child {
  margin-bottom: 0;
}

.content-section h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--primary);
  line-height: 1.4;
}

.content-section h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 16px;
  margin-top: 30px;
  padding-left: 14px;
  border-left: 4px solid var(--primary);
  line-height: 1.4;
}

.content-section h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 12px;
  margin-top: 20px;
}

.content-section p {
  font-size: 15px;
  line-height: 1.9;
  color: #444;
  margin-bottom: 16px;
}

.content-section p:last-child {
  margin-bottom: 0;
}

.content-section img {
  border-radius: 8px;
  margin: 20px 0;
}

.content-section ul {
  margin: 16px 0;
  padding-left: 20px;
}

.content-section ul li {
  font-size: 15px;
  line-height: 1.8;
  color: #444;
  margin-bottom: 8px;
  list-style: disc;
}

.content-section ul li::marker {
  color: var(--primary);
}

/* Info box */
.info-box {
  background: var(--light-gray);
  border-radius: 12px;
  padding: 30px;
  margin: 24px 0;
}

.info-box h4 {
  margin-top: 0;
}

.info-box-accent {
  border-left: 4px solid var(--primary);
  background: rgba(108, 60, 225, 0.04);
}

.info-box-secondary {
  border-left: 4px solid var(--secondary);
  background: rgba(0, 201, 167, 0.04);
}

/* Data table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 14px 18px;
  border: 1px solid #ddd;
  text-align: left;
  line-height: 1.6;
}

.data-table th {
  background: var(--dark);
  color: var(--white);
  font-weight: 600;
  white-space: nowrap;
}

.data-table tr:nth-child(even) {
  background: #f9fafb;
}

.data-table tr:hover {
  background: rgba(108, 60, 225, 0.03);
}

/* Key-value table (horizontal header) */
.kv-table th {
  background: var(--light-gray);
  color: var(--dark);
  width: 180px;
  font-weight: 600;
}

/* --- News Category Tabs --- */
.news-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e5e5e5;
  margin-bottom: 40px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.news-tab {
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  white-space: nowrap;
  position: relative;
  transition: all var(--transition);
  flex-shrink: 0;
}

.news-tab:hover {
  color: var(--primary);
  opacity: 1;
}

.news-tab.active {
  color: var(--primary);
}

.news-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
}

/* Year filter tabs */
.year-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.year-tab {
  padding: 6px 16px;
  font-size: 13px;
  font-family: var(--font-en);
  font-weight: 600;
  border: 1px solid #ddd;
  border-radius: 20px;
  color: #666;
  transition: all var(--transition);
}

.year-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
  opacity: 1;
}

.year-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

/* News card grid */
.news-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 50px;
}

.news-card {
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid #e5e5e5;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.news-card:hover {
  opacity: 1;
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.news-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--light-gray);
}

.news-card-body {
  padding: 18px 20px;
}

.news-card-date {
  font-family: var(--font-en);
  font-size: 13px;
  color: #888;
  font-weight: 500;
  margin-bottom: 8px;
}

.news-card-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--dark);
  transition: color var(--transition);
}

.news-card:hover .news-card-title {
  color: var(--primary);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font-en);
  font-weight: 600;
  color: #666;
  border: 1px solid #ddd;
  transition: all var(--transition);
}

.pagination a:hover {
  opacity: 1;
  border-color: var(--primary);
  color: var(--primary);
}

.pagination .active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.pagination .dots {
  border: none;
  width: auto;
  padding: 0 4px;
}

/* --- Sidebar --- */
.sidebar {
  position: sticky;
  top: 120px;
}

.sidebar-section {
  margin-bottom: 30px;
}

.sidebar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 14px;
}

.sidebar-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  font-size: 13px;
  color: #555;
  border-bottom: 1px solid #eee;
  transition: all var(--transition);
}

.sidebar-links a:hover {
  color: var(--primary);
  opacity: 1;
  padding-left: 5px;
}

.sidebar-links a::before {
  content: '\f054';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 9px;
  color: var(--primary);
  flex-shrink: 0;
}

/* --- Access page transport nav --- */
.transport-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 40px;
}

.transport-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px;
  border-radius: 12px;
  background: var(--light-gray);
  border: 2px solid transparent;
  transition: all var(--transition);
  text-align: center;
}

.transport-nav-item:hover {
  opacity: 1;
  border-color: var(--secondary);
  background: rgba(0, 201, 167, 0.06);
}

.transport-nav-item.active {
  border-color: var(--secondary);
  background: rgba(0, 201, 167, 0.1);
}

.transport-nav-item i {
  font-size: 24px;
  color: var(--secondary);
}

.transport-nav-item span {
  font-size: 12px;
  font-weight: 600;
  color: var(--dark);
}

/* Transport section */
.transport-section {
  margin-bottom: 50px;
  scroll-margin-top: 120px;
}

.transport-section h3 {
  display: flex;
  align-items: center;
  gap: 12px;
}

.transport-section h3 i {
  color: var(--secondary);
  font-size: 20px;
}

/* --- CTA Button --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: calc(0.667em + 2px) calc(1.333em + 2px);
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
}

.btn-primary {
  background: var(--dark-gray);
  color: var(--white);
}

.btn-primary:hover {
  opacity: 1;
  background: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 60, 225, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--dark);
  border: 2px solid var(--dark);
}

.btn-outline:hover {
  opacity: 1;
  background: var(--dark);
  color: var(--white);
}

.btn-accent {
  background: var(--primary);
  color: var(--white);
}

.btn-accent:hover {
  opacity: 1;
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 60, 225, 0.35);
}

.btn i {
  font-size: 12px;
}

/* --- Card grid (for pavilions, events, etc.) --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 30px 0;
}

.card {
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid #e5e5e5;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
  opacity: 1;
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.card-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--light-gray);
}

.card-body {
  padding: 20px;
}

.card-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 3px;
  background: var(--primary);
  color: var(--white);
  margin-bottom: 10px;
}

.card-tag-secondary {
  background: var(--secondary);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--dark);
  margin-bottom: 8px;
  transition: color var(--transition);
}

.card:hover .card-title {
  color: var(--primary);
}

.card-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
}

/* 2-column cards */
.card-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

/* 4-column cards */
.card-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* --- Sub page decorative shapes --- */
.page-deco {
  position: absolute;
  pointer-events: none;
  overflow: hidden;
}

.page-deco-1 {
  width: 500px;
  height: 500px;
  top: -150px;
  right: -200px;
  opacity: 0.04;
}

.page-deco-2 {
  width: 400px;
  height: 400px;
  bottom: -100px;
  left: -150px;
  opacity: 0.04;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .content-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .sidebar {
    position: static;
  }

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

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

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

  .page-hero-title .title-en {
    font-size: 36px;
  }
}

@media (max-width: 768px) {
  .page-hero {
    padding: 120px 0 40px;
    min-height: 220px;
  }

  .page-hero-title .title-en {
    font-size: 28px;
  }

  .content-section h2 {
    font-size: 22px;
  }

  .content-section h3 {
    font-size: 18px;
  }

  .news-card-grid {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

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

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

  .page-content {
    padding: 40px 0 60px;
  }

  .kv-table th {
    width: 120px;
  }
}

@media (max-width: 480px) {
  .page-hero {
    padding: 100px 0 30px;
    min-height: 180px;
  }

  .page-hero-content {
    padding: 0 16px;
  }

  .page-hero-title .title-en {
    font-size: 24px;
  }

  .page-hero-title .title-ja {
    font-size: 13px;
  }

  .page-content .container {
    padding: 0 16px;
  }

  .transport-nav {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .card-grid-4 {
    grid-template-columns: 1fr;
  }

  .year-tabs {
    gap: 6px;
  }

  .year-tab {
    padding: 5px 12px;
    font-size: 12px;
  }

  .content-section h2 {
    font-size: 20px;
  }

  .content-section h3 {
    font-size: 16px;
  }

  .content-section p {
    font-size: 14px;
  }

  .info-box {
    padding: 20px 16px;
  }

  .breadcrumb-inner {
    padding: 0 16px;
  }

  /* Stack key-value tables on very narrow screens */
  .kv-table,
  .kv-table thead,
  .kv-table tbody,
  .kv-table tr,
  .kv-table th,
  .kv-table td {
    display: block;
    width: 100%;
  }

  .kv-table th {
    border-bottom: none;
    padding-bottom: 4px;
    background: var(--light-gray);
    font-size: 13px;
  }

  .kv-table td {
    padding-top: 4px;
    border-top: none;
    margin-bottom: 8px;
  }

  /* Make non-kv data tables horizontally scrollable */
  .data-table:not(.kv-table) {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .pagination a,
  .pagination span {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .sidebar-links a {
    min-height: 44px;
  }

  .news-tab {
    padding: 12px 16px;
    font-size: 13px;
    min-height: 44px;
  }
}

/* --- Form Input Accessibility --- */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--secondary, #00C9A7);
  outline-offset: 2px;
  border-color: var(--secondary, #00C9A7);
}

/* Ensure 16px+ font-size on form inputs to prevent iOS zoom */
.contact-form input,
.contact-form select,
.contact-form textarea {
  font-size: 16px;
}

/* Minimum touch target size for form submit buttons */
.contact-form .btn {
  min-height: 48px;
  min-width: 160px;
}
