/*
 * Liam Kivirist — Custom Styles
 * TailwindCSS loaded via CDN in head.html
 */

/* ========================================
   SCROLL ANIMATIONS
   ======================================== */

.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.25s; }

/* ========================================
   HERO
   ======================================== */

.hero-overlay {
  background: linear-gradient(
    160deg,
    rgba(14, 116, 144, 0.85) 0%,
    rgba(8, 145, 178, 0.6) 50%,
    rgba(236, 72, 153, 0.25) 100%
  );
}

/* ========================================
   IMAGES
   ======================================== */

.img-hover-zoom {
  overflow: hidden;
}

.img-hover-zoom img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.img-hover-zoom:hover img {
  transform: scale(1.04);
}

/* ========================================
   CARDS
   ======================================== */

.card {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.08);
}

/* ========================================
   LINE CLAMP
   ======================================== */

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========================================
   PROSE OVERRIDES
   ======================================== */

.prose h2 {
  margin-top: 2.75rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid #f3f4f6;
  position: relative;
}

.prose h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 3rem;
  height: 2px;
  background: var(--tw-prose-links, #0891b2);
}

.prose h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-left: 0.85rem;
  border-left: 3px solid #e5e7eb;
}

.prose blockquote {
  border-left-width: 3px;
  padding: 1.15rem 1.5rem;
  background: #f8fafc;
  border-radius: 0 0.75rem 0.75rem 0;
  font-style: normal;
}

.prose blockquote p:first-child {
  margin-top: 0;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose img {
  border-radius: 0.75rem;
  margin: 2rem auto;
}

.prose ul > li::before {
  content: none;
}

.prose > p:first-child {
  font-size: 1.15em;
  line-height: 1.75;
  color: #4b5563;
}

/* ========================================
   TABLE OF CONTENTS
   ======================================== */

.toc-nav a {
  display: block;
  padding: 0.4rem 0 0.4rem 0.85rem;
  color: #9ca3af;
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
  line-height: 1.45;
}

.toc-nav a:hover {
  color: #374151;
  border-left-color: #d1d5db;
}

.toc-nav a.toc-active {
  color: #0891b2;
  border-left-color: #0891b2;
  font-weight: 500;
}

.toc-nav a.toc-h3 {
  padding-left: 1.75rem;
  font-size: 0.8rem;
}

/* ========================================
   READING PROGRESS
   ======================================== */

#reading-progress {
  will-change: width;
  pointer-events: none;
}

/* ========================================
   DETAILS CHEVRON
   ======================================== */

details[open] .details-chevron {
  transform: rotate(180deg);
}

/* ========================================
   NAVIGATION
   ======================================== */

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

a:focus-visible,
button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ========================================
   PRINT
   ======================================== */

@media print {
  header, footer, nav, .no-print { display: none !important; }
  .prose { max-width: 100%; }
}
