/**
 * Content Modules — shared styles
 *
 * Text block, CTA button, media (image / video / slideshow) and background
 * bands shared by content_split_module and content_full_width_module.
 * Enqueued by bonsai_enqueue_content_shared_css() (inc/helpers.php).
 *
 * Markup: template-parts/modules/partials/content-text.php
 *         template-parts/modules/partials/content-media.php
**/

/* Background bands — colours are set as custom properties so the text,
   button and slideshow dots all follow the band automatically. */
.content-module {
  --cm-bg: var(--white, #fff);
  --cm-heading: var(--farani-burgundy, #401115);
  --cm-text: var(--farani-text-grey, #585858);
  --cm-eyebrow: var(--farani-orange, #e95a3a);
  --cm-link: var(--farani-burgundy, #401115);
  --cm-link-hover: var(--farani-orange, #e95a3a);
  --cm-btn-bg: var(--farani-burgundy, #401115);
  --cm-btn-text: var(--white, #fff);
  --cm-btn-sweep: var(--farani-orange, #e95a3a);
  --cm-btn-hover-text: var(--white, #fff);
  --cm-dot: var(--farani-burgundy, #401115);
  --cm-dot-active: var(--farani-orange, #e95a3a);

  background: var(--cm-bg);
  padding: 90px 0;
}

.content-module--bg-offwhite { --cm-bg: var(--farani-offwhite, #fffcfb); }
.content-module--bg-salmon { --cm-bg: var(--farani-salmon-grey, #fff2ef); }

/* Orange — text stays burgundy (DESIGN.md §2) */
.content-module--bg-orange {
  --cm-bg: var(--farani-orange, #e95a3a);
  --cm-text: var(--farani-burgundy, #401115);
  --cm-eyebrow: var(--farani-burgundy, #401115);
  --cm-link-hover: var(--white, #fff);
  --cm-btn-sweep: var(--white, #fff);
  --cm-btn-hover-text: var(--farani-burgundy, #401115);
  --cm-dot-active: var(--farani-burgundy, #401115);
}

/* Burgundy — the only band with white text */
.content-module--bg-burgundy {
  --cm-bg: var(--farani-burgundy, #401115);
  --cm-heading: var(--white, #fff);
  --cm-text: var(--white, #fff);
  --cm-link: var(--white, #fff);
  --cm-btn-bg: var(--farani-orange, #e95a3a);
  --cm-btn-sweep: var(--white, #fff);
  --cm-btn-hover-text: var(--farani-burgundy, #401115);
  --cm-dot: var(--white, #fff);
}

/* base.css sets p / h1-h6 to black, which beats inheritance — force the
   WYSIWYG content back to white on the burgundy band. */
.content-module--bg-burgundy .content-module__body p,
.content-module--bg-burgundy .content-module__body h1,
.content-module--bg-burgundy .content-module__body h2,
.content-module--bg-burgundy .content-module__body h3,
.content-module--bg-burgundy .content-module__body h4,
.content-module--bg-burgundy .content-module__body h5,
.content-module--bg-burgundy .content-module__body h6,
.content-module--bg-burgundy .content-module__body li,
.content-module--bg-burgundy .content-module__body blockquote,
.content-module--bg-burgundy .content-module__body figcaption { color: var(--white, #fff); }

/* Text block */
.content-module__eyebrow {
  font-family: var(--farani-body-font);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--cm-eyebrow);
  margin-bottom: 16px;
}

.content-module__heading {
  font-family: var(--farani-heading-font);
  font-weight: 400;
  font-size: 46px;
  line-height: 1.15;
  color: var(--cm-heading);
  margin: 0 0 24px;
}

.content-module__body {
  font-family: var(--farani-body-font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--cm-text);
}
.content-module__body > :last-child { margin-bottom: 0; }
.content-module__body p { margin: 0 0 20px; }
.content-module__body h2,
.content-module__body h3,
.content-module__body h4 {
  font-family: var(--farani-heading-font);
  font-weight: 400;
  color: var(--cm-heading);
  margin: 32px 0 14px;
}
.content-module__body h2 { font-size: 32px; }
.content-module__body h3 { font-size: 24px; }
.content-module__body h4 { font-size: 20px; }
.content-module__body ul,
.content-module__body ol { margin: 0 0 20px; padding-left: 20px; }
.content-module__body ul { list-style: disc; }
.content-module__body ol { list-style: decimal; }
.content-module__body li { margin-bottom: 8px; }
.content-module__body strong { font-weight: 700; color: var(--cm-heading); }
.content-module__body a {
  color: var(--cm-link);
  border-bottom: 1px solid currentColor;
  transition: var(--transition);
}
.content-module__body a:hover { color: var(--cm-link-hover); }

/* Solid button with colour-sweep hover (same pattern as .cta-module__btn) */
.content-module__btn {
  position: relative;
  z-index: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  padding: 16px 28px;
  background: var(--cm-btn-bg);
  color: var(--cm-btn-text);
  font-family: var(--farani-body-font);
  font-weight: 500;
  font-size: 16px;
  overflow: hidden;
  transition: color .4s ease;
}
.content-module__btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: var(--cm-btn-sweep);
  transition: width .4s ease;
  z-index: -1;
}
.content-module__btn i {
  font-size: 14px;
  transition: transform .3s ease;
}
.content-module__btn:hover { color: var(--cm-btn-hover-text); }
.content-module__btn:hover::before { width: 100%; }
.content-module__btn:hover i { transform: translateX(3px); }

/* Media */
.content-media__img {
  display: block;
  width: 100%;
  height: auto;
}

.content-media__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  background: #d9d9d9;
  color: #9a9a9a;
  font-size: 40px;
}

/* Video — 16:9 frame for both embeds and self-hosted files */
.content-media--video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}
.content-media__embed,
.content-media__embed iframe,
.content-media__video-file {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.content-media__video-file { object-fit: cover; }

/* Slideshow — slides share one grid cell, fixed 4:3 frame */
.media-slideshow__slides {
  display: grid;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.media-slideshow__slide {
  grid-area: 1 / 1;
  min-height: 0;
}
.media-slideshow__slide .content-media__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-slideshow--slider .media-slideshow__slide {
  opacity: 0;
  visibility: hidden;
  transition: opacity .8s ease, visibility 0s linear .8s;
}
.media-slideshow--slider .media-slideshow__slide.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity .8s ease, visibility 0s linear 0s;
}

.media-slideshow__dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.media-slideshow__dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 1px solid var(--cm-dot);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
}
.media-slideshow__dot.is-active {
  background: var(--cm-dot-active);
  border-color: var(--cm-dot-active);
}
.media-slideshow__dot:focus-visible {
  outline: 2px solid var(--cm-dot-active);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .media-slideshow--slider .media-slideshow__slide,
  .media-slideshow--slider .media-slideshow__slide.is-active { transition: none; }
}

@media (max-width: 1536px) {

}

@media (max-width: 1366px) {

}

@media (max-width: 1280px) {
  .content-module__heading { font-size: 40px; }
}

@media (max-width: 992px) {
  .content-module { padding: 56px 0; }
}

@media (max-width: 768px) {
  .content-module__heading { font-size: 30px; }
  .content-module__body h2 { font-size: 26px; }
  .content-module__body h3 { font-size: 22px; }
}

@media (max-width: 600px) {
  .content-module { padding: 40px 0; }
  .content-module__btn { width: 100%; justify-content: center; }
}
