@import url('https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@400;500;700&display=swap');
@import url('variables.css');

/* ==========================================================================
   Base Styles
   ========================================================================== */
body {
  font-family: var(--font-family-base);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.8;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  color: var(--color-primary);
  line-height: 1.4;
}

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

a:hover {
  opacity: 0.7;
}

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

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

.max-w-narrow {
  max-width: 800px;
  margin: 0 auto;
}

.section {
  padding: var(--space-xl) 0;
  position: relative;
  border-bottom: 2px dashed var(--color-secondary);
}

.section-title {
  font-size: 2rem;
  margin-bottom: var(--space-md);
  font-weight: 700;
}

/* ==========================================================================
   Decorations & World Building (学校風のあしらい)
   ========================================================================== */
/* マーカー風の下線 */
.marker-line {
  background: linear-gradient(transparent 60%, rgba(212, 175, 55, 0.4) 60%);
  display: inline-block;
  padding: 0 0.5rem;
}

/* 画用紙・プリント風の背景 */
.paper-bg {
  background-color: var(--color-white);
  box-shadow: 0 0 20px rgba(0,0,0,0.02) inset;
}

/* ノート風の背景 */
.notebook-bg {
  background-color: var(--color-white);
  background-image: repeating-linear-gradient(
    transparent,
    transparent 31px,
    var(--color-border) 32px
  );
  background-position: 0 1.5rem;
}

/* 黒板・掲示板風の背景 */
.board-bg {
  background-color: var(--color-primary);
  color: var(--color-bg);
  border: 12px solid var(--color-accent);
  border-radius: 12px;
  padding: 3rem 2rem;
  box-shadow: 0 10px 20px rgba(0,0,0,0.2), inset 0 0 30px rgba(0,0,0,0.5);
  margin: 0 auto 2rem;
}
.board-bg h2, .board-bg h3, .board-bg p {
  color: var(--color-white);
}

/* スクラップブック風の背景 */
.scrapbook-bg {
  background-color: var(--color-bg);
  background-image: radial-gradient(var(--color-secondary) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Global Navigation */
.global-nav {
  background-color: var(--color-white);
  border-bottom: 2px solid var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
}
.nav-logo {
  font-weight: bold;
  font-size: 1.2rem;
  color: var(--color-primary);
  text-decoration: none;
}
.nav-list {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: bold;
  font-size: 1rem;
  transition: color 0.2s;
}
.nav-list a:hover {
  color: var(--color-accent);
}
@media (max-width: 767px) {
  .nav-container {
    flex-direction: column;
    gap: 0.5rem;
  }
  .nav-list {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
}


/* テープで貼ったような見出し */
.taped-title {
  display: inline-block;
  background-color: var(--color-white);
  padding: 0.5rem 1rem;
  margin-bottom: var(--space-md);
  border: 1px solid var(--color-border);
  box-shadow: 2px 2px 5px rgba(0,0,0,0.05);
  position: relative;
  transform: rotate(-1deg);
  margin-bottom: 1rem;
}
.taped-title::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(2deg);
  width: 80px;
  height: 15px;
  background-color: rgba(212, 175, 55, 0.4);
}

/* プリント風カード */
.printout-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  padding: var(--space-md);
  box-shadow: 2px 2px 5px rgba(0,0,0,0.05);
  position: relative;
}
.printout-card::before {
  /* クリップ風 */
  content: '';
  position: absolute;
  top: -10px;
  left: 20px;
  width: 15px;
  height: 30px;
  border: 2px solid var(--color-secondary);
  border-radius: 10px;
  background-color: transparent;
}

/* ==========================================================================
   Components
   ========================================================================== */
.btn {
  display: inline-block;
  background-color: var(--color-accent);
  color: var(--color-text);
  padding: 0.8rem 2rem;
  border-radius: 30px;
  font-weight: bold;
  text-align: center;
  box-shadow: 0 4px 0 var(--color-primary);
  border: 2px solid var(--color-primary);
  transition: all 0.2s ease;
}
.btn:hover {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--color-primary);
  opacity: 1;
}
.btn-large {
  font-size: 1.2rem;
  padding: 1rem 3rem;
}
.btn-outline {
  background-color: transparent;
  color: var(--color-bg);
  border-color: var(--color-bg);
  box-shadow: 0 4px 0 var(--color-bg);
}
.btn-outline:hover {
  box-shadow: 0 2px 0 var(--color-bg);
}
.btn.disabled {
  background-color: var(--color-border);
  color: var(--color-text);
  box-shadow: 0 4px 0 var(--color-secondary);
  border-color: var(--color-secondary);
  pointer-events: none;
}

.card {
  background-color: var(--color-white);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: 4px 4px 0px var(--color-secondary);
  position: relative;
}

