/**
 * Bolton Sections — self-contained front-end styles.
 *
 * Independent of any theme's Tailwind build (the mu-plugin isn't in either
 * theme's content-scan path, so utility classes would be purged). Sections
 * render inside whatever container the theme's single template provides.
 * The accent color is themeable via the --bolton-accent CSS variable
 * (set inline by the plugin from the bolton_section_accent_color filter).
 */

.bolton-sections {
  --bolton-accent: #294468;
}

.bolton-section {
  margin: 0 0 1.75rem;
}

/* Text-bearing widgets keep a comfortable reading width; media widgets
   (image, gallery, raw_html, stat_block) fill the full container width
   supplied by the theme's single-post template. */
.bolton-rich-text,
.bolton-qa,
.bolton-quote {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

/* rich_text */
.bolton-rich-text {
  line-height: 1.7;
}
.bolton-rich-text p {
  margin: 0 0 1em;
}
.bolton-rich-text img {
  max-width: 100%;
  height: auto;
}
/* Any heading an editor inserts inside rich_text content (wp_kses_post already
   allows h1-h6) picks up the section-title treatment automatically. */
.bolton-rich-text h1,
.bolton-rich-text h2,
.bolton-rich-text h3 {
  margin: 0 0 1em;
  font-family: "Tenor Sans", serif;
  font-weight: 400;
  text-align: center;
  color: var(--bolton-accent);
}
.bolton-rich-text h1 {
  font-size: 2.5rem;
}
.bolton-rich-text h2 {
  font-size: 2rem;
}
.bolton-rich-text h3 {
  font-size: 1.5rem;
}

/* all in-text links across section types are underlined — except a plain
   (non-link-arrow) Divi module-link, which prod shows with zero visual
   distinction (see bolton_divi_apply_module_link in wp-cli.php) */
.bolton-rich-text a,
.bolton-qa-answer a,
.bolton-raw-html a {
  text-decoration: underline;
}
.bolton-module-link:not(.bolton-cta-link) {
  text-decoration: none;
}

/* qa_pair — question stacked directly above the answer, single column. */
.bolton-qa {
  margin: 0 auto 2rem;
}
.bolton-qa-question {
  margin-bottom: 0.5rem;
  font-weight: 700;
  color: var(--bolton-accent);
  line-height: 1.4;
}
.bolton-qa-question p {
  margin: 0;
}
.bolton-qa-answer {
  font-weight: 300;
  line-height: 1.75;
}
.bolton-qa-answer p {
  margin: 0 0 1em;
}

/* pull_quote — a single decorative mark carries the "this is a quote" cue so
   the box reads the same whether or not the editor typed literal «»/“” into
   the quote text itself (some migrated content did, most didn't). Mark image
   is themeable via the --bolton-quote-mark-url var (set inline by the plugin
   from the bolton_section_quote_mark_url filter, same pattern as the accent
   color); falls back to no image where a theme hasn't provided one. */
.bolton-quote {
  position: relative;
  margin: 2rem auto;
  padding: 1.75rem 2rem 1.75rem 4.25rem;
  background: #d9edf2;
}
.bolton-quote::before {
  content: "";
  position: absolute;
  top: 1.5rem;
  left: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  background-image: var(--bolton-quote-mark-url, none);
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.35;
}
.bolton-quote-text {
  margin: 0;
  font-style: italic;
  line-height: 1.5;
  color: var(--bolton-accent);
}
.bolton-quote-text p {
  margin: 0;
}
.bolton-quote-cite {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-style: normal;
  font-weight: 400;
  color: #555;
}

/* image */
.bolton-image {
  margin: 1.75rem 0;
}
.bolton-image-img {
  display: block;
  width: 100%;
  height: auto;
}
.bolton-image-caption {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-style: italic;
  color: #777;
  text-align: right;
}

/* gallery */
.bolton-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 1.75rem 0;
}
@media (min-width: 640px) {
  .bolton-gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}
