/* Al Ritmo del Sol — block styles and motion.
 * Colours come from Astra's global palette (Customizer → Global → Colors),
 * so changing the palette there changes everything here. */

@font-face {
  font-family: "Dancing Script";
  src: url("../fonts/DancingScript.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --ards-rojo: var(--ast-global-color-0, #AF1E11);
  --ards-sol: var(--ast-global-color-2, #FEB909);
  --ards-tinta: var(--ast-global-color-3, #3B2314);
  --ards-crema: var(--ast-global-color-5, #FFF7E6);
  --ards-sol-claro: var(--ast-global-color-6, #FEC82C);
  --ards-arena: var(--ast-global-color-7, #F1E2C4);
  --ards-naranja: var(--ast-global-color-8, #FE9F10);
  --ards-sombra: 0 14px 34px rgba(175, 30, 17, .14);
  --ards-radio: 20px;
}

/* ---------- Header: sticky, compact after scrolling ---------- */
#masthead { position: sticky; top: 0; z-index: 100; transition: box-shadow .3s ease; }
.admin-bar #masthead { top: 32px; }
@media (max-width: 782px) { .admin-bar #masthead { top: 0; } }
.ards-scrolled #masthead { box-shadow: 0 6px 22px rgba(175, 30, 17, .12); }
#masthead .site-primary-header-wrap { transition: min-height .3s ease; }
.ards-scrolled #masthead .site-primary-header-wrap { min-height: 58px; }
.site-logo-img .custom-logo-link img.ards-wordmark { display: none; height: 30px; width: auto; max-width: none; }
.ards-scrolled .site-logo-img .custom-logo { display: none; }
.ards-scrolled .site-logo-img .custom-logo-link img.ards-wordmark { display: block; animation: ards-in .35s ease; }
@keyframes ards-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (max-width: 921px) { .site-logo-img .custom-logo-link img.ards-wordmark { height: 22px; } }

/* ---------- Main menu (desktop): sun pill on hover, marked current page ---------- */
@media (min-width: 922px) {
  .main-header-menu > .menu-item > .menu-link { position: relative; z-index: 0; transition: color .25s ease; }
  .main-header-menu > .menu-item > .menu-link::before {
    content: "";
    position: absolute;
    inset: 22% 4px;
    border-radius: 999px;
    background: var(--ards-sol-claro);
    transform: scale(.4, .2);
    opacity: 0;
    z-index: -1;
    transition: transform .35s cubic-bezier(.2, .9, .3, 1.4), opacity .25s ease;
  }
  .main-header-menu > .menu-item:hover > .menu-link::before,
  .main-header-menu > .menu-item > .menu-link:focus-visible::before { transform: none; opacity: 1; }
  .main-header-menu > .menu-item:hover > .menu-link { color: var(--ards-rojo); }
  .main-header-menu > .current-menu-item > .menu-link::before,
  .main-header-menu > .current-menu-ancestor > .menu-link::before,
  .main-header-menu > .current_page_parent > .menu-link::before { transform: none; opacity: 1; background: var(--ards-crema); box-shadow: inset 0 0 0 2px var(--ards-sol); }

  /* Submenu: a card hanging from the menu, each line of work with a sun marker. */
  .main-header-menu .sub-menu {
    border-radius: 18px;
    border: 0;
    border-top: 4px solid var(--ards-sol);
    box-shadow: 0 18px 40px rgba(59, 35, 20, .16);
    padding: 10px 0;
    overflow: hidden;
    min-width: 290px;
  }
  .main-header-menu .sub-menu .menu-link {
    position: relative;
    padding: 10px 22px 10px 44px;
    transition: background .2s ease, color .2s ease, padding .25s ease;
  }
  .main-header-menu .sub-menu .menu-link::before {
    content: "";
    position: absolute;
    left: 20px;
    top: 50%;
    width: 12px;
    height: 12px;
    margin-top: -6px;
    border-radius: 50%;
    background: var(--ards-arena);
    transition: background .25s ease, transform .35s cubic-bezier(.2, .9, .3, 1.5);
  }
  .main-header-menu .sub-menu .menu-item:hover > .menu-link { background: var(--ards-crema); color: var(--ards-rojo); padding-left: 50px; }
  .main-header-menu .sub-menu .menu-item:hover > .menu-link::before { background: var(--ards-sol); transform: scale(1.35); }
  .main-header-menu .sub-menu .current-menu-item > .menu-link { color: var(--ards-rojo); font-weight: 800; }
  .main-header-menu .sub-menu .current-menu-item > .menu-link::before { background: var(--ards-naranja); }
}

/* ---------- Story: way back to all stories ---------- */
.ards-back {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  font-weight: 800;
  font-size: .9rem;
  text-decoration: none;
  color: var(--ards-rojo);
  background: var(--ards-crema);
  border-radius: 999px;
  padding: .45em 1.1em;
  margin-bottom: 1.2rem;
  transition: background .2s ease, transform .2s ease;
}
.ards-back:hover { background: var(--ards-sol-claro); color: var(--ards-rojo); transform: translateX(-3px); }

/* ---------- Handwritten ---------- */
.entry-content .is-style-ards-manuscrita,
.editor-styles-wrapper .is-style-ards-manuscrita,
.wp-block-cover .is-style-ards-manuscrita {
  font-family: "Dancing Script", cursive;
  font-weight: 700;
  color: var(--ards-rojo);
  line-height: 1.15;
}
p.is-style-ards-manuscrita { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }

/* ---------- Label (small pill above a title) ---------- */
p.is-style-ards-etiqueta {
  display: inline-block;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ards-rojo);
  background: var(--ards-sol-claro);
  border-radius: 999px;
  padding: .35em 1em;
  margin-bottom: .6rem;
}
.has-text-align-center.is-style-ards-etiqueta { display: table; margin-left: auto; margin-right: auto; }

/* ---------- Card ---------- */
.is-style-ards-tarjeta {
  background: #fff;
  border-radius: var(--ards-radio);
  box-shadow: var(--ards-sombra);
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2, .8, .3, 1.2), box-shadow .35s ease;
}
.is-style-ards-tarjeta:not(.has-background) { background: #fff; }
.is-style-ards-tarjeta:hover { transform: translateY(-6px) rotate(-.4deg); box-shadow: 0 22px 44px rgba(175, 30, 17, .2); }
.is-style-ards-tarjeta .wp-block-image,
.is-style-ards-tarjeta .wp-block-post-featured-image { margin: 0; overflow: hidden; }
.is-style-ards-tarjeta .wp-block-image img,
.is-style-ards-tarjeta .wp-block-post-featured-image img { transition: transform .6s ease; width: 100%; }
.is-style-ards-tarjeta:hover .wp-block-image img,
.is-style-ards-tarjeta:hover .wp-block-post-featured-image img { transform: scale(1.06); }

/* Inside cards: even rhythm, titles as links without underline. */
.is-style-ards-tarjeta > * { margin-top: 0; margin-bottom: 12px; }
.is-style-ards-tarjeta > *:last-child { margin-bottom: 0; }
.wp-block-post-template .wp-block-post > .is-style-ards-tarjeta { height: 100%; }
.is-style-ards-tarjeta .wp-block-post-title a { text-decoration: none; }
.is-style-ards-tarjeta .wp-block-post-title a:hover { color: var(--ards-naranja); }
.is-style-ards-tarjeta .wp-block-post-excerpt__more-link { font-weight: 800; }

/* ---------- Sticker (round badge) ---------- */
.is-style-ards-sticker {
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #fff;
  border: 8px solid var(--ards-sol);
  box-shadow: var(--ards-sombra);
  transform: rotate(-6deg);
  transition: transform .4s cubic-bezier(.2, .8, .3, 1.4);
}
.is-style-ards-sticker:hover { transform: rotate(4deg) scale(1.05); }

/* ---------- Polaroid images and galleries ---------- */
.wp-block-image.is-style-ards-polaroid img,
.wp-block-gallery.is-style-ards-polaroid .wp-block-image img {
  background: #fff;
  padding: 10px 10px 34px;
  box-shadow: 0 10px 26px rgba(59, 35, 20, .18);
  border-radius: 4px;
  transform: rotate(-2.5deg);
  transition: transform .4s cubic-bezier(.2, .8, .3, 1.3);
}
.wp-block-gallery.is-style-ards-polaroid .wp-block-image:nth-child(even) img { transform: rotate(2.5deg); }
.wp-block-gallery.is-style-ards-polaroid .wp-block-image:nth-child(3n) img { transform: rotate(-1deg); }
.wp-block-image.is-style-ards-polaroid img:hover,
.wp-block-gallery.is-style-ards-polaroid .wp-block-image img:hover { transform: rotate(0) scale(1.04); z-index: 2; position: relative; }

.wp-block-image.is-style-ards-redonda img { border-radius: 50%; aspect-ratio: 1; object-fit: cover; box-shadow: 0 0 0 10px var(--ards-sol-claro), var(--ards-sombra); }

/* ---------- Chapter (media & text that tells a story) ---------- */
.wp-block-media-text.is-style-ards-capitulo { gap: 0; }
.wp-block-media-text.is-style-ards-capitulo .wp-block-media-text__media img {
  aspect-ratio: 5 / 4;
  object-fit: cover;
  border-radius: var(--ards-radio);
  box-shadow: 0 0 0 10px #fff, var(--ards-sombra);
  transform: rotate(-2deg);
  transition: transform .5s cubic-bezier(.2, .8, .3, 1.2);
}
.wp-block-media-text.is-style-ards-capitulo.has-media-on-the-right .wp-block-media-text__media img { transform: rotate(2deg); }
.wp-block-media-text.is-style-ards-capitulo:hover .wp-block-media-text__media img { transform: rotate(0) scale(1.02); }
.wp-block-media-text.is-style-ards-capitulo .wp-block-media-text__content { padding: 2rem 6%; }

/* ---------- Testimonial ---------- */
.entry-content .wp-block-quote.is-style-ards-testimonio {
  border: 0;
  background: var(--ards-crema);
  border-radius: var(--ards-radio);
  padding: 2rem 1.6rem 1.6rem;
  margin: 0;
  position: relative;
  height: 100%;
  transition: transform .3s ease;
}
.wp-block-quote.is-style-ards-testimonio:hover { transform: translateY(-4px); }
.wp-block-quote.is-style-ards-testimonio::before {
  content: "★★★★★";
  display: block;
  color: var(--ards-sol);
  letter-spacing: .2em;
  margin-bottom: .6rem;
}
.wp-block-quote.is-style-ards-testimonio p { font-style: italic; font-size: 1.05rem; }
.wp-block-quote.is-style-ards-testimonio cite { font-style: normal; font-weight: 800; color: var(--ards-rojo); }

/* ---------- Sun waves separator ---------- */
hr.wp-block-separator.is-style-ards-ondas {
  border: 0;
  height: 46px;
  max-width: none;
  width: 100%;
  opacity: 1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 90' preserveAspectRatio='none'%3E%3Cpath d='M0 30 C250 0 450 60 700 28 S1050 0 1200 22 L1200 90 L0 90Z' fill='%23FEC82C'/%3E%3Cpath d='M0 52 C280 24 480 80 760 50 S1080 28 1200 46 L1200 90 L0 90Z' fill='%23FEB909'/%3E%3Cpath d='M0 72 C300 50 520 94 800 70 S1100 52 1200 64 L1200 90 L0 90Z' fill='%23FE9F10'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

/* ---------- Carousel ---------- */
.is-style-ards-carrusel { position: relative; }
.ards-carousel__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.ards-carousel__track::-webkit-scrollbar { display: none; }
.ards-carousel .ards-carousel__track > * { flex: 0 0 100%; scroll-snap-align: start; margin: 0; max-width: none; }
.ards-carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, .92);
  color: var(--ards-rojo);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--ards-sombra);
  z-index: 3;
  transition: transform .2s ease, background .2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.ards-carousel__nav:hover { background: var(--ards-sol-claro); transform: translateY(-50%) scale(1.08); }
.ards-carousel__nav:focus-visible { outline: 3px solid var(--ards-rojo); outline-offset: 3px; }
.ards-carousel__nav--prev { left: 18px; }
.ards-carousel__nav--next { right: 18px; }
.ards-carousel__dots { position: absolute; bottom: 18px; left: 0; right: 0; display: flex; justify-content: center; gap: 10px; z-index: 3; }
.ards-carousel__dot { width: 12px; height: 12px; border-radius: 999px; border: 2px solid #fff; background: rgba(255, 255, 255, .5); padding: 0; cursor: pointer; transition: width .3s ease, background .3s ease; }
.ards-carousel__dot[aria-current="true"] { width: 34px; background: var(--ards-rojo); border-color: var(--ards-rojo); }
.ards-carousel__progress { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--ards-naranja); z-index: 3; width: 0; }
.ards-carousel.is-playing .ards-carousel__progress { animation: ards-progress var(--ards-interval, 6s) linear; }
@keyframes ards-progress { from { width: 0; } to { width: 100%; } }

/* The active slide: background slowly zooms, the text arrives. */
.ards-carousel .wp-block-cover__image-background { transition: transform 7s ease-out; }
.ards-carousel .is-active .wp-block-cover__image-background { transform: scale(1.07); }
.ards-carousel .wp-block-cover__inner-container > * { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .3, 1.1); }
.ards-carousel .is-active .wp-block-cover__inner-container > * { opacity: 1; transform: none; }
.ards-carousel .is-active .wp-block-cover__inner-container > *:nth-child(2) { transition-delay: .12s; }
.ards-carousel .is-active .wp-block-cover__inner-container > *:nth-child(3) { transition-delay: .24s; }
.ards-carousel .is-active .wp-block-cover__inner-container > *:nth-child(4) { transition-delay: .36s; }

@media (max-width: 781px) {
  .ards-carousel__nav { width: 40px; height: 40px; font-size: 1.2rem; top: auto; bottom: 10px; transform: none; }
  .ards-carousel__nav:hover { transform: scale(1.05); }
  .ards-carousel__nav--prev { left: 12px; } .ards-carousel__nav--next { right: 12px; }
  .ards-carousel__dots { bottom: 24px; }
}

/* Light covers on phones: the text runs over the whole photo, so a cream veil
 * goes from the top down (the side gradient only covers the left). */
@media (max-width: 781px) {
  .entry-content .wp-block-cover.is-light::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(255, 247, 230, .94) 0%, rgba(255, 247, 230, .82) 60%, rgba(255, 247, 230, .35) 100%);
    pointer-events: none;
  }
  .entry-content .wp-block-cover.is-light > .wp-block-cover__inner-container { z-index: 2; }
}

/* ---------- Scroll-in animations (only when JS runs) ---------- */
.ards-js .ards-reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .3, 1); }
.ards-js .ards-reveal.is-visible { opacity: 1; transform: none; }

/* ---------- WhatsApp floating button ---------- */
.ards-whatsapp {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
  z-index: 999;
  transition: transform .25s ease;
}
.ards-whatsapp:hover, .ards-whatsapp:focus-visible { transform: scale(1.1); color: #fff; }
.ards-whatsapp svg { width: 32px; height: 32px; fill: currentColor; }
.ards-whatsapp::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(37, 211, 102, .6); animation: ards-pulse 2.4s infinite; }
@keyframes ards-pulse { 70% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); } 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); } }

@media (prefers-reduced-motion: reduce) {
  .ards-js .ards-reveal, .ards-carousel .wp-block-cover__inner-container > * { opacity: 1 !important; transform: none !important; transition: none !important; }
  .ards-carousel .wp-block-cover__image-background, .is-style-ards-tarjeta, .is-style-ards-sticker { transition: none !important; transform: none !important; }
  .ards-carousel__track { scroll-behavior: auto; }
  .ards-whatsapp::after, .ards-carousel.is-playing .ards-carousel__progress { animation: none; }
}
