/*
 * Academy Homepage Campaigns - Hero Carousel
 * Build: r11-staging-test
 * Staging design candidate. Not production approved.
 *
 * Markup contract preserved from 1.2.0-rc.1:
 *   .and-hero[data-and-hero][data-autoplay]
 *     .and-hero__slides > article.and-hero__slide[data-and-slide].and-theme-*
 *       .and-hero__copy  (eyebrow, title, subtitle, description, details, actions)
 *       .and-hero__media (r11 media compositions)
 *     .and-hero__controls (arrow, dots, toggle)
 */

.and-hero {
  /* Palette */
  --and-emerald-deep: #0b3d2e;
  --and-emerald: #17604a;
  --and-emerald-soft: #2c7a5f;
  --and-cream: #f7f3e9;
  --and-ivory: #fdfbf6;
  --and-gold: #c5a059;
  --and-gold-bright: #e0c07d;
  --and-ink: #1c2b25;
  --and-ink-soft: #46564e;

  /* Type */
  --and-display: "Cormorant Garamond", "Georgia", serif;
  --and-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;

  /* Scale */
  --and-pad-block: clamp(3rem, 5vw, 5.25rem);
  --and-pad-inline: clamp(1.25rem, 4vw, 4.5rem);
  --and-radius: 20px;
  --and-shadow-soft: 0 18px 45px rgba(11, 61, 46, 0.16);
  --and-shadow-lift: 0 30px 70px rgba(11, 61, 46, 0.28);

  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--and-radius);
  font-family: var(--and-body);
  color: var(--and-ink);
  background: var(--and-cream);
  outline: none;
}

.and-hero:focus-visible {
  outline: 3px solid var(--and-gold);
  outline-offset: 3px;
}

/*
 * Academy manuscript texture: the open Arabic book photograph carried over
 * from the homepage and the previous carousel, so the r11 carousel keeps the
 * same visual identity. Painted per slide, above the theme ground and beneath
 * every piece of content (copy is z-index 4, media 3, texture 0), at a
 * per-theme opacity so headings and body copy stay fully readable: a touch
 * stronger through the deep emerald treatments, very faint on the cream and
 * light grounds. cover + center keeps it cropping gracefully at every width.
 * (The previous woven-grain pseudo sat below the opaque slide backgrounds and
 * never actually rendered; this replaces it.)
 */
.and-hero__slide::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--and-bg-opacity, 0.1);
  background-image: url("../images/quran-background.webp");
  background-size: cover;
  background-position: center 42%;
  background-repeat: no-repeat;
}

.and-theme-emerald-deep,
.and-theme-gift {
  --and-bg-opacity: 0.075;
}

.and-theme-cream-warm,
.and-theme-light,
.and-theme-editorial {
  --and-bg-opacity: 0.035;
}

.and-hero__slides {
  position: relative;
  display: grid;
  min-height: clamp(30rem, 46vw, 41rem);
}

/* ---------- Slide frame ---------- */

.and-hero__slide {
  grid-area: 1 / 1;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  align-items: center;
  gap: clamp(1.5rem, 3vw, 3.25rem);
  padding: var(--and-pad-block) var(--and-pad-inline);
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 14px, 0);
  transition: opacity 620ms ease, transform 620ms ease, visibility 0s linear 620ms;
}

.and-hero__slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 620ms ease, transform 620ms ease, visibility 0s;
}

/* ---------- Themes ---------- */

