/* Custom layer on top of Pico CSS v2 - mobile-first, no build step. */

:root {
  --brand: #0b6b8a;
}

[x-cloak] {
  display: none !important;
}

/* Honeypot field: invisible for humans, still present in the DOM for bots. */
.honeypot {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-block: 0.6rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
  background: var(--pico-background-color);
  backdrop-filter: blur(6px);
}

.site-header nav {
  padding: 0;
}

.site-header ul {
  gap: 0.75rem;
}

.brand {
  text-decoration: none;
  color: var(--pico-color);
}

main {
  padding-block: 1.5rem 3rem;
}

.site-footer {
  padding-block: 1rem 2rem;
  color: var(--pico-muted-color);
  border-top: 1px solid var(--pico-muted-border-color);
}

.hint {
  color: var(--pico-muted-color);
  font-size: 0.9rem;
}

.hint.legal {
  margin-top: 1rem;
}

.flash {
  padding: 0.9rem 1.1rem;
  border-radius: var(--pico-border-radius);
}

.flash-error {
  border-left: 5px solid #c62828;
  background: #fdecea;
  color: #7f1d1d;
}

.flash-ok {
  border-left: 5px solid #2e7d32;
  background: #e8f5e9;
  color: #1b5e20;
}

fieldset {
  margin-bottom: 1.5rem;
}

legend {
  font-weight: 700;
  font-size: 1.05rem;
}

/* --- Photo selection & preview cards ------------------------------------ */

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.file-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1.4rem 1rem;
  margin-bottom: 1rem;
  border: 2px dashed var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  cursor: pointer;
  font-weight: 600;
  text-align: center;
  background: var(--pico-card-background-color);
}

.file-drop:hover,
.file-drop:focus-within {
  border-color: var(--brand);
  color: var(--brand);
}

.file-input:focus-visible + .file-drop {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

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

.photo-card {
  margin: 0;
  padding: 0.75rem;
}

.photo-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0 0.6rem;
  margin: 0;
  background: none;
  border: 0;
}

.photo-index {
  font-weight: 700;
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--pico-border-radius);
  background: #0b0b0b;
}

.photo-card label {
  font-size: 0.9rem;
}

.photo-card input {
  margin-bottom: 0;
}

.filename {
  display: block;
  margin: 0.35rem 0 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--pico-muted-color);
}

.btn-small {
  width: auto;
  margin: 0;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
}

.upload-status {
  margin-block: 1rem;
}

.upload-status progress {
  width: 100%;
  margin-bottom: 0.35rem;
}

.submit-btn {
  width: 100%;
}

/* --- Admin ------------------------------------------------------------- */

.stats {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 2rem;
}

.stats article {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  padding: 1rem;
}

.stats strong {
  font-size: 1.35rem;
}

.admin-sub > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.badge {
  font-family: var(--pico-font-family-monospace);
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  background: var(--pico-code-background-color, #eef2f4);
  color: var(--pico-color);
}

.admin-sub .notes {
  white-space: pre-wrap;
}

.admin-sub > footer {
  padding-top: 0.5rem;
}

.admin-sub > footer form {
  margin: 0;
}

.admin-photo {
  margin: 0;
}

.admin-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--pico-border-radius);
  background: #0b0b0b;
}

.admin-photo figcaption {
  font-size: 0.8rem;
  margin-top: 0.35rem;
  word-break: break-word;
}

.admin-photo code {
  font-size: 0.7rem;
}

textarea#guide-content {
  font-family: var(--pico-font-family-monospace);
  font-size: 0.85rem;
}

.asset-upload {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.asset-upload input[type="file"] {
  margin-bottom: 0;
}

.asset-upload button {
  width: auto;
  margin-bottom: 0;
}

/* --- Public pages ------------------------------------------------------ */

.prose h2 {
  margin-top: 2rem;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--pico-border-radius);
}

.prose table {
  font-size: 0.9rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block: 1.25rem;
}

.actions a[role="button"] {
  width: auto;
}

.photo-list {
  padding-left: 1.2rem;
}

.summary table {
  margin-bottom: 0;
}

@media (max-width: 600px) {
  h1 {
    font-size: 1.7rem;
  }

  .site-header nav ul {
    gap: 0.6rem;
    font-size: 0.92rem;
  }

  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}
