html, body {
  margin: 0;
  padding: 0;
  background: #ececec;
  color: #000;
  font: 13px/1.4 Arial, Helvetica, sans-serif;
}

a { color: #0033cc; }
a:visited { color: #551a8b; }

#wrap {
  max-width: 960px;
  margin: 0 auto;
  background: #fff;
  border-left: 1px solid #999;
  border-right: 1px solid #999;
  min-height: 100vh;
}

#header {
  background: #c5d0e6;
  border-bottom: 1px solid #999;
  padding: 8px 12px;
  display: table;
  width: 100%;
  box-sizing: border-box;
}

#header h1 {
  display: block;
  margin: 0;
  font-size: 20px;
}

.site {
  display: table-cell;
  vertical-align: middle;
}

.site-stats {
  margin: 2px 0 0;
  font-size: 12px;
  color: #555;
}

#header h1 a { color: #000; text-decoration: none; }
#header h1 a:visited { color: #000; }

#search-form {
  display: table-cell;
  vertical-align: middle;
  text-align: right;
}

#q {
  width: 280px;
  font-size: 16px;
  padding: 3px;
}

#content { padding: 12px; }

h2 { font-size: 16px; margin: 16px 0 8px; }
h3 { font-size: 14px; margin: 14px 0 6px; }
.count { font-weight: normal; color: #555; }

table.listing {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #999;
}

table.listing th {
  background: #ddd;
  text-align: left;
  padding: 4px 6px;
  border-bottom: 1px solid #999;
}

table.listing td {
  padding: 6px;
  border-bottom: 1px solid #ccc;
  vertical-align: middle;
}

table.listing .thumb img {
  width: 80px;
  height: auto;
  display: block;
  background: #000;
}

table.listing .title { font-weight: bold; }
table.listing .date, table.listing .dur, table.listing .likes, table.listing .views {
  white-space: nowrap;
  color: #333;
}

.pager { margin: 12px 0; text-align: center; }

.back { margin: 0 0 8px; }

.video-layout { display: block; }

.player-col video {
  display: block;
  max-width: 100%;
  width: auto;
  max-height: 80vh;
  height: auto;
  background: #000;
}

#like-form { margin: 10px 0 16px; }
#like-button { font-size: 13px; padding: 3px 10px; }
#like-button:disabled { color: #666; }
.like-status { margin-left: 8px; color: #060; }

.view-count { margin: 6px 0 0; font-size: 12px; color: #555; }

table.meta { border-collapse: collapse; }
table.meta th {
  text-align: left;
  padding: 3px 12px 3px 0;
  vertical-align: top;
  color: #333;
  white-space: nowrap;
}
table.meta td { padding: 3px 0; }

.visual, .transcript-full { white-space: pre-wrap; }
.transcript-full { font-size: 14px; margin: 0 0 10px; }
.transcript { list-style: none; padding: 0; margin: 0 0 14px; font-size: 12px; color: #333; }
.transcript li { margin-bottom: 6px; }
.transcript .time { color: #555; }
.flags { font-size: 11px; color: #999; }
.meta-small {
  margin-top: 12px;
  font-size: 11px;
  color: #555;
  line-height: 1.45;
}
.meta-small p { margin: 0 0 4px; }
.onscreen-text { white-space: pre-wrap; }

.tag {
  display: inline-block;
  margin: 0 3px 3px 0;
  padding: 1px 6px;
  border: 1px solid #99a;
  background: #e8eef8;
  color: #0033cc;
  text-decoration: none;
  font-size: 11px;
}
.tag:visited { color: #551a8b; }

.search-hit {
  display: table;
  width: 100%;
  border-bottom: 1px solid #ccc;
  padding: 8px 0;
}
.search-hit .thumb {
  display: table-cell;
  width: 90px;
  vertical-align: top;
  padding-right: 10px;
}
.search-hit .thumb img {
  width: 80px;
  height: auto;
  background: #000;
  display: block;
}
.search-hit .hit-body { display: table-cell; vertical-align: top; }
.search-hit .title { font-weight: bold; }
.search-hit .hit-transcript { margin: 6px 0; }
.search-hit .hit-transcript b { font-weight: bold; }
.search-hit .hit-meta { margin: 0; color: #555; font-size: 12px; }

#search-status { padding: 4px 12px; color: #555; }

@media (min-width: 900px) {
  .video-layout {
    display: table;
    width: 100%;
  }
  .player-col, .meta-col {
    display: table-cell;
    vertical-align: top;
  }
  .player-col { width: 42%; padding-right: 16px; }
}

@media (max-width: 720px) {
  #header {
    display: block;
    text-align: left;
  }
  .site { display: block; }
  #header h1 { font-size: 18px; }
  .site-stats { margin-top: 4px; }
  #search-form {
    display: flex;
    margin-top: 8px;
  }
  #q {
    flex: 1;
    width: auto;
    min-width: 0;
    box-sizing: border-box;
  }
  #search-form button {
    min-height: 44px;
    min-width: 44px;
  }

  #like-button { min-height: 44px; }

  .pager a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 4px 12px;
    box-sizing: border-box;
  }

  table.listing { border: 0; }
  table.listing thead { display: none; }
  table.listing, table.listing tbody, table.listing tr.vrow {
    display: block;
  }
  table.listing tr.vrow {
    position: relative;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin: 0 0 10px;
    padding: 8px 10px;
    background: #fff;
  }
  table.listing tr.vrow td {
    display: block;
    padding: 2px 0;
    border: 0;
  }
  table.listing tr.vrow td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: #555;
  }
  table.listing tr.vrow td.thumb::before,
  table.listing tr.vrow td.likes::before,
  table.listing tr.vrow td.views::before {
    content: none;
  }
  /* The stretched pseudo-element of the title link covers the whole card,
     so even a one-line caption is a comfortable tap target. */
  table.listing tr.vrow td.title a::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
  }
}

@media (max-width: 980px) {
  #wrap { border: 0; }
  #content { padding: 12px 8px; }
}
