/* Public theme — layered on top of Bootstrap 5 + brand tokens.
   Keep this file SMALL: brand colors come from <style> via lib/brand.php,
   layout from Bootstrap, and only block-specific polish lives here. */

html, body { scroll-behavior: smooth; }
img, svg, video { max-width: 100%; height: auto; }
.site-main { min-height: 60vh; }

/* Block scaffolding */
.block { padding: 4rem 0; overflow-x: clip; }
.block-hero { padding: 5rem 0 4rem; }
.block-cta  { background: var(--brand-paper-alt); }
.block-features .feature-card { height: 100%; }

.block + .block { border-top: 0; }

/* Hero — bg_video layer (rendered by partials/blocks/hero.php when settings.bg_video is set) */
.block-hero { position: relative; isolation: isolate; }
.hero-bg-video-wrap { position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.hero-bg-video-wrap video,
.hero-bg-video { width: 100%; height: 100%; object-fit: cover; display: block; max-width: none; }
.hero-bg-video-overlay { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.block-hero > .container { position: relative; z-index: 2; }
@media (prefers-reduced-motion: reduce) { .hero-bg-video-wrap video { display: none; } }

/* Hero */
.hero-eyebrow {
  display: inline-block;
  background: rgba(var(--bs-primary-rgb), .12);
  color: var(--brand-primary);
  font-weight: 600;
  font-size: .8rem;
  padding: .25rem .75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.hero-title { font-size: clamp(2rem, 4.5vw, 3.5rem); font-weight: 700; line-height: 1.1; }
.hero-lead  { font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--brand-ink-soft); }

/* Features */
.feature-card {
  background: var(--brand-paper);
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius);
  padding: 1.5rem;
  transition: transform .15s ease, box-shadow .15s ease;
}
.feature-card:hover { transform: translateY(-2px); box-shadow: var(--brand-shadow); }
.feature-icon {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(var(--bs-primary-rgb), .12);
  color: var(--brand-primary);
  border-radius: var(--brand-radius);
  font-size: 1.4rem;
  margin-bottom: .75rem;
}

/* Testimonial */
.testimonial-card {
  border-left: 4px solid var(--brand-primary);
  background: var(--brand-paper-alt);
  padding: 1.25rem 1.5rem;
  border-radius: var(--brand-radius);
}
.testimonial-card cite { font-style: normal; color: var(--brand-muted); font-size: .9rem; }

/* Pricing */
.pricing-card {
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius-lg);
  padding: 2rem 1.5rem;
  background: var(--brand-paper);
  height: 100%;
}
.pricing-card.featured {
  border-color: var(--brand-primary);
  box-shadow: var(--brand-shadow);
  position: relative;
}
.pricing-card.featured::before {
  content: 'Most popular';
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--brand-primary); color: #fff;
  font-size: .7rem; font-weight: 600;
  padding: .15rem .75rem; border-radius: 999px;
  letter-spacing: .03em; text-transform: uppercase;
}
.pricing-amount { font-size: 2.5rem; font-weight: 700; color: var(--brand-ink); }
.pricing-amount small { font-size: .9rem; color: var(--brand-muted); font-weight: 400; }

/* Gallery / media-grid */
.media-grid img, .media-grid picture img {
  border-radius: var(--brand-radius);
  object-fit: cover;
  aspect-ratio: 4 / 3;
  width: 100%;
}
.media-grid .ratio video { border-radius: var(--brand-radius); }

/* Contact form */
.contact-form .form-status { min-height: 1.25em; margin-top: .75rem; font-size: .9rem; }

/* Brand showcase */
.brand-swatch {
  border-radius: var(--brand-radius);
  padding: 1rem;
  height: 90px;
  display: flex; flex-direction: column; justify-content: flex-end;
  color: #fff;
  font-family: var(--brand-mono-font);
  font-size: .8rem;
  border: 1px solid var(--brand-border);
}
.brand-swatch.light { color: var(--brand-ink); }
.type-sample { padding: 1rem 0; border-bottom: 1px dashed var(--brand-border); }
.type-sample:last-child { border-bottom: 0; }

/* SVG inlined via {{svg:...}} should respect currentColor */
.svg-inline svg { fill: currentColor; }

/* 404 */
.notfound { text-align: center; padding: 5rem 0; }

/* ===== Phase 4 — new block components ===== */

