@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&family=Outfit:wght@400;600;800&display=swap');

/* ==========================================================================
   CSS Variables & Design Tokens
   ========================================================================== */
:root {
  /* Common Colors (independent of theme) */
  --secondary-color: #f77f00;
  /* Warm Sun/Orange */
  --accent-color: #2a9d8f;
  /* Nature/Green */
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;

  /* Layout & Spacing */
  --header-height: 80px;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 24px;

  /* Shadow Styles */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Typography Scale (Defaults to medium) */
  --font-base-size: 16px;
  --font-title-lg: 2rem;
  --font-title-md: 1.5rem;
  --font-title-sm: 1.2rem;
  --font-body: 1rem;
  --font-small: 0.875rem;
}

/* ==========================================================================
   Theme Configurations (CSS Variables)
   ========================================================================== */
/* 1. Default / Uguisu (鶯色) Theme */
:root,
html[data-theme="uguisu"] {
  --primary-color: #bee4c5;
  /* 指定された鶯色 (190, 228, 197) */
  --primary-dark: #a2cfa9;
  /* ホバー用の少し濃い鶯色 */
  --primary-light: #eefaf0;
  /* 背景用の非常に淡い鶯色 */
  --primary-text: #1a3020;
  /* 視認性の高い、極めて濃い鶯色（色付き文字用） */
  --shadow-hover: 0 20px 25px -5px rgba(190, 228, 197, 0.3), 0 10px 10px -5px rgba(190, 228, 197, 0.1);
}

/* 2. Green Theme (Nature & Freshness) */
html[data-theme="green"] {
  --primary-color: #2a9d8f;
  --primary-dark: #1f7a6e;
  --primary-light: #e6f4f2;
  --shadow-hover: 0 20px 25px -5px rgba(42, 157, 143, 0.1), 0 10px 10px -5px rgba(42, 157, 143, 0.04);
}

/* 3. Orange Theme (Warm Sun & Energy) */
html[data-theme="orange"] {
  --primary-color: #f77f00;
  --primary-dark: #d66800;
  --primary-light: #fff3e6;
  --shadow-hover: 0 20px 25px -5px rgba(247, 127, 0, 0.1), 0 10px 10px -5px rgba(247, 127, 0, 0.04);
}

/* 4. Sakura Theme (Cherry Blossoms & Friendliness) */
html[data-theme="sakura"] {
  --primary-color: #e05a88;
  --primary-dark: #c03d69;
  --primary-light: #fbebf0;
  --shadow-hover: 0 20px 25px -5px rgba(224, 90, 136, 0.1), 0 10px 10px -5px rgba(224, 90, 136, 0.04);
}

/* Typography Overrides for Font Size Controls */
html.size-small {
  --font-base-size: 14px;
}

html.size-large {
  --font-base-size: 18px;
}

/* 文字サイズ大のときのヘッダー崩れ防止の調整 */
html.size-large .site-title {
  font-size: 1.2rem;
}

html.size-large .site-subtitle {
  font-size: 0.7rem;
}

html.size-large .nav-link {
  padding: 0.35rem 0.5rem;
  font-size: 0.825rem;
}

html.size-large .main-nav {
  gap: 0.5rem;
}

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

html {
  font-size: var(--font-base-size);
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans JP', 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: var(--primary-text);
  text-decoration: none;
  transition: color 0.25s ease, opacity 0.25s ease;
}

a:hover {
  color: var(--primary-dark);
}

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

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.branding {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.site-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-text);
  line-height: 1.2;
  white-space: nowrap;
}

.site-title a {
  color: inherit;
  white-space: nowrap;
}

.site-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

/* Main Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  overflow: hidden;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  overflow-x: auto;
  white-space: nowrap;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none;
  /* IE and Edge */
  scrollbar-width: none;
  /* Firefox */
}

.nav-menu::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera */
}

.nav-link {
  display: inline-block;
  font-weight: 500;
  color: var(--text-primary);
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  transition: background-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-text) !important;
  background-color: var(--primary-color);
}

