/* Jyavani Page Builder — frontend.css (v2.0)
 * Structural + component styles. Design tokens injected per .jvb-page as CSS vars. */

.jvb-page {
  font-family: var(--jvb-font-body, system-ui, sans-serif);
  font-size: var(--jvb-base-size, 16px);
  line-height: var(--jvb-line-height, 1.65);
  color: var(--jvb-text, #1e293b);
  --jvb-ctn: var(--jvb-container, 1200px);
}
.jvb-page *, .jvb-page *::before, .jvb-page *::after { box-sizing: border-box; }
.jvb-page img { max-width: 100%; height: auto; display: block; }
.jvb-page a { color: var(--jvb-primary, #2563eb); text-decoration: none; }
.jvb-page a:hover { text-decoration: underline; }

/* ---------- Sections ---------- */
.jvb-section { position: relative; }
.jvb-section__inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  width: 100%; max-width: var(--jvb-ctn);
  margin-inline: auto;
  padding: var(--jvb-section-y, 80px) 24px;
  gap: 0;
}
/* boxed: stays in theme container; full: bg bleeds to viewport, content constrained; stretch: full + content edge-to-edge */
.jvb-section--full, .jvb-section--stretch {
  left: 50%; right: 50%;
  margin-left: -50vw; margin-right: -50vw;
  width: 100vw; max-width: 100vw;
}
.jvb-section--stretch .jvb-section__inner { max-width: none; padding-inline: 24px; }
.jvb-section__overlay { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

/* ---------- Rows ---------- */
.jvb-row {
  display: flex; flex-wrap: nowrap;
  gap: var(--jvb-row-gap, 20px);
  width: 100%;
  min-height: 24px;
}
.jvb-row.jvb-row--wrap { flex-wrap: wrap; }
.jvb-row.jvb-row--center { align-items: center; }
.jvb-row.jvb-row--start { align-items: flex-start; }
.jvb-row.jvb-row--end { align-items: flex-end; }
.jvb-row.jvb-row--between { align-items: stretch; justify-content: space-between; }

/* ---------- Columns ---------- */
/* flex-grow ratios (generated per column) instead of width% — width% + flex gap
   overflows the row and wraps columns to the next line. */
.jvb-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--jvb-gap, 24px); }

/* ---------- Elements ---------- */
.jvb-el { width: 100%; }
.jvb-ta-center { text-align: center; }
.jvb-ta-right { text-align: right; }
.jvb-ta-center .jvb-btn, .jvb-ta-center figure { margin-inline: auto; }

.jvb-heading { font-family: var(--jvb-font-heading, inherit); margin: 0; line-height: 1.2; }
.jvb-richtext > *:first-child { margin-top: 0; }
.jvb-richtext > *:last-child { margin-bottom: 0; }
.jvb-richtext img { border-radius: var(--jvb-radius, 10px); }

.jvb-image { margin: 0; }
.jvb-image img { width: 100%; }
.jvb-image figcaption { font-size: .85em; color: var(--jvb-muted, #64748b); margin-top: .5rem; text-align: center; }
.jvb-image--empty, .jvb-video--empty, .jvb-gallery--empty, .jvb-posts--empty, .jvb-form--empty, .jvb-countdown--empty {
  padding: 2rem; text-align: center; color: var(--jvb-muted, #64748b);
  border: 1px dashed var(--jvb-border, #e2e8f0); border-radius: var(--jvb-radius, 10px);
}

/* Button */
.jvb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-weight: 600; border-radius: var(--jvb-radius, 10px);
  border: 2px solid var(--jvb-btn, var(--jvb-primary));
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  text-decoration: none !important;
}
.jvb-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.jvb-btn--sm { padding: .45em 1em; font-size: .875em; }
.jvb-btn--md { padding: .7em 1.5em; font-size: 1em; }
.jvb-btn--lg { padding: .9em 2em; font-size: 1.125em; }
.jvb-btn--solid { background: var(--jvb-btn); color: #fff; }
.jvb-btn--outline { background: transparent; color: var(--jvb-btn); }
.jvb-btn--ghost { background: transparent; color: var(--jvb-btn); border-color: transparent; }
.jvb-btn--full { display: flex; width: 100%; }

/* Icon */
.jvb-icon { display: inline-flex; }
.jvb-icon svg { display: block; }

/* Divider */
.jvb-divider { margin-block: 0; }

/* Video */
.jvb-video { position: relative; width: 100%; background: #000; }
.jvb-video iframe, .jvb-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.jvb-video--facade { cursor: pointer; }
.jvb-video--facade img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.jvb-video__play {
  position: absolute; inset: 0; margin: auto; width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.65); color: #fff; border: 0; border-radius: 50%;
  cursor: pointer; transition: transform .15s, background .15s;
}
.jvb-video__play:hover { transform: scale(1.1); background: var(--jvb-primary, #2563eb); }

/* Accordion (native details) */
.jvb-accordion { display: flex; flex-direction: column; gap: .5rem; }
.jvb-accordion__item { border: 1px solid var(--jvb-border, #e2e8f0); border-radius: var(--jvb-radius, 10px); background: var(--jvb-surface, #fff); overflow: hidden; }
.jvb-accordion__item summary {
  padding: 1rem 1.25rem; font-weight: 600; cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.jvb-accordion__item summary::-webkit-details-marker { display: none; }
.jvb-accordion__item summary::after {
  content: ''; width: 10px; height: 10px; flex: none;
  border-right: 2px solid var(--jvb-acc, var(--jvb-primary)); border-bottom: 2px solid var(--jvb-acc, var(--jvb-primary));
  transform: rotate(45deg); transition: transform .2s;
}
.jvb-accordion__item[open] summary::after { transform: rotate(-135deg); }
.jvb-accordion__body { padding: 0 1.25rem 1.25rem; }

/* Tabs */
.jvb-tabs__nav { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 2px solid var(--jvb-border, #e2e8f0); }
.jvb-tabs__nav button {
  padding: .7rem 1.25rem; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--jvb-muted, #64748b);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.jvb-tabs__nav button.is-active { color: var(--jvb-tab, var(--jvb-primary)); border-bottom-color: var(--jvb-tab, var(--jvb-primary)); }
.jvb-tabs__panel { padding: 1.25rem 0; }

/* Counter */
.jvb-counter__num { font-weight: 800; font-variant-numeric: tabular-nums; }

/* Countdown */
.jvb-countdown { display: flex; gap: 1rem; justify-content: inherit; }
.jvb-countdown__box {
  display: flex; flex-direction: column; align-items: center;
  min-width: 72px; padding: .75rem 1rem;
  background: var(--jvb-surface, #fff); border: 1px solid var(--jvb-border, #e2e8f0);
  border-radius: var(--jvb-radius, 10px);
}
.jvb-countdown__num { font-size: 2em; font-weight: 800; color: var(--jvb-cd, var(--jvb-primary)); font-variant-numeric: tabular-nums; }
.jvb-countdown__label { font-size: .75em; text-transform: uppercase; letter-spacing: .05em; color: var(--jvb-muted, #64748b); }

/* Gallery */
.jvb-gallery { display: grid; }
.jvb-gallery__item { overflow: hidden; cursor: pointer; }
.jvb-gallery__item img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .3s; }
.jvb-gallery__item:hover img { transform: scale(1.06); }

/* Testimonial */
.jvb-testimonial { margin: 0; max-width: 720px; }
.jvb-testimonial__stars { color: var(--jvb-tst, var(--jvb-primary)); font-size: 1.1em; letter-spacing: .1em; }
.jvb-star { opacity: .25; }
.jvb-star.is-on { opacity: 1; }
.jvb-testimonial blockquote { margin: .75rem 0 1rem; font-size: 1.25em; font-style: italic; line-height: 1.5; }
.jvb-testimonial figcaption { display: flex; align-items: center; gap: .75rem; }
.jvb-ta-center .jvb-testimonial figcaption { justify-content: center; }
.jvb-testimonial__avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.jvb-testimonial figcaption strong { display: block; }
.jvb-testimonial figcaption small { color: var(--jvb-muted, #64748b); }

/* Pricing */
.jvb-pricing {
  position: relative; display: flex; flex-direction: column; gap: 1rem;
  padding: 2rem; background: var(--jvb-surface, #fff);
  border: 1px solid var(--jvb-border, #e2e8f0); border-radius: var(--jvb-radius, 10px);
  height: 100%;
}
.jvb-pricing.is-highlight { border-color: var(--jvb-prc, var(--jvb-primary)); box-shadow: 0 12px 32px rgba(0,0,0,.1); transform: scale(1.02); }
.jvb-pricing__badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--jvb-prc, var(--jvb-primary)); color: #fff;
  font-size: .75rem; font-weight: 700; padding: .25rem .9rem; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
}
.jvb-pricing__plan { font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--jvb-muted, #64748b); font-size: .85em; }
.jvb-pricing__price { font-size: 3em; font-weight: 800; line-height: 1; }
.jvb-pricing__cur { font-size: .4em; vertical-align: super; margin-right: .1em; }
.jvb-pricing__per { font-size: .3em; font-weight: 500; color: var(--jvb-muted, #64748b); }
.jvb-pricing__features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.jvb-pricing__features li { display: flex; gap: .5rem; align-items: flex-start; }
.jvb-pricing__features svg { color: var(--jvb-prc, var(--jvb-primary)); flex: none; margin-top: .3em; }

/* Icon box */
.jvb-iconbox { display: flex; gap: 1rem; }
.jvb-iconbox--top { flex-direction: column; align-items: flex-start; }
.jvb-ta-center .jvb-iconbox--top { align-items: center; }
.jvb-iconbox--left { flex-direction: row; align-items: flex-start; }
.jvb-iconbox__icon { display: inline-flex; }
.jvb-iconbox__title { margin: 0 0 .35rem; font-size: 1.15em; }
.jvb-iconbox__body p { margin: 0; color: var(--jvb-muted, #64748b); }
.jvb-iconbox-link { display: block; color: inherit !important; }
.jvb-iconbox-link:hover { text-decoration: none; }

/* Posts grid */
.jvb-posts { display: grid; gap: var(--jvb-gap, 24px); }
.jvb-posts__card {
  display: flex; flex-direction: column;
  background: var(--jvb-surface, #fff); border: 1px solid var(--jvb-border, #e2e8f0);
  border-radius: var(--jvb-radius, 10px); overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.jvb-posts__card:hover { box-shadow: 0 10px 28px rgba(0,0,0,.1); transform: translateY(-3px); }
.jvb-posts__img img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.jvb-posts__body { padding: 1.25rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.jvb-posts__body h3 { margin: 0; font-size: 1.1em; line-height: 1.35; }
.jvb-posts__body p { margin: 0; color: var(--jvb-muted, #64748b); font-size: .9em; flex: 1; }
.jvb-posts__more { font-weight: 600; font-size: .9em; color: var(--jvb-pst, var(--jvb-primary)); }

/* Shape dividers */
.jvb-shape-wrap { position: absolute; left: 0; right: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.jvb-shape-wrap--top { top: -1px; }
.jvb-shape-wrap--bottom { bottom: -1px; }
.jvb-shape { width: 100%; height: 100%; display: block; }
.jvb-shape-wrap { height: 60px; }

/* ---------- Entrance animations (armed by inline script → .jvb-anim-on) ---------- */
.jvb-anim-on [data-jvb-anim] { opacity: 0; transition: opacity .7s ease, transform .7s ease; will-change: opacity, transform; }
.jvb-anim-on [data-jvb-anim="fade-up"] { transform: translateY(32px); }
.jvb-anim-on [data-jvb-anim="fade-down"] { transform: translateY(-32px); }
.jvb-anim-on [data-jvb-anim="fade-left"] { transform: translateX(32px); }
.jvb-anim-on [data-jvb-anim="fade-right"] { transform: translateX(-32px); }
.jvb-anim-on [data-jvb-anim="zoom-in"] { transform: scale(.9); }
.jvb-anim-on [data-jvb-anim="flip-up"] { transform: perspective(800px) rotateX(12deg); }
.jvb-anim-on [data-jvb-anim].jvb-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .jvb-anim-on [data-jvb-anim] { opacity: 1 !important; transform: none !important; transition: none; }
}

/* ---------- Lightbox ---------- */
.jvb-lightbox {
  position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.9); cursor: zoom-out; padding: 4vw;
}
.jvb-lightbox img { max-width: 100%; max-height: 92vh; border-radius: 8px; }
.jvb-lightbox__close { position: absolute; top: 16px; right: 24px; color: #fff; font-size: 32px; background: none; border: 0; cursor: pointer; }

/* ---------- Preview bar ---------- */
.jvb-preview-bar {
  position: sticky; top: 0; z-index: 999;
  background: #f59e0b; color: #1c1917; text-align: center;
  padding: .5rem 1rem; font-size: .875rem; font-weight: 600;
}
.jvb-preview-bar a { color: #1c1917; text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .jvb-section__inner { padding-block: calc(var(--jvb-section-y, 80px) * .7); }
}
@media (max-width: 767px) {
  .jvb-section__inner { padding-block: calc(var(--jvb-section-y, 80px) * .5); }
  .jvb-row { flex-direction: column; }
  .jvb-col { flex: none !important; width: 100% !important; }
  .jvb-countdown { flex-wrap: wrap; justify-content: center; }
  .jvb-posts { grid-template-columns: 1fr !important; }
  .jvb-gallery { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ── Card ── */
.jvb-card { background: var(--jvb-surface); border: 1px solid var(--jvb-border); border-radius: var(--jvb-card-radius, 12px); overflow: hidden; display: flex; flex-direction: column; }
.jvb-card--shadow { box-shadow: 0 10px 30px rgba(15, 23, 42, .08); }
.jvb-card--left { flex-direction: row; }
.jvb-card--left .jvb-card__media { flex: 0 0 40%; }
.jvb-card__media { position: relative; }
.jvb-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jvb-card__badge { position: absolute; top: 12px; left: 12px; background: var(--jvb-card, var(--jvb-primary)); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; line-height: 1.4; }
.jvb-card__body { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.jvb-card__title { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--jvb-text); }
.jvb-card__text { margin: 0; color: var(--jvb-muted); line-height: 1.6; }
.jvb-card__body .jvb-btn { align-self: flex-start; margin-top: 6px; }
@media (max-width: 767px) { .jvb-card--left { flex-direction: column; } }

/* ── Carousel (Swiper — assets ship with CMS core) ── */
.jvb-carousel { position: relative; }
.jvb-carousel__slide img { width: 100%; aspect-ratio: var(--jvb-cr-ratio, 16 / 9); object-fit: cover; display: block; border-radius: var(--jvb-cr-radius, 0); }
.jvb-carousel .swiper-button-prev, .jvb-carousel .swiper-button-next { color: var(--jvb-primary); }
.jvb-carousel .swiper-pagination-bullet-active { background: var(--jvb-primary); }
.jvb-carousel--empty { padding: 40px; text-align: center; color: var(--jvb-muted); border: 1px dashed var(--jvb-border); border-radius: 8px; }