.info-card {
  background-color: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  display: inline-block;
  text-align: left;
}
.info-card-title {
  color: var(--color-accent);
  font-size: 1rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding-bottom: 0.5rem;
}
.info-card-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Official Events Area */
.official-events-area {
  margin: 3rem 0;
}
.event-card {
  display: flex;
  flex-direction: column;
}
.event-image-placeholder,
.event-image {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
}
.event-image-placeholder {
  background-color: var(--color-bg);
  border: 2px dashed var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 0.9rem;
}
.event-image {
  object-fit: contain;
  border: 1px solid rgba(0,0,0,0.05);
}
.event-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 1rem;
}
.event-card-body .event-title {
  margin: 0;
  font-size: 1.3rem;
}
.event-card-body p {
  margin: 0;
  line-height: 1.6;
}
.event-card-body .btn {
  margin-top: auto;
}
.event-label {
  display: inline-block;
  padding: 0.3rem 1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--color-white);
  margin-bottom: 0;
}
.label-x { background-color: #1da1f2; }
.label-intro { background-color: #ff7a59; color: var(--color-white); }
.label-pre { background-color: var(--color-accent); }
.label-collab { background-color: #8a2be2; }
.event-title {
  margin: 0.5rem 0;
}

/* ==========================================================================
   Grids & Layout utilities
   ========================================================================== */
.grid { display: grid; gap: var(--space-md); }
.text-center { text-align: center; }
.text-small { font-size: 0.85rem; color: #555; }
.text-accent { color: var(--color-accent) !important; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }

/* Grid columns */
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-2-pc { grid-template-columns: repeat(2, 1fr); }
  .grid-3-pc { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-4-pc { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 767px) {
  .grid-4-pc { grid-template-columns: repeat(2, 1fr); }
  .info-card-list { flex-direction: column; gap: 0.5rem; }
}

/* ==========================================================================
   Specific Sections
   ========================================================================== */
/* Hero */
.hero {
  padding: var(--space-lg) 0 0;
  background-color: var(--color-bg);
}
.hero-image-wrapper {
  width: 100%;
  max-width: 1200px;
  margin: var(--space-lg) auto 0;
  position: relative;
}
.hero-image {
  width: 100%;
  height: auto;
  display: block;
}
.hero-title-area {
  max-width: 700px;
  margin: 0 auto;
  border-width: 3px;
  border-color: var(--color-primary);
}
.hero-label {
  font-weight: bold;
  color: var(--color-accent);
  margin-bottom: 0.2rem;
  font-size: 0.9rem;
}
.hero-title {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.hero-subtitle {
  font-size: 1.2rem;
  color: var(--color-text);
}

@media (min-width: 768px) {
  .hero-title { font-size: 2.2rem; }
  .hero-subtitle { font-size: 1.4rem; }
  .hero-label { font-size: 1rem; margin-bottom: 0.5rem; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Departments */
.img-placeholder {
  background-color: var(--color-border);
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  color: #888;
  font-size: 0.9rem;
}

/* Guide Cards */
.guide-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.guide-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 2px solid var(--color-primary);
  margin-bottom: 1rem;
}
@media (min-width: 768px) {
  .guide-card {
    flex-direction: row;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
  }
  .guide-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 2rem;
  }
  .guide-content h3 { margin: 0; min-width: 150px; }
  .guide-content p { margin: 0; flex-grow: 1; }
  .guide-content .btn { margin-top: 0; white-space: nowrap; }
}

/* Lists */
.info-list, .facility-list, .shop-list, .news-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.info-list dt { font-weight: bold; margin-top: 0.5rem; color: var(--color-primary); }
.info-list dd { margin-left: 0; margin-bottom: 0.5rem; border-bottom: 1px dashed var(--color-border); }
.facility-list li, .shop-list li {
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--color-border);
  display: flex;
  justify-content: space-between;
}
.facility-list li::before, .shop-list li::before {
  content: '✓';
  color: var(--color-accent);
  margin-right: 0.5rem;
  font-weight: bold;
}
.news-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px dashed var(--color-border);
}
.news-list time { font-weight: bold; color: var(--color-primary); }

/* Member Avatar */
.member-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  border: 3px solid var(--color-primary);
  box-shadow: 2px 2px 0 var(--color-secondary);
  display: block;
}

/* Large Member Card (Vertical layout for huge images) */
.member-card-large {
  display: flex;
  flex-direction: column;
  gap: 1.5rem; /* 画像と文字の間隔を少し広げてバランス良く */
  text-align: left;
}
.member-card-large .member-avatar {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 0;
  display: block;
}
@media (max-width: 767px) {
  .member-card-large {
    text-align: center;
  }
}
.member-profile {
  flex: 1;
}
.member-profile-text {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.6;
}

.principal-greeting-area {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
@media (min-width: 768px) {
  .principal-greeting-area {
    flex-direction: row;
    align-items: flex-start;
  }
}
.principal-figure {
  margin: 0;
  text-align: center;
  flex-shrink: 0;
  width: 120px;
}
@media (max-width: 767px) {
  .principal-figure {
    margin: 0 auto;
  }
}
.principal-photo {
  width: 120px;
  height: auto;
  border-radius: var(--radius-sm);
  border: 2px solid var(--color-primary);
  box-shadow: 3px 3px 0 var(--color-secondary);
}
.principal-figure figcaption {
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--color-primary);
  margin-top: 0.5rem;
}
.principal-message {
  flex: 1;
}
.principal-message p {
  margin: 0;
}

/* 施設案内レイアウト（ポラロイド風） */
.facility-main-photo {
  width: 100%;
  height: auto;
  border: 4px solid var(--color-white);
  border-radius: 2px;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
}
.facility-photo-grid {
  gap: 12px;
}
.photo-card {
  background-color: var(--color-white);
  padding: 8px 8px 4px 8px;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.1);
  text-align: center;
  border-radius: 2px;
}
.photo-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  object-fit: cover;
  border: 1px solid rgba(0,0,0,0.05);
}
.photo-card p {
  font-size: 0.8rem;
  font-weight: bold;
  margin: 0.5rem 0;
  color: var(--color-text);
}

/* Shop Menu Grid */
.shop-menu-grid {
  gap: 1rem;
}
.shop-item-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--color-primary);
  margin-bottom: 0.5rem;
  display: block;
}
.shop-title {
  margin-bottom: var(--space-md);
}
.shop-item p {
  margin: 0;
  font-weight: bold;
  line-height: 1.3;
}

