/*
 * astro-om: a temple at dawn.
 *
 * Sandalwood-cream pages with saffron and vermilion accents and a
 * soft primary-washed CTA panel in light mode; dark mode uses
 * the shared dark tokens from index.css. Heading font is Marcellus (carved-inscription Roman), body is
 * Mukta, and Tiro Devanagari Hindi carries the Sanskrit accents and Om.
 *
 * Built on the shared token base; everything below the import overrides tokens or
 * adds the om-* decorative utilities used by src/tenant/templates/astro-om.
 */
@import url("./index.css");
@import url("https://fonts.googleapis.com/css2?family=Marcellus&family=Mukta:wght@300;400;500;600;700&family=Tiro+Devanagari+Hindi&display=swap");

:root {
  /* saffron. --primary itself is assembled from these three numbers by
       index.css, so the tenant's primary-colour preset (data-primary-color) can
       override them. Never set --primary directly here. */
  --primary-h: 48;
  --primary-c: 0.165;
  --primary-l: 0.58;
  --primary-foreground: oklch(0.99 0.01 86);

  /* template-only tokens. The gold core and the vermilion end of the gradient
       follow the tenant's primary hue, so a primary-colour preset recolours both. */
  --om-gold: oklch(0.88 var(--primary-c) calc(var(--primary-h) + 40));
  --om-text-from: var(--primary);
  --om-text-to: oklch(
    calc(var(--primary-l) - 0.08) calc(var(--primary-c) + 0.03)
      calc(var(--primary-h) - 20)
  );

  --font-heading: "Marcellus", "Tiro Devanagari Hindi", serif;
  --font-sans: "Mukta", "Tiro Devanagari Hindi", sans-serif;
  --font-deva: "Tiro Devanagari Hindi", serif;
  --radius: 0.75rem; /* overridden by the tenant corner-style preset */
  --shadow-color: oklch(0.3 0.07 25);
}

/* The sandalwood palette is light mode only: scoped so it can't override the shared
   dark tokens from index.css. */
:root:not(.dark) {
  --background: oklch(0.982 0.014 86); /* sandalwood cream */
  --foreground: oklch(0.27 0.055 25); /* deep maroon ink */
  --card: oklch(0.995 0.006 86);
  --card-foreground: oklch(0.27 0.055 25);
  --popover: oklch(0.995 0.006 86);
  --popover-foreground: oklch(0.27 0.055 25);
  --secondary: oklch(0.958 0.032 84); /* marigold cream */
  --secondary-foreground: oklch(0.3 0.055 25);
  --muted: oklch(0.96 0.02 84);
  --muted-foreground: oklch(0.5 0.04 30);
  --accent: oklch(0.925 0.06 80);
  --accent-foreground: oklch(0.3 0.055 25);
  --destructive: oklch(0.55 0.22 27);
  --destructive-foreground: oklch(1 0 0);
  --border: oklch(0.9 0.035 80);
  --input: oklch(0.885 0.04 80);
  --ring: var(--primary);
  --chart-1: var(--primary);
  --chart-2: oklch(0.78 0.14 85);
  --chart-3: oklch(0.5 0.17 28);
  --chart-4: oklch(0.65 0.15 55);
  --chart-5: oklch(0.36 0.09 25);
  --sidebar: oklch(0.97 0.02 84);
  --sidebar-foreground: oklch(0.27 0.055 25);
  --sidebar-accent: oklch(0.925 0.06 80);
  --sidebar-accent-foreground: oklch(0.3 0.055 25);
  --sidebar-border: oklch(0.9 0.035 80);
  --sidebar-ring: var(--primary);
}

/* In dark mode only the primary is brightened; every background and text colour
   comes from the shared dark tokens in index.css. */
.dark {
  --primary-l: 0.76;
  --primary-c: 0.15;
  --primary-foreground: oklch(0.2 0.05 25);
}

/* The CTA panel in light mode: a soft wash of the page's own primary over the
   page background, so it follows the tenant's primary-colour preset. Text and
   buttons keep the normal tokens. In dark mode it is left alone and uses the
   page's dark tokens. */
:root:not(.dark) .om-panel {
  background-image: linear-gradient(
    135deg,
    color-mix(in oklab, var(--primary) 9%, var(--background)),
    color-mix(in oklab, var(--primary) 24%, var(--background))
  );
  border-color: color-mix(in oklab, var(--primary) 45%, transparent);
}

body {
  font-family: var(--font-sans);
}

.font-deva {
  font-family: var(--font-deva);
}

/* ---------- section spacing ---------- */

/* Covers the shared sections too (reports, videos, webinars, ...). Unlayered, so
   it wins over their Tailwind padding without touching other templates. The hero
   sets its own. */
