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

:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-card: #1f2940;
  --accent: #c9a84c;
  --accent-hover: #e0c068;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0b0;
  --text-heading: #ffffff;
  --border: #2a3a5c;
  --shadow: rgba(0, 0, 0, 0.4);
  --font-body: 'Noto Sans', sans-serif;
  --font-heading: 'Noto Serif', serif;
  --radius: 8px;
  --transition: 0.3s ease;
}

* {
  box-sizing: border-box;
}

body {
  width: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(201, 168, 76, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(22, 33, 62, 0.8) 0%, transparent 50%);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#div_center {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ===== HEADER ===== */
#header {
  width: 100%;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  color: var(--text-heading);
  padding: 20px 0 0 0;
  position: relative;
  border-bottom: 2px solid var(--accent);
}

#hieroglyph {
  width: 100%;
  max-width: 750px;
  height: 100px;
  margin: 0 auto;
  text-align: center;
}

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

#kanku {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 120px;
  height: 120px;
  z-index: 10;
}

#kanku img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 2px 8px var(--shadow));
  transition: transform var(--transition);
}

#kanku img:hover {
  transform: scale(1.05);
}

#title1 {
  width: 100%;
  text-align: center;
  padding: 10px 20px 15px 160px;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
}

/* ===== NAVIGATION ===== */
#navigation {
  width: 100%;
  padding: 0 20px 15px 20px;
  text-align: center;
}

#navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

#navigation li {
  margin: 0;
  padding: 0;
}

#navigation a {
  display: inline-block;
  padding: 10px 20px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  transition: all var(--transition);
  letter-spacing: 0.5px;
}

#navigation a:hover,
#navigation a:active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(201, 168, 76, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(201, 168, 76, 0.15);
}

/* Hamburger button */
.hamburger {
  display: none;
  background: none;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 8px 12px;
  cursor: pointer;
  margin: 0 auto 10px auto;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--accent);
  margin: 5px 0;
  transition: all var(--transition);
}

/* ===== CONTENT ===== */
#content {
  width: 100%;
  min-height: 400px;
  padding: 30px 40px;
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: var(--radius);
  margin: 20px 0;
  box-shadow: 0 4px 20px var(--shadow);
}

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

#content a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

#content ul {
  margin: 15px 0;
  padding-left: 0;
}

#content ul li {
  list-style: none;
  padding: 8px 0 8px 24px;
  position: relative;
}

#content ul li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 14px;
}

#content h1 {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-heading);
  text-align: center;
  margin: 20px 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

#content h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  text-indent: 0;
  margin: 25px 0 12px 0;
}

#content h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-heading);
  text-indent: 0;
  margin: 20px 0 10px 0;
}

#content h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  text-indent: 0;
  margin: 15px 0 8px 0;
}

#content p {
  margin: 10px 0;
  text-indent: 0;
}

/* ===== GALLERY (portrait on homepage) ===== */
.gallery1 {
  margin: 20px auto;
  width: 400px;
  max-width: 100%;
  text-align: center;
}

.gallery1 a {
  display: inline-block;
  position: static;
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  transition: all var(--transition);
  user-select: none;
}

.gallery1 a:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(201, 168, 76, 0.2);
  transform: translateY(-4px);
}

.gallery1 a img {
  max-width: 100%;
  height: auto;
  display: block;
  border: none;
  transition: transform var(--transition);
}

.gallery1 a:hover img {
  transform: scale(1.02);
}

.gallery1 a:focus img {
  cursor: default;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 80vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  z-index: 20;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

/* ===== KAYCHO / TITLE BLOCKS ===== */
.kaycho {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-heading);
}

.sekiguti {
  padding-top: 30px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  text-align: center;
}

.text_center {
  text-align: center;
  text-indent: 0;
}

.text_right {
  text-align: right;
  text-indent: 0;
}

/* ===== PAGINATION (video page) ===== */
#navigation2 {
  text-align: center;
  margin: 20px 0;
  padding: 0;
}

#navigation2 ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

#navigation2 ul li {
  display: inline-block;
  margin: 0;
  padding: 0;
}

#navigation2 ul li:first-child {
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 6px;
}