/* Header Action (Accessibility Controls) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.text-size-control {
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  background-color: var(--card-bg);
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.size-btn {
  background: none;
  border: none;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 600;
  transition: all 0.2s ease;
}

.size-btn:not(:last-child) {
  border-right: 1px solid var(--border-color);
}

.size-btn:hover {
  background-color: var(--bg-color);
  color: var(--primary-text);
}

.size-btn.active {
  background-color: var(--primary-color);
  color: var(--primary-text);
}

/* Theme Switcher Styling */
.theme-control {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 0.35rem 0.55rem;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.theme-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  padding: 0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

.theme-btn:hover {
  transform: scale(1.15);
}

.theme-btn.active {
  border-color: var(--text-primary);
  transform: scale(1.15);
  box-shadow: 0 0 0 1px var(--card-bg), inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

.theme-uguisu {
  background-color: #bee4c5;
}

.theme-green {
  background-color: #2a9d8f;
}

.theme-orange {
  background-color: #f77f00;
}

.theme-sakura {
  background-color: #e05a88;
}

.theme-custom {
  position: relative;
  background: linear-gradient(135deg, #ff0000 0%, #ff7f00 15%, #ffff00 30%, #00ff00 45%, #00ffff 60%, #0000ff 75%, #8b00ff 90%, #ff007f 100%);
  overflow: hidden;
}

#custom-color-picker {
  position: absolute;
  top: -2px;
  left: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  opacity: 0;
  cursor: pointer;
  padding: 0;
  border: none;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-primary);
  padding: 0.5rem;
}

/* ==========================================================================
   Hero Visual Section
   ========================================================================== */
.hero-section {
  position: relative;
  height: 400px;
  background-color: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  color: #ffffff;
}

.hero-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 0 1.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-badge {
  display: inline-block;
  background-color: var(--secondary-color);
  color: #ffffff;
  padding: 0.35rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-sm);
}

.hero-title {
  font-size: var(--font-title-lg);
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hero-desc {
  font-size: var(--font-title-sm);
  font-weight: 400;
  opacity: 0.9;
}

/* Quick Contact Strip */
.quick-contact-strip {
  background-color: var(--primary-color);
  color: var(--primary-text);
  font-size: 0.9rem;
  padding: 0.75rem 0;
  border-bottom: 4px solid var(--secondary-color);
}

.contact-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.contact-items {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-item svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  opacity: 0.8;
}

.contact-link {
  color: var(--primary-text);
}

.contact-link:hover {
  text-decoration: underline;
}

.urgent-badge {
  background-color: var(--secondary-color);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.75rem;
  animation: pulse 2s infinite;
}

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

  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }

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

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-wrapper {
  max-width: 1200px;
  margin: 3rem auto;
  padding: 0 1.5rem;
  min-height: 50vh;
}

.page-section {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.page-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

/* Section Titles */
.section-header {
  border-left: 5px solid var(--primary-color);
  padding-left: 1rem;
  margin-bottom: 2rem;
  transition: border-color 0.3s ease;
}

.section-title {
  font-size: var(--font-title-lg);
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.2;
}

.section-subtitle {
  font-size: var(--font-small);
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Layout Grids */
.grid-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2.5rem;
}

/* ==========================================================================
   Home Section Specifics
   ========================================================================== */
.welcome-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 2.5rem;
}

.welcome-card h3 {
  font-size: var(--font-title-sm);
  color: var(--primary-text);
  margin-bottom: 1rem;
  font-weight: 700;
}

.welcome-card p {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/* Info Cards Block */
.info-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.info-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.info-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
}

.info-card-title {
  font-size: var(--font-title-sm);
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-card-title svg {
  width: 24px;
  height: 24px;
  color: var(--primary-color);
}

.info-card-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.info-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary-color);
}

.info-card-btn::after {
  content: '→';
  transition: transform 0.2s ease;
}

.info-card:hover .info-card-btn::after {
  transform: translateX(4px);
}

