:root {
  --primary-color: #2E7D82;
  --secondary-color: #5FB3B9;
  --accent-color: #7BC9A4;
  --warm-beige: #F5F1E8;
  --soft-green: #A8D5A8;
  --background-color: #FEFEFE;
  --surface-color: #ffffff;
  --text-color: #2c3e50;
  --text-color-light: #ffffff;
  --text-color-secondary: #5a6c7d;
  --border-color: #d5dae1;
  --shadow-color: rgba(0, 0, 0, 0.08);
  --overlay-color: rgba(46, 125, 130, 0.9);

  --font-family-base: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  --font-family-heading: 'Georgia', 'Times New Roman', 'Hiragino Mincho ProN', serif;

  --header-height: 80px;
  --transition-speed: 0.3s;
  --border-radius: 8px;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family-base);
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-color);
  background-color: var(--background-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  color: var(--primary-color);
  line-height: 1.4;
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-md);
}

h2 {
  font-size: 2rem;
  margin-bottom: var(--spacing-sm);
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-speed);
  font-weight: 500;
}

a:hover, a:focus {
  color: var(--secondary-color);
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--border-radius);
}

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

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 12px var(--shadow-color);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--header-height);
  padding: 0 var(--spacing-lg);
}

.logo a {
  font-family: var(--font-family-heading);
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--text-color-light);
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.logo a:hover {
  color: var(--warm-beige);
  outline: none;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: var(--spacing-md);
  align-items: center;
  flex-wrap: wrap;
  max-width: 900px;
  justify-content: center;
}

.nav-item a {
  font-weight: 500;
  color: var(--text-color-light);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius);
  transition: all var(--transition-speed);
  font-size: 1rem;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.1);
}

.nav-item a:hover, .nav-item a:focus {
  background: rgba(255, 255, 255, 0.2);
  color: var(--warm-beige);
  transform: translateY(-2px);
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--spacing-xs);
  position: relative;
  width: 40px;
  height: 40px;
}

.hamburger-line {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--text-color-light);
  margin: 5px auto;
  transition: all var(--transition-speed);
  border-radius: 2px;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--overlay-color), rgba(123, 201, 164, 0.8)),
              url('images/hero-main.jpg') center/cover no-repeat;
  color: var(--text-color-light);
  text-align: center;
  padding: var(--spacing-xl) 0;
  min-height: 70vh;
  display: flex;
  align-items: center;
  position: relative;
}

/* WebP対応ブラウザ用 */
.webp .hero {
  background: linear-gradient(135deg, var(--overlay-color), rgba(123, 201, 164, 0.8)),
              url('images/hero-main.webp') center/cover no-repeat;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.hero h1 {
  color: var(--text-color-light);
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.9),
               0 2px 6px rgba(0, 0, 0, 0.8),
               0 0 2px rgba(0, 0, 0, 1);
}

.hero-subtitle {
  font-size: 1.3rem;
  margin-bottom: var(--spacing-lg);
  opacity: 0.95;
  line-height: 1.6;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.9),
               0 1px 4px rgba(0, 0, 0, 0.8);
}

.cta-button {
  display: inline-block;
  background: var(--accent-color);
  color: var(--text-color);
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 1.1rem;
  transition: all var(--transition-speed);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.cta-button:hover, .cta-button:focus {
  background: var(--soft-green);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  color: var(--text-color);
}

/* Main Content */
.main-content {
  padding: var(--spacing-xl) 0;
}

.page-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--spacing-xl);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.content-area {
  background: var(--surface-color);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 16px var(--shadow-color);
}

.sidebar {
  background: var(--warm-beige);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 16px var(--shadow-color);
  height: fit-content;
  position: sticky;
  top: calc(var(--header-height) + var(--spacing-lg));
}

/* Sections */
.section {
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-lg) 0;
}

.section:not(:last-child) {
  border-bottom: 1px solid var(--border-color);
}

.section h2 {
  color: var(--primary-color);
  border-left: 4px solid var(--accent-color);
  padding-left: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.section p {
  margin-bottom: var(--spacing-sm);
  line-height: 1.8;
}

/* Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  margin: var(--spacing-lg) 0;
}

.card {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 4px 16px var(--shadow-color);
  transition: all var(--transition-speed);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-content {
  padding: var(--spacing-md);
}

.card h3 {
  color: var(--primary-color);
  margin-bottom: var(--spacing-xs);
}

.card p {
  color: var(--text-color-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* News List */
.news-list {
  background: var(--warm-beige);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius);
  margin: var(--spacing-lg) 0;
}

