/*
 * サムライ総合病院 - Samurai General Hospital
 * Main Stylesheet
 * Design: Modern Rich UI with Samurai Blue Theme
 */

/* ========================
   Google Fonts Import
   ======================== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700;900&family=Noto+Serif+JP:wght@400;700&family=Cinzel:wght@400;600;700&display=swap');

/* ========================
   CSS Custom Properties
   ======================== */
:root {
  --primary: #1e3a7b;
  --primary-dark: #0d1f3c;
  --primary-light: #2952a3;
  --primary-ultra-light: #e8eef8;
  --secondary: #1a6b9a;
  --accent: #d4af37;
  --accent-light: #f0d060;
  --accent-dark: #b8860b;
  --danger: #c0392b;
  --success: #27ae60;

  --white: #ffffff;
  --off-white: #f8f9ff;
  --light: #f0f4ff;
  --gray-100: #f5f5f7;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --dark: #0d1b3e;

  --font-jp: 'Noto Sans JP', sans-serif;
  --font-serif: 'Noto Serif JP', serif;
  --font-display: 'Cinzel', serif;

  --shadow-xs: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.1);
  --shadow: 0 4px 20px rgba(0,0,0,0.12);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.16);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.22);
  --shadow-colored: 0 8px 32px rgba(30,58,123,0.25);

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition: 0.3s ease;
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);

  --container: 1280px;
  --container-pad: clamp(1rem, 4vw, 2rem);

  --header-h: 80px;
  --header-h-scroll: 64px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-jp);
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { list-style: none; }

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* ========================
   Typography
   ======================== */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  font-weight: 700;
}

.section-label {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
  position: relative;
  padding-left: 2rem;
}

.section-label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 2px;
  background: var(--accent);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--primary-dark);
  margin-bottom: 1rem;
}

.section-title span {
  color: var(--primary);
}

.section-desc {
  font-size: 1rem;
  color: var(--gray-500);
  max-width: 600px;
  line-height: 1.8;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.accent-text {
  color: var(--accent);
}

/* ========================
   Layout Utilities
   ======================== */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.section {
  padding: clamp(4rem, 8vw, 7rem) 0;
}

.section-alt {
  background: var(--light);
}

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

.section-header {
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-header.center {
  text-align: center;
}

.section-header.center .section-label::before {
  display: none;
}

.section-header.center .section-label {
  padding-left: 0;
}

.section-header.center .section-desc {
  margin: 0 auto;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

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

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { flex-direction: column; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* ========================
   Buttons
   ======================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  border-radius: var(--radius-full);
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: var(--font-jp);
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-colored);
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(30,58,123,0.35);
}

.btn-accent {
  background: var(--accent);
  color: var(--primary-dark);
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(212,175,55,0.3);
}

.btn-accent:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(212,175,55,0.4);
}

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

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

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

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

.btn-lg {
  padding: 1.1rem 2.5rem;
  font-size: 1rem;
}

.btn-sm {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
}

.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Arrow icon for buttons */
.btn .arrow {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border-right: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 0.25rem;
  transition: transform var(--transition);
}

.btn:hover .arrow {
  transform: rotate(45deg) translate(2px, -2px);
}

/* ========================
   Header / Navigation
   ======================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  transition: height var(--transition), background var(--transition), box-shadow var(--transition), top var(--transition);
}

body.has-banner .site-header {
  top: 44px; /* fallback before JS computes real banner height */
}

.site-header.scrolled {
  height: var(--header-h-scroll);
  background: rgba(13, 31, 60, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 var(--container-pad);
  max-width: var(--container);
  margin: 0 auto;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo img {
  width: 52px;
  height: 52px;
  transition: transform var(--transition);
}

.site-logo:hover img {
  transform: rotate(-5deg) scale(1.05);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-text .main-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.05em;
}

.logo-text .sub-name {
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
}

.logo-text .disclaimer-name {
  font-family: var(--font-jp);
  font-size: 0.55rem;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.28);
  font-weight: 300;
  margin-top: 0.1rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  list-style: none;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: block;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  border-radius: var(--radius);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent);
  background: rgba(255,255,255,0.08);
}

.nav-link.active {
  position: relative;
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 55%;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  background: var(--primary-dark);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: var(--radius-lg);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
  box-shadow: var(--shadow-xl);
}

