/* daily-slop gallery — shared styles for index.html and view.html */

:root {
  --bg: #0e0f12;
  --panel: #16181d;
  --card: #16181d;
  --edge: #262a33;
  --ink: #e8e6df;
  --dim: #8b8fa3;
  --acc: #ffd23f;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--mono);
}

/* ---------- gallery page ---------- */

.site-header {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 24px 8px;
}
.site-header h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 1px;
}
.site-header .tilde { color: var(--acc); }
.site-header .strap {
  margin: 6px 0 0;
  color: var(--dim);
}

.grid {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}

.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, border-color .15s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--acc);
}
.card .shot {
  aspect-ratio: 16 / 10;
  background: #000;
  overflow: hidden;
}
.card .shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.card:hover .shot img { transform: scale(1.04); }

.card .meta { padding: 12px 14px 14px; }
.card .date {
  color: var(--acc);
  font-size: 12px;
  letter-spacing: 1px;
}
.card .name {
  margin: 2px 0 4px;
  font-size: 17px;
  font-weight: 700;
}
.card .tag {
  margin: 0;
  color: var(--dim);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .byline {
  margin-top: 10px;
  font-size: 11px;
  color: var(--dim);
}
.card .byline b { color: var(--ink); font-weight: 600; }

.site-header .header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.repo-link {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--edge);
  border-radius: 50%;
  color: var(--dim);
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease, transform .15s ease;
}
.repo-link:hover {
  border-color: var(--acc);
  color: var(--acc);
  transform: scale(1.06);
}
.repo-link:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 3px;
}
.repo-link svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.site-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 36px;
  color: var(--dim);
  font-size: 12px;
}
.site-footer code { color: var(--acc); }

/* ---------- viewer page ---------- */

.viewer-page { overflow: hidden; }

#frame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.float-btn {
  position: fixed;
  top: 14px;
  z-index: 20;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--edge);
  background: rgba(14, 15, 18, .82);
  color: var(--ink);
  font: 20px/1 var(--mono);
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: border-color .15s ease, color .15s ease;
}
.float-btn:hover { border-color: var(--acc); color: var(--acc); }
#back-btn { left: 14px; }
#info-btn { right: 14px; }

#panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 92vw);
  z-index: 30;
  background: var(--panel);
  border-left: 1px solid var(--edge);
  transform: translateX(102%);
  transition: transform .22s ease;
  display: flex;
  flex-direction: column;
}
#panel.open { transform: translateX(0); }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--edge);
}
.panel-tabs { display: flex; gap: 8px; }
.tab {
  background: none;
  border: 1px solid var(--edge);
  border-radius: 6px;
  color: var(--dim);
  font: 12px var(--mono);
  letter-spacing: 1px;
  padding: 6px 12px;
  cursor: pointer;
}
.tab.active {
  color: #111;
  background: var(--acc);
  border-color: var(--acc);
}
#panel-close {
  background: none;
  border: 0;
  color: var(--dim);
  font: 22px/1 var(--mono);
  cursor: pointer;
}
#panel-close:hover { color: var(--ink); }

#panel-body {
  overflow-y: auto;
  padding: 18px 22px 40px;
}

#scrim {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(0, 0, 0, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
#scrim.open { opacity: 1; pointer-events: auto; }

/* ---------- rendered markdown ---------- */

.md { font-size: 14px; }
.md h1, .md h2, .md h3 {
  line-height: 1.3;
  margin: 1.4em 0 .5em;
}
.md h1:first-child { margin-top: 0; }
.md h1 { font-size: 20px; color: var(--acc); }
.md h2 { font-size: 16px; border-bottom: 1px solid var(--edge); padding-bottom: 4px; }
.md h3 { font-size: 14px; }
.md p { margin: .7em 0; }
.md a { color: var(--acc); }
.md code {
  background: #0a0b0d;
  border: 1px solid var(--edge);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12.5px;
}
.md pre {
  background: #0a0b0d;
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
}
.md pre code { border: 0; padding: 0; background: none; }
.md ul, .md ol { padding-left: 1.4em; margin: .7em 0; }
.md li { margin: .25em 0; }
.md blockquote {
  margin: .8em 0;
  padding: .1em 1em;
  border-left: 3px solid var(--acc);
  color: var(--dim);
}
.md hr { border: 0; border-top: 1px solid var(--edge); margin: 1.4em 0; }
.md table {
  border-collapse: collapse;
  margin: .8em 0;
  font-size: 13px;
}
.md th, .md td {
  border: 1px solid var(--edge);
  padding: 5px 10px;
  text-align: left;
}
.md th { color: var(--acc); }
.md .md-empty { color: var(--dim); font-style: italic; }
