/* ====================
   Variables — Ocean & Sky palette
   ==================== */
:root {
  /* Primary: deep ocean blue */
  --color-primary: #0c4a6e;
  --color-primary-light: #0284c7;
  --color-primary-lighter: #38bdf8;

  /* Accents */
  --color-accent: #f59e0b;
  --color-accent-soft: #fef3c7;

  /* Surfaces */
  --color-bg: #f0f7ff;
  --color-surface: #ffffff;
  --color-surface-hover: #f8fbff;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-text-muted: #94a3b8;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(12, 74, 110, 0.04);
  --shadow-sm: 0 1px 3px rgba(12, 74, 110, 0.06), 0 1px 2px rgba(12, 74, 110, 0.04);
  --shadow-md: 0 4px 6px rgba(12, 74, 110, 0.06), 0 2px 4px rgba(12, 74, 110, 0.04);
  --shadow-lg: 0 10px 25px rgba(12, 74, 110, 0.08), 0 4px 10px rgba(12, 74, 110, 0.04);
  --shadow-xl: 0 20px 40px rgba(12, 74, 110, 0.1), 0 8px 16px rgba(12, 74, 110, 0.04);

  /* Layout */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --max-width: 1100px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.15s var(--ease-out);
  --transition: 0.3s var(--ease-out);
  --transition-slow: 0.5s var(--ease-out);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: var(--color-primary-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

ul {
  list-style: none;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ====================
   Header
   ==================== */
.site-header {
  position: relative;
  background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 40%, #0284c7 70%, #0ea5e9 100%);
  color: #fff;
  padding: 56px 0 40px;
  text-align: center;
  overflow: hidden;
}

/* Decorative wave overlay at bottom of header */
.site-header::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--color-bg);
  clip-path: ellipse(55% 100% at 50% 100%);
}

/* Subtle animated gradient shimmer */
.site-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255, 255, 255, 0.03) 30%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(255, 255, 255, 0.03) 70%,
    transparent 80%
  );
  animation: headerShimmer 8s ease-in-out infinite;
}

@keyframes headerShimmer {
  0%, 100% { transform: translateX(-10%); }
  50% { transform: translateX(10%); }
}

.site-header .container {
  position: relative;
  z-index: 1;
}

.site-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  line-height: 1.3;
}

.site-subtitle {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-top: 6px;
  letter-spacing: 0.18em;
  font-weight: 300;
  text-transform: uppercase;
}

.site-nav {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.site-nav a {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all var(--transition);
  backdrop-filter: blur(4px);
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  transform: translateY(-1px);
}

/* ====================
   Sections
   ==================== */
.section {
  margin-top: 48px;
  padding-top: 8px;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-primary);
  padding-left: 16px;
  margin-bottom: 24px;
  position: relative;
  letter-spacing: 0.02em;
}

.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--color-primary-light), var(--color-primary-lighter));
}

/* Fade-in animation for sections */
.section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fallback: if JS doesn't load, show sections */
.no-js .section {
  opacity: 1;
  transform: none;
}

/* ====================
   News Section
   ==================== */
.news-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 8px 20px;
  border: 1.5px solid var(--color-border);
  border-radius: 24px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  outline: none;
}

.tab-btn:hover {
  border-color: var(--color-primary-lighter);
  color: var(--color-primary-light);
  background: rgba(56, 189, 248, 0.06);
  transform: translateY(-1px);
}

.tab-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

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

.news-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  border: 1px solid transparent;
  position: relative;
}

.news-item:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(56, 189, 248, 0.15);
  transform: translateX(4px);
  background: var(--color-surface-hover);
}

.news-item.hidden {
  display: none;
}

.news-item.news-overflow {
  display: none;
}

.news-more-btn {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 4px;
  background: var(--color-bg);
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius);
  color: var(--color-primary-light);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.news-more-btn:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-primary-light);
  color: var(--color-primary);
}

.news-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-transform: capitalize;
}

.news-badge.info {
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  color: #0c4a6e;
}

.news-badge.event {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
}

.news-id {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  min-width: 48px;
  font-family: "SF Mono", "Fira Code", monospace;
}

.news-title {
  flex: 1;
  min-width: 0;
}

.news-title a {
  color: var(--color-text);
  font-size: 0.93rem;
  font-weight: 500;
  line-height: 1.5;
  transition: color var(--transition-fast);
}

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