.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown a {
  display: block;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.8);
  border-radius: var(--radius);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-dropdown a:hover {
  color: var(--accent);
  background: rgba(255,255,255,0.06);
  padding-left: 1.25rem;
}

.nav-dropdown .dropdown-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent);
  padding: 0.5rem 1rem 0.25rem;
  text-transform: uppercase;
}

.nav-emergency {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--danger);
  color: var(--white);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  animation: pulse-red 2s infinite;
  text-decoration: none;
}

.nav-emergency:hover {
  background: #a93226;
  transform: scale(1.03);
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192,57,43,0.5); }
  50% { box-shadow: 0 0 0 8px rgba(192,57,43,0); }
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 32px;
  height: 32px;
  justify-content: center;
  padding: 4px;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition);
  transform-origin: center;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--primary-dark);
  z-index: 1001;
  padding: 5rem 2rem 2rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav.open {
  transform: translateX(0);
}

.mobile-nav-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.mobile-nav-close:hover {
  background: rgba(255,255,255,0.2);
  color: var(--white);
}

.mobile-nav a {
  display: block;
  padding: 1rem 0;
  font-size: 1.125rem;
  color: rgba(255,255,255,0.85);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: var(--transition);
}

.mobile-nav a:hover,
.mobile-nav a.active {
  color: var(--accent);
  padding-left: 0.5rem;
}

.mobile-nav .mobile-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
  padding: 1.5rem 0 0.5rem;
}

/* ========================
   Hero Section
   ======================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--primary-dark);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('https://images.unsplash.com/photo-1519494026892-80bbd2d6fd0d?w=1920&q=80');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  opacity: 0.18;
  transform: scale(1.05);
  transition: transform 20s ease;
}

.hero-bg.loaded { transform: scale(1); }

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(13,31,60,0.97) 0%,
    rgba(30,58,123,0.85) 50%,
    rgba(13,31,60,0.92) 100%
  );
}

.hero-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(212,175,55,0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(41,82,163,0.15) 0%, transparent 50%),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 40px,
      rgba(255,255,255,0.01) 40px,
      rgba(255,255,255,0.01) 41px
    );
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: var(--container-pad);
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
  padding-top: calc(var(--header-h) + 3rem);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 1.25rem;
  border: 1px solid rgba(212,175,55,0.4);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(8px);
  animation: fadeInDown 0.8s ease both;
}

.hero-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.5s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 0.5rem;
  animation: fadeInUp 0.8s 0.2s ease both;
}

.hero-title .gold {
  color: var(--accent);
  display: block;
}

.hero-subtitle {
  font-family: var(--font-display);
  font-size: clamp(0.875rem, 2vw, 1.125rem);
  letter-spacing: 0.35em;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  margin-bottom: 2rem;
  animation: fadeInUp 0.8s 0.35s ease both;
}

.hero-desc {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: rgba(255,255,255,0.75);
  max-width: 560px;
  line-height: 1.8;
  margin-bottom: 2.5rem;
  animation: fadeInUp 0.8s 0.5s ease both;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s 0.65s ease both;
}

.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.4);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: fadeIn 1s 1.2s ease both;
}

.hero-scroll .scroll-line {
  width: 1px;
  height: 50px;
  background: linear-gradient(to bottom, transparent, rgba(212,175,55,0.5));
  animation: scrollDown 1.5s ease-in-out infinite;
}

@keyframes scrollDown {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ========================
   Quick Info Bar
   ======================== */
.quick-info {
  background: var(--primary);
  padding: 1.25rem 0;
  border-bottom: 3px solid var(--accent);
}

.quick-info-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  justify-content: center;
}

.quick-info-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255,255,255,0.9);
  font-size: 0.875rem;
}

.quick-info-item .icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quick-info-item .icon svg {
  width: 18px;
  height: 18px;
  fill: var(--accent);
}

.quick-info-item strong {
  display: block;
  color: var(--white);
  font-size: 0.9375rem;
}

.quick-info-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.15);
}

/* ========================
   Stats Section
   ======================== */
.stats {
  background: var(--primary-dark);
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}

