:root {
  --bg-color: #fff;
  --text-color: #333;
  --muted-color: #666;
  --border-color: #e0e0e0;
  --link-color: #2a8139;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
}

a {
  color: var(--link-color);
  text-decoration: none;
  font-weight: bold;
}

a:hover {
  text-decoration: underline;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  background-color: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  flex-shrink: 0;
}

.navbar-logo {
  height: 3rem;
  width: auto;
  display: block;
}

.navbar-nav {
  display: flex;
  gap: 0.5rem 1rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: 2rem;
}

.navbar-nav a {
  color: var(--text-color);
  font-size: 0.95rem;
  white-space: nowrap;
}

/* Hamburger button */
.navbar-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-shrink: 0;
}

.navbar-toggle span {
  width: 20px;
  height: 2px;
  background-color: var(--text-color);
  margin: 3px 0;
  transition: 0.3s;
}

/* Main */
.main {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* Footer */
.footer {
  padding: 1.5rem 1.5rem 3rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-color);
  text-align: center;
  color: var(--muted-color);
  font-size: 0.875rem;
  max-width: 800px;
  margin: 0 auto;
}

/* Content */
h1 {
  margin-bottom: 1rem;
}

.content {
  margin-top: 1.5rem;
}

.content h2 {
  margin: 2rem 0 1rem;
}

.content p {
  margin: 1rem 0;
  text-align: justify;
}

.content hr {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 1.5rem 0;
}

.content ul,
.content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.content li {
  margin: 0.5rem 0;
}

/* Page list */
.page-list {
  margin-top: 1.5rem;
}

.page-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.page-item:last-child {
  border-bottom: none;
}

.page-item h2 {
  margin-bottom: 0.5rem;
}

.page-item .summary {
  color: var(--muted-color);
}

/* Responsive */
@media (max-width: 900px) {
  .navbar {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }

  .navbar-brand {
    flex-grow: 1;
  }

  .navbar-toggle {
    display: flex;
  }

  .navbar-nav {
    display: none;
    flex-direction: column;
    gap: 0;
    width: 100%;
    order: 3;
    padding: 0;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
  }

  .navbar-nav.active {
    display: flex;
  }

  .navbar-nav a {
    padding: 0.75rem 1rem;
  }

  .main {
    padding: 2rem 1rem;
  }

  .footer {
    padding: 1.5rem 1rem 2rem 1rem;
  }
}

@media (max-width: 640px) {
  .navbar {
    padding: 0.5rem 0.75rem;
  }

  .navbar-brand {
    font-size: 0.95rem;
    gap: 0.5rem;
  }

  .navbar-logo {
    height: 2.25rem;
  }

  .navbar-nav a {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
  }
}

img[src$='#floatleft'] {
	float: left;
  margin-right: 1rem;
}

img[src$='#floatright'] {
	float: right;
  margin-left: 1rem;
}

/* Gallery styles */
.gallery-list {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

.gallery-preview h2 {
  margin-top: 0;
}

.gallery-preview h2 a {
  text-decoration: none;
  color: var(--text-color);
}

.gallery-preview h2 a:hover {
  color: var(--link-color);
}

.gallery-date {
  font-style: italic;
  color: var(--muted-color);
  margin: 0;
}

.gallery-description,
.gallery-summary {
  color: var(--text-color);
}

.gallery-preview-images {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
  text-decoration: none;
  font-weight: normal;
}

.gallery-preview-images:hover {
  text-decoration: none;
}

.gallery-preview-images img {
  border-radius: 4px;
  transition: opacity 0.2s;
}

.gallery-more {
  grid-column: 1 / -1;
  color: var(--muted-color);
  font-style: italic;
  text-align: center;
  font-size: 0.75rem;
  margin: 0;
}

/* Fancybox gallery */
.fancybox-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.gallery-item {
  margin-bottom: 0;
}

.gallery-item-wrapper {
  position: relative;
  width: 100%;
  padding-top: 66.66666667%; /* 3:2 aspect ratio = 2/3 * 100% = 66.67% */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item-wrapper:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.gallery-item a {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

/* Figure/image styles */
.figure {
  margin: 1.5rem 0;
}

.figure img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.fancybox-image-link {
  display: inline-block;
}

.fancybox-image-link:hover img {
  opacity: 0.9;
}

.caption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted-color);
  font-style: italic;
}

/* Responsive gallery */
@media (max-width: 768px) {
  .fancybox-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-preview-images {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

  .gallery-preview-images {
    grid-template-columns: repeat(2, 1fr);
  }
}