#navigation2 ul li a {
  display: inline-block;
  min-width: 32px;
  padding: 6px 10px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  transition: all var(--transition);
}

#navigation2 ul li a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(201, 168, 76, 0.1);
}

#navigation2 ul li:last-child a {
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}

/* current page (no link) */
#navigation2 ul li:not(:first-child):not(:last-child) {
  padding: 6px 10px;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: rgba(201, 168, 76, 0.1);
}

/* ===== SUB-NAVIGATION (school section) ===== */
.subnav {
  margin: 0 0 30px 0;
  padding: 0;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.subnav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.subnav ul li {
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  list-style: none;
}

.subnav ul li::before {
  content: none;
}

.subnav ul li a {
  display: block;
  padding: 14px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  border-right: 1px solid var(--border);
  transition: all var(--transition);
  position: relative;
}

.subnav ul li:last-child a {
  border-right: none;
}

.subnav ul li a:hover {
  color: var(--accent);
  background: rgba(201, 168, 76, 0.08);
}

.subnav ul li.active a {
  color: var(--accent);
  background: rgba(201, 168, 76, 0.12);
}

.subnav ul li.active a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
}

/* ===== YEAR / JAPAN TRIPS SECTION ===== */
.year {
  margin-top: 40px;
  padding: 0;
  text-align: center;
  text-indent: 0;
}

.year h1 {
  color: var(--accent);
  margin-bottom: 20px;
}

.year > div {
  display: inline-block;
  vertical-align: top;
  width: 280px;
  max-width: 100%;
  margin: 10px 15px;
  padding: 15px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all var(--transition);
  text-align: center;
  overflow: hidden;
  box-sizing: border-box;
}

.year > div:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(201, 168, 76, 0.15);
  transform: translateY(-4px);
}

.year > div img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 0 auto 10px auto;
  display: block;
}

.year > div p {
  font-size: 14px;
  margin: 5px 0;
  text-indent: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.year > div p:last-child a {
  color: var(--accent);
  font-weight: 600;
}

/* ===== PHOTO GALLERY GRID ===== */
#gallery {
  text-align: center;
  text-indent: 0;
  margin: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

#gallery a {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 135px;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: all var(--transition);
  user-select: none;
  background: var(--bg-secondary);
}

#gallery a:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(201, 168, 76, 0.2);
  transform: translateY(-3px);
}

#gallery a img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border: none;
  position: static;
  transition: transform var(--transition);
}

#gallery a:hover img {
  transform: scale(1.05);
}

#gallery a:focus img {
  cursor: default;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  z-index: 20;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

/* ===== TABLES ===== */
table {
  margin: 15px auto 30px auto;
  border-collapse: collapse;
  width: 100%;
  max-width: 800px;
}

tr td {
  padding: 12px 15px;
  border: 1px solid var(--border);
  font-size: 14px;
  vertical-align: top;
  background: var(--bg-secondary);
}

tr td:first-child {
  font-weight: 600;
  color: var(--accent);
}

/* Calendar table */
.calend {
  margin: 0 auto;
}

.calend tr td {
  width: 250px;
  border: 1px solid var(--border);
}

.calend tr:first-child {
  text-align: center;
}

.calend td:first-child {
  text-align: center;
}

/* ===== IFRAME ===== */
iframe {
  display: block;
  margin: 20px auto;
  max-width: 100%;
  border: none;
  border-radius: var(--radius);
}

/* ===== CONTENT BLOCKS ===== */
.content_block {
  display: block;
}

#ul_li {
  padding: 15px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  color: var(--text-primary);
}

#ul_li ul li {
  padding: 0;
  margin: 5px 0;
  font-size: 15px;
  list-style-type: none;
}

/* ===== FOOTER ===== */
#footer {
  width: 100%;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #0f1525 100%);
  color: var(--text-primary);
  padding: 25px 30px;
  margin-top: 30px;
  border-top: 2px solid var(--accent);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

#linder {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

#linder div {
  display: inline-block;
}

#linder img {
  height: 31px;
  width: auto;
  opacity: 0.7;
  transition: opacity var(--transition);
}