.bolton-gallery-item {
  margin: 0;
}
.bolton-gallery-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* carousel */
.bolton-carousel {
  position: relative;
  overflow: hidden;
  margin: 1.75rem 0;
}
.bolton-carousel-track {
  display: flex;
  transition: transform 0.5s ease;
}
.bolton-carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
}
.bolton-carousel-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.bolton-carousel-link {
  display: block;
}
.bolton-carousel-caption {
  margin: 0.4rem 0 0;
  font-family: "Poppins", sans-serif;
  font-size: 0.85rem;
  font-style: italic;
  text-align: center;
  color: #777;
}
.bolton-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
}
.bolton-carousel-arrow:hover {
  background: rgba(0, 0, 0, 0.7);
}
.bolton-carousel:hover .bolton-carousel-arrow,
.bolton-carousel:focus-within .bolton-carousel-arrow {
  opacity: 1;
}
.bolton-carousel-prev {
  left: 0.75rem;
}
.bolton-carousel-next {
  right: 0.75rem;
}
.bolton-carousel-dots {
  position: absolute;
  bottom: 0.75rem;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}
.bolton-carousel-dot {
  width: 0.5rem;
  height: 0.5rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 0;
}
.bolton-carousel-dot.is-active {
  background: #fff;
  width: 0.65rem;
  height: 0.65rem;
}
@media (max-width: 767px) {
  .bolton-carousel-arrow {
    opacity: 1;
  }
  .bolton-carousel-caption {
    font-size: 0.8rem;
  }
}

/* stat_block */
.bolton-stats {
  margin: 2rem 0;
}
.bolton-stats-heading {
  margin: 0 0 1rem;
  font-family: "Tenor Sans", serif;
  font-size: 1.25rem;
}
.bolton-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
}
.bolton-stat {
  display: flex;
  flex-direction: column;
}
.bolton-stat-prefix {
  font-family: "Poppins", sans-serif;
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.15rem;
}
.bolton-stat-number {
  font-family: "Poppins", sans-serif;
  font-size: 3rem;
  font-weight: 700;
  line-height: 0.85;
  color: var(--bolton-accent);
  font-variant-numeric: tabular-nums;
}
number-flow.bolton-stat-number {
  display: inline-block;
}
.bolton-stat-label {
  margin-top: 0.25rem;
  font-family: "Poppins", sans-serif;
  font-size: 0.95rem;
  color: #555;
}
/* Hand-built "key numbers" blocks (heading and/or prefix present) get a
   card treatment: neutral background, bigger centered title inside it. */
.bolton-stats--centered {
  background: #f7f9fa;
  padding: 2.5rem 2rem;
  border-radius: 0.75rem;
}
.bolton-stats--centered .bolton-stats-heading {
  text-align: center;
  font-size: 1.75rem;
}
.bolton-stats--centered .bolton-stat {
  text-align: center;
  align-items: center;
}

/* raw_html — oEmbed video markup carries the provider's fixed width/height
   attrs (e.g. a YouTube iframe defaults to 500x281); override so embeds
   fill the full content-band width at a proper 16:9 ratio instead of
   rendering pinned to their default pixel size. */
.bolton-raw-html iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
}

/* cta link (Divi "module link" — link_option_url) */
.bolton-cta-link {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  text-decoration: underline;
  color: inherit;
}
.bolton-cta-link::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 0.5em;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid currentColor;
  transition: transform 0.15s ease;
}
.bolton-cta-link:hover::after {
  transform: translateX(3px);
}

/* author_bio */
.bolton-author-bio {
  display: flex;
  align-items: flex-start;
  gap: 1.75rem;
  margin: 2rem 0;
  padding: 1.75rem;
  border-radius: 0.5rem;
}
.bolton-author-bio-photo {
  flex: none;
  width: 8rem;
}
.bolton-author-bio-photo img {
  display: block;
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  object-fit: cover;
}
.bolton-author-bio-credit {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  line-height: 1.3;
  text-align: center;
  opacity: 0.7;
}
.bolton-author-bio-body {
  flex: 1 1 0%;
  min-width: 0;
}
.bolton-author-bio-name {
  margin: 0 0 0.75rem;
  font-family: "Tenor Sans", serif;
  font-size: 1.5rem;
}
.bolton-author-bio-divider {
  margin: 0 0 0.75rem;
  border: 0;
  border-top: 1px solid;
}
.bolton-author-bio-text {
  margin: 0;
  line-height: 1.6;
}
.bolton-author-bio-text p {
  margin: 0 0 1em;
}
@media (max-width: 640px) {
  .bolton-author-bio {
    flex-direction: column;
    text-align: center;
  }
}

/* divider */
.bolton-divider {
  border: 0;
  border-top: 1px solid #e2e2e2;
  margin: 2.5rem 0;
}