.stats::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0 L60 30 L30 60 L0 30 Z' fill='none' stroke='rgba(212,175,55,0.04)' stroke-width='1'/%3E%3C/svg%3E") repeat;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  position: relative;
}

.stat-item {
  text-align: center;
  padding: 2rem 1rem;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(212,175,55,0.1);
  transition: var(--transition);
}

.stat-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(212,175,55,0.3);
  transform: translateY(-4px);
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-unit {
  font-size: 1.25rem;
  color: rgba(212,175,55,0.7);
}

.stat-label {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.05em;
}

.stat-note {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.3);
  margin-top: 0.25rem;
}

/* ========================
   Department Cards
   ======================== */
.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.dept-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition-slow);
  border: 1px solid var(--gray-200);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.dept-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(30,58,123,0.2);
}

.dept-card-img {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: var(--primary-ultra-light);
}

.dept-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.dept-card:hover .dept-card-img img {
  transform: scale(1.08);
}

.dept-card-icon {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.dept-card-icon svg {
  width: 22px;
  height: 22px;
  fill: var(--white);
}

.dept-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dept-card-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--primary-light);
  text-transform: uppercase;
  margin-bottom: 0.375rem;
}

.dept-card-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--primary-dark);
  margin-bottom: 0.625rem;
}

.dept-card-desc {
  font-size: 0.875rem;
  color: var(--gray-500);
  line-height: 1.7;
  flex: 1;
}

.dept-card-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dept-card-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: var(--transition);
}

.dept-card-link:hover { color: var(--primary-light); gap: 0.5rem; }

/* Special card for Samurai dept */
.dept-card.samurai {
  border: 2px solid var(--accent);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: var(--white);
}

.dept-card.samurai .dept-card-label { color: var(--accent); }
.dept-card.samurai .dept-card-title { color: var(--white); }
.dept-card.samurai .dept-card-desc { color: rgba(255,255,255,0.7); }
.dept-card.samurai .dept-card-footer { border-color: rgba(255,255,255,0.15); }
.dept-card.samurai .dept-card-link { color: var(--accent); }

/* ========================
   News Section
   ======================== */
.news-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--gray-200);
  padding-bottom: 0;
}

.news-tab {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  background: none;
}

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

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

.news-list { display: flex; flex-direction: column; gap: 0; }

.news-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--gray-200);
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}

.news-item:hover { background: var(--light); margin: 0 -1rem; padding: 1.25rem 1rem; border-radius: var(--radius); }

.news-date {
  flex-shrink: 0;
  text-align: center;
}

.news-date .day {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.news-date .month {
  display: block;
  font-size: 0.7rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.news-category {
  display: inline-block;
  padding: 0.2rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.375rem;
}

.cat-important { background: rgba(192,57,43,0.1); color: var(--danger); }
.cat-info { background: rgba(30,58,123,0.1); color: var(--primary); }
.cat-samurai { background: rgba(212,175,55,0.15); color: var(--accent-dark); }
.cat-recruit { background: rgba(39,174,96,0.1); color: var(--success); }

.news-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1.5;
}

/* ========================
   Cards - General
   ======================== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  transition: var(--transition-slow);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Feature cards */
.feature-card {
  padding: 2rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-slow);
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(30,58,123,0.15);
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-colored);
}

.feature-icon svg {
  width: 28px;
  height: 28px;
  fill: var(--white);
}

.feature-title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  color: var(--primary-dark);
  margin-bottom: 0.625rem;
}

.feature-desc {
  font-size: 0.875rem;
  color: var(--gray-500);
  line-height: 1.7;
}

/* ========================
   Director Section (Teaser)
   ======================== */
.director-section {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  position: relative;
  overflow: hidden;
}

.director-section::before {
  content: '';
  position: absolute;
  right: -100px;
  top: -100px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(212,175,55,0.05);
}

.director-section::after {
  content: '';
  position: absolute;
  left: -50px;
  bottom: -50px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.02);
}

.director-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.director-quote {
  font-family: var(--font-serif);
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  color: var(--white);
  line-height: 1.8;
  position: relative;
  padding-left: 2rem;
}

.director-quote::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  border-radius: 2px;
}

.director-image-wrap {
  position: relative;
}

.director-portrait {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 4px solid rgba(212,175,55,0.3);
  box-shadow: var(--shadow-xl);
}

