/* ── CSS Variables (Light & Dark) ─────────────────────── */

:root {
  --bg:         #ffffff;
  --surface:    #ffffff;
  --text:       #000000;
  --muted:      #555555;
  --border:     #cccccc;
  --hover-bg:   #e0e0e0;
  --input-bg:   #ffffff;
  --nav-bg:     #ffffff;
  --nav-border: #cccccc;
  --indicator:  #000000;
  --svg-fill:   #000;
}

[data-theme="dark"] {
  --bg:         #111111;
  --surface:    #1a1a1a;
  --text:       #f0f0f0;
  --muted:      #999999;
  --border:     #333333;
  --hover-bg:   #2a2a2a;
  --input-bg:   #1a1a1a;
  --nav-bg:     #111111;
  --nav-border: #333333;
  --indicator:  #f0f0f0;
  --svg-fill:   #fff;
}

/* ── Reset ─────────────────────────────────────────────── */

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

input, button, textarea, select {
  font-family: inherit;
}

html,
body {
  height: 100%;
  overflow-x: hidden;
  position: relative;
  -webkit-overflow-scrolling: touch;
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 200ms ease, color 200ms ease;
}

body {
  font-family: "Open Sans", sans-serif;
}

a {
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3 {
  font-weight: 700;
}

h1.pgTitle {
  margin-bottom: 40px;
}

p {
  overflow-wrap: break-word;
}


/* ── Top header ─────────────────────────────────────────── */

.top-header {
  width: 100%;
  height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  padding: 0 20px;
  margin-top: 10px;
  border-bottom: 1px solid var(--border);
}

.top-header #logo {
  height: 50px;
  width: auto;
}

.top-header #logo:hover {
  cursor: pointer;
}


/* ── Dark Mode Toggle Button ────────────────────────────── */

#darkToggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease, color 160ms ease;
}

#darkToggle:hover {
  background: var(--hover-bg);
  transform: scale(1.08);
}

#darkToggle svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

/* ── Main content ───────────────────────────────────────── */

.content {
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.grid-container .container {
  margin-top: 0 !important;
  height: 100%;
}

/* ── Image Gallery ──────────────────────────────────────── */

.image-gallery {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding-bottom: 10px;
  scrollbar-width: thin;
}

.image-gallery::-webkit-scrollbar {
  height: 6px;
}

.image-gallery::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.image-gallery img {
  height: 180px;
  width: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: contain;
  background: var(--bg);
}
/* ── Links ──────────────────────────────────────────────── */

.link {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  font-weight: 600;
  font-style: italic;
  color: inherit;
  cursor: pointer;
}

.link:hover {
  text-decoration: none;
  font-weight: 700;
  color: var(--text);
  background: var(--hover-bg);
}

/* ── Container ──────────────────────────────────────────── */

.container {
  border: 1px solid var(--border);
  padding: 30px;
  border-radius: 30px;
  margin-bottom: 8px;
  background: var(--surface);
  transition: background 200ms ease, border-color 200ms ease;
}

/* ── Formatting utilities ───────────────────────────────── */

.bold { font-weight: 700; }
.it   { font-style: italic; }
.u    { text-decoration: underline; }

.mb-5  { margin-bottom: 5px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }
.mt-5  { margin-top: 5px; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }

/* ── Social buttons ─────────────────────────────────────── */

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.socials a {
  padding: 5px 20px;
  border: 1px solid var(--border);
  border-radius: 30px;
  text-decoration: none;
  font-style: normal;
  display: inline-block;
  color: var(--text);
  background: var(--surface);
  transition: background 160ms ease;
}

.socials a:hover {
  background: var(--hover-bg);
}

/* ── Forms (Anon & Contact) ─────────────────────────────── */

#anonForm textarea,
#form .input-minimal {
  width: 100%;
  padding: 20px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 400;
  border: 1px solid var(--border);
  border-radius: 20px;
  box-sizing: border-box;
  background: var(--input-bg);
  color: var(--text);
  margin-bottom: 15px;
}

#anonForm textarea {
  min-height: 200px;
  padding: 30px;
  border-radius: 30px;
  resize: vertical;
}

#anonForm textarea:hover,
#form .input-minimal:hover,
#form .input-minimal:focus {
  outline: none;
  border: 1px solid var(--text);
}

#anonForm button,
#form button {
  display: block;
  margin: 10px 0px 0px auto;
  padding: 5px 20px;
  border: 1px solid var(--border);
  border-radius: 30px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
}

#anonForm button {
  margin-bottom: 120px;
}

#form button {
  margin-bottom: 20px;
}

#anonForm button:hover,
#form button:hover {
  font-weight: 700;
  background: var(--hover-bg);
}

/* ── Bottom navbar ──────────────────────────────────────── */

.bottom-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  bottom: env(safe-area-inset-bottom, 0);
  position: fixed;
  left: 0;
  height: 70px;
  background: var(--nav-bg);
  border-top: 1px solid var(--nav-border);
  z-index: 1000;
  transition: background 200ms ease, border-color 200ms ease;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text);
  width: 100px;
  height: 70px;
  padding: 5px;
  margin: 0;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--hover-bg);
}

.nav-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}


.nav-item span {
  font-size: 13px;
  margin-top: 5px;
  text-align: center;
}

.nav-item.active {
  font-weight: 700;
}

/* Invert black SVG icons to white in dark mode */
[data-theme="dark"] .nav-icon {
  filter: invert(1);
}

#nav-indicator {
  position: absolute;
  top: -1px;
  height: 2px;
  background-color: var(--indicator);
  border-radius: 1px;
  width: 0;
  left: 0;
  z-index: 1001;
}

/* ── Footer ─────────────────────────────────────────────── */

.footer {
  padding: 40px 20px 120px 20px;
  max-width: 800px;
  margin: 0 auto;
  font-size: 15px;
  color: var(--muted);
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 600px) {
  .bottom-nav {
    justify-content: space-between;
  }

  .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0;
    margin: 0;
    width: auto;
  }

  .nav-icon {
    width: 25px;
    height: 25px;
  }

  .nav-item span {
    font-size: 11px;
    margin-top: 3px;
  }

  .content {
    padding: 15px;
  }
}

@media (max-width: 400px) {
  .nav-item {
    height: 100%;
    padding: 0;
  }

  .nav-icon {
    width: 20px;
    height: 20px;
  }

  .nav-item span {
    font-size: 10px;
  }
}

/* ── Image Modal ────────────────────────────────────────── */
.image-modal {
  display: none; 
  position: fixed; 
  z-index: 9999; 
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto; 
  background-color: rgba(0,0,0,0.8);
  backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-modal.show {
  display: flex;
  opacity: 1;
}

.image-modal-content {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.image-modal.show .image-modal-content {
  transform: scale(1);
}

.image-modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
}

.image-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 50px;
  font-weight: bold;
  cursor: pointer;
  background: none;
  border: none;
  padding: 20px;
  user-select: none;
  transition: opacity 0.2s;
  z-index: 10000;
}

.image-modal-nav:hover { opacity: 0.7; }
.image-modal-prev { left: 10px; }
.image-modal-next { right: 10px; }