/* News List */
.news-widget {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.news-widget-header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.news-widget-title {
  font-size: var(--font-title-sm);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.news-widget-source {
  margin: 0.35rem 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

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

/* 「まめわざ」RSSを既存のお知らせ欄に馴染ませる */
#news-list-container.mamewaza_blog > div { border: 0; font-size: 1rem; }
#news-list-container.mamewaza_blog h5.mamewaza_blog { display: none; }
#news-list-container.mamewaza_blog ul.mamewaza_blog {
  height: auto !important;
  overflow: visible !important;
  margin: 0;
  padding: 0;
  list-style: none;
}
#news-list-container.mamewaza_blog li {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 0;
  border-bottom: 1px dashed var(--border-color);
}
#news-list-container.mamewaza_blog li:last-child { border-bottom: 0; }
#news-list-container.mamewaza_blog a.mamewaza_blog_title {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.6;
  text-decoration: none;
}

#news-list-container.mamewaza_blog a.mamewaza_blog_title::before {
  content: "ブログ";
  display: inline-block;
  margin-right: 0.65rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: var(--primary-color);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
  vertical-align: 0.08rem;
}
#news-list-container.mamewaza_blog a.mamewaza_blog_title:hover {
  color: var(--primary-color);
  text-decoration: underline;
}
#news-list-container.mamewaza_blog .mamewaza_blog_date {
  order: -1;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
#news-list-container.mamewaza_blog > div > div.mamewaza_blog_exp {
  padding-top: 0.6rem;
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.news-item {
  display: flex;
  gap: 1.5rem;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 1rem;
}

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

.news-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
  padding-top: 0.15rem;
}

.news-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.news-title {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}

.news-title a {
  color: inherit;
}

.news-title a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.news-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}

.news-tag.pdf {
  background-color: #ffeef0;
  color: #ff4757;
  border: 1px solid #ffd2d6;
}

.news-tag.info {
  background-color: var(--primary-light);
  color: var(--primary-text);
  border: 1px solid var(--primary-dark);
}