.and-theme-emerald-deep {
  background:
    radial-gradient(120% 90% at 82% 12%, rgba(44, 122, 95, 0.5), transparent 62%),
    linear-gradient(152deg, #0b3d2e 0%, #0f4a37 52%, #093326 100%);
  color: var(--and-ivory);
}

.and-theme-cream-warm {
  background:
    radial-gradient(105% 85% at 12% 8%, rgba(197, 160, 89, 0.2), transparent 58%),
    linear-gradient(160deg, #fdfbf6 0%, #f5efe1 100%);
  color: var(--and-ink);
}

.and-theme-gift {
  background:
    radial-gradient(115% 95% at 78% 18%, rgba(224, 192, 125, 0.34), transparent 60%),
    linear-gradient(148deg, #0d4433 0%, #123f31 55%, #08291f 100%);
  color: var(--and-ivory);
}

.and-theme-light {
  background: linear-gradient(168deg, #fdfbf6 0%, #f2ece0 100%);
  color: var(--and-ink);
}

.and-theme-editorial {
  background:
    radial-gradient(100% 80% at 88% 90%, rgba(23, 96, 74, 0.16), transparent 60%),
    linear-gradient(160deg, #f7f3e9 0%, #ece4d4 100%);
  color: var(--and-ink);
}

/* ---------- Copy column ---------- */

.and-hero__copy {
  position: relative;
  z-index: 4;
  max-width: 38rem;
  display: flex;
  flex-direction: column;
  gap: clamp(0.85rem, 1.4vw, 1.3rem);
}

.and-hero__eyebrow {
  font-family: var(--and-body);
  font-size: clamp(0.72rem, 0.92vw, 0.84rem);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--and-gold);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* The rule after the eyebrow is a manuscript ruling, not decoration:
   it marks where the slide's own voice begins. */
.and-hero__eyebrow::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  max-width: 5.5rem;
  background: linear-gradient(90deg, var(--and-gold), transparent);
}

.and-theme-cream-warm .and-hero__eyebrow,
.and-theme-light .and-hero__eyebrow,
.and-theme-editorial .and-hero__eyebrow {
  color: #9c7a33;
}

.and-theme-cream-warm .and-hero__eyebrow::after,
.and-theme-light .and-hero__eyebrow::after,
.and-theme-editorial .and-hero__eyebrow::after {
  background: linear-gradient(90deg, #b99a58, transparent);
}

.and-hero__title {
  font-family: var(--and-display);
  font-size: clamp(2.6rem, 4.6vw, 4.35rem);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -0.012em;
  margin: 0;
}

.and-hero__subtitle {
  font-family: var(--and-display);
  font-size: clamp(1.35rem, 2vw, 1.95rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.2;
  margin: -0.35rem 0 0;
  color: var(--and-gold-bright);
}

.and-theme-cream-warm .and-hero__subtitle,
.and-theme-light .and-hero__subtitle,
.and-theme-editorial .and-hero__subtitle {
  color: var(--and-emerald);
}

.and-hero__description {
  font-size: clamp(1.03rem, 1.28vw, 1.22rem);
  line-height: 1.62;
  margin: 0;
  max-width: 34rem;
  opacity: 0.93;
}

.and-hero__audience {
  font-size: clamp(0.9rem, 1.05vw, 1rem);
  font-weight: 600;
  letter-spacing: 0.045em;
  margin: 0;
  color: var(--and-gold);
}

.and-theme-cream-warm .and-hero__audience,
.and-theme-light .and-hero__audience,
.and-theme-editorial .and-hero__audience {
  color: var(--and-emerald);
}

.and-hero__details {
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.and-hero__details li {
  position: relative;
  padding-left: 1.55rem;
  font-size: clamp(0.95rem, 1.1vw, 1.06rem);
  line-height: 1.45;
}

.and-hero__details li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.5rem;
  height: 0.5rem;
  border: 1px solid var(--and-gold);
  transform: rotate(45deg);
}

.and-theme-cream-warm .and-hero__details li::before,
.and-theme-light .and-hero__details li::before,
.and-theme-editorial .and-hero__details li::before {
  border-color: var(--and-emerald-soft);
}

/* ---------- Actions ---------- */

.and-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.6rem;
}

.and-button {
  /* content-box + width:100% + padding overflowed the slide on phones in the
     standalone preview (WordPress themes reset this globally; the preview and
     other themes do not, so the component carries its own). */
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.78rem 1.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--and-body);
  font-size: clamp(0.94rem, 1.05vw, 1.02rem);
  font-weight: 600;
  letter-spacing: 0.015em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.and-button--primary {
  background: linear-gradient(135deg, var(--and-gold-bright), var(--and-gold));
  color: #17240f;
  box-shadow: 0 12px 26px rgba(197, 160, 89, 0.34);
}

.and-button--secondary {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}

.and-button:hover {
  transform: translateY(-2px);
}

.and-button--secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.and-theme-cream-warm .and-button--secondary:hover,
.and-theme-light .and-button--secondary:hover,
.and-theme-editorial .and-button--secondary:hover {
  background: rgba(11, 61, 46, 0.08);
}

.and-button:focus-visible {
  outline: 3px solid var(--and-gold);
  outline-offset: 3px;
}

/* ---------- Controls ---------- */

/* r11f: a quiet utility, not a focal point. Smaller visible chrome, a
   translucent low-profile pill seated near the bottom edge, dimmed while
   idle and fully legible again on hover or keyboard focus. Interactive hit
   targets stay comfortably above the 24px minimum throughout. */
.and-hero__controls {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: clamp(0.5rem, 1.1vw, 0.9rem);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.4rem;
  border-radius: 999px;
  background: rgba(253, 251, 246, 0.55);
  border: 1px solid rgba(11, 61, 46, 0.08);
  box-shadow: 0 4px 14px rgba(11, 61, 46, 0.1);
  backdrop-filter: blur(6px);
  opacity: 0.7;
  transition: opacity 200ms ease, background-color 200ms ease;
}

/* rc.7: this state may raise legibility only; it must never paint a surface.
   Since rc.3 the legacy stylesheet re-shapes .and-hero__controls from a
   bottom pill into a transparent full-hero placement canvas (so the arrows
   can sit in the gutters). The pill-era ivory hover background survived
   here at higher specificity than the canvas's `background: none`, so
   hovering any arrow, dot or toggle veiled the entire hero in
   rgba(253,251,246,.92), and :focus-within pinned the veil after a click
   until focus left the controls. That was the production washout. */
.and-hero__controls:hover,
.and-hero__controls:focus-within {
  opacity: 1;
}

.and-hero__arrow,
.and-hero__toggle {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--and-emerald-deep);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.and-hero__arrow:hover,
.and-hero__toggle:hover {
  background: rgba(11, 61, 46, 0.09);
}

.and-hero__arrow:focus-visible,
.and-hero__toggle:focus-visible,
.and-hero__dot:focus-visible {
  outline: 3px solid var(--and-emerald);
  outline-offset: 2px;
}

.and-hero__nav {
  display: flex;
  align-items: center;
}

.and-hero__dots {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

/* Touch target is 24x24 even though the visible pip is 9px.
   This addresses the 12C finding that dots measured 9x9. */
.and-hero__dot {
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.and-hero__dot::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: rgba(11, 61, 46, 0.28);
  transition: background-color 200ms ease, transform 200ms ease;
}

.and-hero__dot.is-active::before {
  background: var(--and-gold);
  transform: scale(1.4);
}

.and-hero-empty {
  padding: 2rem;
  font-family: var(--and-body);
  color: var(--and-ink-soft);
}
