/* OH Recs — a loving nod to the old-school torrent index look. */
:root {
  --navy: #000090;
  --ink: #000;
  --text-2: #4a4a4a;
  --grey: #767676;
  --red: #9b2d20;
  --green: #3e8b25;
  --blue: #2f6feb;
  --page: #fcfcfc;
  --sep: #fafaf8;
  --tan: #cbb8a6;
  --row: #f2efec;
  --row-alt: #efe9e5;
  --box: #f5f2ef;
  --line: #d3c6b9;
  --field: #6f6f6f;
  --btn: #efefef;
  --mono: "Courier New", Courier, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 13px/1.45 Verdana, Geneva, "DejaVu Sans", sans-serif;
  accent-color: var(--blue);
}
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}
[hidden] { display: none !important; }
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.sep { color: var(--grey); }
svg { flex: none; }

/* ---------------------------------------------------------------- header */
.site-header {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  padding: 18px 24px 12px;
}
.logo { display: block; flex: none; line-height: 0; }
.logo svg { width: 86px; height: 86px; }
.logo:hover { text-decoration: none; opacity: .92; }
.controls { display: flex; flex-direction: column; gap: 9px; min-width: 0; padding-top: 4px; }
.nav { font-size: 13px; }
.nav b { color: var(--ink); }

.search-row { display: flex; gap: 6px; }
input[type="search"], input[type="text"], input[type="url"], input[type="email"],
input[type="password"], input[type="date"], select, textarea {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--field);
  border-radius: 0;
  padding: 4px 8px;
}
.search-row input { width: 420px; max-width: 100%; height: 30px; }
button, .btn {
  font: inherit;
  color: var(--ink);
  background: var(--btn);
  border: 1px solid var(--grey);
  border-radius: 4px;
  padding: 0 12px;
  height: 30px;
  cursor: pointer;
  white-space: nowrap;
}
button:hover, .btn:hover { background: #e4e4e4; text-decoration: none; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.cb { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; }
.cb input { margin: 0; width: 14px; height: 14px; }
.filter-row select { height: 26px; padding: 1px 6px; max-width: 220px; }
.show-images { margin-left: 8px; padding-left: 16px; border-left: 1px solid var(--line); }

/* ---------------------------------------------------------------- subbar */
.subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 24px 8px;
}
.subbar h1 { margin: 0; font-size: 15px; font-weight: bold; overflow-wrap: anywhere; }
.toggle-images { display: none; align-items: center; gap: 6px; color: var(--ink); font-size: 12px; white-space: nowrap; }
.fake-cb {
  width: 14px; height: 14px; border: 1px solid var(--grey); border-radius: 3px; background: #fff;
  display: inline-block;
}
.fake-cb.on {
  background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3.5 7.2l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.8'/%3E%3C/svg%3E") center / 14px no-repeat;
  border-color: var(--blue);
}

.main { padding: 0 24px 24px; }
.empty { padding: 28px 4px; }