.om-sections > section:not(.om-hero),
.om-sections > div > section {
  padding-block: 1.5rem;
}

@media (min-width: 640px) {
  .om-sections > section:not(.om-hero),
  .om-sections > div > section {
    padding-block: 2.5rem;
  }
}

/* ---------- corner style ---------- */

/* Some shared sections hard-code pill buttons. Make their text buttons (the ones
   with side padding) and the tab bars around them follow the tenant's corner
   style; round icon buttons stay round. */
.om-sections :is(a, button).rounded-full[class*="px-"],
.om-sections div.rounded-full:has(> button[class*="px-"]) {
  border-radius: var(--radius);
}

/* ---------- decorative utilities ---------- */

/* A pool of soft light, like a diya. Size and position it with utilities. */
.om-glow {
  pointer-events: none;
  background: radial-gradient(
    closest-side,
    color-mix(in oklab, var(--primary) 40%, transparent),
    transparent
  );
}

.om-gradient-text {
  background-image: linear-gradient(
    100deg,
    var(--om-text-from),
    var(--om-text-to)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Temple-doorway arch: a full semicircle on top, the corner style at the bottom.
   Needs an element that is taller than it is wide to read as an arch. */
.om-arch {
  border-top-left-radius: 999px;
  border-top-right-radius: 999px;
  border-bottom-left-radius: calc(var(--radius) + 6px);
  border-bottom-right-radius: calc(var(--radius) + 6px);
}

/* Double keyline. The outer line is an outline, so it takes no room. */
.om-frame {
  border: 1px solid color-mix(in oklab, var(--primary) 55%, transparent);
  outline: 1px solid color-mix(in oklab, var(--primary) 28%, transparent);
  outline-offset: 3px;
}

/* Card with a saffron lintel across the top (an inset shadow, so no extra
   height). It lights up on hover. */
.om-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: inset 0 3px 0 0 var(--primary);
  transition:
    transform 0.4s ease,
    box-shadow 0.4s ease,
    border-color 0.4s ease;
}

/* The same card with the saffron on its left edge */
.om-card-side {
  box-shadow: inset 3px 0 0 0 var(--primary);
}

.om-card-lift:hover {
  transform: translateY(-3px);
  border-color: color-mix(in oklab, var(--primary) 55%, var(--border));
  box-shadow:
    inset 0 3px 0 0 var(--primary),
    0 18px 36px -20px color-mix(in oklab, var(--primary) 65%, transparent);
}

/* Small rotated square used as a bullet / icon holder */
.om-diamond {
  transform: rotate(45deg);
  border-radius: 0.35rem;
  border: 1px solid color-mix(in oklab, var(--primary) 40%, transparent);
  background: color-mix(in oklab, var(--primary) 12%, transparent);
}

/* Slim saffron rule that fades out at both ends */
.om-rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

/* ---------- footer ---------- */

/* In light mode the footer takes the page's secondary colour (the "Powered by"
   strip uses --background as well). In dark mode it keeps the page background. */
:root:not(.dark) .om-footer {
  --background: var(--secondary);
  background-color: var(--background);
}

/* Lattice of tiny lotus diamonds. The SVG is only a mask; the colour comes from
   --primary. Put it on an absolutely positioned, pointer-events-none layer. */
.om-lattice {
  background-color: var(--primary);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Cpath d='M18 5 23 18 18 31 13 18z' fill='none' stroke='black' stroke-width='0.8'/%3E%3Ccircle cx='18' cy='18' r='1.4'/%3E%3Ccircle cx='0' cy='0' r='1'/%3E%3Ccircle cx='36' cy='0' r='1'/%3E%3Ccircle cx='0' cy='36' r='1'/%3E%3Ccircle cx='36' cy='36' r='1'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Cpath d='M18 5 23 18 18 31 13 18z' fill='none' stroke='black' stroke-width='0.8'/%3E%3Ccircle cx='18' cy='18' r='1.4'/%3E%3Ccircle cx='0' cy='0' r='1'/%3E%3Ccircle cx='36' cy='0' r='1'/%3E%3Ccircle cx='0' cy='36' r='1'/%3E%3Ccircle cx='36' cy='36' r='1'/%3E%3C/svg%3E");
  -webkit-mask-size: 36px 36px;
  mask-size: 36px 36px;
}

@keyframes om-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes om-breathe {
  0%,
  100% {
    opacity: 0.75;
  }
  50% {
    opacity: 1;
  }
}

@keyframes om-rise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.om-spin {
  animation: om-spin 180s linear infinite;
}

.om-breathe {
  animation: om-breathe 4s ease-in-out infinite;
}

.om-rise {
  opacity: 0;
  animation: om-rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
  .om-spin,
  .om-breathe {
    animation: none;
  }
  .om-rise {
    animation: none;
    opacity: 1;
  }
}
