/* img.dc5.cz — sdílené styly galerie
   Oranžové/jantarové téma + světlý a tmavý režim. Bez frameworků. */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #fff8f0;
  --surface: #ffffff;
  --surface-2: #fffaf3;
  --text: #3b1f00;
  --muted: #9a7548;
  --accent: #ff8a00;
  --accent-2: #ff6a00;
  --grad: linear-gradient(135deg, #ffd89b 0%, #ffa515 50%, #ff8a00 100%);
  --border: rgba(255, 140, 0, 0.18);
  --shadow: 0 6px 18px rgba(255, 140, 0, 0.14);
  --shadow-hover: 0 12px 26px rgba(255, 140, 0, 0.24);
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #160f07;
    --surface: #221810;
    --surface-2: #2b2013;
    --text: #ffe9cf;
    --muted: #c49a64;
    --accent: #ff9d2e;
    --accent-2: #ffb454;
    --border: rgba(255, 170, 60, 0.16);
    --shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 14px 30px rgba(0, 0, 0, 0.6);
  }
}

html { color-scheme: light dark; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a { color: var(--accent-2); }

/* ---------- Menu ---------- */
.dc5-menu {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.dc5-menu__wrap {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 16px;
}
.dc5-menu__brand {
  font-weight: 800;
  font-size: 18px;
  color: var(--accent-2);
  text-decoration: none;
  margin-right: 6px;
}
.dc5-menu__list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.dc5-menu__link {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: #3b1f00;
  font-weight: 600;
  background: var(--grad);
  box-shadow: var(--shadow);
  transition: transform .14s ease, box-shadow .14s ease;
}
.dc5-menu__link:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.dc5-menu__link:active { transform: translateY(0); }
.dc5-menu__link.is-active { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* ---------- Galerie + toolbar ---------- */
.gallery {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}
.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}
.toolbar__search {
  flex: 1 1 240px;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
}
.toolbar__search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.toolbar__sort {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}
.toolbar__sort select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}
.toolbar__count {
  color: var(--muted);
  font-size: 14px;
  margin-left: auto;
}

/* ---------- Mřížka karet ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .14s ease, box-shadow .14s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.card__thumb {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  /* Pevná světlá šachovnice nezávislá na motivu, aby byly průhledné
     obrázky (tmavá SVG loga apod.) vždy dobře čitelné. */
  background-color: #e9e9e9;
  background-image:
    linear-gradient(45deg, rgba(0, 0, 0, .12) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, .12) 75%),
    linear-gradient(45deg, rgba(0, 0, 0, .12) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, .12) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 9px 9px;
}
.card__thumb img {
  max-width: 100%;
  max-height: 170px;
  object-fit: contain;
  border-radius: 6px;
}
.card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 12px;
}
.card__name {
  font-weight: 600;
  font-size: 13px;
  word-break: break-all;
  line-height: 1.3;
}
.card__meta { color: var(--muted); font-size: 12px; }
.card__copy {
  margin-top: 4px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: var(--grad);
  color: #3b1f00;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
.card__copy:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.card__copy:active { transform: translateY(0); }

.empty { color: var(--muted); padding: 30px 0; text-align: center; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 50;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Footer ---------- */
.dc5-footer {
  font-size: 14px;
  color: var(--muted);
  padding: 18px 12px;
  text-align: center;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.dc5-footer a { color: var(--accent-2); text-decoration: none; font-weight: 600; }
.dc5-footer a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