/* Stats */
.stat-card {
  padding: 1.25rem .5rem;
}
.stat-number {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--brand-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin-bottom: .35rem;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: .85rem;
  color: var(--brand-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Logo cloud */
.letter-wide { letter-spacing: 0.12em; }
.logo-cloud .logo-cell {
  display: flex; align-items: center; justify-content: center;
  height: 60px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--brand-muted);
  filter: grayscale(100%);
  opacity: .7;
  transition: opacity .2s ease, filter .2s ease, color .2s ease;
}
.logo-cloud .logo-cell:hover {
  opacity: 1;
  filter: grayscale(0%);
  color: var(--brand-ink);
}
.logo-cloud .logo-cell img {
  max-height: 40px;
  width: auto;
}

/* Callout */
.callout {
  display: flex; gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--brand-radius);
  border-left: 4px solid var(--brand-primary);
  background: rgba(var(--bs-primary-rgb), .06);
}
.callout-icon { font-size: 1.4rem; line-height: 1.2; color: var(--brand-primary); }
.callout-body h3 { color: var(--brand-ink); }
.callout-info     { border-color: var(--brand-primary); background: rgba(var(--bs-primary-rgb), .06); }
.callout-info     .callout-icon { color: var(--brand-primary); }
.callout-success  { border-color: var(--brand-success); background: rgba(var(--bs-success-rgb), .08); }
.callout-success  .callout-icon { color: var(--brand-success); }
.callout-warning  { border-color: var(--brand-accent);  background: rgba(244, 183, 42, .12); }
.callout-warning  .callout-icon { color: var(--brand-accent); }
.callout-danger   { border-color: var(--brand-danger);  background: rgba(var(--bs-danger-rgb), .08); }
.callout-danger   .callout-icon { color: var(--brand-danger); }
.callout-highlight{ border-color: var(--brand-secondary); background: var(--brand-paper-alt); }

/* Two-column block — defaults inherit from features-card hover for image side */
.block-two-column .ratio { transition: transform .2s ease, box-shadow .2s ease; }
.block-two-column .ratio:hover { transform: translateY(-4px); box-shadow: var(--brand-shadow); }

/* Accordion polish */
.block-accordion .accordion-item {
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius) !important;
  overflow: hidden;
  margin-bottom: .5rem;
}
.block-accordion .accordion-item:last-child { margin-bottom: 0; }
.block-accordion .accordion-button:not(.collapsed) {
  background: rgba(var(--bs-primary-rgb), .08);
  color: var(--brand-primary);
  box-shadow: none;
}
.block-accordion .accordion-button:focus { box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .2); }

/* Embed */
.block-embed iframe { border: 0; width: 100%; height: 100%; }

/* Newsletter form */
.block-newsletter .newsletter-form .input-group { box-shadow: var(--brand-shadow); border-radius: var(--brand-radius); overflow: hidden; }
.block-newsletter .newsletter-form .form-control { border: 0; padding: .85rem 1rem; }
.block-newsletter .newsletter-form .form-control:focus { box-shadow: none; }
.block-newsletter .newsletter-form .btn { border-radius: 0; padding-left: 1.5rem; padding-right: 1.5rem; }

/* Carousel (Swiper) */
.site-swiper { padding-bottom: 2.5rem; }
.site-swiper .swiper-pagination-bullet { background: var(--brand-primary); }
.site-swiper .swiper-button-next, .site-swiper .swiper-button-prev {
  color: var(--brand-primary);
  width: 36px; height: 36px;
}
.site-swiper .swiper-button-next::after, .site-swiper .swiper-button-prev::after { font-size: 1.1rem; font-weight: 700; }

/* Gallery lightbox grid */
.block-gallery-lightbox a { transition: transform .15s ease, box-shadow .15s ease; }
.block-gallery-lightbox a:hover { transform: scale(1.02); box-shadow: var(--brand-shadow); }

/* Flex section layout (block-section + layout=flex) */
[data-section-layout="flex"] .section-flex { width: 100%; }
[data-section-layout="flex"] .section-col > * { width: 100%; }
/* Responsive stack: below 720px, every flex column takes the full row so the
   layout degrades gracefully without the user tweaking breakpoints. */
@media (max-width: 720px) {
  [data-section-layout="flex"] .section-col { flex-basis: 100% !important; flex-grow: 1 !important; }
}
/* Nested blocks keep their own breathing room unless the section explicitly
   chooses to absorb it — override with custom_class="compact-children" to
   zero inner padding (works across all section layouts). */
.block-section.compact-children .section-col > .block,
.block-section.compact-children > .container > .row > [class^="col"] > .block,
.block-section.compact-children > .container > .row > [class*=" col"] > .block { padding: 0; }