.director-badge {
  position: absolute;
  bottom: -1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.8125rem;
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}

/* ========================
   Access Teaser
   ======================== */
.access-teaser {
  background: var(--light);
  position: relative;
  overflow: hidden;
}

.access-visual {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.access-visual img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

.access-visual-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(13,31,60,0.9) 0%, rgba(13,31,60,0.3) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem;
}

.access-coords {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.access-name {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--white);
  margin-bottom: 1rem;
}

.access-note {
  font-size: 0.9375rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.8;
  max-width: 300px;
}

/* ========================
   Footer
   ======================== */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.7);
  padding-top: 4rem;
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand .logo-text .main-name { font-size: 1rem; }

.footer-desc {
  font-size: 0.875rem;
  margin-top: 1rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.5);
}

.footer-hours {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius);
  border: 1px solid rgba(212,175,55,0.15);
}

.footer-hours dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.footer-hours dd {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.7);
}

.footer-col-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.footer-links a {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.55);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.footer-links a::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
  flex-shrink: 0;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--white);
  padding-left: 0.25rem;
}

.footer-links a:hover::before { opacity: 1; }

.footer-bottom {
  padding: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copyright {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.3);
}

.footer-legal {
  display: flex;
  gap: 1.5rem;
}

.footer-legal a {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.3);
  transition: var(--transition);
}

.footer-legal a:hover { color: rgba(255,255,255,0.6); }

/* ========================
   Page Header (Sub pages)
   ======================== */
.page-hero {
  position: relative;
  padding: calc(var(--header-h) + 4rem) 0 5rem;
  background: var(--primary-dark);
  overflow: hidden;
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.15;
}

.page-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(13,31,60,0.95),
    rgba(30,58,123,0.8)
  );
}

.page-hero-content {
  position: relative;
  z-index: 1;
}

.page-hero .breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 1.5rem;
}

.page-hero .breadcrumb a {
  color: rgba(255,255,255,0.5);
  transition: var(--transition);
}

.page-hero .breadcrumb a:hover { color: var(--accent); }

.page-hero .breadcrumb .sep {
  color: rgba(255,255,255,0.25);
}

.page-hero .page-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--white);
  margin-bottom: 0.75rem;
}

.page-hero .page-title span { color: var(--accent); }

.page-hero .page-subtitle {
  font-family: var(--font-display);
  font-size: clamp(0.75rem, 2vw, 0.9375rem);
  letter-spacing: 0.3em;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
}

/* ========================
   Dept Detail Page
   ======================== */
.dept-detail-header {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 3rem;
}

.dept-detail-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-colored);
}

.dept-detail-icon svg {
  width: 42px;
  height: 42px;
  fill: var(--white);
}

.info-box {
  background: var(--primary-ultra-light);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  border-left: 4px solid var(--primary);
}

.info-box.warning {
  background: rgba(192,57,43,0.05);
  border-left-color: var(--danger);
}

.info-box.gold {
  background: rgba(212,175,55,0.08);
  border-left-color: var(--accent);
}

/* ========================
   Timeline (History)
   ======================== */
.timeline {
  position: relative;
  padding: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--primary), var(--accent), var(--primary), transparent);
  transform: translateX(-50%);
}

.timeline-item {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  gap: 0;
  margin-bottom: 3rem;
  align-items: start;
}

.timeline-item:nth-child(odd) .timeline-content { grid-column: 1; grid-row: 1; text-align: right; padding-right: 2.5rem; }
.timeline-item:nth-child(odd) .timeline-center { grid-column: 2; grid-row: 1; }
.timeline-item:nth-child(odd) .timeline-empty { grid-column: 3; grid-row: 1; }

.timeline-item:nth-child(even) .timeline-empty { grid-column: 1; grid-row: 1; }
.timeline-item:nth-child(even) .timeline-center { grid-column: 2; grid-row: 1; }
.timeline-item:nth-child(even) .timeline-content { grid-column: 3; grid-row: 1; text-align: left; padding-left: 2.5rem; }

.timeline-center {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 0.25rem;
}

.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(212,175,55,0.2);
}

.timeline-year {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.375rem;
}

