/* ============================================================================
   Site-wide motion + guide components (every page; behaviour in assets/js/site-motion.js):
   1. scroll reveal · 2. FAQ accordion · 3. "How to use it" cards · 4. numbered step lists
   5. tool-card arrows · 6. pricing table "show all". Reduced motion = everything static.
   ========================================================================== */

/* ---------- 1. Scroll reveal — JS only tags elements that start BELOW the fold, so nothing
   the visitor already sees ever blinks; without JS nothing is hidden. */
.fmd-reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity .7s cubic-bezier(.2, .8, .2, 1), transform .7s cubic-bezier(.2, .8, .2, 1);
  transition-delay: var(--reveal-delay, 0s);
}
.fmd-reveal.is-in { opacity: 1; transform: none; }

/* ---------- 2. FAQ accordion (template-parts/content/faq-accordion.php) */
.fmd-faq { max-width: 760px; margin: clamp(40px, 6vw, 64px) auto 0; }
.fmd-faq .fmd-faq__title { margin: 0 0 16px; font-size: clamp(20px, 3vw, 25px); font-weight: 900; }
.fmd-faq__list { display: grid; gap: 10px; }
.fmd-faq__item {
  overflow: hidden; border-radius: 18px; background: var(--surface);
  border: 1px solid var(--card-border); box-shadow: var(--shadow-card);
}
.fmd-faq__q {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 18px 16px 20px; cursor: pointer; font-weight: 800; font-size: 16px; line-height: 1.4; color: var(--ink);
  transition: color .2s ease;
}
.fmd-faq__q::-webkit-details-marker { display: none; }
.fmd-faq__q:hover { color: var(--accent); }
.fmd-faq__q:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; border-radius: 18px; }
.fmd-faq__chev {
  position: relative; flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface-2); color: var(--ink-2); transition: transform .3s ease, background .3s ease, color .3s ease;
}
.fmd-faq__chev::before {
  content: ""; position: absolute; left: 50%; top: 44%; width: 8px; height: 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translate(-50%, -50%) rotate(45deg);
}
.fmd-faq__item[open] .fmd-faq__chev { transform: rotate(180deg); background: rgba(255, 106, 77, .14); color: var(--accent); }
.fmd-faq .fmd-faq__a p { margin: 0; padding: 0 20px 18px; color: var(--ink-2); font-size: 15.5px; line-height: 1.72; font-weight: 500; }

/* ---------- 3. "How to use it" cards (template-parts/tools/how-to.php) */
.fmd-howto { max-width: 860px; margin: clamp(26px, 4vw, 40px) auto 0; }
.fmd-howto__title { margin: 0; text-align: center; font-size: clamp(19px, 2.6vw, 23px); font-weight: 900; }
.fmd-howto__list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.fmd-howto__step {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px;
  border-radius: 20px; background: var(--surface); border: 1px solid var(--card-border); box-shadow: var(--shadow-card);
}
.fmd-howto__num { position: absolute; top: 14px; right: 16px; font-size: 26px; line-height: 1; font-weight: 900; color: var(--surface-2); }
:root[data-theme="dark"] .fmd-howto__num { color: rgba(255, 255, 255, .08); }
.fmd-howto__ic { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 6px; border-radius: 14px; background: rgba(255, 106, 77, .12); color: var(--accent); }
.fmd-howto__name { font-size: 16px; font-weight: 800; color: var(--ink); }
.fmd-howto__text { font-size: 14px; line-height: 1.6; font-weight: 500; color: var(--ink-2); }
/* A small chevron between cards: the order matters. */
.fmd-howto__step:not(:last-child)::after {
  content: ""; position: absolute; top: 50%; right: -12px; width: 8px; height: 8px; opacity: .55;
  border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); transform: translateY(-50%) rotate(45deg);
}
.fmd-howto__step.is-in .fmd-howto__ic { animation: fmdPop .6s cubic-bezier(.34, 1.56, .64, 1) var(--reveal-delay, 0s) both; }
@keyframes fmdPop { from { transform: scale(.4) rotate(-12deg); opacity: 0; } }
@media (max-width: 760px) {
  .fmd-howto__list { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .fmd-howto__step:not(:last-child)::after { top: auto; bottom: -11px; right: 50%; transform: translateX(50%) rotate(135deg); }
}

/* ---------- 4. Numbered step lists in articles (/timer/ "How to use this timer", tool guides) */
.timer-steps, .tool-list { list-style: none; padding: 0; counter-reset: fmdstep; }
.timer-steps li, .tool-list li {
  counter-increment: fmdstep; position: relative; margin: 0 0 10px; padding: 14px 18px 14px 62px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--card-border); box-shadow: var(--shadow-card);
}
.timer-steps li::before, .tool-list li::before {
  content: counter(fmdstep); position: absolute; left: 16px; top: 13px; width: 32px; height: 32px;
  display: grid; place-items: center; border-radius: 50%; background: var(--grad-brand); color: #fff; font-size: 14.5px; font-weight: 900;
}
.timer-steps b, .tool-list b { color: var(--ink); }

/* ---------- 5. Tool cards on the homepage: say "this opens something" */
.home-tools__list a { position: relative; padding-bottom: 58px; }
.home-tools__list a::after {
  content: "→"; position: absolute; left: 20px; bottom: 18px; width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(255, 106, 77, .12); color: var(--accent); font-weight: 900;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.home-tools__list a:hover::after, .home-tools__list a:focus-visible::after { transform: translateX(5px); background: var(--accent); color: #fff; }

/* ---------- 6. Pricing: 175 countries fold to the first rows + yours (assets/js/pricing.js) */
.pricing-more {
  display: flex; align-items: center; gap: 8px; margin: 16px auto 0; padding: 12px 22px; border: 0; cursor: pointer;
  border-radius: var(--r-pill); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pill);
  font: inherit; font-size: 14.5px; font-weight: 800;
}
.pricing-more[hidden] { display: none; }
.pricing-more::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .25s ease; }
.pricing-more[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); }
.pricing-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .fmd-reveal { opacity: 1; transform: none; transition: none; }
  .fmd-howto__step.is-in .fmd-howto__ic { animation: none; }
  .fmd-faq__chev, .home-tools__list a::after, .pricing-more::after { transition: none; }
}
