/*
Theme Name: Link Dump 
Theme URI: http://github.com/chrismccoy/linkdump
Author: Chris McCoy
Author URI: http://github.com/chrismccoy
Description: Dark, clean link submission theme with AJAX A-Z index, search and archives.
Version: 1.0
Text Domain: links
*/

:root {
  --bg: #09090b;
  --panel: rgba(24, 24, 27, 0.6);
  --panel-solid: rgba(24, 24, 27, 0.8);
  --border: #27272a;
  --border-soft: rgba(39, 39, 42, 0.8);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --muted-2: #71717a;
  --faint: #52525b;
  --faint-2: #3f3f46;
  --rose: #f43f5e;
  --rose-light: #fb7185;
  --rose-dark: #e11d48;
  --radius: 0.75rem;
  --radius-lg: 1rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 40px 40px;
}

.top-accent {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  z-index: 50;
  background: linear-gradient(90deg, transparent, var(--rose), transparent);
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 64rem;
  margin: 0 auto;
  padding: 4rem 2rem;
}

@media (max-width: 640px) {
  .wrap {
    padding: 2.5rem 1.25rem;
  }
}

.site-head {
  margin-bottom: 2.5rem;
}

.site-head-top {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  justify-content: space-between;
}

@media (min-width: 640px) {
  .site-head-top {
    flex-direction: row;
    align-items: flex-start;
  }
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 0.125rem;
}

.wordmark-link {
  font-size: clamp(2.75rem, 6vw, 3.75rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}

.brand-babe {
  background: linear-gradient(135deg, var(--rose-light), var(--rose-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-dump {
  color: var(--text);
}

.badge {
  align-self: flex-end;
  margin: 0 0 0.25rem 0.5rem;
  border-radius: 0.25rem;
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid rgba(244, 63, 94, 0.3);
  padding: 0.125rem 0.375rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--rose-light);
}

.tagline {
  margin-top: 1rem;
  max-width: 32rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted-2);
}

.tagline-em {
  color: var(--rose-light);
  font-weight: 500;
}

.stats {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.stat {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel-solid);
  padding: 1rem 1.25rem;
  text-align: center;
}

.stat--pending {
  border-color: rgba(244, 63, 94, 0.2);
  background: rgba(244, 63, 94, 0.05);
  box-shadow:
    0 0 0 1px rgba(244, 63, 98, 0.15),
    0 0 20px rgba(244, 63, 98, 0.08);
}

.stat-num {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.stat--pending .stat-num {
  color: var(--rose-light);
}

.stat-label {
  margin-top: 0.125rem;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--faint);
}

.stat--pending .stat-label {
  color: var(--rose-dark);
}

.pulse-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: var(--rose);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.mainnav {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.25rem;
  border-top: 1px solid var(--border-soft);
  padding-top: 1.5rem;
}

.mainnav a {
  border-radius: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-2);
  transition:
    color 0.15s,
    background-color 0.15s,
    border-color 0.15s;
}

.mainnav a:hover {
  color: var(--text);
  background: var(--faint-2);
}

.mainnav a.nav-home {
  color: #18181b;
  background: var(--text);
  font-weight: 600;
}
.mainnav a.nav-home:hover {
  background: #fff;
}

.mainnav a[href*="submit"] {
  border: 1px solid rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.1);
  color: var(--rose-light);
  font-weight: 600;
}
.mainnav a[href*="submit"]:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: rgba(244, 63, 94, 0.6);
}

.azbar {
  margin-bottom: 2rem;
}

.azbar-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.125rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 0.5rem;
}

.az {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  height: 2rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  transition:
    color 0.15s,
    background-color 0.15s;
}

.az.azindex:hover {
  color: #fff;
  background: var(--rose);
}
.az.azindex.active {
  color: #fff;
  background: var(--rose);
}

.az-off {
  color: var(--faint-2);
  font-weight: 500;
  cursor: default;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1.25rem;
}

.page-head h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page-head h2 span {
  color: var(--rose-light);
}

.page-head-meta {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--faint);
}

.linkset {
  margin-bottom: 2rem;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--panel);
}

.linkset-head {
  display: none;
  grid-template-columns: 100px 1fr 130px;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel-solid);
  padding: 0.75rem 1.25rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--faint);
}

.linkset-head .ta-r {
  text-align: right;
}

@media (min-width: 640px) {
  .linkset-head {
    display: grid;
  }
}

.posts {
  list-style: none;
}

.link-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid rgba(39, 39, 42, 0.6);
  transition: background-color 0.15s;
}

.posts .link-row:first-child {
  border-top: 0;
}

.link-row:hover {
  background: rgba(39, 39, 42, 0.5);
}

@media (min-width: 640px) {
  .link-row {
    grid-template-columns: 100px 1fr 130px;
    gap: 1rem;
  }
}

.cell-cat {
  order: 2;
  grid-column: 1 / -1;
}

@media (min-width: 640px) {
  .cell-cat {
    order: 1;
    grid-column: auto;
  }
}

.link-cat {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(244, 63, 94, 0.7);
  transition: color 0.15s;
}

.link-cat:hover {
  color: var(--rose-light);
}

.link-cat .dot {
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 9999px;
  background: currentColor;
}

.cell-name {
  order: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

@media (min-width: 640px) {
  .cell-name {
    order: 2;
  }
}

.rank {
  flex-shrink: 0;
  width: 1.25rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--faint-2);
  font-variant-numeric: tabular-nums;
}

.link-name {
  font-weight: 600;
  color: #e4e4e7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s;
}

.link-row:hover .link-name {
  color: #fff;
}

