/* ============================================================
   Base — dark theme
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  background-color: #0d0d0d;
  color: #cccccc;
  font-family: system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

a { color: #aaaaaa; text-decoration: none; }
a:hover { color: #ffffff; }

/* ============================================================
   Site nav (public)
   ============================================================ */
.site-nav {
  position: absolute;
  top: 1rem;
  left: 1.5rem;
  z-index: 10;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============================================================
   Flash messages
   ============================================================ */
.flash {
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
}
.flash-notice { background: #1a3a1a; color: #7ecf7e; }
.flash-alert  { background: #3a1a1a; color: #cf7e7e; }

/* ============================================================
   Homepage
   ============================================================ */
.featured-section {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

.featured-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.featured-placeholder {
  width: 100%;
  height: 100%;
  background: #111;
}

.homepage-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
  padding: 3rem 2rem 1.5rem;
}

.homepage-description {
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem 2rem 3rem;
  text-align: center;
  color: #888;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ============================================================
   Tag links
   ============================================================ */
.tag-link {
  font-size: 0.85rem;
  color: #777;
  transition: color 0.15s;
}
.tag-link::before {
  content: '#';
  color: #555;
}
.tag-link:hover {
  color: #ccc;
}

/* ============================================================
   Photo show
   ============================================================ */
.photo-show {
  display: flex;
  justify-content: center;
  min-height: 80vh;
  padding: 2rem 0;
}

.photo-frame {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  max-width: 100%;
}

.photo-display {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 5rem;
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.25);
  transition: color 0.15s, background 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.nav-arrow:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.5);
}

.nav-arrow-prev { left: 0; }
.nav-arrow-next { right: 0; }

@media (min-width: 768px) {
  .photo-show {
    padding: 3rem 3.5rem;
  }
  .nav-arrow {
    color: #666;
    background: none;
  }
  .nav-arrow:hover {
    color: #fff;
    background: none;
  }
  .nav-arrow-prev { left: -3.5rem; }
  .nav-arrow-next { right: -3.5rem; }
}

.photo-meta {
  text-align: center;
  padding: 0rem 1rem 3rem;
}

.photo-title {
  font-size: 0.9rem;
  font-weight: normal;
  letter-spacing: 0.06em;
  color: #ccc;
  margin-bottom: 0.75rem;
}

.photo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* ============================================================
   Tag collection (grid)
   ============================================================ */
.tag-header {
  text-align: center;
  padding: 2.5rem 1rem 1rem;
}

.tag-title {
  font-size: 1rem;
  font-weight: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #888;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 4px;
  padding: 1rem;
}

.photo-thumb-link {
  display: block;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: #111;
}

.photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s;
}
.photo-thumb-link:hover .photo-thumb { opacity: 0.8; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.75rem;
  color: #444;
  letter-spacing: 0.04em;
}

.site-footer a { color: #555; }
.site-footer a:hover { color: #999; }

.footer-sep {
  margin: 0 0.6rem;
}

/* ============================================================
   License page
   ============================================================ */
.license-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

.license-heading {
  font-size: 0.9rem;
  font-weight: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 2.5rem;
}

.license-section {
  margin-bottom: 2rem;
}

.license-section h2 {
  font-size: 0.75rem;
  font-weight: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 0.75rem;
}

.license-section p,
.license-section li {
  font-size: 0.85rem;
  color: #999;
  line-height: 1.75;
}

.license-section ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}

.license-section strong { color: #bbb; font-weight: normal; }
.license-section a { color: #888; text-decoration: underline; text-underline-offset: 3px; }
.license-section a:hover { color: #ccc; }

/* ============================================================
   Admin — general
   ============================================================ */
.admin-body {
  background: #1a1a1a;
  color: #ddd;
  font-family: system-ui, sans-serif;
  min-height: 100vh;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: #111;
  border-bottom: 1px solid #333;
}

.admin-nav-brand {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #666;
  margin-right: auto;
}

.admin-nav a { color: #aaa; font-size: 0.9rem; }
.admin-nav a:hover { color: #fff; }

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

.admin-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.admin-header h1 {
  font-size: 1.2rem;
  font-weight: normal;
  color: #ddd;
  margin: 0;
}

/* ============================================================
   Admin — login
   ============================================================ */
.admin-login-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
}

.admin-login-card {
  background: #222;
  border: 1px solid #333;
  padding: 2rem;
  width: 100%;
  max-width: 360px;
}

.admin-login-title {
  font-size: 1rem;
  font-weight: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  color: #ccc;
}

/* ============================================================
   Admin — forms
   ============================================================ */
.field { margin-bottom: 1.2rem; }

.label {
  display: block;
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 0.35rem;
  letter-spacing: 0.04em;
}

.input, .textarea, .select {
  display: block;
  width: 100%;
  background: #2a2a2a;
  border: 1px solid #444;
  color: #ddd;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 3px;
  outline: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: #777;
}

.textarea { resize: vertical; }

.help {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.35rem;
}

.tag-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.current-image { margin-top: 0.5rem; }

.form-errors {
  background: #3a1a1a;
  border: 1px solid #7a2a2a;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: #cf7e7e;
}

/* ============================================================
   Admin — table
   ============================================================ */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #333;
  color: #888;
  font-weight: normal;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.admin-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #222;
  vertical-align: middle;
}

.admin-table .actions {
  display: flex;
  gap: 0.5rem;
  white-space: nowrap;
}

.visibility-badge {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
}
.visibility-public  { background: #1a3a1a; color: #7ecf7e; }
.visibility-private { background: #2a2a2a; color: #666; }

.help-inline {
  font-size: 0.8rem;
  color: #666;
  margin-left: 0.25rem;
}

.admin-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  display: block;
  background: #111;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-block;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  text-align: center;
  line-height: 1.4;
  transition: opacity 0.15s;
  font-family: inherit;
}
.btn:hover { opacity: 0.85; }

.btn-primary   { background: #3a6ea5; color: #fff; border-color: #3a6ea5; }
.btn-secondary { background: transparent; color: #aaa; border-color: #555; }
.btn-danger    { background: #7a2a2a; color: #fff; border-color: #7a2a2a; }
.btn-sm        { padding: 0.3rem 0.7rem; font-size: 0.8rem; }

.nav-logout {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #aaa;
  font-size: 0.9rem;
}
.nav-logout:hover { color: #fff; }
