/* ===================================================
   大分高専 専攻科 共通スタイルシート
   Responsive Design / UTF-8
=================================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&family=Noto+Serif+JP:wght@400;700&display=swap');

/* --- CSS Variables --- */
:root {
  --color-primary:     #1a4f8a;   /* 大分高専ブルー */
  --color-primary-dk:  #12346b;
  --color-accent:      #e8a000;   /* ゴールド */
  --color-accent-lt:   #fdf3dc;
  --color-bg:          #f7f8fa;
  --color-surface:     #ffffff;
  --color-text:        #2c2c2c;
  --color-text-sub:    #5a6070;
  --color-border:      #dde2ea;
  --color-mc:          #1a6b4a;   /* MC専攻グリーン */
  --color-es:          #1a508a;   /* ES専攻ブルー */
  --color-header-h:    72px;
  --radius:            8px;
  --radius-lg:         14px;
  --shadow-sm:         0 1px 4px rgba(0,0,0,.08);
  --shadow-md:         0 4px 16px rgba(0,0,0,.10);
  --max-w:             960px;
  --font-sans:         'Noto Sans JP', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  --font-serif:        'Noto Serif JP', 'Hiragino Mincho ProN', serif;
  --transition:        .2s ease;
}

/* --- Reset / Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.75;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent); text-decoration: underline; }

/* ===================================================
   Header
=================================================== */
.site-header {
  background: var(--color-primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--color-header-h);
}
.site-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}
.site-title small {
  display: block;
  font-size: .7rem;
  font-weight: 400;
  font-family: var(--font-sans);
  opacity: .85;
  letter-spacing: .04em;
}
.site-title a { color: #fff; }

/* Hamburger */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #fff;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  transition: var(--transition);
}

/* ===================================================
   Navigation
=================================================== */
.site-nav ul {
  list-style: none;
  display: flex;
  gap: 2px;
}
.site-nav a {
  display: block;
  color: rgba(255,255,255,.9);
  font-size: .8rem;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background var(--transition);
  white-space: nowrap;
}
.site-nav a:hover,
.site-nav a.active {
  background: rgba(255,255,255,.15);
  color: #fff;
  text-decoration: none;
}

/* ===================================================
   Page Hero
=================================================== */
.page-hero {
  background: linear-gradient(135deg, var(--color-primary-dk) 0%, var(--color-primary) 60%, #2a6fba 100%);
  color: #fff;
  padding: 48px 20px 40px;
  text-align: center;
}
.page-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 8px;
}
.page-hero .breadcrumb {
  font-size: .8rem;
  opacity: .75;
}
.page-hero .breadcrumb a { color: rgba(255,255,255,.8); }

/* ===================================================
   Layout
=================================================== */
.page-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 20px 64px;
}
.page-container.with-sidebar {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: start;
}

/* ===================================================
   Sidebar
=================================================== */
.sidebar {
  position: sticky;
  top: calc(var(--color-header-h) + 16px);
}
.sidebar-nav {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.sidebar-nav-title {
  background: var(--color-primary);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  padding: 12px 16px;
  letter-spacing: .05em;
}
.sidebar-nav ul { list-style: none; }
.sidebar-nav li a {
  display: block;
  padding: 10px 16px;
  font-size: .85rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition);
}
.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  background: var(--color-accent-lt);
  color: var(--color-primary);
  text-decoration: none;
}
.sidebar-nav li:last-child a { border-bottom: none; }
.sidebar-section-label {
  background: var(--color-bg);
  color: var(--color-text-sub);
  font-size: .75rem;
  font-weight: 700;
  padding: 8px 16px 4px;
  letter-spacing: .06em;
}

/* ===================================================
   Main Content
=================================================== */
.main-content {
  min-width: 0;
}

/* Section */
.content-section {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 32px;
  margin-bottom: 24px;
}
.content-section:last-child { margin-bottom: 0; }

