/*
  Global styles shared by index.php and gallery.php
  Theme: minimalist, elegant, with subtle green accents.
*/

:root {
  --bg: #ffffff;
  --text: #222222;
  --muted-text: #5a5a5a;
  --accent: #2e7d32;
  --accent-light: #66bb6a;
  --accent-dark: #1b5e20;
  --border: #e5e7eb;
  --header-height: 64px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Sticky header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: saturate(120%) blur(4px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  height: var(--header-height);
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.brand {
  font-weight: 600;
  color: var(--accent-dark);
}
.nav-links a {
  color: var(--accent);
  text-decoration: none;
  margin-left: 16px;
  border-radius: 6px;
  padding: 6px 10px;
}
.nav-links a:hover, .nav-links a:focus { background: #f0fdf4; outline: none; }

/* Page container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

.muted { color: var(--muted-text); }
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  padding: 10px 14px;
}
.btn:hover, .btn:focus { background: var(--accent-dark); outline: none; }
.btn-secondary {
  background: #fff;
  color: var(--accent-dark);
  border: 1px solid var(--accent);
}
.btn-secondary:hover, .btn-secondary:focus { background: #f0fdf4; }

/* Lightbox */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 24px;
}
.lightbox-backdrop.active { display: flex; }
.lightbox-content {
  max-width: 95vw;
  max-height: 90vh;
  position: relative;
}
.lightbox-content img {
  display: block;
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #fff;
  color: #111;
  border: none;
  border-radius: 999px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 22px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* Gallery grid (column + size values are injected from gallery.php via a <style> tag) */
.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 18px 0;
  flex-wrap: wrap;
}

.gallery-grid {
  display: grid;
  /* grid-template-columns is set dynamically */
  gap: var(--thumb-gap, 16px);
  justify-content: center; /* keep neat and centered */
}
.gallery-item {
  width: var(--thumb-size, 100px);
  height: var(--thumb-size, 100px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--thumb-radius, 8px);
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* crop to keep rows even top/bottom */
  display: block;
}

.gallery-links {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}
.gallery-links a {
  font-size: 14px;
  text-decoration: none;
  color: var(--accent);
}
.gallery-links a[aria-disabled="true"] {
  color: #9aa0a6;
  pointer-events: none;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted-text);
  margin-top: 40px;
  padding: 24px 0;
}