.news-item {
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--border-color);
}

.news-item:last-child {
  border-bottom: none;
}

.news-date {
  color: var(--text-color-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.news-title {
  color: var(--primary-color);
  font-weight: 600;
  margin-top: var(--spacing-xs);
}

/* Sidebar Components */
.sidebar h3 {
  color: var(--primary-color);
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: var(--spacing-xs);
  margin-bottom: var(--spacing-sm);
}

.sidebar-section {
  margin-bottom: var(--spacing-lg);
}

.toc-list {
  list-style: none;
}

.toc-list li {
  margin-bottom: var(--spacing-xs);
}

.toc-list a {
  color: var(--text-color);
  font-size: 0.95rem;
  padding: var(--spacing-xs);
  display: block;
  border-radius: 4px;
  transition: all var(--transition-speed);
}

.toc-list a:hover, .toc-list a:focus {
  background: var(--surface-color);
  color: var(--primary-color);
}

.related-links {
  list-style: none;
}

.related-links li {
  margin-bottom: var(--spacing-xs);
}

.related-links a {
  color: var(--secondary-color);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  padding: var(--spacing-xs);
  border-radius: 4px;
  transition: all var(--transition-speed);
}

.related-links a:hover, .related-links a:focus {
  background: var(--surface-color);
  color: var(--primary-color);
}

.related-links a::before {
  content: '→';
  margin-right: var(--spacing-xs);
  color: var(--accent-color);
}

/* Footer */
.footer {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: var(--text-color-light);
  padding: var(--spacing-xl) 0 var(--spacing-lg);
  margin-top: var(--spacing-xl);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.footer-section h3 {
  color: var(--text-color-light);
  margin-bottom: var(--spacing-sm);
}

.footer-section a {
  color: var(--warm-beige);
  display: block;
  margin-bottom: var(--spacing-xs);
  font-size: 0.95rem;
}

.footer-section a:hover, .footer-section a:focus {
  color: var(--text-color-light);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--spacing-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--warm-beige);
}

/* Responsive Design */
@media (max-width: 768px) {
  :root {
    --header-height: 70px;
  }

  body {
    font-size: 16px;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary-color);
    flex-direction: column;
    padding: var(--spacing-sm);
    box-shadow: 0 4px 12px var(--shadow-color);
  }

  .nav-menu.active {
    display: flex;
  }

  .mobile-menu-btn {
    display: block;
  }

  .mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .page-container {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .content-area {
    order: 2;
  }

  .sidebar {
    order: 1;
    position: static;
  }

  .container {
    padding: 0 var(--spacing-sm);
  }

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

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --spacing-lg: 1rem;
    --spacing-xl: 1.5rem;
  }

  .hero {
    padding: var(--spacing-lg) 0;
    min-height: 50vh;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .content-area,
  .sidebar {
    padding: var(--spacing-sm);
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #1a5a5f;
    --secondary-color: #2c8690;
    --text-color: #000000;
    --border-color: #000000;
    --shadow-color: rgba(0, 0, 0, 0.3);
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus Styles for Accessibility */
*:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Skip to Content Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-color);
  color: var(--text-color-light);
  padding: 8px;
  text-decoration: none;
  z-index: 1001;
  border-radius: 4px;
}

.skip-link:focus {
  top: 6px;
}

/* Latest News Section Styles */
.latest-news-section {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.latest-news-section h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: var(--spacing-lg);
  color: var(--primary-color);
}

.latest-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.latest-news-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.latest-news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.latest-news-card a {
  text-decoration: none;
  color: inherit;
  display: flex;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
}

.news-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-content {
  flex: 1;
}

.news-meta-date {
  display: block;
  font-size: 0.85rem;
  color: #888;
  margin-bottom: var(--spacing-xs);
}

.news-meta-title {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: var(--spacing-xs);
  color: var(--text-color);
}

.news-meta-excerpt {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #555;
  margin: 0;
}

.news-cta {
  text-align: center;
  padding-top: var(--spacing-md);
}

.btn-news-more {
  display: inline-block;
  padding: var(--spacing-md) var(--spacing-xl);
  background: var(--primary-color);
  color: var(--text-color-light);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.3s ease, transform 0.2s ease;
}

.btn-news-more:hover {
  background: var(--secondary-color);
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .latest-news-grid {
    grid-template-columns: 1fr;
  }

  .latest-news-card a {
    flex-direction: column;
    text-align: center;
  }

  .news-icon {
    font-size: 3rem;
  }
}