.news-loading,
.news-empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: 48px 0;
  font-size: 0.9rem;
}

.news-source {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  text-align: right;
}

/* ====================
   Links Section
   ==================== */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.link-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition: all var(--transition);
  border: 1px solid var(--color-border-light);
  position: relative;
  overflow: hidden;
}

.link-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary-lighter));
  opacity: 0;
  transition: opacity var(--transition);
}

.link-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.15);
}

.link-card:hover::before {
  opacity: 1;
}

.link-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--color-border-light);
}

.link-card-icon {
  font-size: 1.5rem;
  line-height: 1;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.link-category {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.02em;
}

/* Fallback for cards without the new header structure */
.link-card > .link-category {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--color-border-light);
}

.link-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.link-list li {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.link-list li:hover {
  background: rgba(56, 189, 248, 0.06);
}

.link-list li::before {
  content: "\203A";
  color: var(--color-primary-lighter);
  margin-right: 8px;
  font-weight: 700;
  font-size: 1.1em;
  transition: transform var(--transition-fast);
  display: inline-block;
}

.link-list li:hover::before {
  transform: translateX(3px);
  color: var(--color-primary-light);
}

.link-list a {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-text);
  transition: color var(--transition-fast);
}

.link-list a:hover {
  color: var(--color-primary-light);
}

/* ====================
   Access Section
   ==================== */
.access-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.map-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border-light);
}

.map-container iframe {
  display: block;
}

.access-info {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px;
  border: 1px solid var(--color-border-light);
}

.access-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.access-list dt {
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 16px;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.access-list dt:first-child {
  margin-top: 0;
}

.access-list dt .access-icon {
  font-size: 1.1rem;
}

.access-list dd {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-top: 4px;
  line-height: 1.7;
  padding-left: 4px;
}

/* ====================
   Footer
   ==================== */
.site-footer {
  margin-top: 64px;
  padding: 32px 0;
  text-align: center;
  background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.82rem;
  position: relative;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--color-bg);
  clip-path: ellipse(55% 100% at 50% 0%);
}

.footer-note {
  margin-top: 6px;
  font-size: 0.72rem;
  opacity: 0.5;
}

/* ====================
   Scroll to Top Button
   ==================== */
.scroll-top-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all var(--transition);
  z-index: 100;
}

.scroll-top-btn.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

.scroll-top-btn:active {
  transform: translateY(-1px);
}

/* Chevron arrow inside button */
.scroll-top-btn::before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  border-left: 2.5px solid #fff;
  border-top: 2.5px solid #fff;
  transform: rotate(45deg) translateY(2px);
}

/* ====================
   Responsive
   ==================== */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .site-header {
    padding: 40px 0 32px;
  }

  .site-header::after {
    height: 24px;
  }

  .site-title {
    font-size: 1.6rem;
  }

  .site-subtitle {
    font-size: 0.78rem;
  }

  .site-nav {
    gap: 6px;
  }

  .site-nav a {
    padding: 6px 14px;
    font-size: 0.82rem;
  }

  .section {
    margin-top: 36px;
  }

  .section-title {
    font-size: 1.15rem;
  }

  .links-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .access-content {
    grid-template-columns: 1fr;
  }

  .map-container iframe {
    height: 280px;
  }

  .news-item {
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 12px 14px;
  }

  .news-item:hover {
    transform: none;
  }

  .news-id {
    min-width: auto;
  }

  .news-title {
    width: 100%;
  }

  .link-card:hover {
    transform: none;
  }

  .scroll-top-btn {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
  }

  .site-footer::before {
    height: 24px;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 32px 0 26px;
  }

  .site-title {
    font-size: 1.35rem;
  }

  .site-nav {
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .site-nav a {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .news-tabs {
    gap: 6px;
  }

  .tab-btn {
    padding: 6px 14px;
    font-size: 0.8rem;
  }

  .link-card {
    padding: 18px;
  }

  .link-card-icon {
    width: 34px;
    height: 34px;
    font-size: 1.2rem;
  }

  .access-info {
    padding: 20px;
  }
}

/* ====================
   Selection color
   ==================== */
::selection {
  background: rgba(56, 189, 248, 0.25);
  color: var(--color-primary);
}

/* ====================
   Focus styles for accessibility
   ==================== */
:focus-visible {
  outline: 2px solid var(--color-primary-lighter);
  outline-offset: 2px;
}

a:focus-visible {
  border-radius: 2px;
}
