/*
 * Shared theme and layout for public/private sites.
 * BlackberryJam.ttf and pinksmoke.gif should live next to this file.
 */
@font-face {
  font-family: 'BlackberryJam';
  src: url('./BlackberryJam.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

:root,
[data-theme="default"] {
  --bg: #0f0f12;
  --surface: #1a1a20;
  --border: #2a2a32;
  --text: #e8e8ed;
  --text-muted: #8888a0;
  --accent: #6c5ce7;
  --accent-hover: #7d6ef7;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="vehicles"] {
  --bg: #0c0d10;
  --surface: #16181d;
  --border: #252830;
  --text: #e4e6eb;
  --text-muted: #7a8090;
  --accent: #e67e22;
  --accent-hover: #f39c12;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

[data-theme="animals"] {
  --bg: #0d120d;
  --surface: #141c14;
  --border: #243024;
  --text: #d8ecd8;
  --text-muted: #7a9a7a;
  --accent: #27ae60;
  --accent-hover: #2ecc71;
  --radius: 14px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.site-header,
main { position: relative; z-index: 1; }

.site-header {
  padding: 2rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.site-header h1 {
  margin: 0;
  font-size: 3.5rem;
  font-weight: 700;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.05em;
}

.subtitle {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  font-size: 1.5rem;
  font-family: 'BlackberryJam', cursive;
  text-align: center;
  white-space: pre-line;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover { color: var(--accent-hover); text-decoration: underline; }

main { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }

.loading, .error { text-align: center; color: var(--text-muted); padding: 3rem 1rem; }
.error { color: #e07070; }
.hidden { display: none !important; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.gallery-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  min-height: 0;
}

.gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.gallery-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  background: var(--border);
  flex-shrink: 0;
}

.gallery-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  min-height: 180px;
}

.gallery-card h2 {
  margin: 0;
  padding: 1rem 1rem 0.25rem;
  font-size: 1.1rem;
  font-weight: 600;
  flex-shrink: 0;
}

.gallery-count {
  display: block;
  padding: 0 1rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: auto;
}

.gallery-detail .media-grid { display: flex; flex-direction: column; gap: 2rem; }

.media-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.media-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}

.media-link { display: block; text-decoration: none; color: inherit; width: 100%; }

.media-item {
  display: block;
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  background: var(--border);
}

.video-thumbnail {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--border);
  min-height: 200px;
  cursor: pointer;
  overflow: hidden;
}

.video-thumbnail-image {
  width: 100%; height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0; left: 0;
  z-index: 1;
}

.video-thumbnail-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  z-index: 2;
}

.video-thumbnail-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 3;
}

.video-thumbnail:hover .video-thumbnail-overlay { opacity: 1; }

.video-play-icon {
  font-size: 4rem;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.video-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 0.75rem 0.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  color: var(--text);
  font-size: 0.9rem;
  text-align: center;
  z-index: 4;
}

.media-item.file-link {
  padding: 1rem;
  color: var(--accent);
  text-decoration: none;
  max-height: none;
}

.media-viewer { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100vh - 200px); padding: 2rem 1rem; }

.media-viewer-container {
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.media-viewer-item {
  max-width: 100%;
  max-height: calc(100vh - 300px);
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.media-viewer-item.video { width: 100%; max-width: 1200px; }

.media-viewer-info { text-align: center; color: var(--text-muted); font-size: 0.9rem; }

.media-viewer-nav { display: flex; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; justify-content: center; }

.media-viewer-nav a {
  color: var(--accent);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.media-viewer-nav a:hover { color: var(--accent-hover); border-color: var(--accent); }

/* Footer & About (public + private) */
.site-footer {
  margin-top: 4rem;
  padding: 2rem 1rem;
  text-align: center;
}

.site-footer.top-footer { margin-top: 0; padding-top: 1rem; }

.about-link {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.about-link:hover { opacity: 1; transform: translateY(-1px); }

.about-link.emphasis {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.6rem 1.4rem;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}

.about-link.emphasis:hover {
  opacity: 1;
  border-color: rgba(255,255,255,0.6);
}

.about-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  text-align: center;
}

.about-text { margin-bottom: 3rem; }

.about-text p { line-height: 1.8; font-size: 1rem; opacity: 0.85; }

.social-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.social-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
}

.social-btn img { width: 18px; height: 18px; filter: invert(1); }

.social-btn.reddit { background: #ff4500; }
.social-btn.telegram { background: #2aabee; }
.social-btn.kik { background: #7ac943; }

.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.35);
  opacity: 0.95;
}

.social-btn.full-width { flex-basis: 100%; }

.home-link { position: absolute; left: 1rem; top: 1.5rem; color: var(--accent); text-decoration: none; }
.home-link:hover { color: var(--accent-hover); }

@media (max-width: 768px) {
  .site-header h1 { font-size: 2.5rem; }
  .gallery-grid { grid-template-columns: 1fr; }
  .media-viewer-item { max-height: calc(100vh - 200px); }
}