/* Sidebar Widgets */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-widget {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.btn-blog {
  display: block;
  background-color: var(--primary-color);
  color: var(--primary-text);
  text-align: center;
  padding: 0.85rem 1rem;
  border-radius: var(--border-radius-sm);
  font-weight: 700;
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.btn-blog:hover {
  background-color: var(--primary-dark);
  color: var(--primary-text);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Table & List Styling
   ========================================================================== */
.school-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  background-color: var(--card-bg);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.school-table th,
.school-table td {
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.school-table th {
  background-color: var(--primary-light);
  color: var(--primary-text);
  font-weight: 700;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.school-table tr:last-child td {
  border-bottom: none;
}

.school-table tr:nth-child(even) {
  background-color: var(--bg-color);
}

.school-table .total-row {
  font-weight: 700;
  background-color: var(--primary-light) !important;
  transition: background-color 0.3s ease;
}

/* History Timeline */
.timeline {
  position: relative;
  max-width: 1000px;
  margin: 2rem auto;
  padding: 1rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 120px;
  width: 3px;
  background-color: var(--primary-light);
  border-radius: 5px;
}

.timeline-item {
  position: relative;
  display: flex;
  margin-bottom: 2rem;
}

.timeline-year {
  width: 100px;
  text-align: right;
  font-weight: 700;
  color: var(--primary-text);
  font-size: 1.1rem;
  padding-top: 0.25rem;
  font-family: 'Outfit', sans-serif;
}

.timeline-marker {
  position: absolute;
  left: 121px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 4px solid var(--primary-color);
  z-index: 10;
  transform: translateX(-50%);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.timeline-item:hover .timeline-marker {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.timeline-content {
  margin-left: 50px;
  background-color: var(--card-bg);
  border-radius: var(--border-radius-sm);
  padding: 1rem 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  flex-grow: 1;
}

/* Event List Accordion-style Card */
.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.event-month-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.event-month-header {
  background-color: var(--primary-color);
  color: var(--primary-text);
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s ease;
}

.event-month-body {
  padding: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-primary);
  min-height: 100px;
}

/* Documents / School Letter Section Layout */
.letter-section-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

.letter-selector {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.letter-select-btn {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  border-radius: var(--border-radius-md);
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.letter-select-btn:hover {
  background-color: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-text);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.letter-select-btn.active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--primary-text);
}

.letter-select-btn .arrow-icon {
  font-size: 1.2rem;
  opacity: 0.7;
}

.letter-select-btn.active .arrow-icon {
  transform: translateX(3px);
  opacity: 1;
}

.letter-preview-area {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 700px;
}

.letter-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 1rem;
}

.letter-preview-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.pdf-embed-container {
  flex-grow: 1;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  height: 600px;
  background-color: #f1f5f9;
  position: relative;
}

.pdf-embed-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

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

  .letter-preview-area {
    min-height: auto;
  }
}

@media (max-width: 768px) {
  .pdf-embed-container {
    height: 420px;
  }
}

/* Bulletins Section Custom Styling */
.bulletin-box {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.bulletin-title {
  font-size: var(--font-title-sm);
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.btn-large-pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background-color: #ff4757;
  color: #ffffff;
  padding: 1rem 2rem;
  border-radius: var(--border-radius-sm);
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
  transition: all 0.2s ease;
}

.btn-large-pdf:hover {
  background-color: #ff2a3a;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4);
}

.btn-large-pdf svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* ==========================================================================
   Access & Map Styling
   ========================================================================== */
.access-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

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

.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.access-info-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.info-item {
  display: flex;
  gap: 1rem;
}

.info-icon {
  color: var(--primary-color);
  flex-shrink: 0;
  padding-top: 0.2rem;
}

.info-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.info-text h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.info-text p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background-color: #1e293b;
  color: #e2e8f0;
  padding: 4rem 0 2rem;
  margin-top: 5rem;
  border-top: 4px solid var(--primary-color);
  transition: border-top-color 0.3s ease;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-branding {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
}

.footer-subtitle {
  font-size: 0.85rem;
  color: #94a3b8;
}

.footer-address {
  font-style: normal;
  margin-top: 1rem;
  font-size: 0.95rem;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

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

.footer-links-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}

.footer-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-menu-link {
  color: #94a3b8;
  font-size: 0.95rem;
}

.footer-menu-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 0;
  border-top: 1px solid #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.copyright {
  font-size: 0.85rem;
  color: #64748b;
}

/* ==========================================================================
   Responsive Utilities (Mobile & Tablet)
   ========================================================================== */
@media (max-width: 992px) {
  .grid-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .access-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .timeline::before {
    left: 20px;
  }

  .timeline-year {
    width: 60px;
    text-align: left;
    padding-left: 35px;
    font-size: 0.95rem;
  }

  .timeline-marker {
    left: 21px;
  }

  .timeline-content {
    margin-left: 20px;
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 1200px) {
  .site-header {
    height: 60px;
  }

  .header-container {
    height: 100%;
    padding: 0 1rem;
    flex-wrap: nowrap;
    gap: 1rem;
  }

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

  .site-subtitle {
    display: none;
  }

  .menu-toggle {
    display: block;
    z-index: 210;
  }

  .main-nav {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 80%;
    max-width: 280px;
    background-color: var(--card-bg);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    padding: 5rem 1.5rem 2rem;
    z-index: 200;
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, visibility 0.3s ease;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
  }

  .main-nav.open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-menu {
    flex-direction: column;
    gap: 0.75rem;
  }

  .nav-link {
    font-size: 1.05rem;
    padding: 0.6rem 1rem;
    display: block;
  }

  .header-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-top: auto;
    gap: 0.5rem;
  }

  .text-size-control {
    justify-content: center;
  }

  .theme-control {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .hero-section {
    height: 300px;
  }

  .hero-title {
    font-size: 1.5rem;
  }

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

  .contact-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* Consolidated Layout for Rules & Guidelines */
.rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

@media (max-width: 768px) {
  .rules-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 0px) {
/* ==========================================================================
   2026 Readability & Responsive UI Refresh
   ========================================================================== */
:root {
  --font-base-size: 17px;
  --font-title-lg: clamp(2rem, 3vw, 2.65rem);
  --font-title-md: clamp(1.5rem, 2.2vw, 2rem);
  --font-title-sm: clamp(1.2rem, 1.6vw, 1.4rem);
  --font-body: 1rem;
  --font-small: 0.95rem;
  --border-radius-sm: 10px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.07);
  --shadow-md: 0 10px 24px rgba(15, 23, 42, 0.09);
}

html.size-small {
  --font-base-size: 16px;
}

html.size-large {
  --font-base-size: 20px;
}

html.size-large .site-title {
  font-size: 1.55rem;
}

html.size-large .site-subtitle {
  font-size: 0.82rem;
}

html.size-large .nav-link {
  font-size: 1rem;
  padding: 0.55rem 0.8rem;
}

body {
  line-height: 1.8;
  letter-spacing: 0.015em;
  background: #f5f8fb;
}

button,
select,
input,
textarea {
  font: inherit;
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 3px;
}

.site-header {
  background-color: rgba(255, 255, 255, 0.96);
  border-bottom-color: rgba(148, 163, 184, 0.35);
}

.header-container,
.hero-content,
.contact-container,
.main-wrapper,
.footer-container,
.footer-bottom {
  max-width: 1280px;
}

.header-container {
  min-height: 84px;
}

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

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

.nav-link {
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
}

/* ヘッダー内の横スクロールを禁止し、必ず全項目を表示する */
.main-nav,
.nav-menu {
  overflow: visible;
}

.nav-menu {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.menu-toggle,
.size-btn {
  min-width: 44px;
  min-height: 44px;
}

.size-btn {
  font-size: 0.95rem;
}

.hero-section {
  height: clamp(360px, 42vw, 520px);
}

.hero-overlay {
  height: 78%;
  background: linear-gradient(to top, rgba(10, 25, 17, 0.82) 0%, rgba(10, 25, 17, 0.12) 72%, transparent 100%);
}

.hero-title {
  font-size: clamp(2.3rem, 5vw, 4.25rem);
  line-height: 1.15;
}

.hero-desc {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  max-width: 44rem;
}

.quick-contact-strip {
  font-size: 1rem;
  padding: 0.9rem 0;
}

.main-wrapper {
  margin: clamp(2.5rem, 5vw, 4.5rem) auto;
}

.section-header {
  border-left-width: 7px;
  padding: 0.35rem 0 0.35rem 1.25rem;
  margin-bottom: 2.25rem;
}

.section-title {
  letter-spacing: -0.025em;
}

.section-subtitle {
  margin-top: 0.4rem;
  line-height: 1.65;
}

.welcome-card,
.info-card,
.news-widget,
.sidebar-widget,
.event-month-card,
.access-info-card,
.bulletin-box,
.letter-preview-area {
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-sm);
}

.welcome-card,
.news-widget,
.access-info-card {
  padding: clamp(1.5rem, 3vw, 2.25rem);
}

.welcome-card p,
.info-card-desc,
.news-title,
.sidebar-widget p,
.info-text p,
.footer-address,
.footer-menu-link,
.timeline-content,
.event-month-body {
  font-size: 1rem !important;
}

.info-card {
  padding: 1.75rem;
  min-height: 205px;
}

.info-card-btn {
  min-height: 44px;
  font-size: 1rem;
  align-items: center;
}

.news-list {
  gap: 0;
}

.news-item {
  padding: 1rem 0;
  gap: 1.25rem;
}

.news-date {
  font-size: 0.95rem;
}

.news-tag {
  font-size: 0.85rem;
  padding: 0.2rem 0.6rem;
}

.school-table th,
.school-table td {
  padding: 1rem 1.25rem;
  font-size: 1rem;
}

.timeline-content {
  padding: 1.2rem 1.5rem;
}

.event-month-header {
  min-height: 54px;
  font-size: 1.2rem;
}

.letter-section-layout {
  grid-template-columns: minmax(240px, 290px) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.letter-selector {
  position: sticky;
  top: 108px;
}

.year-select {
  min-height: 50px;
  font-size: 1.05rem !important;
  background: #fff;
}

.letter-select-btn {
  min-height: 58px;
  padding: 0.85rem 1rem;
  font-size: 1.05rem;
  border-width: 2px;
}

.letter-preview-area {
  min-height: 0;
  padding: clamp(1.25rem, 2.5vw, 2rem);
}

.letter-preview-title {
  font-size: clamp(1.3rem, 2vw, 1.65rem);
}

.btn-large-pdf {
  min-height: 52px;
  padding: 0.8rem 1.25rem;
  font-size: 1rem;
  border-radius: 12px;
}

.pdf-embed-container {
  height: clamp(650px, 76vh, 920px) !important;
  min-height: 650px;
  border-radius: 14px !important;
  border: 1px solid #cbd5e1 !important;
  background: #475569 !important;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.25);
}

.pdf-embed-container iframe {
  display: block;
  width: 100%;
  height: 100%;
  background: #475569;
}

.bulletin-box {
  max-width: 960px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
}

.copyright {
  font-size: 0.95rem;
  color: #94a3b8;
}

@media (max-width: 1200px) {
  .header-container {
    min-height: 64px;
  }

  .main-nav {
    max-width: 340px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .main-nav .nav-menu {
    width: 100%;
    max-width: none;
    overflow: visible;
    flex-wrap: nowrap;
  }

  .nav-link {
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
  }
}

@media (min-width: 1201px) {
  .header-container {
    height: auto;
    min-height: 92px;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    gap: 1rem 1.5rem;
  }

  .branding {
    max-width: 330px;
  }

  .main-nav {
    flex: 1 1 720px;
    justify-content: flex-end;
  }

  .nav-menu {
    width: 100%;
    row-gap: 0.25rem;
  }

  .nav-link {
    min-height: 40px;
    padding: 0.4rem 0.7rem;
  }
}

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

  .letter-selector {
    position: static;
  }

  .letter-buttons-container {
    flex-direction: row !important;
    gap: 0.65rem !important;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding: 0.15rem 0.1rem 0.65rem;
    scrollbar-width: thin;
  }

  .letter-select-btn {
    flex: 0 0 auto;
    min-width: 145px;
    scroll-snap-align: start;
  }
}

@media (max-width: 768px) {
  :root {
    --font-base-size: 16.5px;
  }

  html.size-small {
    --font-base-size: 16px;
  }

  html.size-large {
    --font-base-size: 19px;
  }

  .main-wrapper {
    margin: 2rem auto;
    padding: 0 1rem;
  }

  .hero-section {
    height: 320px;
  }

  .hero-title {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .contact-items {
    gap: 0.6rem 1.25rem;
  }

  .section-header {
    margin-bottom: 1.5rem;
  }

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

  .info-card {
    min-height: 0;
  }

  .news-item {
    flex-direction: column;
    gap: 0.35rem;
  }

  .school-table {
    display: block;
    overflow-x: auto;
  }

  .letter-preview-header {
    align-items: stretch;
  }

  .letter-preview-header .btn-large-pdf {
    width: 100%;
    justify-content: center;
  }

  .pdf-embed-container {
    height: auto !important;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    color: #fff;
  }

  .pdf-embed-container iframe {
    display: none;
  }

  .pdf-embed-container::before {
    content: 'スマートフォンでは、上のPDFボタンから全画面でご覧ください。';
    max-width: 24rem;
    font-weight: 700;
    line-height: 1.7;
  }

  .bulletin-box {
    padding: 1.25rem;
  }

  .site-footer {
    margin-top: 3rem;
    padding-top: 3rem;
  }
}
}

/* ==========================================================================
   Focused usability fixes (original visual design is intentionally preserved)
   ========================================================================== */

/* ヘッダーは横スクロールさせず、PCでは必要に応じて折り返す */
.main-nav,
.nav-menu {
  overflow: visible;
}

.nav-menu {
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* 小さかった本文系テキストだけを読みやすくする */
.section-subtitle,
.info-card-desc,
.news-title,
.sidebar-widget p,
.info-text p,
.footer-address,
.footer-menu-link,
.event-month-body {
  font-size: 1rem !important;
}

.news-date {
  font-size: 0.95rem;
}

.news-tag {
  font-size: 0.82rem;
}

.year-select,
.letter-select-btn {
  font-size: 1rem !important;
}

.letter-preview-title {
  font-size: 1.35rem;
}

@media (min-width: 1201px) {
  .header-container {
    height: auto;
    min-height: var(--header-height);
    flex-wrap: wrap;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    gap: 0.25rem 1rem;
  }

  .main-nav {
    flex: 1 1 720px;
    justify-content: flex-end;
  }

  .nav-menu {
    width: 100%;
    row-gap: 0.15rem;
  }

  .nav-link {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

@media (max-width: 1200px) {
  .main-nav {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .main-nav .nav-menu {
    width: 100%;
    max-width: none;
    overflow: visible;
    flex-wrap: nowrap;
  }
}
