:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #202020;
  --panel-2: #292929;
  --line: #0b0b0b;
  --text: #efefef;
  --muted: #aaa;
  --link: #2879d7;
  --header-height: 166px;
  --sidebar-width: 182px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 12px/1.3 Arial, Helvetica, sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover, a:focus-visible { color: #6aaeff; text-decoration: underline; }
img { max-width: 100%; height: auto; }

.site-header {
  height: var(--header-height);
  padding: 8px 14px;
  background: #000;
  display: flex;
  align-items: flex-start;
}
.site-logo { width: 350px; height: 158px; object-fit: contain; object-position: left top; }
.top-strip, .section-strip {
  min-height: 26px;
  padding: 5px 9px;
  border-top: 1px solid #555;
  border-bottom: 1px solid #111;
  background: linear-gradient(#4b4b4b, #252525);
  font-weight: 700;
  color: #fff;
}
.top-strip { font-size: 11px; }
.top-strip a { color: #fff; }
.top-strip { display: flex; justify-content: space-between; gap: 20px; }

.layout { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar {
  min-height: calc(100vh - var(--header-height) - 26px);
  padding: 14px 8px;
  border-right: 1px solid #090909;
  background: #202020;
}
.sidebar h3 { margin: 18px 0 8px; font: 700 15px Georgia, serif; }
.sidebar-search { display: flex; }
.sidebar-search input {
  width: 100%;
  height: 21px;
  border: 1px solid #bbb;
  background: #ddd;
  color: #222;
  padding: 2px 5px;
}
.sidebar-links { list-style: none; margin: 8px 0 0; padding: 0; }
.sidebar-links li { margin: 7px 0; }
.sidebar-links a { font-weight: 700; }
.peer-list { list-style: none; margin: 8px 0; padding: 0; }
.peer-list li { margin: 5px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peer-list a { font-weight: 700; }
.random-card img { border: 2px solid #aaa; display: block; margin-bottom: 7px; }
.random-card strong { display: block; font: 700 14px Georgia, serif; }
.random-card small { display: block; margin-top: 8px; color: var(--muted); }
.sape-slot { margin-top: 20px; overflow-wrap: anywhere; }

.content { min-width: 0; background: #000; }
.intro {
  min-height: 93px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 10px;
  background: #202020;
  border-bottom: 1px solid #444;
}
.intro h1 { margin: 0 0 7px; font: 700 13px Arial, Helvetica, sans-serif; }
.intro p { margin: 3px 0; }
.count { color: var(--muted); white-space: nowrap; }
.pager-strip {
  min-height: 30px;
  padding: 7px 12px;
  text-align: right;
  background: linear-gradient(#4b4b4b, #242424);
  border-bottom: 1px solid #080808;
}
.pager-strip a, .pager-strip span { margin-left: 9px; font-weight: 700; }
.pager-strip .current { color: #fff; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #080808;
  gap: 1px;
}
.gallery-card {
  min-height: 285px;
  padding: 12px 14px 15px;
  text-align: center;
  background: #000;
  border-bottom: 1px solid #555;
}
.gallery-card .thumb-wrap {
  height: 155px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 7px;
}
.gallery-card img { max-width: 154px; max-height: 154px; border: 2px solid #aaa; }
.gallery-card h2 { margin: 4px 0 9px; font: 700 15px Arial, Helvetica, sans-serif; }
.gallery-card h2 a { color: #fff; }
.gallery-card p { margin: 2px 0; color: #ddd; }
.gallery-card .meta { color: var(--muted); font-size: 12px; }
.keywords { margin-top: 6px; color: var(--muted); font-size: 12px; }
.keywords a { margin: 0 2px; font-weight: 700; }

.photo-heading {
  min-height: 65px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px;
  background: #202020;
}
.photo-heading h1 { margin: 0; font: 700 16px Georgia, serif; }
.photo-meta { color: #bbb; min-width: 310px; font-size: 12px; }
.photo-stage { padding: 8px 12px 22px; text-align: center; background: #000; }
.photo-stage img { display: block; max-width: min(100%, 1000px); margin: 0 auto; }
.photo-stage .full-link { display: inline-block; margin-top: 10px; }
.properties, .comments { margin: 0 12px 20px; border-top: 1px solid #555; }
.properties h2, .comments h2 { font: 700 15px Georgia, serif; }
.properties dl { display: grid; grid-template-columns: 190px 1fr 190px 1fr; gap: 5px 12px; }
.properties dt { color: #aaa; }
.properties dd { margin: 0; }
.comment { padding: 10px 0; border-top: 1px solid #333; }
.comment-head { color: #aaa; margin-bottom: 5px; }
.comment-subject { font-weight: 700; }

.search-panel { padding: 18px; }
.search-panel form { display: flex; max-width: 720px; gap: 8px; }
.search-panel input { flex: 1; padding: 8px; border: 1px solid #777; background: #eee; color: #111; }
.search-panel button { padding: 8px 16px; }
.search-results { margin-top: 18px; display: grid; gap: 8px; }
.search-result { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 10px; background: #171717; }
.search-result img { max-width: 90px; max-height: 90px; margin: auto; }
.search-result h2 { margin: 0 0 5px; font-size: 16px; }

.slideshow { position: relative; min-height: 70vh; display: grid; place-items: center; padding: 20px; }
.slideshow img { max-height: 72vh; max-width: 95%; }
.slide-controls { display: flex; justify-content: center; gap: 12px; margin: 10px; }

.site-footer { padding: 22px; text-align: center; color: #aaa; border-top: 1px solid #444; }

@media (max-width: 860px) {
  :root { --header-height: auto; }
  .site-header { height: auto; min-height: 112px; }
  .site-logo { width: min(350px, 75vw); height: auto; }
  .layout { display: block; }
  .sidebar { min-height: 0; border-right: 0; border-bottom: 1px solid #555; }
  .sidebar .peer-section, .sidebar .random-section { display: none; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro { grid-template-columns: 1fr; gap: 4px; }
  .count { white-space: normal; }
  .photo-heading { align-items: flex-start; flex-direction: column; }
  .photo-meta { min-width: 0; }
  .properties dl { grid-template-columns: 140px 1fr; }
}

@media (max-width: 520px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-card { min-height: 0; }
  .top-strip { display: block; }
  .search-result { grid-template-columns: 65px 1fr; }
  .search-result img { max-width: 65px; max-height: 65px; }
}