#linder img:hover {
  opacity: 1;
}

#jushinru {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

#jushinru div {
  display: inline-block;
}

#jushinru img {
  width: 40px;
  height: 40px;
  transition: transform var(--transition), opacity var(--transition);
  opacity: 0.8;
}

#jushinru img:hover {
  transform: scale(1.15);
  opacity: 1;
}

#contakt {
  color: var(--text-secondary);
}

/* ===== LIGHTBOX ===== */
#lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.92);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.lightbox-hidden {
  display: none !important;
}

#lightbox-image {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

#lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: var(--accent);
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  transition: color var(--transition);
}

#lightbox-close:hover {
  color: var(--accent-hover);
}

#lightbox-prev,
#lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 50px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  user-select: none;
  transition: color var(--transition), transform var(--transition);
}

#lightbox-prev {
  left: 20px;
}

#lightbox-next {
  right: 20px;
}

#lightbox-prev:hover,
#lightbox-next:hover {
  color: var(--accent-hover);
  transform: translateY(-50%) scale(1.1);
}

/* ===== UTILITY ===== */
.kyu {
  margin-top: 40px;
}

/* ===== RESPONSIVE: TABLET ===== */
@media (max-width: 768px) {
  #div_center {
    max-width: 100%;
    padding: 0 10px;
  }

  #header {
    padding: 15px 0 0 0;
  }

  #kanku {
    position: static;
    width: 80px;
    height: 80px;
    margin: 0 auto;
  }

  #hieroglyph {
    height: 60px;
    margin-top: 10px;
  }

  #title1 {
    font-size: 18px;
    padding: 10px 15px;
    letter-spacing: 0;
  }

  /* Hamburger visible */
  .hamburger {
    display: block;
  }

  /* Nav collapsed by default */
  #navigation ul {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 0;
  }

  #navigation ul.active {
    display: flex;
  }

  #navigation a {
    width: 100%;
    max-width: 300px;
    text-align: center;
    padding: 12px 20px;
  }

  #content {
    padding: 20px;
    margin: 15px 0;
  }

  #content h1 {
    font-size: 22px;
  }

  #content h2 {
    font-size: 19px;
  }

  .gallery1 {
    width: 100%;
    max-width: 350px;
  }

  .gallery1 a {
    width: 100%;
  }

  .year > div {
    width: 100%;
    max-width: 350px;
  }

  #gallery {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    margin: 15px;
  }

  #navigation2 ul {
    gap: 3px;
  }

  #navigation2 ul li a {
    min-width: 28px;
    padding: 5px 8px;
    font-size: 13px;
  }

  .subnav ul li a {
    padding: 10px 12px;
    font-size: 13px;
  }

  #footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
  }

  #linder {
    justify-content: center;
  }

  #jushinru {
    justify-content: center;
  }
}

/* ===== RESPONSIVE: MOBILE ===== */
@media (max-width: 480px) {
  #title1 {
    font-size: 16px;
    padding: 8px 10px;
  }

  #kanku {
    width: 60px;
    height: 60px;
  }

  #hieroglyph {
    height: 45px;
  }

  #hieroglyph img {
    max-height: 45px;
  }

  #content {
    padding: 15px;
    font-size: 15px;
    border-radius: 6px;
  }

  #content h1 {
    font-size: 19px;
  }

  #content h2 {
    font-size: 17px;
  }

  #content h3 {
    font-size: 16px;
  }

  #gallery {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 6px;
    margin: 10px;
  }

  #gallery a {
    min-height: 100px;
  }

  #navigation2 ul {
    gap: 2px;
    flex-wrap: wrap;
  }

  #navigation2 ul li a {
    min-width: 26px;
    padding: 4px 6px;
    font-size: 12px;
  }

  .subnav ul {
    flex-direction: column;
  }

  .subnav ul li a {
    padding: 12px 15px;
    font-size: 13px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .subnav ul li:last-child a {
    border-bottom: none;
  }

  .year > div {
    padding: 10px;
    margin: 8px 0;
  }

  #footer {
    padding: 15px;
  }

  #jushinru img {
    width: 32px;
    height: 32px;
  }
}