.timeline-era {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.timeline-event {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--primary-dark);
  font-weight: 700;
  margin-bottom: 0.375rem;
}

.timeline-desc {
  font-size: 0.875rem;
  color: var(--gray-500);
  line-height: 1.7;
}

/* Mobile timeline */
@media (max-width: 767px) {
  .timeline::before { left: 20px; }
  .timeline-item { grid-template-columns: 40px 1fr; gap: 0 1rem; }
  .timeline-item:nth-child(odd) .timeline-content,
  .timeline-item:nth-child(even) .timeline-content {
    grid-column: 2; text-align: left; padding: 0;
  }
  .timeline-item:nth-child(odd) .timeline-center,
  .timeline-item:nth-child(even) .timeline-center { grid-column: 1; }
  .timeline-item:nth-child(odd) .timeline-empty,
  .timeline-item:nth-child(even) .timeline-empty { display: none; }
}

/* ========================
   Table Styles
   ======================== */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9375rem;
}

.data-table th {
  background: var(--primary);
  color: var(--white);
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.03em;
}

.data-table th:first-child { border-radius: var(--radius) 0 0 0; }
.data-table th:last-child { border-radius: 0 var(--radius) 0 0; }

.data-table td {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-600);
}

.data-table tr:hover td { background: var(--light); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:last-child td:first-child { border-radius: 0 0 0 var(--radius); }
.data-table tr:last-child td:last-child { border-radius: 0 0 var(--radius) 0; }

.table-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}

/* ========================
   Form Styles
   ======================== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.form-label .required {
  color: var(--danger);
  margin-left: 0.25rem;
  font-size: 0.75rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.875rem 1.25rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: var(--font-jp);
  color: var(--gray-800);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(30,58,123,0.1);
}

.form-textarea {
  min-height: 160px;
  resize: vertical;
}

/* ========================
   Scroll Reveal Animations
   ======================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.from-left {
  transform: translateX(-30px);
}

.reveal.from-right {
  transform: translateX(30px);
}

.reveal.scale-in {
  transform: scale(0.95);
}

.reveal.active {
  opacity: 1;
  transform: none;
}

/* Staggered children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.stagger-children.active > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.active > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.active > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children.active > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children.active > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children.active > *:nth-child(6) { transition-delay: 0.3s; }
.stagger-children.active > *:nth-child(7) { transition-delay: 0.35s; }
.stagger-children.active > *:nth-child(8) { transition-delay: 0.4s; }
.stagger-children.active > *:nth-child(9) { transition-delay: 0.45s; }
.stagger-children.active > *:nth-child(10) { transition-delay: 0.5s; }

.stagger-children.active > * {
  opacity: 1;
  transform: translateY(0);
}

/* ========================
   Keyframe Animations
   ======================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ========================
   Misc Components
   ======================== */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.badge-primary { background: rgba(30,58,123,0.1); color: var(--primary); }
.badge-accent { background: rgba(212,175,55,0.15); color: var(--accent-dark); }
.badge-danger { background: rgba(192,57,43,0.1); color: var(--danger); }
.badge-success { background: rgba(39,174,96,0.1); color: var(--success); }

.divider {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 2rem 0;
}

.divider-gold {
  border-color: var(--accent);
  opacity: 0.3;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ========================
   Back to top button
   ======================== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition);
  z-index: 900;
  border: 2px solid rgba(212,175,55,0.3);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-light);
  transform: translateY(-3px);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
  fill: var(--white);
}

/* ========================
   Responsive
   ======================== */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .director-content { grid-template-columns: 1fr; gap: 2rem; }
  .director-image-wrap { order: -1; }
  .director-portrait { max-width: 280px; }
}

@media (max-width: 768px) {
  :root { --header-h: 64px; }

  .site-nav { display: none; }
  .hamburger { display: flex; }
  .mobile-nav { display: block; }

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

  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }

  .quick-info-inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .quick-info-divider { display: none; }

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

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

  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-bottom { flex-direction: column; text-align: center; }

  .timeline-item { grid-template-columns: 40px 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .news-item { flex-direction: column; gap: 0.75rem; }
}

/* ========================
   Animations
   ======================== */
@keyframes banner-ticker {
  from { transform: translateX(100vw); }
  to   { transform: translateX(-100%); }
}