/* ---------------------------------------------------------------- feed table */
table.feed {
  width: 100%;
  border-collapse: separate;
  border-spacing: 1px;
  background: var(--sep);
}
.feed th {
  background: var(--tan);
  text-align: left;
  font-weight: bold;
  padding: 5px 8px;
  white-space: nowrap;
}
.feed td { background: var(--row); padding: 5px 8px; vertical-align: middle; }
.feed tbody tr:nth-child(even) td { background: var(--row-alt); }
.feed tbody tr:hover td { background: #e9e1d9; }
.c-type { width: 168px; white-space: nowrap; }
.c-type .gt { color: var(--grey); }
.c-name { overflow-wrap: anywhere; }
.rec-link { font-weight: bold; }
.star-d { display: inline-flex; vertical-align: -2px; margin-left: 6px; }
.admin-table .c-name .i-star { margin-left: 6px; vertical-align: -2px; }
.m-meta { display: none; }
.c-date { width: 108px; white-space: nowrap; }
.c-link { width: 36px; text-align: center; }
.ext { display: inline-flex; color: var(--red); vertical-align: middle; }
.ext:hover { color: #6e1f16; }
.feed tfoot td { background: var(--page); text-align: center; padding: 10px 4px 4px; }
.pages { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 7px; }
.pages .next { display: inline-flex; }

/* ---------------------------------------------------------------- image grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 22px 16px;
  padding: 6px 0 4px;
}
.tile { display: flex; flex-direction: column; color: var(--ink); min-width: 0; }
.tile:hover { text-decoration: none; }
.tile:hover .tile-name { text-decoration: underline; }
.tile-img { display: flex; align-items: flex-end; aspect-ratio: 3 / 4; margin-bottom: 7px; }
.tile-img img, .tile-img .ph {
  display: block;
  width: 100%;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--box);
}
.r-34 { aspect-ratio: 3 / 4; }
.r-11 { aspect-ratio: 1 / 1; }
.ph {
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: var(--box);
  font: bold 34px/1 Georgia, "Times New Roman", serif;
}
.ph-0 { background: #74573e !important; }
.ph-1 { background: #5e6b5a !important; }
.ph-2 { background: #8c6f5a !important; }
.ph-3 { background: #4f5d6b !important; }
.ph-4 { background: #a3876b !important; }
.ph-5 { background: #6b5a6e !important; }
.ph-6 { background: #7a7f5a !important; }
.ph-7 { background: #5a6f73 !important; }
.ph-8 { background: #9a6b5a !important; }
.ph-9 { background: #3f4a52 !important; }
.tile-type { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-name {
  font-weight: bold;
  color: var(--navy);
  line-height: 1.3;
  margin: 1px 0 2px;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile-meta { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--grey); }
.grid-pager { text-align: center; padding: 18px 0 0; }

/* ---------------------------------------------------------------- detail */
.detail { max-width: 1000px; }
.detail-title {
  font-size: 19px;
  line-height: 1.3;
  margin: 2px 0 14px;
  overflow-wrap: anywhere;
}
.detail-title .i-star { width: 17px; height: 17px; vertical-align: -1px; margin-left: 6px; }
.detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  grid-template-areas: "info cover" "main cover";
  grid-template-rows: auto 1fr;
  column-gap: 32px;
}
.detail-body.no-cover { grid-template-columns: minmax(0, 1fr); grid-template-areas: "info" "main"; }
.info {
  grid-area: info;
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 32px;
  align-content: start;
  margin: 0;
}
.info.rows-1 { grid-template-rows: repeat(1, auto); }
.info.rows-2 { grid-template-rows: repeat(2, auto); }
.info.rows-3 { grid-template-rows: repeat(3, auto); }
.info.rows-4 { grid-template-rows: repeat(4, auto); }
.info.rows-5 { grid-template-rows: repeat(5, auto); }
.info.rows-6 { grid-template-rows: repeat(6, auto); }
.info.rows-7 { grid-template-rows: repeat(7, auto); }
.info.rows-8 { grid-template-rows: repeat(8, auto); }
.info.rows-9 { grid-template-rows: repeat(9, auto); }
.info.rows-10 { grid-template-rows: repeat(10, auto); }
.info .row { display: flex; gap: 8px; padding: 2px 0; min-width: 0; }
.info dt { flex: none; width: 84px; font-weight: bold; }
.info dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.info dd .gt { color: var(--grey); }
.cover { grid-area: cover; margin: 0; width: 100%; align-self: start; }
.cover img { display: block; width: 100%; object-fit: cover; border: 1px solid var(--line); background: var(--box); }
.cover.r-34 img { aspect-ratio: 3 / 4; }
.cover.r-11 img { aspect-ratio: 1 / 1; }
.detail-main { grid-area: main; min-width: 0; padding-top: 6px; }
.get {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 12px 0;
  color: var(--green);
  font-weight: bold;
  font-size: 15px;
  text-transform: uppercase;
}
.get .i-link { color: var(--red); width: 16px; height: 16px; }
.get:hover { color: #2c6a19; }
.nfo {
  margin: 0;
  padding: 14px 16px;
  background: var(--box);
  border: 1px solid var(--line);
  color: #111;
  font: 13px/1.55 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.admin-note {
  margin: 0 0 12px;
  padding: 6px 10px;
  background: #fff8d6;
  border: 1px solid #e3c766;
  display: inline-block;
}

/* ---------------------------------------------------------------- browse */
.browse { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px 28px; max-width: 1000px; }
.browse-col h2 { font-size: 14px; margin: 0 0 6px; padding: 4px 8px; background: var(--tan); }
.browse-col ul { list-style: none; margin: 0; padding: 0 8px; }
.browse-col li { padding: 2px 0; color: var(--grey); }

/* ---------------------------------------------------------------- footer */
.site-footer { text-align: center; padding: 18px 12px 36px; color: var(--grey); line-height: 1.8; }

/* ---------------------------------------------------------------- admin */
.admin-wrap { max-width: 1100px; }
.admin-wrap.narrow { max-width: 440px; }
.admin-tag { margin: 0; color: var(--grey); font-size: 12px; }
form.inline { display: inline; }
button.linkish {
  background: none; border: 0; padding: 0; height: auto; color: var(--navy); font: inherit; cursor: pointer;
}
button.linkish:hover { background: none; text-decoration: underline; }
.danger, button.danger { color: var(--red); }
.flash { background: #e8f3e0; border: 1px solid var(--green); padding: 6px 10px; margin: 0 0 12px; display: inline-block; }
.errors { background: #fbeaea; border: 1px solid var(--red); padding: 8px 12px; margin: 0 0 14px; }
.errors ul { margin: 4px 0 0; padding-left: 18px; }
.admin-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.btn { display: inline-flex; align-items: center; font-weight: bold; }
.btn.secondary { font-weight: normal; }
.admin-search { display: flex; gap: 6px; }
.admin-search input { width: 260px; height: 30px; }
.admin-table .c-status, .admin-table .c-img { white-space: nowrap; width: 80px; }
.admin-table .c-actions { white-space: nowrap; width: 150px; }
.rec-form fieldset { border: 1px solid var(--line); background: #fff; margin: 0 0 14px; padding: 10px 14px 14px; }
.rec-form legend { font-weight: bold; padding: 0 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px 18px; align-items: start; }
.rec-form label { display: block; }
.rec-form label > span { display: block; font-weight: bold; font-size: 12px; margin-bottom: 3px; }
.rec-form input:not([type="checkbox"]), .rec-form select, .rec-form textarea { width: 100%; }
.rec-form input:not([type="checkbox"]):not([type="file"]), .rec-form select { height: 32px; }
.rec-form input[type="file"] { border: 0; padding: 4px 0; }
.rec-form label.check { display: flex; align-items: center; gap: 6px; padding-top: 18px; font-weight: bold; font-size: 12px; }
.rec-form label.check input { width: 15px; height: 15px; margin: 0; }
.rec-form small { display: block; color: var(--grey); font-size: 11px; margin-top: 3px; }
textarea { resize: vertical; line-height: 1.5; }
textarea.mono { font-family: var(--mono); font-size: 13px; background: var(--box); }
.current-image { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 10px; }
.current-image img, .current-image-preview { max-width: 150px; max-height: 200px; border: 1px solid var(--line); display: block; }
.current-image .check { padding-top: 0 !important; }
.current-image-preview { margin: 10px 0 4px; }
.actions { display: flex; align-items: center; gap: 12px; }
.login fieldset { padding: 14px; }
.login .actions { margin-top: 12px; }
code { font-family: var(--mono); background: var(--box); padding: 0 3px; }

/* ---------------------------------------------------------------- mobile */
@media (max-width: 640px) {
  .site-header { gap: 10px; padding: 10px 8px 8px; }
  .logo svg { width: 54px; height: 54px; }
  .controls { flex: 1; gap: 7px; padding-top: 0; }
  .nav { font-size: 12px; }
  .nav .long { display: none; }
  .search-row input { width: auto; flex: 1; min-width: 0; font-size: 16px; height: 30px; }
  .search-row button { padding: 0 8px; font-size: 12px; }
  .filter-row { gap: 4px 10px; font-size: 12px; }
  .filter-row select, .show-images { display: none; }
  .cb input { width: 13px; height: 13px; }

  .subbar { padding: 4px 8px 6px; }
  .subbar h1 { font-size: 13px; }
  .toggle-images { display: inline-flex; }

  .main { padding: 0 4px 16px; }

  .feed thead, .c-date, .c-link { display: none; }
  .feed td { padding: 5px 6px; vertical-align: top; }
  .c-type { width: 76px; white-space: normal; font-size: 11px; line-height: 1.35; }
  .c-type .gt { display: none; }
  .c-type .sub { display: block; color: var(--text-2); }
  .star-d { display: none; }
  .m-meta { display: flex; align-items: center; gap: 5px; margin-top: 2px; font-size: 11px; color: var(--grey); }
  .m-meta .ext svg { width: 13px; height: 13px; }

  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 8px; }
  .tile-name { font-size: 11px; }
  .tile-type, .tile-meta { font-size: 10px; }
  .ph { font-size: 24px; }

  .detail-title { font-size: 15px; margin-bottom: 10px; }
  .detail-body { grid-template-columns: minmax(0, 1fr) 104px; grid-template-areas: "info cover" "main main"; column-gap: 10px; }
  .info, .info[class*="rows-"] { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; font-size: 12px; }
  .info dt { width: 66px; }
  .get { font-size: 13px; margin: 10px 0; }
  .nfo { font-size: 12px; padding: 10px; }

  .site-footer { font-size: 12px; }
  input, select, textarea { font-size: 16px; }
  .admin-search input { width: 100%; }
  .admin-table .c-date, .admin-table .c-status, .admin-table .c-img { display: none; }
}
