:root {
  --bg: #f4efe4;
  --bg-strong: #efe6d2;
  --panel: rgba(255, 252, 246, 0.82);
  --panel-strong: rgba(255, 250, 242, 0.94);
  --text: #211b18;
  --muted: #615349;
  --line: rgba(33, 27, 24, 0.14);
  --accent: #c6492d;
  --accent-strong: #8e2f17;
  --olive: #325844;
  --warning: #8f3d2c;
  --shadow: 0 18px 40px rgba(33, 27, 24, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(rgba(33, 27, 24, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(33, 27, 24, 0.03) 1px, transparent 1px),
    radial-gradient(circle at top left, rgba(198, 73, 45, 0.18), transparent 25%),
    radial-gradient(circle at top right, rgba(50, 88, 68, 0.12), transparent 22%),
    linear-gradient(180deg, #f6f1e8 0%, #f4efe4 42%, #ece3d0 100%);
  background-size: 30px 30px, 30px 30px, auto, auto, auto;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  min-height: 100vh;
}

a {
  color: inherit;
}

img,
video {
  display: block;
  max-width: 100%;
}

iframe {
  border: 0;
  width: 100%;
}

.page-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 4rem;
}

.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding: 2rem 1rem 1.25rem;
}

.site-logo {
  text-decoration: none;
}

.eyebrow,
.card-meta,
.link-preview-site {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.73rem;
  color: var(--muted);
}

.logo-title,
h1,
h2,
h3 {
  font-family: "Bitter", Georgia, serif;
}

.logo-title {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  gap: 0.65rem;
}

.site-tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button {
  cursor: pointer;
  font: inherit;
  background: transparent;
}

.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff8f3;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.45);
}

.button-danger {
  background: var(--warning);
  border-color: var(--warning);
  color: #fff7f1;
}

