/* /art/art.css — ART gallery, viewer and admin. Uses the site's theme variables from /style.css. */

/* ── Gallery page ───────────────────────────────────────────────────────── */
.artContent > h1,
.artContent .art-intro,
.artContent .art-empty {
  text-align: center;
}

.artContent .art-intro {
  line-height: 1.5;
  margin: 0.5em 0 1.5em;
}

.artContent .art-intro code {
  font-size: 0.95em;
}

.art-empty {
  color: var(--text-muted);
}

.art-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.art-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
  transition: border-color 0.2s, transform 0.2s;
}

.art-card:hover,
.art-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.art-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;   /* uniform tiles; portrait/square renders are centre-cropped here, shown whole in the viewer */
  object-fit: cover;
  background: #000;
}

.art-card-title,
.art-card-meta {
  display: block;
  padding: 0 10px;
}

.art-card-title {
  padding-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.art-card-meta {
  font-size: 0.75em;
  color: var(--text-muted);
  padding-bottom: 8px;
}

@media screen and (max-width: 767px) {
  .art-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }
  .art-card-meta  { font-size: 0.8em; }
}

/* ── Viewer ─────────────────────────────────────────────────────────────── */
html.av-open,
html.av-open body {
  overflow: hidden;
}

.art-viewer[hidden],
.art-viewer [hidden] {
  display: none !important;
}

.art-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #050505;
  color: #e2e2de;
  font-family: pixelate, Arial, sans-serif;
  outline: none;
}

.av-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  contain: strict;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-select: none;
}

.av-stage.av-pannable { cursor: grab; }
.av-stage.av-pannable.av-dragging { cursor: grabbing; }

.av-img {
  position: absolute;
  max-width: none;
  max-height: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.av-img.av-pixelated {
  image-rendering: pixelated;
}

.av-bar {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  pointer-events: none;          /* bars don't block panning... */
}

.av-bar > * { pointer-events: auto; }   /* ...but their controls work */

.av-top {
  top: 0;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
}

.av-bottom {
  bottom: 0;
  justify-content: center;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
}

.av-heading {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.av-title {
  font-size: 1.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.av-sub {
  font-size: 0.75rem;
  color: #9a9a96;
}

.av-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.av-btn {
  font: inherit;
  font-size: 0.85rem;
  color: #e2e2de;
  background: rgba(20, 20, 20, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  padding: 6px 10px;
  min-width: 36px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  text-align: center;
}

.av-btn:hover,
.av-btn:focus-visible,
.av-btn[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.av-zoom {
  min-width: 90px;
  text-align: center;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.av-loading {
  font-size: 0.75rem;
  color: var(--accent);
}

.av-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font: inherit;
  font-size: 2.2rem;
  line-height: 1;
  width: 44px;
  height: 64px;
  color: #e2e2de;
  background: rgba(20, 20, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  cursor: pointer;
}

.av-nav:hover,
.av-nav:focus-visible { color: var(--accent); border-color: var(--accent); }
.av-prev { left: 10px; }
.av-next { right: 10px; }

.av-panel {
  position: absolute;
  top: 64px;
  right: 14px;
  width: min(360px, calc(100% - 28px));
  max-height: calc(100% - 140px);
  overflow: auto;
  background: rgba(12, 12, 12, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 14px 16px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.av-panel h2 {
  font-size: 1.1rem;
  margin: 0 0 4px;
}

.av-panel-meta,
.av-panel-help {
  color: #9a9a96;
  font-size: 0.75rem;
}

.av-panel-desc {
  white-space: pre-line;
}

.av-panel-links a {
  display: inline-block;
  margin-right: 14px;
  color: var(--accent);
}

@media screen and (max-width: 767px) {
  .av-nav { width: 36px; height: 52px; font-size: 1.8rem; }
  .av-one, #av-one { display: none; }
  .av-zoom { min-width: 70px; }
}

/* ── Admin ──────────────────────────────────────────────────────────────── */
.artAdmin {
  text-align: left;
  font-size: 1.5rem;          /* same base as the other content pages (pixelate + font-size-adjust) */
}

.artAdmin h1 { font-size: 1.6em; }
.artAdmin h2 { font-size: 1.2em; margin-top: 1.5em; }

.aa-flash {
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 8px 12px;
  margin: 12px 0;
}

.aa-flash.aa-error { border-color: #dc2626; color: #dc2626; }

.aa-form label {
  display: block;
  margin: 10px 0 4px;
  font-size: 0.85em;
  color: var(--text-muted);
}

.aa-form input[type=text],
.aa-form input[type=password],
.aa-form input[type=date],
.aa-form textarea {
  width: 100%;
  max-width: 560px;
  font: inherit;
  font-size: 0.9em;
  padding: 6px 8px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-sizing: border-box;
}

.aa-form textarea { min-height: 70px; }

.aa-form button,
.aa-inline button {
  font: inherit;
  font-size: 0.85em;
  margin-top: 10px;
  padding: 6px 14px;
  cursor: pointer;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 4px;
}

.aa-form button:disabled { opacity: 0.5; cursor: wait; }

.aa-hint {
  font-size: 0.75em;
  color: var(--text-muted);
}

.aa-progress {
  width: 100%;
  max-width: 560px;
  margin-top: 10px;
}

.aa-piece {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.aa-piece img {
  width: 200px;
  height: auto;
  border-radius: 4px;
  background: #000;
}

.aa-inline {
  display: inline-block;
  margin-right: 8px;
}

.aa-inline button { margin-top: 6px; }
.aa-inline label { display: inline; margin-right: 6px; }
.aa-inline input[type=checkbox] { width: auto; margin: 0 4px 0 0; vertical-align: middle; }
.aa-danger button { border-color: #dc2626; }

@media screen and (max-width: 767px) {
  .aa-piece { grid-template-columns: 1fr; }
}
