/* Shared Styles for Dissertation Presentation Tools */
/* Matches the Jay Rosen Digital Archive design language */

/* Screen reader only - for accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Paper Texture Background */
body {
  background-color: #fdfbf7;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #a8a29e; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #78716c; }

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Selection styling */
::selection {
  background: #fef08a;
  color: #1c1917;
}

/* Focus states for accessibility */
a:focus,
button:focus {
  outline: 2px solid #0284c7;
  outline-offset: 2px;
}

/* Card base styles */
.card {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Quote styling */
.quote {
  position: relative;
  font-style: italic;
  padding-left: 1.5rem;
  border-left: 3px solid #d6d3d1;
}

.quote::before {
  content: '"';
  position: absolute;
  left: 0.5rem;
  top: -0.5rem;
  font-size: 2rem;
  color: #d6d3d1;
  font-family: Georgia, serif;
}

/* Badge styles */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-amber { background: #fef3c7; color: #92400e; }
.badge-sky { background: #e0f2fe; color: #0369a1; }
.badge-emerald { background: #d1fae5; color: #065f46; }
.badge-violet { background: #ede9fe; color: #6d28d9; }
.badge-rose { background: #ffe4e6; color: #be123c; }
.badge-stone { background: #f5f5f4; color: #57534e; }

/* Pill/tag styles */
.pill {
  display: inline-block;
  background: #f5f5f4;
  border: 1px solid #e7e5e4;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  color: #57534e;
  transition: all 0.2s ease;
  cursor: pointer;
}

.pill:hover {
  background: #e7e5e4;
  border-color: #d6d3d1;
}

.pill.active {
  background: #1c1917;
  color: white;
  border-color: #1c1917;
}

/* Chapter reference badge */
.chapter-ref {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #fafaf9;
  border: 1px solid #e7e5e4;
  padding: 0.375rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  color: #78716c;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Fade-in animation */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Navigation dots */
.nav-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d6d3d1;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.nav-dot:hover {
  background: #a8a29e;
  transform: scale(1.2);
}

.nav-dot.active {
  background: #78716c;
  transform: scale(1.3);
}

/* Year marker */
.year-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  font-family: 'Special Elite', cursive;
  font-size: 1.1rem;
  background: #fafaf9;
  border: 2px solid #78716c;
  color: #44403c;
}

/* Connection lines */
.connection-line {
  position: relative;
}

.connection-line::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #78716c, #0284c7);
  transform: translateX(-50%);
}

/* Print styles */
@media print {
  body {
    background: white;
  }

  .no-print {
    display: none !important;
  }

  .card {
    box-shadow: none;
    border: 1px solid #e7e5e4;
    page-break-inside: avoid;
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .hide-mobile {
    display: none;
  }

  /* Improve touch targets */
  .pill {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  /* Prevent horizontal scroll */
  body {
    overflow-x: hidden;
  }

  /* Make cards full-width on small screens */
  .card {
    border-radius: 0.375rem;
  }

  /* Improve quote readability on mobile */
  .quote {
    padding-left: 1rem;
    font-size: 0.9rem;
  }

  /* Improve year marker sizing */
  .year-marker {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1rem;
  }
}

/* Body scroll lock for modals */
body.modal-open {
  overflow: hidden;
}

/* Safe area insets for iOS notch */
@supports (padding: max(0px)) {
  header {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  footer {
    padding-bottom: max(3rem, env(safe-area-inset-bottom));
  }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
  .hide-tablet {
    display: none;
  }
}

/* Desktop-only */
@media (min-width: 1024px) {
  .hide-desktop {
    display: none;
  }
}