/* Headings */
.content-section h2 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--color-primary);
  border-left: 4px solid var(--color-accent);
  padding-left: 12px;
  margin-bottom: 20px;
}
.content-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary-dk);
  margin: 20px 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--color-border);
}
.content-section p {
  margin-bottom: 1em;
  font-size: .93rem;
}
.content-section p:last-child { margin-bottom: 0; }

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
  margin-top: 12px;
}
.data-table th {
  background: var(--color-primary);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 500;
  font-size: .82rem;
}
.data-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}
.data-table tbody tr:nth-child(even) td { background: #f4f6fb; }
.data-table tbody tr:hover td { background: var(--color-accent-lt); }

/* Badge MC/ES */
.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  margin-right: 4px;
  vertical-align: middle;
}
.badge-mc { background: #d6f0e4; color: var(--color-mc); }
.badge-es { background: #d6e8f5; color: var(--color-es); }

/* Info / Notice blocks */
.notice {
  border-left: 4px solid var(--color-accent);
  background: var(--color-accent-lt);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  font-size: .88rem;
  margin: 16px 0;
}
.notice-info {
  border-color: var(--color-primary);
  background: #eaf1fb;
}

/* Download list */
.dl-list { list-style: none; }
.dl-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: .9rem;
}
.dl-list li:last-child { border-bottom: none; }
.dl-list .dl-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: #e8eded;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 700;
  color: #c00;
  letter-spacing: -.02em;
}
.dl-list a { color: var(--color-primary); font-weight: 500; }

/* Cards (for index) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  color: var(--color-text);
  display: block;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--color-text);
}
.card-label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: .08em;
  margin-bottom: 6px;
}
.card h3 {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--color-primary-dk);
  border: none;
  padding: 0;
}
.card p {
  font-size: .82rem;
  color: var(--color-text-sub);
  margin: 0;
}

/* Staff table */
.staff-table { font-size: .85rem; }
.staff-table th { white-space: nowrap; }
.staff-section-mc { border-left: 4px solid var(--color-mc); padding-left: 10px; }
.staff-section-es { border-left: 4px solid var(--color-es); padding-left: 10px; }

/* ===================================================
   Index Page Hero
=================================================== */
.index-hero {
  background: linear-gradient(135deg, var(--color-primary-dk) 0%, var(--color-primary) 50%, #2e78c4 100%);
  color: #fff;
  padding: 56px 20px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.index-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 40%, rgba(255,255,255,.07) 0%, transparent 60%);
  pointer-events: none;
}
.index-hero-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 8px;
  position: relative;
}
.index-hero-sub {
  font-size: .9rem;
  opacity: .85;
  margin-bottom: 4px;
}
.index-hero-en {
  font-size: .75rem;
  opacity: .65;
  letter-spacing: .08em;
  margin-bottom: 32px;
}
.hero-tags {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-tag {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: .8rem;
}

/* ===================================================
   Footer
=================================================== */
.site-footer {
  background: var(--color-primary-dk);
  color: rgba(255,255,255,.7);
  text-align: center;
  padding: 24px 20px;
  font-size: .78rem;
  margin-top: auto;
}
.site-footer a { color: rgba(255,255,255,.8); }

/* ===================================================
   Responsive
=================================================== */
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: var(--color-header-h);
    left: 0;
    right: 0;
    background: var(--color-primary-dk);
    box-shadow: var(--shadow-md);
    z-index: 99;
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a {
    border-bottom: 1px solid rgba(255,255,255,.1);
    border-radius: 0;
    padding: 14px 20px;
    font-size: .9rem;
  }
  .page-container.with-sidebar {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    order: 2;
  }
  .main-content { order: 1; }
  .content-section { padding: 20px 16px; }
  .data-table { font-size: .8rem; }
  .data-table th, .data-table td { padding: 7px 10px; }
}
@media (max-width: 480px) {
  .page-hero { padding: 32px 16px 28px; }
  .page-container { padding: 20px 12px 48px; }
  .card-grid { grid-template-columns: 1fr; }
}