/* FAQ Accordion */
.faq-item {
  margin-bottom: 0.5rem;
}
.faq-question {
  width: 100%;
  text-align: left;
  background-color: var(--color-white);
  border: 2px solid var(--color-primary);
  padding: 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: background-color 0.2s;
  color: var(--color-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-question:hover {
  background-color: var(--color-bg);
}
.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  line-height: 1;
}
.faq-question.is-open::after {
  content: '-';
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background-color: var(--color-white);
  border: 2px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.faq-answer p {
  padding: 1rem;
  margin: 0;
}

/* Footer */
.site-footer {
  background-color: var(--color-text);
  color: var(--color-white);
  padding: var(--space-xl) 0 var(--space-md);
}
.site-footer h2 { color: var(--color-white); margin-bottom: 0; }
.footer-sub { font-size: 1rem; font-weight: normal; }
.flex-center {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
}
.flex-center a.social-btn {
  color: var(--color-secondary);
  display: inline-block;
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  border: 2px solid var(--color-secondary);
  font-weight: bold;
  text-decoration: none;
  transition: all 0.3s ease;
}
.flex-center a.social-btn:hover {
  background-color: var(--color-secondary);
  color: var(--color-text);
  transform: translateY(-2px);
}
.copyright { color: var(--color-secondary); }

/* Lightbox (画像拡大) */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  display: none; /* JSでflexに変更 */
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
  backdrop-filter: blur(5px);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  animation: zoomIn 0.2s ease-out;
  margin: auto;
}
@keyframes zoomIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.zoomable {
  cursor: zoom-in;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.zoomable:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
  line-height: 1;
  user-select: none;
}
.lightbox-close:hover,
.lightbox-close:focus {
  color: #bbb;
  text-decoration: none;
}

.category-icon {
  width: 2.5em;
  height: 2.5em;
  vertical-align: middle;
  margin-right: 1rem;
  object-fit: contain;
}

html {
  scroll-behavior: smooth;
}

.prof-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin-bottom: 0;
}
.prof-image-placeholder {
  width: 100%;
  aspect-ratio: 4/5;
  background-color: var(--color-bg);
  border: 2px dashed var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  font-weight: bold;
  border-radius: var(--radius-sm);
  margin-bottom: 0;
}

.prof-card {
  padding: 0;
  overflow: hidden;
  aspect-ratio: 4/5;
}
.prof-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.prof-image-placeholder {
  width: 100%;
  aspect-ratio: 4/5;
  background-color: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  font-weight: bold;
}

.category-icon {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-right: 16px;
  vertical-align: middle;
}

.prof-category-title {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-border);
}


/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--color-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.2s ease;
  z-index: 1000;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}



/* Cheki Gallery */
.cheki-card {
  padding: 0;
  background-color: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
}
.cheki-image {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
  transition: transform 0.2s;
}
.cheki-image:hover {
  transform: translateY(-3px);
}
.cheki-image-placeholder {
  width: 100%;
  aspect-ratio: 2/3;
  background-color: rgba(255,255,255,0.7);
  border: 2px dashed #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  font-size: 0.9rem;
  border-radius: 4px;
}

/* Cheki Gallery */
.cheki-card {
  padding: 0;
  background-color: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
}
.cheki-image {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
  transition: transform 0.2s;
}
.cheki-image:hover {
  transform: translateY(-3px);
}
.cheki-image-placeholder {
  width: 100%;
  aspect-ratio: 2/3;
  background-color: rgba(255,255,255,0.7);
  border: 2px dashed #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  font-size: 0.9rem;
  border-radius: 4px;
}

