/* Base Styles for Detective Corkboard Theme */

body {
  background-color: var(--bg);
  color: var(--text-hi);
  font-family: var(--font-serif);
}

h1, h2, h3, h4, h5, h6, p, a, button, span, div {
  font-family: var(--font-serif);
}

/* Paper Card Helper */
.paper {
  background-color: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card), inset 0 0 0 1px rgba(101, 67, 33, 0.08);
  position: relative;
  overflow: hidden;
}

.paper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(0,0,0,0.08) 1px, transparent 1px);
  background-size: 4px 4px;
  opacity: 0.12;
  pointer-events: none;
  z-index: 1;
}

.paper > * {
  position: relative;
  z-index: 2;
}

/* Pin Decoration */
.pin {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #b91c1c;
  box-shadow: var(--shadow-pin);
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
}

.pin::before {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  top: 2px;
  left: 2px;
}

/* Cork Background */
.cork {
  background-color: var(--surface);
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(139, 92, 46, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(101, 67, 33, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(120, 81, 45, 0.06) 0%, transparent 50%);
  position: relative;
}

.cork::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.15;
  pointer-events: none;
}

/* Red String/Twine */
.string-stroke {
  stroke: var(--string);
  stroke-width: 3;
  stroke-linecap: round;
  fill: none;
  opacity: 0.85;
}

/* Focus Styles */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Typography for dark backgrounds */
.dark-text {
  color: var(--text-hi);
}

.dark-text-muted {
  color: var(--text-lo);
}

/* Button Styles */
.btn-primary {
  background-color: var(--accent);
  color: var(--ink);
  padding: 0.75rem 1.5rem;
  border-radius: calc(var(--radius) / 2);
  font-weight: 600;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: #d97706;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.btn-secondary {
  background-color: var(--paper);
  color: var(--ink);
  padding: 0.75rem 1.5rem;
  border-radius: calc(var(--radius) / 2);
  font-weight: 600;
  transition: all 0.2s;
  border: 2px solid var(--ink);
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: #e8e7e0;
  transform: translateY(-1px);
}

/* Filter Button Styles */
.btn-filter {
  padding: 0.5rem 1rem;
  border-radius: calc(var(--radius) / 2);
  border: 2px solid #a8a29e;
  background-color: transparent;
  color: #d6d3d1;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-filter:hover {
  background-color: #292524;
}

.btn-filter-active {
  padding: 0.5rem 1rem;
  border-radius: calc(var(--radius) / 2);
  background-color: var(--accent);
  color: white;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

/* Enhanced Theme Utilities */
.news-collage {
  background-image: url('/textures/newsprint.jpg');
  background-size: 800px;
  filter: grayscale(100%) contrast(1.1) brightness(0.95);
  opacity: 0.35;
}

.brush-red {
  background-image: url('/textures/brush-red.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.torn-label {
  -webkit-mask-image: url('/textures/torn-edge.png');
  mask-image: url('/textures/torn-edge.png');
  -webkit-mask-size: cover;
  mask-size: cover;
}

.card-rot-1 { transform: rotate(-0.8deg); }
.card-rot-2 { transform: rotate(0.6deg); }
.card-rot-3 { transform: rotate(-1.2deg); }
.card-rot-4 { transform: rotate(1deg); }

/* Pill Button Style */
.btn-pill {
  padding: 0.625rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.2s;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
}

.btn-pill-primary {
  background-color: var(--accent);
  color: var(--ink);
  border: none;
}

.btn-pill-primary:hover {
  background-color: #d97706;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-pill-secondary {
  background-color: transparent;
  color: var(--paper);
  border: 2px solid var(--paper);
}

.btn-pill-secondary:hover {
  background-color: rgba(243, 242, 237, 0.1);
  transform: translateY(-1px);
}

/* Preview Card Summary with Fade */
.summary-preview {
  position: relative;
  max-height: 8.5em;
  overflow: hidden;
}

.summary-preview::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2em;
  background: linear-gradient(to bottom, transparent, var(--paper));
  pointer-events: none;
}
