/* Small additions on top of Tailwind utilities */

details > summary::-webkit-details-marker { display: none; }

/* ---------- Hero slider ---------- */
.hero-bg { opacity: 0; transform: scale(1.12); transition: opacity 1.2s ease, transform 8s ease-out; }
.hero-bg.is-active { opacity: 1; transform: scale(1); }

/* All slides sit in the same grid cell, so the box keeps the height of the tallest one */
.hero-slide {
  grid-area: 1 / 1;
  opacity: 0; visibility: hidden; transform: translateY(24px);
  transition: opacity .5s ease, transform .5s ease, visibility 0s linear .5s;
}
.hero-slide.is-active {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .7s ease .25s, transform .7s ease .25s, visibility 0s;
}

/* Dots double as progress bars; when the bar fills, app.js moves to the next slide */
.hero-dot {
  position: relative; height: 6px; width: 12px; overflow: hidden; border-radius: 9999px;
  background: rgba(255, 255, 255, .3); transition: width .4s ease, background-color .3s ease;
}
.hero-dot:hover { background: rgba(255, 255, 255, .5); }
.hero-dot.is-active { width: 48px; }
.hero-dot span { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: #fbbf24; }
.hero-dot.is-active span { animation: heroProgress 6s linear forwards; }
.hero-paused .hero-dot.is-active span { animation-play-state: paused; }
@keyframes heroProgress { to { width: 100%; } }

/* ---------- Blog post body (HTML made from Markdown) ---------- */
.post-body { color: #334155; font-size: 1.0625rem; line-height: 1.8; }
.post-body > * + * { margin-top: 1.25em; }
.post-body > :first-child { margin-top: 0; }
.post-body h2 { margin-top: 2em; font-size: 1.5rem; line-height: 1.3; font-weight: 800; letter-spacing: -.01em; color: #0f172a; }
.post-body h3 { margin-top: 1.75em; font-size: 1.25rem; line-height: 1.4; font-weight: 700; color: #0f172a; }
.post-body ul, .post-body ol { padding-left: 1.4em; }
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }
.post-body li + li { margin-top: .5em; }
.post-body li::marker { color: #1a8059; }
.post-body strong { font-weight: 700; color: #0f172a; }
.post-body a { color: #1a8059; text-decoration: underline; text-underline-offset: 3px; }
.post-body blockquote { border-left: 4px solid #fbbf24; padding-left: 1em; font-style: italic; color: #475569; }
.post-body table { width: 100%; border-collapse: collapse; font-size: .95em; }
.post-body th, .post-body td { padding: .65em .9em; border: 1px solid #e2e8f0; text-align: left; vertical-align: top; }
.post-body th { background: #effaf4; font-weight: 700; color: #0f172a; }
.post-body tbody tr:nth-child(even) td { background: #f8fafc; }

/* ---------- Scroll reveal ----------
   [data-reveal] elements and the children of [data-reveal-stagger] start hidden and fade in
   when they scroll into view (app.js adds .is-revealed and plays the movement).
   The "reveal-on" class is set in the page head, so nothing hides when JavaScript is off. */
@media screen and (prefers-reduced-motion: no-preference) {
  .reveal-on [data-reveal]:not(.is-revealed),
  .reveal-on [data-reveal-stagger] > :not(.is-revealed) { opacity: 0; }
}

/* ---------- Thin progress bar at the top while scrolling ---------- */
.scroll-progress {
  position: fixed; inset: 0 0 auto 0; z-index: 60; height: 3px; pointer-events: none;
  background: linear-gradient(90deg, #2a9d6e, #82d2ad 60%, #fbbf24);
  transform: scaleX(0); transform-origin: 0 50%;
}

/* ---------- Cards: a soft green glow follows the mouse ---------- */
.spotlight { isolation: isolate; }
.spotlight::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--spot-x, 50%) var(--spot-y, 0%), rgba(42, 157, 110, .13), transparent 60%);
  opacity: 0; transition: opacity .35s ease;
}
.spotlight:hover::before { opacity: 1; }

/* ---------- Buttons: a light sweep on hover ---------- */
.btn-shine { position: relative; overflow: hidden; isolation: isolate; }
.btn-shine::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -80%; z-index: -1; width: 55%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent);
  transform: skewX(-20deg); transition: left .75s ease;
}
.btn-shine:hover::after { left: 130%; }

/* ---------- Slow floating background shapes ---------- */
@keyframes floatShape {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(22px, -26px, 0) scale(1.06); }
}
.float-slow { animation: floatShape 14s ease-in-out infinite; }
.float-slower { animation: floatShape 20s ease-in-out infinite reverse; }

/* Glow behind the hero tracking card breathes slowly */
@keyframes glowBreath {
  0%, 100% { opacity: .65; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}
.glow-breath { animation: glowBreath 6s ease-in-out infinite; }

/* WhatsApp button: a ring keeps pulsing out */
.pulse-ring::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: inherit;
  animation: pulseRing 2.4s cubic-bezier(.2, .6, .35, 1) infinite;
}
@keyframes pulseRing {
  0% { opacity: .5; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.7); }
}

/* Count-up numbers keep their width while counting */
[data-count] { font-variant-numeric: tabular-nums; }

/* Tracking page progress badge */
.progress-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: 9999px;
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(6, 95, 70, 0.05);
}
.progress-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background-color: #10b981;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(.85); }
}

/* Tracking page header status badges */
.track-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

@media print {
  header, footer, .no-print, #scrollProgress, .floating-buttons {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-bg, .hero-slide { transition: none; transform: none; }
  .hero-dot.is-active span { animation: none; width: 100%; }
  .float-slow, .float-slower, .glow-breath, .pulse-ring::before { animation: none; }
  .btn-shine::after { display: none; }
}

/* ---------- Phones ---------- */
/* Nothing may make the page wider than the screen. "clip" (not "hidden") keeps sticky elements working. */
body { overflow-x: clip; }

/* Long links and words in posts wrap instead of stretching the page */
.post-body { overflow-wrap: break-word; }
.post-body pre { overflow-x: auto; }

/* Wide tables in posts scroll sideways on their own on small screens */
@media (max-width: 767px) {
  .post-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .post-body th, .post-body td { min-width: 7rem; }
}
