/* ============================================================
   Duuump - strona publiczna
   ============================================================ */

@import url('theme.css');

/* ---------- Nagłówek - identyczny z adminem ---------- */
.frame-header .subtitle {
  margin-left: auto;
  font-size: 12px;
  color: var(--fg-muted);
}

/* ---------- Pasek kategorii ---------- */
.frame-categories {
  flex-shrink: 0;
  border-bottom: var(--border);
  padding: var(--pad-xs) var(--pad-md);
  display: flex;
  gap: var(--pad-sm);
  align-items: center;
  font-size: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.frame-categories::-webkit-scrollbar {
  display: none;
}

.cat-btn {
  background: none;
  border: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.cat-btn:hover {
  color: var(--accent);
}

.cat-btn.active {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Siatka inspiracji ---------- */
.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--pad-md);
}

.card {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.card-image-wrapper {
  cursor: zoom-in;
  overflow: hidden;
  display: block;
  border: 0;
  padding: 0;
  width: 100%;
  text-align: left;
  background: var(--fg-subtle);
}

.card-image-wrapper img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.15s ease;
}

.card-image-wrapper:hover img {
  opacity: 0.85;
}

.card-caption {
  margin-top: var(--pad-xs);
  font-size: 12px;
  color: var(--fg);
  line-height: 1.2;
  margin-bottom: 0;
}

.card-meta {
  margin-top: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--pad-xs);
  font-size: 11px;
  color: var(--fg-muted);
  line-height: 1.2;
}

.card-author {
  font-size: 11px;
  color: var(--fg-muted);
}

.card-date {
  font-size: 11px;
  color: var(--fg-muted);
  white-space: nowrap;
}

.card-author a {
  color: var(--fg-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.card-author a:hover {
  color: var(--accent);
}

.empty {
  color: var(--fg-muted);
  text-align: center;
  margin: var(--pad-lg) 0;
  font-size: 12px;
}

/* ---------- Modal / lightbox ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.97);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad-lg);
}

.modal[hidden] {
  display: none;
}

.modal-figure {
  margin: 0;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-figure img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.modal-caption {
  margin: var(--pad-sm) 0 4px;
  font-size: 13px;
  color: var(--fg);
  text-align: center;
}

.modal-author {
  margin: 0;
  font-size: 12px;
  color: var(--fg-muted);
  text-align: center;
}

.modal-close {
  position: absolute;
  top: var(--pad-sm);
  right: var(--pad-md);
  background: none;
  border: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  color: var(--fg-muted);
  padding: 4px 8px;
}

.modal-close:hover {
  color: var(--accent);
}

/* ============================================================
   Zegar i pogoda w stopce (lewa strona)
   ============================================================ */
.live-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

/* ============================================================
   Przełącznik trybu wyświetlania w stopce
   ============================================================ */
.view-toggle {
  display: flex;
  gap: 4px;
}

.view-btn {
  background: none;
  border: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  cursor: pointer;
  transition: color 0.1s;
}

.view-btn:hover {
  color: var(--fg);
}

.view-btn.active {
  color: var(--fg);
  font-weight: 500;
}

/* ============================================================
   Tryby wyświetlania siatki
   ============================================================ */

/* --- Tryb 1: Jeden obrazek na stronie --- */
.grid.mode-single {
  display: block;
  max-width: 800px;
  margin: 0 auto;
}

.grid.mode-single .card {
  display: block;
}

.grid.mode-single .card-image-wrapper {
  width: 100%;
  max-height: 70vh;
}

.grid.mode-single .card-image-wrapper img {
  width: 100%;
  height: auto;
}

.grid.mode-single .card-caption,
.grid.mode-single .card-author,
.grid.mode-single .card-date {
  text-align: center;
  margin-top: var(--pad-xs);
  line-height: 1.2;
}

/* --- Tryb 2: 4 duże miniatury --- */
.grid.mode-large {
  grid-template-columns: repeat(2, 1fr);
  gap: var(--pad-md);
}

.grid.mode-large .card-image-wrapper {
  aspect-ratio: 4 / 3;
}

.grid.mode-large .card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.grid.mode-large .card-caption {
  font-size: 13px;
  line-height: 1.1;
}

.grid.mode-large .card-author {
  font-size: 12px;
  line-height: 1.1;
}

.grid.mode-large .card-date {
  font-size: 11px;
}

/* --- Tryb 3: Małe ikony (domyślny) --- */
.grid.mode-small {
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: var(--pad-xs);
}

.grid.mode-small .card-image-wrapper {
  aspect-ratio: 1;
}

.grid.mode-small .card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.grid.mode-small .card-caption,
.grid.mode-small .card-author {
  display: none; /* Ukrywamy podpisy dla trybu ikonek */
}

/* --- Reset do domyślnego (małe ikony) --- */
.grid {
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: var(--pad-xs);
}

.grid .card-image-wrapper {
  aspect-ratio: 1;
}

.grid .card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.grid .card-caption,
.grid .card-author {
  display: none;
}

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 480px) {
  .grid.mode-large {
    grid-template-columns: 1fr;
    gap: var(--pad-sm);
  }
  .grid.mode-small {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  }
  .frame-header .subtitle {
    display: none;
  }
  .view-toggle {
    display: none; /* Na mobilu ukrywamy przełącznik */
  }
}

@media (min-width: 481px) {
  .grid.mode-large .card-caption,
  .grid.mode-large .card-author,
  .grid.mode-single .card-caption,
  .grid.mode-single .card-author {
    display: block; /* Pokazuj podpisy w trybie dużym i single */
  }
}