.flash-stack {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.flash {
  padding: 0.85rem 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.flash-success {
  border-color: rgba(50, 88, 68, 0.25);
}

.flash-error {
  border-color: rgba(198, 73, 45, 0.28);
}

.page-intro,
.auth-card,
.empty-state,
.editor-form,
.submission-card,
.admin-card {
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.page-intro h1,
.auth-card h1,
.dashboard-header h1 {
  margin: 0.25rem 0 0.9rem;
  font-size: clamp(2.3rem, 5vw, 4.9rem);
  line-height: 0.94;
}

.page-intro p,
.empty-state p {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.02rem;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin: 2.2rem 0 1.1rem;
}

.empty-state h2,
.admin-card h2 {
  margin: 0.1rem 0 0.3rem;
  font-size: clamp(1.7rem, 2.8vw, 2.7rem);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.1rem;
}

.submission-card,
.admin-card {
  border-radius: 28px;
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.card-meta,
.admin-card-summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.card-header h3 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1;
}

.card-header h3 a {
  text-decoration: none;
}

.card-header h3 a:hover {
  color: var(--accent);
}

.card-caption,
.admin-card-caption {
  margin: 0.4rem 0 0;
  color: var(--accent-strong);
}

.media-frame {
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(33, 27, 24, 0.06);
  aspect-ratio: 16 / 10;
}

.media-frame img,
.media-frame video,
.media-frame iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame-audio {
  aspect-ratio: auto;
  padding: 1rem;
}

.media-frame-admin {
  aspect-ratio: auto;
}

.media-frame-admin figcaption {
  padding: 0.7rem 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.card-description,
.admin-card-description {
  margin: 0;
  color: var(--text);
  white-space: pre-line;
  line-height: 1.6;
}

.link-preview {
  display: grid;
  grid-template-columns: minmax(0, 108px) minmax(0, 1fr);
  gap: 0.9rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  text-decoration: none;
  background: rgba(255, 252, 246, 0.6);
}

.link-preview-thumb {
  border-radius: 16px;
  overflow: hidden;
  min-height: 88px;
  background: rgba(33, 27, 24, 0.08);
}

.link-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-preview-copy {
  display: grid;
  gap: 0.35rem;
  align-content: start;
}

.link-preview-copy strong {
  font-size: 1.05rem;
}

.link-preview-copy span:last-child {
  color: var(--muted);
  line-height: 1.5;
}

.page-intro,
.auth-card,
.editor-form,
.empty-state {
  border-radius: 32px;
}

.page-intro,
.empty-state {
  padding: clamp(1.4rem, 3vw, 2rem);
}

.editor-form {
  display: grid;
  gap: 1rem;
  padding: clamp(1.2rem, 3vw, 2rem);
}

.editor-form label {
  display: grid;
  gap: 0.45rem;
}

.editor-form span {
  font-weight: 500;
}

.editor-form input,
.editor-form textarea {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.8);
  color: var(--text);
  font: inherit;
}

.editor-form textarea {
  min-height: 10rem;
  resize: vertical;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-actions p {
  margin: 0;
  color: var(--muted);
  max-width: 38ch;
}

.auth-shell {
  display: grid;
  place-items: center;
  padding: 3rem 0;
}

.auth-card {
  max-width: 520px;
  padding: 2rem;
}

.compact-form {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.status-tabs {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.status-tab {
  display: inline-flex;
  gap: 0.7rem;
  align-items: center;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.58);
  text-decoration: none;
}

.status-tab-active {
  background: var(--accent);
  color: #fffaf5;
  border-color: var(--accent);
}

.admin-stack {
  display: grid;
  gap: 1rem;
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.admin-actions form {
  display: grid;
  gap: 0.65rem;
}

.admin-actions textarea {
  min-height: 6rem;
}

.admin-comments {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
  display: grid;
  gap: 0.5rem;
}

.admin-comment {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.admin-comment-body {
  display: grid;
  gap: 0.15rem;
  font-size: 0.9rem;
  min-width: 0;
}

.admin-comment-body span {
  color: var(--muted);
}

.button-small {
  min-height: auto;
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
}

.share-card-section {
  display: grid;
  gap: 0.65rem;
}

.share-card {
  max-width: 400px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.share-card-image {
  aspect-ratio: 1.91 / 1;
  background: rgba(33, 27, 24, 0.05);
  overflow: hidden;
}

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

.share-card-no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-size: 0.88rem;
}

.share-card-meta {
  padding: 0.65rem 0.85rem;
  display: grid;
  gap: 0.15rem;
}

.share-card-meta span:first-child {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
  color: var(--muted);
}

.share-card-meta strong {
  font-size: 0.95rem;
  line-height: 1.25;
}

.share-card-meta span:last-child {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.share-card-upload {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
}

.share-card-upload .button {
  white-space: nowrap;
}

.link-preview-text-only {
  grid-template-columns: 1fr;
}

.category-filters {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.58);
  text-decoration: none;
  font-size: 0.75rem;
  transition: background 180ms ease, border-color 180ms ease;
}

.category-pill:hover {
  background: rgba(255, 252, 246, 0.85);
}

.category-pill-active {
  background: var(--accent);
  color: #fffaf5;
  border-color: var(--accent);
}

.editor-form select {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.8);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.submission-detail {
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 32px;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  display: grid;
  gap: 1.25rem;
  max-width: 760px;
  margin: 0 auto;
}

.submission-detail h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.96;
  margin: 0;
}

.submission-credit {
  color: var(--muted);
  font-size: 0.9rem;
}

.share-links {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}

.share-links .eyebrow {
  margin-right: 0.3rem;
}

.card-votes {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.25rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.vote-score {
  font-weight: 600;
  color: var(--text);
  min-width: 1.5em;
  text-align: center;
}

.vote-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
}

.vote-link:hover {
  color: var(--text);
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.vote-buttons {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.vote-buttons form {
  display: contents;
}

.vote-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted);
  transition: color 150ms, border-color 150ms;
}

.vote-btn:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent);
}

.vote-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.vote-active {
  color: var(--accent);
  border-color: var(--accent);
}

.comments-section {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}

.comments-section h2 {
  font-size: 1.2rem;
  margin: 0 0 1rem;
}

.comment {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.comment:last-of-type {
  border-bottom: 0;
}

.comment-meta {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
}

.comment-meta time {
  color: var(--muted);
  font-size: 0.78rem;
}

.comment p {
  margin: 0;
  line-height: 1.5;
}

.comment-form {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.8);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
}

.comment-form textarea {
  min-height: 4rem;
  resize: vertical;
}

.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--text);
}

.search-form {
  display: flex;
  gap: 0.75rem;
  align-items: end;
}

.search-form label {
  flex: 1;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
}

.pagination-info {
  color: var(--muted);
  font-size: 0.95rem;
}


@media (max-width: 860px) {
  .dashboard-header,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 1rem, 1180px);
  }

  .submission-card,
  .admin-card,
  .editor-form,
  .page-intro,
  .auth-card,
  .empty-state {
    border-radius: 24px;
  }

  .link-preview {
    grid-template-columns: 1fr;
  }

  .link-preview-thumb {
    min-height: 180px;
  }

  .card-header h3 {
    font-size: 1.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .site-nav a,
  .button {
    animation: none;
    transition: none;
  }
}

.fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(198, 73, 45, 0.35);
  transition: transform 150ms ease, box-shadow 150ms ease;
  z-index: 10;
}

.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 22px rgba(198, 73, 45, 0.45);
}

.text-size-controls {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.text-size-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1;
}

.text-size-btn:hover {
  color: var(--text);
  border-color: var(--text);
}
