* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Integration of Fonts by Google https://fonts.google.com/noto */
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 400;
  src: local("Noto Sans"), local("Noto Sans-Regular"),
    url(../fonts/NotoSans-Regular.ttf) format("truetype");
}

@font-face {
  font-family: "Noto Sans JP";
  font-style: normal;
  font-weight: 400;
  src: local("Noto Sans JP"), local("Noto Sans JP-Regular"),
    url(../fonts/NotoSansJP-Regular.ttf) format("truetype");
}

/* Integration of Material Icons by Google https://fonts.google.com/icons */
@font-face {
  font-family: "Material Icons";
  font-style: normal;
  font-weight: 400;
  src: local("Material Icons"), local("MaterialIcons-Regular"),
    url(../fonts/MaterialIcons-Regular.ttf) format("truetype");
}

.material-icons {
  font-family: "Material Icons";
  font-weight: normal;
  font-style: normal;
  font-size: 24px; /* Preferred icon sizes 20, 24, 40, 48*/
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;

  /* Support for all WebKit browsers. */
  -webkit-font-smoothing: antialiased;
  /* Support for Safari and Chrome. */
  text-rendering: optimizeLegibility;

  /* Support for Firefox. */
  -moz-osx-font-smoothing: grayscale;

  /* Support for IE. */
  font-feature-settings: "liga";
}

/* Standard Colours for this Project (Variables) */
:root {
  /* Primary Colors */
  --sky-blue: #3396ff;
  --sky-blue-light: #5eb0ff;
  --sky-blue-dark: #1976d2;

  /* Secondary/Contrast Colors */
  --japanese-red: #d32f2f;
  --japanese-red-light: #ef5350;
  --sunrise-red: #c6262e;

  /* Background Colors */
  --bg-black: #000000;
  --bg-dark: #0a0a0a;
  --bg-glass: rgba(10, 10, 20, 0.85);

  /* Text Colors */
  --text-white: #f5f5f5;
  --text-light: rgba(255, 255, 255, 0.9);
  --text-muted: rgba(255, 255, 255, 0.7);

  /* Glass Effects */
  --glass-border: rgba(51, 150, 255, 0.2);
  --glass-shadow: rgba(51, 150, 255, 0.1);

  /* Legacy compatibility */
  --maincolor: var(--sky-blue);
  --subcolor: var(--japanese-red);
}

.maincolor {
  background-color: var(--maincolor);
}
.subcolor {
  background-color: var(--subcolor);
}

/* General settings affecting whole site */

html {
  font-family: "Noto Sans", "Noto Sans JP", "Material Icons", "Segoe UI", Tahoma,
    Geneva, Verdana, sans-serif;
}

body {
  font-size: medium;
  padding: 10px;
  color: var(--text-white);
  background-color: var(--bg-black);
}

h1 {
  font-size: x-large;
  text-align: center;
  overflow: auto;
}

h2 {
  font-size: large;
  text-align: center;
}

h3 {
  text-align: center;
  padding-bottom: 3px;
}

h4 {
  text-align: center;
  padding-bottom: 3px;
}

h5 {
  text-align: center;
  padding-bottom: 3px;
}

ol {
  margin: 0px 0px 10px 30px;
}

li {
  position: relative;
  padding-bottom: 5px;
}

a {
  color: hsl(0, 0%, 100%);
  text-decoration: none;
  cursor: pointer;
}

/* Header settings */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(15px) saturate(180%);
  -webkit-backdrop-filter: blur(15px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
}

header a {
  display: flex;
  align-items: center;
}

/* Logo container removed old fixed dimensions - now handled below */

/* Hamburger Menu Button */
.menu-toggle {
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 0;
  z-index: 1001;
  transition: all 0.3s ease;
}

.menu-toggle span {
  width: 30px;
  height: 3px;
  background: white;
  border-radius: 3px;
  transition: all 0.3s ease;
  display: block;
}