.link-arrow {
  flex-shrink: 0;
  width: 0.875rem;
  height: 0.875rem;
  color: var(--rose);
  opacity: 0;
  transform: translateX(-4px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

.link-row:hover .link-arrow {
  opacity: 1;
  transform: translateX(0);
}

.hl {
  background: none;
  color: var(--rose-light);
  font-weight: 700;
}

.cell-views {
  order: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.meter {
  display: none;
  width: 4rem;
  height: 0.25rem;
  border-radius: 9999px;
  background: var(--faint-2);
  overflow: hidden;
}

@media (min-width: 640px) {
  .meter {
    display: block;
  }
}

.meter-fill {
  display: block;
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--rose-dark), var(--rose-light));
}

.views-num {
  white-space: nowrap;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.linkset-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  background: var(--panel-solid);
  padding: 0.75rem 1.25rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--faint);
}

.empty-note {
  padding: 2rem 1.25rem;
  color: var(--muted-2);
}

.pagenavi {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin-bottom: 3.5rem;
}

.pagenavi .page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.25rem;
  min-width: 2.25rem;
  padding: 0 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: rgba(24, 24, 27, 0.9);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-2);
  transition:
    color 0.15s,
    border-color 0.15s,
    background-color 0.15s;
}

.pagenavi .page:hover {
  color: var(--text);
  border-color: var(--faint-2);
}

.pagenavi .page.current {
  border-color: transparent;
  background: var(--rose);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 15px -3px rgba(244, 63, 94, 0.2);
}

.pagenavi .page-nav {
  border-color: var(--faint-2);
  background: var(--faint-2);
  color: var(--muted);
}
.pagenavi .page-nav svg {
  width: 1rem;
  height: 1rem;
}

.site-foot {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.tagcloud-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--faint);
}

.tagcloud-head .rule {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.tagcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-pill {
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: rgba(24, 24, 27, 0.9);
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-2);
  transition:
    color 0.15s,
    border-color 0.15s,
    background-color 0.15s;
}

.tag-pill:hover {
  color: var(--rose-light);
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.05);
}

.foot-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  border-top: 1px solid var(--border-soft);
  padding-top: 1.5rem;
}

@media (min-width: 640px) {
  .foot-bar {
    flex-direction: row;
    align-items: center;
  }
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wordmark-sm {
  font-size: 0.875rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}
.wordmark-sm .brand-dump {
  color: var(--muted);
}

.foot-dot {
  color: var(--faint-2);
  font-size: 0.75rem;
}
.foot-note {
  font-size: 0.75rem;
  color: var(--faint);
}

.foot-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--faint-2);
}
.foot-links a {
  transition: color 0.15s;
}
.foot-links a:hover {
  color: var(--muted);
}

.taxonomies {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 1.5rem;
}

.taxonomies #tags {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 1rem;
}

.searchcontrols {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.875rem;
  color: var(--muted-2);
}

.tagtoggle {
  cursor: pointer;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  padding: 0.25rem 0.75rem;
  color: var(--muted);
  transition:
    color 0.15s,
    background-color 0.15s,
    border-color 0.15s;
}
.tagtoggle:hover {
  color: var(--text);
  border-color: var(--faint-2);
}
.tagtoggle.selected {
  color: #18181b;
  background: var(--text);
  border-color: transparent;
  font-weight: 600;
}

.searchcontrols .slash {
  color: var(--faint-2);
}

.taglist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.taglist a {
  cursor: pointer;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: rgba(24, 24, 27, 0.9);
  padding: 0.375rem 0.875rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted-2);
  transition:
    color 0.15s,
    background-color 0.15s,
    border-color 0.15s;
}

.taglist a:hover {
  color: var(--rose-light);
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.05);
}

.taglist a.selectedtag {
  color: #fff;
  background: var(--rose);
  border-color: transparent;
  font-weight: 600;
}

.searchtags {
  display: inline-block;
  margin-top: 1.5rem;
  cursor: pointer;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  background: var(--rose);
  padding: 0.625rem 1.25rem;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 10px 15px -3px rgba(244, 63, 94, 0.2);
  transition: background-color 0.15s;
}
.searchtags:hover {
  background: var(--rose-dark);
}

.archive-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.archive-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.archive-field h4 {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--faint);
}

.archive-page select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 12rem;
  border-radius: 0.5rem;
  border: 1px solid var(--faint-2);
  background-color: #09090b;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.archive-page select:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15);
}

.archive-page select option {
  background: #18181b;
  color: var(--text);
}

#archive-wrapper {
  margin-top: 0;
}

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.sm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(4px);
  animation: sm-fade 0.15s ease;
}

.sm-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 30rem);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: #18181b;
  padding: 1.5rem;
  box-shadow:
    0 0 0 1px rgba(244, 63, 98, 0.15),
    0 20px 60px rgba(0, 0, 0, 0.6);
  animation: sm-pop 0.15s ease;
}

.sm-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}
.sm-title span {
  color: var(--rose-light);
}

.sm-input {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid var(--faint-2);
  background: #09090b;
  padding: 0.625rem 0.75rem;
  font: inherit;
  color: var(--text);
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.sm-input::placeholder {
  color: var(--faint);
}
.sm-input:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15);
}

.sm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.sm-btn {
  cursor: pointer;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s;
}

.sm-cancel {
  background: none;
  border-color: var(--border);
  color: var(--muted);
}
.sm-cancel:hover {
  color: var(--text);
  border-color: var(--faint-2);
}

.sm-go {
  background: var(--rose);
  color: #fff;
  box-shadow: 0 10px 15px -3px rgba(244, 63, 94, 0.2);
}
.sm-go:hover {
  background: var(--rose-dark);
}

@keyframes sm-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes sm-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
