* {
  box-sizing: border-box
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #e6e6e6;
  background: #0f0f10
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px
}

.header-inner,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px
}

.site-nav {
  display: flex;
  gap: 12px
}

.site-nav a {
  color: #cfcfcf;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid transparent
}

.site-nav a:hover {
  background: #18181b;
  border-color: #2a2a2b;
  color: #fff
}

.site-footer {
  border-top: 1px solid #2a2a2b;
  border-bottom: none;
  margin-top: 32px;
  padding: 8px 0;
  color: #a0a0a0;
  background: #0f0f10;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 998
}

/* Reserve space so content isn't hidden behind fixed footer */
body {
  padding-bottom: 40px
}

.muted {
  color: #a0a0a0
}

.small {
  font-size: 12px
}

.site-header,
.site-footer {
  border-bottom: 1px solid #2a2a2b
}

.site-footer {
  border-top: 1px solid #2a2a2b;
  border-bottom: none;
  margin-top: 32px;
  padding: 8px 0;
  color: #a0a0a0
}

.site-header {
  padding: 12px 0;
  margin-bottom: 12px;
  background: #0f0f10
}

.site-title {
  text-decoration: none;
  color: #fafafa;
  font-weight: 600
}

.h1 {
  font-size: 22px;
  margin: 8px 0 16px;
  color: #fafafa
}

.notice {
  padding: 10px 12px;
  background: #1b1b1d;
  border: 1px solid #333;
  color: #d9b94e;
  border-radius: 6px
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px
}

.card {
  display: block;
  background: #151518;
  border: 1px solid #2a2a2b;
  border-radius: 8px;
  overflow: hidden;
  color: inherit;
  text-decoration: none
}

.card .thumb {
  aspect-ratio: 1/1;
  background: #101014;
  display: flex;
  align-items: center;
  justify-content: center
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

.card .caption {
  padding: 8px 10px;
  border-top: 1px solid #202024;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px
}

/* New caption structure for homepage: left column with title and byline */
.card .caption .cap-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0
}

.card .caption .cap-left .title,
.card .name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f0f0f0
}

.card .caption .cap-left .by {
  color: #a0a0a0
}

.card .caption .cap-left .by a {
  color: inherit;
  text-decoration: none
}

.card .caption .cap-left .by a:hover {
  text-decoration: underline
}

.card .views {
  font-variant-numeric: tabular-nums;
  color: #c8c8c8;
  flex: 0 0 auto;
  white-space: nowrap
}

.search-bar {
  margin: 6px 0 14px;
  display: flex;
  justify-content: center
}

.search-form {
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: 520px;
  width: 100%
}

.search-form input[type=text] {
  width: 320px;
  flex: 0 0 auto;
  background: #121215;
  border: 1px solid #2a2a2b;
  color: #e6e6e6;
  border-radius: 8px;
  padding: 10px 12px;
  outline: none
}

.search-form input[type=text]::placeholder {
  color: #777
}

.search-form button {
  flex: 0 0 auto;
  background: #1c1c20;
  border: 1px solid #2a2a2b;
  color: #eaeaea;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer
}

.search-form button:hover {
  background: #212127
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 640px
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px
}

.form-row input,
.form-row select,
.form-row textarea {
  background: #121215;
  border: 1px solid #2a2a2b;
  color: #e6e6e6;
  border-radius: 8px;
  padding: 10px 12px;
  outline: none
}

.form-actions {
  margin-top: 4px
}

.form-actions button {
  background: #1c1c20;
  border: 1px solid #2a2a2b;
  color: #eaeaea;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer
}

.form-actions button:hover {
  background: #212127
}

@media (max-width:520px) {
  .search-form {
    max-width: 100%;
    flex-direction: column;
    align-items: stretch
  }

  .search-form input[type=text] {
    width: 100%
  }

  .search-form button {
    width: 100%
  }
}

@media (max-width:420px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr))
  }
}

.spinner {
  display: inline-block;
  padding: 10px 12px;
  border: 1px dashed #2a2a2b;
  color: #cfcfcf;
  border-radius: 8px
}

/* Ads */
.ad-sticky {
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 1000
}

.ad-mobile {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  display: none;
  background: rgba(15, 15, 16, 0.95);
  border-top: 1px solid #2a2a2b;
  padding: env(safe-area-inset-bottom, 0) 8px 8px
}

.ad-inner {
  background: #151518;
  border: 1px solid #2a2a2b;
  border-radius: 8px;
  padding: 4px;
  margin: 0 auto;
  max-width: 420px
}

@media (max-width:720px) {
  .ad-sticky {
    display: none
  }

  .ad-mobile {
    display: block
  }
}

.ad-native .thumb {
  aspect-ratio: auto;
  padding: 0
}

.ad-native .caption {
  justify-content: flex-start
}

.ad-label {
  color: #a0a0a0;
  font-size: 12px
}