.menu-toggle:hover span {
  background: var(--sky-blue);
  box-shadow: 0 0 10px var(--glass-shadow);
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(9px, 9px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(9px, -9px);
}

/* Off-canvas Navigation */
.offcanvas-menu {
  position: fixed;
  top: 0;
  right: -450px; /* Increased from -400px to hide box-shadow */
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: linear-gradient(
    135deg,
    rgba(10, 20, 40, 0.95) 0%,
    rgba(25, 40, 70, 0.95) 100%
  );
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: -5px 0 30px var(--glass-shadow),
    -2px 0 20px rgba(51, 150, 255, 0.05);
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2000;
  overflow-y: auto;
  padding: 20px;
  border-left: 1px solid var(--glass-border);
}

.offcanvas-menu.active {
  right: 0;
}

.menu-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 30px;
  padding-top: 10px;
}

.menu-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 3rem;
  cursor: pointer;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
  padding: 0;
}

.menu-close:hover {
  color: var(--sky-blue);
  transform: rotate(90deg);
  text-shadow: 0 0 15px var(--glass-shadow);
}

/* Main Navigation Menu */
.menu-main {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-main > li {
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-main > li > a {
  display: block;
  padding: 15px 20px;
  color: white;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 5px;
}

.menu-main > li > a:hover {
  background: rgba(51, 150, 255, 0.15);
  color: var(--sky-blue);
  transform: translateX(5px);
  box-shadow: 0 0 20px rgba(51, 150, 255, 0.1);
}

/* Submenu */
.submenu {
  list-style: none;
  margin: 0;
  padding: 0 0 10px 20px;
  /* Removed max-height: 0 and overflow: hidden to make submenu always visible */
}

.submenu li {
  margin-bottom: 5px;
  border: none;
  padding-bottom: 0;
}

.submenu li a {
  display: block;
  padding: 10px 15px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.95rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.submenu li a:hover {
  background: rgba(51, 150, 255, 0.12);
  color: var(--sky-blue-light);
  transform: translateX(3px);
}

/* Language Switcher in Menu */
.offcanvas-menu .language-switcher {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.offcanvas-menu .language-switcher h3 {
  color: white;
  margin-bottom: 15px;
  font-size: 1.1rem;
  text-align: left;
}

.offcanvas-menu .language-switcher ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.offcanvas-menu .language-switcher ul li {
  padding-bottom: 0;
}

.offcanvas-menu .language-switcher ul li a {
  display: block;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  color: white;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.offcanvas-menu .language-switcher ul li a:hover {
  background: rgba(51, 150, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(51, 150, 255, 0.15);
}

.offcanvas-menu .language-switcher ul li a.active {
  background: rgba(211, 47, 47, 0.25);
  border-color: var(--japanese-red);
  box-shadow: 0 0 20px rgba(211, 47, 47, 0.2);
}

/* Main Content Spacing */
main {
  margin-top: 80px;
  padding: 20px;
}

/* Footer settings */
footer {
  background: rgba(0, 0, 0, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 30px 20px;
  margin-top: 50px;
}

footer .container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
}

footer nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

footer nav ul li {
  padding-bottom: 0;
}

footer nav ul li a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.2s ease;
}

footer nav ul li a:hover {
  color: var(--sky-blue);
}

a.languageswitch {
  color: var(--japanese-red-light);
}

li a {
  margin: 10px;
  position: relative;
  top: 2px;
}

a:hover {
  color: var(--sky-blue);
  text-shadow: 0 0 10px rgba(51, 150, 255, 0.3);
}

.paragraph {
  font-size: large;
}

.container {
  margin: 5px;
  padding: 15px;
}

.navcontainer {
  padding: 15px;
  position: sticky;
  top: 0;
  z-index: 100;
}

[aria-current] {
  color: var(--sky-blue);
  font-style: italic;
  display: inline-flex;
}

article,
aside,
p {
  padding: 5px;
}

img {
  overflow: hidden;
  pointer-events: none;
}

.portrait {
  height: 300px;
  width: 300px;
  padding: 20px;
  border-radius: 50%;
  display: block;
  margin-left: auto;
  margin-right: auto;
  z-index: 1;
}

.preis {
  color: var(--sky-blue);
}

.button {
  background: linear-gradient(
    135deg,
    var(--sky-blue) 0%,
    var(--sky-blue-dark) 100%
  );
  border: none;
  border-radius: 8px;
  color: white;
  padding: 15px 32px;
  text-align: left;
  text-decoration: none;
  margin: 4px 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  width: 100%;
  box-shadow: 0 4px 15px rgba(51, 150, 255, 0.3);
}

.button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 8px rgba(51, 150, 255, 0.2);
}

.button:hover {
  background: linear-gradient(
    135deg,
    var(--sky-blue-light) 0%,
    var(--sky-blue) 100%
  );
  box-shadow: 0 6px 25px rgba(51, 150, 255, 0.4);
  transform: translateY(-2px);
}

.navboxes {
  flex-direction: row;
  justify-content: center;
}

/* Responsive Design - Mobile First */

/* Small tablets and landscape phones (600px and up) */
@media screen and (min-width: 600px) {
  .logo {
    width: 220px;
    height: 70px;
  }

  .portrait {
    float: left;
    z-index: 1;
  }

  article,
  aside {
    column-count: 2;
    column-gap: 40px;
    column-rule-style: solid;
  }

  article.japanshop {
    column-count: 1;
  }

  .container {
    background-color: transparent;
  }

  .container p {
    background-color: transparent;
  }

  .button {
    width: auto;
  }

  .navboxes {
    display: flex;
    flex-wrap: wrap;
  }

  main {
    padding: 30px;
  }

  footer .container {
    padding: 0 30px;
  }
}

/* Tablets (768px and up) */
@media screen and (min-width: 768px) {
  header {
    height: 90px;
    padding: 0 40px;
  }

  .logo {
    width: 250px;
    height: 80px;
  }

  .menu-toggle {
    width: 45px;
    height: 45px;
  }

  .menu-toggle span {
    width: 35px;
    height: 3px;
  }

  .offcanvas-menu {
    width: 420px;
    right: -420px;
  }

  .offcanvas-menu.active {
    right: 0;
  }

  main {
    margin-top: 90px;
    padding: 40px;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }
}

/* Desktop (1024px and up) */
@media screen and (min-width: 1024px) {
  header {
    padding: 0 60px;
  }

  .logo {
    width: 280px;
    height: 90px;
  }

  .offcanvas-menu {
    width: 450px;
    right: -450px;
  }

  .offcanvas-menu.active {
    right: 0;
  }

  main {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 50px;
  }

  .container {
    max-width: 1200px;
    margin: 0 auto;
  }

  article,
  aside {
    column-gap: 60px;
  }
}

/* Large Desktop (1440px and up) */
@media screen and (min-width: 1440px) {
  header {
    padding: 0 80px;
  }

  .logo {
    width: 300px;
    height: 100px;
  }

  main {
    max-width: 1600px;
    padding: 60px 80px;
  }

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.25rem;
  }
}

/* Ultra-wide screens (1920px and up) */
@media screen and (min-width: 1920px) {
  main {
    max-width: 2400px;
    padding: 60px 5%;
  }
}

/* Mobile landscape optimization */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .offcanvas-menu {
    padding: 10px;
  }

  .menu-header {
    margin-bottom: 15px;
  }

  .menu-main > li > a {
    padding: 10px 15px;
    font-size: 1rem;
  }

  .submenu li a {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* In-Menu Language Switcher */
.menu-lang-switcher {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-lang-switcher h3 {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 15px;
  padding-left: 20px;
}

.menu-lang-switcher ul {
  list-style: none;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr; /* Two columns */
  gap: 10px;
}

.menu-lang-switcher li {
  margin: 0;
}

.menu-lang-switcher a {
  display: block;
  text-align: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.menu-lang-switcher a:hover {
  background: rgba(51, 150, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(51, 150, 255, 0.15);
}

.menu-lang-switcher a.active {
  background: rgba(211, 47, 47, 0.25);
  border-color: var(--japanese-red);
  color: #fff;
  box-shadow: 0 0 20px rgba(211, 47, 47, 0.2);
}

/* City Gallery */
.city-gallery {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.city-gallery h2 {
  text-align: left;
  margin-bottom: 20px;
  color: var(--sky-blue);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.gallery-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(51, 150, 255, 0.2);
  border-color: var(--sky-blue);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  /* aspect-ratio: 1 / 1; Removed to allow natural scaling */
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.image-metadata {
  padding: 12px 15px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 20, 0.95) 0%,
    rgba(0, 0, 20, 0.85) 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.image-title {
  font-size: 0.95rem;
  color: var(--sky-blue-light);
  margin: 0 0 8px 0;
  font-weight: 600;
  text-align: left;
  padding: 0;
}

.image-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 10px 0;
  line-height: 1.4;
  text-align: left;
}

.image-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.image-tags .tag {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(51, 150, 255, 0.15);
  border: 1px solid rgba(51, 150, 255, 0.3);
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--sky-blue);
  transition: all 0.2s ease;
}

.image-tags .tag:hover {
  background: rgba(51, 150, 255, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(51, 150, 255, 0.15);
}

/* City Map Section */
.city-map {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.city-map h2 {
  text-align: left;
  margin-bottom: 20px;
  color: var(--sky-blue);
}

#city-map-container {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(51, 150, 255, 0.2);
}

/* Map Info Window Styling */
.map-info-window h3 {
  margin: 0 0 8px 0;
  color: #1a1a1a;
  font-size: 1rem;
  text-align: left;
  padding: 0;
}

.map-info-window p {
  margin: 0 0 8px 0;
  color: #333;
  font-size: 0.9rem;
  padding: 0;
}

.map-info-window a {
  color: var(--sky-blue-dark);
  text-decoration: underline;
  font-size: 0.9rem;
}

.map-info-window a:hover {
  color: var(--sky-blue);
}

/* Logo Styling */
.logo {
  position: relative;
  display: inline-block;
}

/* WebGL Logo Container - Hidden until loaded */
#webgl-logo {
  width: 150px;
  height: 150px;
  cursor: pointer;
  position: relative;
  z-index: 10;
  display: none; /* Hidden by default */
}

/* Show WebGL logo when loaded */
#webgl-logo.loaded {
  display: block;
}

#webgl-logo canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* Fallback static logo - shown by default */
.logo-fallback {
  display: inline-block;
}

/* Hide fallback when WebGL is loaded */
/* Hide fallback when WebGL is loaded - using body class */
body.webgl-loaded .logo-fallback {
  display: none !important;
}

.logo img {
  display: block;
  width: auto;
  height: 80px;
  opacity: 1 !important;
}

/* Responsive logo sizes */
@media (min-width: 768px) {
  .logo img {
    height: 90px;
  }

  #webgl-logo {
    width: 180px;
    height: 180px;
  }
}

@media (min-width: 1024px) {
  .logo img {
    height: 100px;
  }

  #webgl-logo {
    width: 200px;
    height: 200px;
  }
}

/* Gallery Styles */
.city-gallery {
  margin-top: 40px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.gallery-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  background: #222; /* Dark background for images */
}

.gallery-item picture,
.gallery-item img {
  display: block;
  width: 100%;
  height: auto; /* Allow full height for non-square images */
  object-fit: contain; /* Ensure full image is visible */
}

.image-metadata {
  padding: 15px;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  opacity: 0; /* Hidden by default */
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
  max-height: 50%;
  overflow-y: auto;
}

.gallery-item:hover .image-metadata {
  opacity: 1; /* Show on hover */
  transform: translateY(0);
  pointer-events: auto;
}

.image-title {
  margin: 0 0 5px 0;
  font-size: 1rem;
  color: var(--sky-blue);
}

.image-description {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}
