/*
 * NADI — shared base styles.
 * The site stylesheet (raizes.css) sets its own tokens (--text, --surface…) and layout;
 * this file only holds resets and components that behave the same everywhere.
 */

:root {
  --brand-green-900: #0f2f20;
  --brand-green-800: #133a27;
  --brand-green-700: #1d4d31;
  --brand-green-600: #225333;
  --brand-green-500: #2f6b45;
  --brand-gold-600: #9a7a2e;
  --brand-gold-500: #b8913a;
  --brand-gold-300: #e3c877;
  --brand-gold-100: #efdb94;
  --brand-cream: #f6f2e9;
  --pain: #b5543c;

  --radius: 14px;
  --focus: 3px solid var(--brand-gold-500);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

:focus-visible {
  outline: var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--brand-green-800);
  color: #fff;
  border-radius: 8px;
}

.skip-link:focus {
  top: 1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Content still to be supplied by the practice. Must be gone before launch:
   `grep -rn 'class="todo"' index.html` should return nothing. */
.todo {
  background: #fff3b0;
  color: #5a4500;
  padding: 0 0.25em;
  border-radius: 3px;
  outline: 1px dashed #c9a400;
}

/* ---------- Floating WhatsApp button ---------- */

.wa-float {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  background: #1f7a4a;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(15, 47, 32, 0.3);
}

.wa-float svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: currentColor;
}

.wa-float:hover {
  background: #186a3f;
}

/* ---------- Lite YouTube embed (loads nothing from YouTube until clicked) ---------- */

.video {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--brand-green-800) center / cover no-repeat;
  cursor: pointer;
  color: #fff;
  font: inherit;
}

.video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.55));
}

.video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 64px;
  height: 64px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
  transition: transform 0.2s ease;
}

.video__play svg {
  width: 26px;
  height: 26px;
  margin-left: 4px;
  fill: var(--brand-green-800);
}

.video:hover .video__play {
  transform: translate(-50%, -50%) scale(1.08);
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 2;
}

.video--pending {
  cursor: default;
  background-image: repeating-linear-gradient(
    135deg,
    var(--brand-green-800) 0 14px,
    var(--brand-green-700) 14px 28px
  );
}

.video--pending .video__play {
  opacity: 0.35;
}

.video__pending-label {
  position: absolute;
  left: 50%;
  bottom: 0.8rem;
  z-index: 1;
  transform: translateX(-50%);
  font-size: 0.8rem;
  white-space: nowrap;
}

.video--instagram {
  aspect-ratio: 9 / 16;
  background:
    radial-gradient(circle at 30% 20%, rgba(233, 207, 124, 0.35), transparent 55%),
    linear-gradient(160deg, var(--brand-green-700), var(--brand-green-900));
}

.video--instagram iframe {
  background: #fff;
}

.video__badge {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  z-index: 1;
  transform: translateX(-50%);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.video__consent {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  opacity: 0.75;
}

/* Media grid: a vertical reel beside a column of 16:9 videos. */
.media-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
  align-items: start;
}

.media-grid figure {
  margin: 0;
}

.media-grid figcaption {
  margin-top: 0.6rem;
}

@media (min-width: 720px) {
  .media-grid {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  }

  .media-grid .media--reel {
    grid-row: span 3;
  }
}

/* ---------- Self-hosted reels: cover image → video (behaviour in site.js) ---------- */

.reels {
  display: grid;
  gap: 1.75rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .reels {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.reel {
  margin: 0;
  max-width: 360px;
  justify-self: center;
  width: 100%;
}

.reel__play,
.reel__video {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius);
  background: #000;
  overflow: hidden;
}

.reel__play {
  padding: 0;
  border: 0;
  cursor: pointer;
}

.reel__play img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.reel__play:hover img {
  transform: scale(1.03);
}

.reel__play:focus-visible {
  outline: var(--focus);
  outline-offset: 3px;
}

.reel__play:hover .video__play {
  transform: translate(-50%, -50%) scale(1.08);
}

.reel figcaption {
  margin-top: 0.85rem;
}

.reel__title {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
}

.reel__text {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.95rem;
  opacity: 0.85;
}

.reel__source {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: inherit;
}

@media (prefers-reduced-motion: reduce) {
  .reel__play img {
    transition: none;
  }
}

/* ---------- Photo slideshow (behaviour in site.js) ---------- */
/* Templates set --slideshow-radius and the figure's width. */

.slideshow__track {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--slideshow-radius, var(--radius));
  background: rgba(19, 58, 39, 0.08);
}

.slideshow__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.slideshow__slide.is-active {
  opacity: 1;
}

.slideshow__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.slideshow__btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line, rgba(19, 58, 39, 0.2));
  border-radius: 50%;
  background: transparent;
  color: var(--brand-green-700);
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.slideshow__toggle {
  display: inline-grid;
  place-items: center;
}

.slideshow__toggle svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.slideshow__btn:hover {
  background: rgba(19, 58, 39, 0.06);
}

.slideshow__dots {
  display: flex;
}

/* 24px hit area around a 9px dot. */
.slideshow__dot {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.slideshow__dot::before {
  content: "";
  display: block;
  width: 9px;
  height: 9px;
  margin: auto;
  border-radius: 50%;
  background: rgba(19, 58, 39, 0.25);
}

.slideshow__dot[aria-current="true"]::before {
  background: var(--brand-gold-500);
}

.slideshow__btn:focus-visible,
.slideshow__dot:focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .slideshow__slide {
    transition: none;
  }
}

/* ---------- Mirror diagram (arm ↔ leg) ---------- */

.mirror {
  --line: currentColor;
  --accent: var(--brand-gold-500);
  width: 100%;
  font-size: 12px;
}

.mirror text {
  fill: currentColor;
}

.mirror .mirror__limb-label {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 10px;
}

.mirror .mirror__bone {
  stroke: var(--line);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0.55;
}

.mirror .mirror__joint {
  fill: var(--mirror-bg, #fff);
  stroke: var(--line);
  stroke-width: 2;
}

.mirror .mirror__link {
  stroke: var(--line);
  stroke-width: 1.2;
  stroke-dasharray: 3 4;
  opacity: 0.45;
}

.mirror .mirror__pain {
  fill: none;
  stroke: var(--pain);
  stroke-width: 2;
}

.mirror .mirror__pain-core {
  fill: var(--pain);
}

.mirror .mirror__point {
  fill: var(--accent);
  stroke: var(--accent);
}

.mirror .mirror__arrow {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.mirror .mirror__arrowhead {
  fill: var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
  .mirror .mirror__pain {
    animation: mirror-pulse 2.4s ease-out infinite;
    transform-box: fill-box;
    transform-origin: center;
  }

  @keyframes mirror-pulse {
    0% {
      transform: scale(0.6);
      opacity: 0.9;
    }
    100% {
      transform: scale(1.5);
      opacity: 0;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
