/* ============================================
   MCT-Lab Homepage - Common Styles
   Color: Sky Blue Theme
   ============================================ */

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

:root {
  --sky-blue: #7EC8E3;
  --sky-blue-light: #B8E4F0;
  --sky-blue-pale: #E8F4F8;
  --accent: #2C5F7C;
  --accent-dark: #1A3A4A;
  --text-primary: #2D3436;
  --text-secondary: #636E72;
  --bg-white: #FFFFFF;
  --bg-light: #F7FAFB;
  --border-light: #DFE6E9;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
  --radius: 8px;
  --transition: 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--text-primary);
  background: var(--bg-light);
  line-height: 1.8;
  font-size: 16px;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--sky-blue);
}

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

/* --- Header --- */
.site-header {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: white;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
}

.site-logo:hover {
  color: var(--sky-blue-light);
}

.site-logo .lab-name {
  font-size: 0.75rem;
  opacity: 0.85;
  display: block;
}

/* Language switcher */
.lang-switch {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  transition: all var(--transition);
  margin-left: 12px;
  white-space: nowrap;
}

.lang-switch:hover {
  color: white;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.7);
}

/* --- Navigation --- */
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
}

.main-nav a {
  color: rgba(255, 255, 255, 0.85);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
  color: white;
  background: rgba(255, 255, 255, 0.15);
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown > a {
  cursor: pointer;
}

.nav-dropdown > a::after {
  content: ' \25BE';
  font-size: 0.7em;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--accent-dark);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  min-width: 180px;
  z-index: 1001;
  padding: 4px 0;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu a {
  display: block;
  padding: 10px 16px;
  border-radius: 0;
  font-size: 0.85rem;
}

.nav-dropdown-menu a:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border: none;
  background: transparent;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: all var(--transition);
}

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

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

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, rgba(44, 95, 124, 0.85), rgba(126, 200, 227, 0.8)),
              url('../images/bg/dna-helix.jpg') center/cover no-repeat;
  color: white;
  padding: 80px 20px;
  text-align: center;
  position: relative;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero .subtitle {
  font-size: 1.1rem;
  opacity: 0.95;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.hero .affiliation {
  font-size: 0.95rem;
  opacity: 0.85;
}

/* --- Page Background with science pattern --- */
.page-bg-molecules {
  background: linear-gradient(180deg, rgba(247, 250, 251, 0.92), rgba(232, 244, 248, 0.92)),
              url('../images/bg/molecules.jpg') center/cover no-repeat fixed;
}

.page-bg-microscope {
  background: linear-gradient(180deg, rgba(247, 250, 251, 0.93), rgba(232, 244, 248, 0.93)),
              url('../images/bg/microscope.jpg') center/cover no-repeat fixed;
}

.page-bg-cells {
  background: linear-gradient(180deg, rgba(247, 250, 251, 0.92), rgba(232, 244, 248, 0.92)),
              url('../images/bg/lab-cells.jpg') center/cover no-repeat fixed;
}

/* --- Section Decorative Background --- */
.section-bg {
  position: relative;
  padding: 48px 0;
  margin: 0 -9999px;
  padding-left: 9999px;
  padding-right: 9999px;
}

.section-bg-light {
  background: linear-gradient(180deg, var(--sky-blue-pale), rgba(255, 255, 255, 0.6));
}

.section-bg-accent {
  background: linear-gradient(135deg, rgba(44, 95, 124, 0.06), rgba(126, 200, 227, 0.08));
}

/* --- Content Image in Research Pages --- */
.content-image {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 16px 0;
}

.content-image-float-right {
  float: right;
  max-width: 45%;
  margin: 0 0 16px 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.content-image-float-left {
  float: left;
  max-width: 45%;
  margin: 0 24px 16px 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

/* --- Main Content --- */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* --- Section --- */
.section {
  margin-bottom: 48px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  padding-bottom: 12px;
  margin-bottom: 24px;
  border-bottom: 3px solid var(--sky-blue);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 24px;
  background: var(--sky-blue);
  border-radius: 2px;
}

/* --- Card --- */
.card {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  transition: box-shadow var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

/* --- Topics --- */
.topics-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.topic-item {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  display: flex;
  gap: 16px;
  transition: box-shadow var(--transition);
}

.topic-item:hover {
  box-shadow: var(--shadow-hover);
}

.topic-date {
  color: var(--sky-blue);
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  min-width: 90px;
}

.topic-content h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.topic-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.topic-image {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

/* --- Research Card --- */
.research-card {
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  display: block;
}

.research-card:hover {
  box-shadow: 0 8px 30px rgba(44, 95, 124, 0.2);
  transform: translateY(-4px);
}

.research-card .card-header {
  background: linear-gradient(135deg, var(--sky-blue), var(--accent));
  color: white;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.research-card .card-header::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.research-card .card-header h3 {
  font-size: 1.15rem;
  position: relative;
  z-index: 1;
}

.research-card .card-body {
  padding: 24px;
}

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

/* --- Gallery (Activities) --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.gallery-item {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

.gallery-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.gallery-item .gallery-info {
  padding: 16px;
}

.gallery-item .gallery-info h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

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

.gallery-item .gallery-date {
  color: var(--sky-blue);
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 8px;
}

/* --- Members --- */
.member-section {
  margin-bottom: 32px;
}

.member-section h3 {
  font-size: 1.15rem;
  color: var(--accent);
  margin-bottom: 16px;
  padding-left: 12px;
  border-left: 3px solid var(--sky-blue);
}

.member-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.member-item {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}

.member-item .name {
  font-weight: 600;
  font-size: 0.95rem;
}

.member-item .role {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-top: 4px;
}

/* --- Table --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.data-table th {
  background: var(--accent);
  color: white;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
}

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

.data-table tr:hover td {
  background: var(--sky-blue-pale);
}

/* --- Achievement list --- */
.achievement-year {
  margin-bottom: 32px;
}

.achievement-year h3 {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 3px solid var(--sky-blue);
}

.achievement-list {
  list-style: none;
  padding: 0;
}

.achievement-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
  line-height: 1.7;
}

.achievement-list li:last-child {
  border-bottom: none;
}

/* --- Footer --- */
.site-footer {
  background: linear-gradient(135deg, var(--accent-dark), #0d2530),
              url('../images/bg/molecules.jpg') center/cover no-repeat;
  background-blend-mode: overlay;
  color: rgba(255, 255, 255, 0.8);
  padding: 40px 20px;
  text-align: center;
  font-size: 0.85rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--sky-blue-light);
}

.footer-contact {
  margin-bottom: 16px;
}

.footer-sns {
  margin-bottom: 16px;
}

.footer-sns a {
  color: var(--sky-blue-light);
  font-weight: 500;
}

/* --- Admin Page --- */
.admin-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

.auth-form {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 24px;
}

.auth-form h2 {
  color: var(--accent);
  margin-bottom: 20px;
  font-size: 1.3rem;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--sky-blue);
  box-shadow: 0 0 0 3px rgba(126, 200, 227, 0.2);
}

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

.btn {
  display: inline-block;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

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

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-secondary {
  background: var(--sky-blue);
  color: white;
}

.btn-secondary:hover {
  background: var(--accent);
}

.btn-danger {
  background: #e74c3c;
  color: white;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-sm {
  padding: 6px 16px;
  font-size: 0.85rem;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

.hidden {
  display: none !important;
}

/* --- Lightbox (写真拡大) --- */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90%;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 2001;
  line-height: 1;
  transition: opacity var(--transition);
}

.lightbox-close:hover {
  opacity: 0.7;
}

/* Tabs for admin */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 0;
}

.admin-tab {
  padding: 10px 20px;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  font-family: inherit;
}

.admin-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.admin-tab:hover {
  color: var(--accent);
}

/* Image preview */
.image-preview {
  margin-top: 8px;
  max-width: 200px;
  border-radius: var(--radius);
  overflow: hidden;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.loading::after {
  content: '';
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--sky-blue-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--accent-dark);
    padding: 16px;
    box-shadow: var(--shadow);
  }

  .main-nav.open {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 4px;
  }

  .main-nav a {
    display: block;
    padding: 12px 16px;
  }

  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0;
    padding: 0;
  }

  .nav-dropdown .nav-dropdown-menu {
    display: none;
  }

  .nav-dropdown.open .nav-dropdown-menu {
    display: block;
  }

  .nav-dropdown-menu a {
    padding-left: 32px;
    font-size: 0.85rem;
  }

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

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

  .main-content {
    padding: 24px 16px;
  }

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

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

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .topic-item {
    flex-direction: column;
    gap: 8px;
  }

  .topic-image {
    width: 100%;
    height: 160px;
  }

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

  .data-table {
    font-size: 0.8rem;
  }

  .data-table th,
  .data-table td {
    padding: 8px 10px;
  }

  .header-inner {
    height: 60px;
  }

  .admin-tabs {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .member-list {
    grid-template-columns: 1fr;
  }

  .footer-links {
    flex-direction: column;
    gap: 8px;
  }
}