/* -----------------------------------------------------------------
   Home-template components — generic; safe to remove if you fork.
   ----------------------------------------------------------------- */

/* Service card — hover lift + color wash on arrow */
.service-card {
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -20px rgba(0,0,0,.2);
  border-color: rgba(var(--bs-primary-rgb), .3);
}
.service-card-icon { transition: background-color .2s ease; }
.service-card:hover .service-card-icon { background: var(--brand-primary) !important; color: #fff !important; }
.service-card-arrow i { transition: transform .2s ease; display: inline-block; }
.service-card:hover .service-card-arrow i { transform: translateX(4px); }

/* Trust band — dividers between cells on desktop */
.trust-band { background: linear-gradient(135deg, #1a1f2e 0%, #2d3748 100%) !important; }
@media (min-width: 768px) {
  .trust-cell + .trust-cell { border-left: 1px solid rgba(255,255,255,.1); }
}

/* Work bento grid — one big tile, five smaller */
.work-bento {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 180px;
}
.work-tile {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  display: block;
  text-decoration: none;
  grid-column: span 3;
  grid-row: span 1;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: transform .25s ease, box-shadow .25s ease;
}
.work-tile-large { grid-column: span 4; grid-row: span 2; }
.work-tile picture, .work-tile img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.work-tile:hover { transform: translateY(-2px); box-shadow: 0 20px 40px -15px rgba(0,0,0,.25); }
.work-tile:hover img { transform: scale(1.04); }
.work-tile-caption {
  position: absolute; inset: auto 0 0 0;
  padding: 1rem 1.25rem;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.75) 100%);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease;
}
.work-tile-large .work-tile-caption { opacity: 1; transform: none; padding: 1.25rem 1.5rem 1.5rem; }
.work-tile:hover .work-tile-caption { opacity: 1; transform: none; }
@media (max-width: 992px) {
  .work-bento { grid-template-columns: repeat(2, 1fr); }
  .work-tile, .work-tile-large { grid-column: span 1; grid-row: span 1; }
  .work-tile-large { grid-column: span 2; grid-row: span 2; }
}
@media (max-width: 540px) {
  .work-bento { grid-template-columns: 1fr; }
  .work-tile-large { grid-column: span 1; grid-row: span 2; }
}

/* Testimonial carousel */
.testimonial-swiper { padding: 0 3rem 3rem; }
.testimonial-card {
  border: 1px solid rgba(0,0,0,.05);
}
.testimonial-card .testimonial-quote {
  font-size: 1.05rem;
  line-height: 1.65;
  color: #374151;
  font-weight: 400;
  font-style: italic;
  border-left: 3px solid var(--brand-primary);
  padding-left: 1.1rem;
  margin: 0;
}
.testimonial-swiper .swiper-button-prev,
.testimonial-swiper .swiper-button-next {
  color: var(--brand-primary);
  width: 44px; height: 44px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  top: 40%;
}
.testimonial-swiper .swiper-button-prev::after,
.testimonial-swiper .swiper-button-next::after {
  font-size: 1.1rem; font-weight: 700;
}
.testimonial-swiper .swiper-pagination-bullet {
  background: var(--brand-primary); opacity: .3;
  width: 8px; height: 8px;
}
.testimonial-swiper .swiper-pagination-bullet-active { opacity: 1; width: 24px; border-radius: 4px; }
@media (max-width: 720px) {
  .testimonial-swiper { padding: 0 0 3rem; }
  .testimonial-swiper .swiper-button-prev, .testimonial-swiper .swiper-button-next { display: none; }
}

/* Missing-media placeholder (public + admin) */
.media-missing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  aspect-ratio: 16 / 9;
  width: 100%;
  min-height: 140px;
  padding: 1.25rem;
  background: var(--brand-paper-alt, #f4f4f5);
  border: 1px dashed rgba(0,0,0,.15);
  border-radius: 8px;
  color: var(--brand-ink-muted, #6b7280);
  font-size: .9rem;
  text-align: center;
  overflow: hidden;
}
.media-missing .media-missing-icon { font-size: 1.75rem; opacity: .55; line-height: 1; }
.media-missing .media-missing-title { font-weight: 600; }
.media-missing .media-missing-hint  { font-size: .75rem; opacity: .75; word-break: break-all; }
.media-missing-svg { aspect-ratio: 1 / 1; min-height: 64px; }
.media-missing-video { aspect-ratio: 16 / 9; }
