/* Base styles */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #f5f5f5;
  margin: 0;
  padding: 0;
  text-align: center;
  color: #333;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 100%;
  line-height: 1.6;
  word-wrap: break-word;
  min-height: 100vh;
  opacity: 0;
  transition: opacity 0.15s ease-in;
}

body.layout-ready {
  opacity: 1;
}

/* Layout */
#container {
  background: #FFFFFF;
  margin: 0 auto;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  text-align: left;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#header {
  background: #fff;
  padding: 0 30px;
  border-bottom: 1px solid #e0e0e0;
}

#header h1 {
  margin: 0;
  padding: 20px 0;
  color: #2c3e50;
  font-size: 1.5em;
  font-weight: 400;
  letter-spacing: 0.3px;
}

.content-wrapper {
  display: flex;
  flex: 1;
}

#sidebar-container {
  flex-shrink: 0;
  width: 200px;
  background-color: #FFFFFF;
  padding: 20px 15px;
  border-right: 1px solid #f0f0f0;
}

#sidebar1 {
  font: normal 11px Arial, Helvetica, sans-serif;
  position: sticky;
  top: 20px;
}

#mainContent {
  flex: 1;
  padding: 30px 40px;
  min-width: 0;
  max-width: 900px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

#footer {
  padding: 0 30px;
  background: #f8f8f8;
  border-top: 1px solid #eee;
}

#footer p {
  margin: 0;
  padding: 15px 0;
  color: #888;
  font-size: 0.9em;
}

/* Navigation menu styles */
.nav-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-label {
  padding: 0 0 12px 0;
  border-bottom: 2px solid #2c3e50;
  margin-bottom: 8px;
}

.nav-label-text {
  color: #2c3e50;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-item {
  list-style: none;
}

.nav-item a {
  display: block;
  padding: 10px 12px;
  color: #555;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
}

.nav-item a:hover {
  color: #2c3e50;
  background: #f8f9fa;
  border-left-color: #2c3e50;
}

.nav-item.active a {
  color: #2c3e50;
  font-weight: 600;
  border-left-color: #2c3e50;
}

.nav-item.has-submenu a::after {
  content: "›";
  float: right;
  color: #999;
}

/* Language switcher */
.lang-switcher {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 8px;
}

.lang-switcher button {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  color: #666;
  font-size: 11px;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-switcher button:hover {
  border-color: #2c3e50;
  color: #2c3e50;
  background: #f8f9fa;
}

.lang-switcher button.active {
  background: #2c3e50;
  border-color: #2c3e50;
  color: #fff;
}

/* Typography */
h1 {
  color: #2c3e50;
  font-weight: 400;
  margin-top: 0;
  margin-bottom: 1em;
}

h2, h3 {
  color: #2c3e50;
  font-weight: 500;
}

p {
  max-width: 70ch;
  margin-bottom: 1.2em;
}

/* Links */
a {
  color: #2980b9;
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #1a5276;
  text-decoration: underline;
}

/* Article list */
.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-list li {
  padding: 14px 0;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

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

.article-list .article-number {
  color: #888;
  font-size: 0.95em;
  min-width: 24px;
}

.article-list a {
  font-size: 1.05em;
  font-weight: 500;
  color: #2c3e50;
}

.article-list a:hover {
  color: #2980b9;
  text-decoration: none;
}

/* Card grid (for homepage) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  margin-top: 20px;
}

.card {
  background: #fafafa;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.4s ease;
}

.card:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.card .card-image {
  height: 300px;
  background: #f8f8f8;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card img {
  max-width: 80%;
  max-height: 240px;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.card:hover img {
  transform: scale(1.05);
}

.card-content {
  padding: 20px;
}

.card-content p {
  margin: 0;
  font-size: 0.95em;
  color: #555;
  line-height: 1.5;
}

/* Icon gallery grid */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 20px;
}

.icon-card {
  background: #fafafa;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.4s ease;
}

.icon-card:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.icon-card a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 250px;
  background: #f8f8f8;
  overflow: hidden;
}

.icon-card img {
  max-width: 80%;
  max-height: 200px;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.icon-card:hover img {
  transform: scale(1.05);
}

.icon-card-content {
  padding: 15px 20px;
}

.icon-card-content h3 {
  margin: 0 0 5px 0;
  font-size: 1.1em;
}

.icon-card-content .dimensions {
  color: #888;
  font-size: 0.85em;
  margin-bottom: 8px;
}

.icon-card-content p {
  margin: 0;
  font-size: 0.9em;
  color: #666;
}

/* Text alignment */
.text-center {
  text-align: center;
}

/* Legacy table support */
table {
  border-collapse: collapse;
}

td {
  padding: 10px;
  vertical-align: top;
}

/* Lightbox modal */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  z-index: 1000;
  cursor: pointer;
}

.lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: default;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.lightbox-caption {
  color: #333;
  text-align: center;
  margin-top: 20px;
  max-width: 600px;
}

.lightbox-caption h3 {
  color: #2c3e50;
  margin: 0 0 8px 0;
  font-size: 1.3em;
}

.lightbox-caption .dimensions {
  color: #888;
  font-size: 0.9em;
  margin-bottom: 10px;
  display: block;
}

.lightbox-caption p {
  color: #555;
  margin: 0;
  font-size: 0.95em;
  line-height: 1.5;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #666;
  font-size: 2em;
  cursor: pointer;
  transition: color 0.15s ease;
}

.lightbox-close:hover {
  color: #333;
}

/* Audio player */
.audio-player-container {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  padding: 30px 35px;
  margin: 30px 0;
  max-width: 500px;
}

.audio-credits {
  margin-bottom: 25px;
}

.audio-credits p {
  margin: 0;
  font-size: 0.9em;
  color: #555;
  line-height: 1.8;
}

.audio-player {
  width: 100%;
  height: 54px;
  border-radius: 12px;
  outline: none;
}

/* PDF links */
a[href$=".pdf"] {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

a[href$=".pdf"]::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232980b9' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M10 13h4'/%3E%3Cpath d='M10 17h4'/%3E%3Cpath d='M10 9h1'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

/* Biography publication entries */
.publication-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.publication-item {
  padding: 15px 20px;
  margin-bottom: 10px;
  background: #fafafa;
  border-radius: 6px;
  border-left: 3px solid #2c3e50;
}

.publication-item:hover {
  background: #f5f5f5;
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.85em;
  color: #888;
  margin-bottom: 15px;
}

.breadcrumbs a {
  color: #666;
}

.breadcrumbs a:hover {
  color: #2980b9;
}

.breadcrumbs span {
  margin: 0 8px;
  color: #ccc;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

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

.back-to-top:hover {
  background: #f8f8f8;
  border-color: #2c3e50;
}

.back-to-top::before {
  content: "";
  width: 10px;
  height: 10px;
  border-left: 2px solid #2c3e50;
  border-top: 2px solid #2c3e50;
  transform: rotate(45deg);
  margin-top: 4px;
}

/* Responsive design */
@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* Hamburger menu button - hidden on desktop */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  margin-left: auto;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #2c3e50;
  margin: 5px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.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);
}

/* Mobile menu overlay */
.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.menu-overlay.active {
  opacity: 1;
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  #header {
    padding: 0 20px;
    display: flex;
    align-items: center;
  }

  #header h1 {
    font-size: 1.2em;
    flex: 1;
  }

  .content-wrapper {
    flex-direction: column;
  }

  #sidebar-container {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    padding: 20px;
    background: #fff;
    border-right: 1px solid #eee;
    z-index: 999;
    overflow-y: auto;
    transition: left 0.3s ease;
  }

  #sidebar-container.open {
    left: 0;
  }

  #sidebar1 {
    position: static;
  }

  .nav-menu {
    display: block;
  }

  .nav-label {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 10px;
  }

  .nav-item {
    display: block;
  }

  .nav-item a {
    display: block;
    padding: 12px 15px;
    border: none;
    border-radius: 0;
    border-left: 3px solid transparent;
  }

  .nav-item a:hover,
  .nav-item.active a {
    border: none;
    border-left: 3px solid #2c3e50;
    background: #f8f9fa;
  }

  .nav-item.has-submenu a::after {
    display: none;
  }

  .lang-switcher {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    justify-content: flex-start;
  }

  .menu-overlay {
    display: block;
    pointer-events: none;
  }

  .menu-overlay.active {
    pointer-events: auto;
  }

  #mainContent {
    padding: 20px;
  }

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

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}

/* Print styles */
@media print {
  body {
    background: #fff;
    font-size: 11pt;
    line-height: 1.4;
  }

  #container {
    border: none;
    max-width: 100%;
  }

  #header {
    border-bottom: 1px solid #000;
    padding: 10px 0;
  }

  #header h1 {
    font-size: 14pt;
  }

  #sidebar-container,
  .back-to-top,
  .lightbox {
    display: none !important;
  }

  .content-wrapper {
    display: block;
  }

  #mainContent {
    padding: 20px 0;
    max-width: 100%;
  }

  #footer {
    border-top: 1px solid #000;
    background: none;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href$=".pdf"]::after {
    content: " [PDF]";
    background: none;
    width: auto;
    height: auto;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666;
  }

  a[href^="mailto"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666;
  }

  .card-grid,
  .icon-grid {
    display: block;
  }

  .card,
  .icon-card {
    page-break-inside: avoid;
    margin-bottom: 20px;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .card-image,
  .icon-card a {
    height: auto;
    max-height: 200px;
  }

  img {
    max-width: 100% !important;
    max-height: 200px !important;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }

  p {
    orphans: 3;
    widows: 3;
  }
}
