/* ============================================================
   Master CMS — Classic structural family
   Ported from the proven Newedge design system: soft/bouncy,
   pill-shaped buttons, rounded cards, decorative background
   circles, spring cubic-bezier hover lifts. Driven entirely by
   the CSS custom properties theme.php outputs per active theme —
   this file contains no hardcoded colors itself.
   ============================================================ */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-dark);
  background: var(--color-background);
  line-height: 1.6;
  overflow-x: hidden; /* required for full-bleed circles to never cause horizontal scroll */
}

h1, h2, h3 { font-family: var(--font-heading); font-weight: 800; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
p { margin: 0 0 1em; }
a { color: inherit; }

/* ---- Decorative background circles (Classic's signature motif) ---- */
.theme-classic .block {
  position: relative;
  overflow: hidden;
}
.theme-classic .bg-circle {
  position: absolute;
  border-radius: 50%;
  background: var(--color-highlight);
  opacity: .12;
  pointer-events: none;
  z-index: 0;
}
/* KNOWN RECURRING RULE (carried over from the proven build): any
   ">*{position:relative;z-index:1}" lifting block content above
   circles must exclude circles themselves. */
.theme-classic .block > *:not(.bg-circle) { position: relative; z-index: 1; }

/* ---- Header ---- */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 3rem;
  background: var(--color-background);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.logo { font-family: var(--font-heading); font-weight: 800; font-size: 1.25rem; text-decoration: none; color: var(--color-dark); }
.logo img { height: 36px; display: block; }
.main-nav { display: flex; gap: 2rem; }
.main-nav a { text-decoration: none; color: var(--color-dark); font-weight: 600; transition: color .2s var(--motion-easing); }
.main-nav a:hover { color: var(--color-primary); }

/* ---- Buttons (pill-shaped per radius-sm token) ---- */
.btn {
  display: inline-block;
  padding: .85rem 1.75rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: transform .35s var(--motion-easing), box-shadow .35s var(--motion-easing);
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { transform: var(--hover-btn); box-shadow: var(--shadow-card); }
.btn-secondary { background: transparent; color: var(--color-dark); border: 2px solid var(--color-line); }

/* ---- Blocks: shared spacing ---- */
.block { padding: 4.5rem 3rem; }

/* Banner (Home's hero, built as an ordinary block) */
.block-banner {
  display: flex;
  align-items: center;
  gap: 3rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff;
}
.block-banner h1 { color: #fff; }
.block-banner .btn-primary { background: #fff; color: var(--color-primary); }
.banner-copy { flex: 1; }
.banner-media { flex: 1; }
.banner-media img { width: 100%; display: block; }

/* Text / Image+Text / Twin Text */
.block-text, .block-image-text, .block-twin-text { max-width: 1100px; margin: 0 auto; }
.block-image-text { display: flex; gap: 3rem; align-items: center; }
.block-image-text.reverse { flex-direction: row-reverse; }
.block-image-text img, .block-image-image img { width: 100%; box-shadow: var(--shadow-card); }
.block-image-image { display: flex; gap: 2rem; max-width: 1100px; margin: 0 auto; }
.block-twin-text { display: flex; gap: 3rem; }
.block-twin-text > div { flex: 1; }

/* Stats band */
.block-stats-band {
  display: flex;
  justify-content: center;
  gap: 4rem;
  background: var(--color-dark);
  color: #fff;
}
.stat { display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.stat-badge {
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-card);
}
.stat-value { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 800; color: #fff; }
.stat-label { opacity: .8; }

/* Testimonial */
.block-testimonial { max-width: 700px; margin: 0 auto; text-align: center; }
.testimonial-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow-card);
  position: relative;
}
.testimonial-card::before {
  content: '\201C';
  position: absolute;
  top: 1rem; left: 1.5rem;
  font-family: Georgia, serif;
  font-size: 5rem;
  color: var(--color-primary);
  opacity: .15;
  line-height: 1;
}
.block-testimonial blockquote { font-size: 1.4rem; font-style: italic; margin: 0 0 1rem; position: relative; }
.block-testimonial cite { display: flex; flex-direction: column; font-style: normal; font-weight: 700; color: var(--color-primary); }
.block-testimonial cite span { font-weight: 400; opacity: .7; color: var(--color-dark); }

/* CTA scroller / Single CTA — big rounded pill banner, like a
   newsletter-signup band, per the reference design */
.block-cta-scroller, .block-single-cta {
  text-align: center;
  background: linear-gradient(120deg, var(--color-primary), var(--color-accent));
  padding: 3rem 4rem;
  position: relative;
  overflow: hidden;
}
.block-cta-scroller h2, .block-single-cta h2 { color: #fff; }
/* Guards against themes where highlight and primary are the same
   color (both Corporate themes do this) — a colored button on a
   colored section can silently vanish, so this block always uses
   the same safe white-button pattern as the Banner block. */
.block-cta-scroller .btn.btn-primary, .block-single-cta .btn.btn-primary {
  background: #fff;
  color: var(--color-dark);
}

/* FAQs */
.block-faqs { max-width: 800px; margin: 0 auto; }
.block-faqs details {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
}
.block-faqs summary { font-weight: 700; cursor: pointer; }

/* Contact form */
.block-contact-form { max-width: 600px; margin: 0 auto; }
.block-contact-form form { display: flex; flex-direction: column; gap: 1rem; }
.block-contact-form input, .block-contact-form textarea {
  padding: .9rem 1.1rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
}
.block-contact-form textarea { min-height: 120px; }

/* Logo strip */
.block-logo-strip { display: flex; justify-content: center; align-items: center; gap: 3rem; flex-wrap: wrap; opacity: .7; }
.block-logo-strip img { max-height: 40px; }

/* Pricing table */
.block-pricing-table { display: grid; gap: 2rem; max-width: 1100px; margin: 0 auto; }
.block-pricing-table[data-columns="2"] { grid-template-columns: repeat(2, 1fr); }
.block-pricing-table[data-columns="3"] { grid-template-columns: repeat(3, 1fr); }
.block-pricing-table[data-columns="4"] { grid-template-columns: repeat(4, 1fr); }
.pricing-col ul { display: flex; flex-direction: column; gap: .2rem; }
.pricing-col li { display: flex; align-items: center; gap: .5rem; }
.pricing-col li svg { color: var(--color-primary); flex-shrink: 0; }

/* ---- Gallery ---- */
.block-gallery { max-width: 1200px; margin: 0 auto; }
.gallery-grid { display: grid; gap: 1.5rem; }
.gallery-grid[data-columns="2"] { grid-template-columns: repeat(2, 1fr); }
.gallery-grid[data-columns="3"] { grid-template-columns: repeat(3, 1fr); }
.gallery-grid[data-columns="4"] { grid-template-columns: repeat(4, 1fr); }
.gallery-item { margin: 0; }
.gallery-item img { width: 100%; height: 240px; object-fit: cover; display: block; box-shadow: var(--shadow-card); transition: transform .3s var(--motion-easing); }
.gallery-item:hover img { transform: scale(1.03); }
.gallery-item figcaption { margin-top: .5rem; font-size: .85rem; opacity: .7; text-align: center; }
@media (max-width: 900px) {
  .block-pricing-table[data-columns="3"], .block-pricing-table[data-columns="4"] { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid[data-columns="3"], .gallery-grid[data-columns="4"] { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .block-pricing-table[data-columns="2"], .block-pricing-table[data-columns="3"], .block-pricing-table[data-columns="4"] { grid-template-columns: 1fr; }
  .gallery-grid[data-columns="2"], .gallery-grid[data-columns="3"], .gallery-grid[data-columns="4"] { grid-template-columns: 1fr; }
}
.pricing-col {
  flex: 1;
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-card);
  transition: transform .35s var(--motion-easing);
}
.pricing-col:hover { transform: var(--hover-card); }
.pricing-col .price { font-size: 2rem; font-weight: 800; color: var(--color-primary); }
.pricing-col ul { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.pricing-col li { padding: .4rem 0; border-bottom: 1px solid var(--color-line); }

/* Video embed */
.block-video-embed { max-width: 900px; margin: 0 auto; }
.video-wrap { position: relative; padding-bottom: 56.25%; height: 0; border-radius: var(--radius-md); overflow: hidden; }
.video-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* Team grid */
.block-team-grid { display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap; }
.team-member { display: flex; flex-direction: column; align-items: center; text-align: center; width: 180px; }
.team-member img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; margin-bottom: .75rem; box-shadow: var(--shadow-card); }
.team-name { font-weight: 700; }
.team-role { opacity: .7; font-size: .9rem; }

/* ---- Footer ---- */
.site-footer {
  padding: 0 3rem 2rem;
  text-align: left;
  border-top: 1px solid var(--color-line);
  background: var(--color-dark);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.footer-bg-circle { opacity: .06; background: #fff; position: absolute; z-index: 0; pointer-events: none; }
.footer-newsletter-wrap { padding: 3rem 0 2.5rem; position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; }
.footer-newsletter {
  background: linear-gradient(120deg, var(--color-primary), var(--color-accent));
  background-size: cover;
  background-position: center;
  border-radius: 999px;
  padding: 2rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}
.footer-newsletter-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(0,0,0,.55), var(--color-primary) 140%);
  z-index: 0;
}
.footer-newsletter > div:not(.footer-newsletter-overlay), .footer-newsletter > form { position: relative; z-index: 1; }
.footer-newsletter h3 { margin: 0; color: #fff; }
.newsletter-form { display: flex; gap: .75rem; flex-wrap: wrap; }
.newsletter-form input[type=email] {
  padding: .8rem 1.4rem;
  border-radius: 999px;
  border: none;
  min-width: 240px;
}
.footer-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.footer-col-heading {
  display: block;
  color: #fff;
  font-weight: 700;
  margin-bottom: .5rem;
}
.footer-col-heading::after {
  content: '';
  display: block;
  width: 28px;
  height: 3px;
  background: var(--color-primary);
  margin-top: .5rem;
  margin-bottom: 1rem;
}
.footer-nav { display: flex; flex-direction: column; gap: .6rem; }
.footer-nav a { color: #fff; text-decoration: none; opacity: .85; }
.footer-nav a:hover { opacity: 1; }
.footer-nav a::before { content: '\2192'; margin-right: .4rem; opacity: .6; }
.footer-contact-line { display: block; color: var(--color-highlight); text-decoration: none; margin-bottom: .5rem; }
.footer-tagline { opacity: .75; font-size: .9rem; }
.footer-post { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: #fff; margin-bottom: 1rem; opacity: .9; }
.footer-post:hover { opacity: 1; }
.footer-post img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.footer-post span { font-size: .88rem; font-weight: 600; }
.footer-copyright { opacity: .6; font-size: .85rem; margin-top: 1.5rem; text-align: center; position: relative; z-index: 1; }

@media (max-width: 720px) {
  .footer-columns { grid-template-columns: 1fr; }
  .footer-newsletter { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 720px) {
  .block-banner, .block-image-text, .block-image-image, .block-twin-text { flex-direction: column; }
  .block { padding: 3rem 1.5rem; }
  .site-header { padding: 1rem 1.5rem; flex-direction: column; gap: 1rem; }
}

/* ============================================================
   Editorial structural family
   Sharp/flat/minimal, serif headlines, masthead motif (thick
   two-tone top border on hero + colored dash before section
   text), folded-page-corner shapes via clip-path instead of
   circles.
   ============================================================ */
.theme-editorial body { letter-spacing: .01em; }
.theme-editorial h1, .theme-editorial h2, .theme-editorial h3 { font-weight: 700; letter-spacing: -.01em; }

.theme-editorial .block-banner {
  border-radius: 0;
  border-top: 10px solid var(--color-accent);
  box-shadow: inset 0 6px 0 -2px var(--color-dark);
  background: var(--color-dark);
}
.theme-editorial .btn { border-radius: var(--radius-xs); }
.theme-editorial .btn-primary { background: var(--color-accent); color: #fff; }

/* Masthead dash before section headings */
.theme-editorial .block h2::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 4px;
  background: var(--color-accent);
  margin-right: .75rem;
  vertical-align: middle;
}

/* Folded-page-corner shape, replacing circles as the signature motif */
.theme-editorial .block { position: relative; }
.theme-editorial .pricing-col,
.theme-editorial .block-testimonial,
.theme-editorial .block-image-text img,
.theme-editorial .block-image-image img {
  border-radius: 0 0 0 0;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 24px 100%, 0 calc(100% - 24px));
}
.theme-editorial .pricing-col { border: 2px solid var(--color-dark); box-shadow: none; }
.theme-editorial .pricing-col:hover { transform: none; }
.theme-editorial .block-stats-band { border-radius: 0; }
.theme-editorial .block-cta-scroller, .theme-editorial .block-single-cta {
  border-radius: 0;
  background: var(--color-dark);
  color: #fff;
}
.theme-editorial .block-cta-scroller h2, .theme-editorial .block-single-cta h2 { color: #fff; }
.theme-editorial .block-faqs details { border-radius: 0; border: 2px solid var(--color-dark); }

/* ============================================================
   Corporate structural family
   Confident/restrained, moderate rounding, solid left-aligned
   CTAs, diagonal-cut-corner-with-triangle motif on major panels
   plus large background triangles replacing circles.
   ============================================================ */
.theme-corporate .block-banner {
  clip-path: polygon(0 0, 100% 0, 100% 92%, 96% 100%, 0 100%);
  text-align: left;
}
.theme-corporate .block-banner .btn-primary { border-radius: var(--radius-sm); }
.theme-corporate .btn { border-radius: var(--radius-sm); }

/* Large background triangle, Corporate's signature motif replacing circles */
.theme-corporate .block { position: relative; overflow: hidden; }
.theme-corporate .block::after {
  content: '';
  position: absolute;
  right: -60px;
  bottom: -60px;
  width: 220px;
  height: 220px;
  background: var(--color-accent);
  opacity: .06;
  clip-path: polygon(100% 0, 0 100%, 100% 100%);
  pointer-events: none;
  z-index: 0;
}
.theme-corporate .block > *:not(.bg-circle) { position: relative; z-index: 1; }

.theme-corporate .pricing-col {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 20px, 20px 0);
  border-radius: 0;
}
.theme-corporate .block-cta-scroller, .theme-corporate .block-single-cta { text-align: left; }

/* ============================================================
   Bold structural family
   Maximalist/playful, very round corners, hard offset "sticker"
   shadows (not soft blurs), permanently-tilted alternating cards,
   sparkle-star shapes replacing circles.
   ============================================================ */
.theme-bold .block-banner, .theme-bold .block-stats-band,
.theme-bold .block-cta-scroller, .theme-bold .block-single-cta {
  box-shadow: 8px 8px 0 var(--color-dark);
  border: 3px solid var(--color-dark);
}
.theme-bold .pricing-col {
  box-shadow: 6px 6px 0 var(--color-dark);
  border: 3px solid var(--color-dark);
  transform: rotate(-2deg);
}
.theme-bold .pricing-col:nth-child(even) { transform: rotate(2deg); }
.theme-bold .pricing-col:hover { transform: var(--hover-tilt); }
.theme-bold .btn { box-shadow: 4px 4px 0 var(--color-dark); border: 2px solid var(--color-dark); }
.theme-bold .btn:hover { transform: var(--hover-btn); box-shadow: 6px 6px 0 var(--color-dark); }

/* Sparkle-star shape, Bold's signature motif replacing circles */
.theme-bold .block { position: relative; overflow: hidden; }
.theme-bold .bg-circle {
  border-radius: 0;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  background: var(--color-highlight);
  opacity: .5;
}
.theme-bold .block > *:not(.bg-circle) { position: relative; z-index: 1; }

/* ---- Projects (case studies) ---- */
.block-projects-listing { max-width: 1200px; margin: 0 auto; }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; margin-top: 2rem; }
.project-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform .35s var(--motion-easing);
}
.project-card:hover { transform: var(--hover-card); }
.project-card-media { position: relative; }
.project-card img { width: 100%; height: 180px; object-fit: cover; display: block; }
.project-card h3, .project-card .project-client, .project-card p { padding: 0 1.25rem; }
.project-card h3 { margin-top: 1rem; }
.project-client { display: block; opacity: .6; font-size: .85rem; margin-bottom: .5rem; }
.project-card p { padding-bottom: 1.25rem; }

.block-project-detail { max-width: 1200px; margin: 0 auto; padding: 3rem; }
.project-client-line { opacity: .7; margin-top: -.5rem; }
.project-hero-image { width: 100%; border-radius: var(--radius-md); margin: 1.5rem 0; }
.block-project-detail section { margin-bottom: 2rem; }

/* ---- Mega menu ---- */
.main-nav { display: flex; gap: 2rem; align-items: center; }
.nav-item-has-children { position: relative; }
.nav-parent-link::after { content: ' \25BE'; font-size: .7em; }
.mega-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: .75rem;
  min-width: 200px;
  z-index: 50;
  flex-direction: column;
}
.nav-item-has-children:hover .mega-menu,
.nav-item-has-children:focus-within .mega-menu {
  display: flex;
}
.mega-menu-item {
  padding: .6rem .75rem;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}
.mega-menu-item:hover { background: var(--color-background); }

/* ---- Footer social links ---- */
.footer-social { display: flex; justify-content: center; gap: 1.25rem; margin-bottom: 1rem; }
.footer-social a { color: #fff; opacity: .85; text-decoration: none; }

/* Honeypot field — invisible to real visitors, catches simple bots */
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---- Blog ---- */
.block-blog-listing { max-width: 1200px; margin: 0 auto; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; margin-top: 2rem; }
.blog-card {
  display: block; text-decoration: none; color: inherit;
  background: #fff; border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-card); transition: transform .35s var(--motion-easing);
}
.blog-card:hover { transform: var(--hover-card); }
.blog-card-media { position: relative; }
.blog-card img { width: 100%; height: 180px; object-fit: cover; display: block; }
.blog-card h3, .blog-card p { padding: 0 1.25rem; }
.blog-card h3 { margin-top: 1rem; }
.blog-card p { padding-bottom: 1.25rem; }

.block-post-detail { max-width: 1400px; margin: 0 auto; padding: 3rem; }
.post-hero-image { width: 100%; border-radius: var(--radius-md); margin: 1.5rem 0; }

/* ---- Services ---- */
.section-heading-center { text-align: center; max-width: 700px; margin: 3rem auto 0; position: relative; }
.block-services-listing { max-width: 1200px; margin: 0 auto 3rem; }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2rem; margin-top: 2rem; }
.service-card {
  display: block; text-decoration: none; color: inherit; position: relative;
  background: #fff; border-radius: var(--radius-md); padding: 2rem;
  box-shadow: var(--shadow-card); transition: transform .35s var(--motion-easing);
}
.service-card:hover { transform: var(--hover-card); }
.service-card h3 { margin-bottom: .5rem; }

/* ---- Hero Slider (Home's default rotating hero) ---- */
.block-hero-slider {
  position: relative;
  min-height: clamp(420px, 65vh, 640px);
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
}
.block-hero-slider::before {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 30%;
  background: rgba(0,0,0,.12);
  clip-path: polygon(40% 0, 100% 0, 100% 100%, 0% 100%);
  z-index: 1;
  pointer-events: none;
}
.hero-slide {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  gap: 3rem;
  padding: 4rem;
  color: #fff;
  opacity: 0;
  transition: opacity .6s ease;
}
.hero-slide.active { display: flex; opacity: 1; position: relative; }
.hero-slide h1 { color: #fff; }
.hero-slide .btn-primary { background: #fff; color: var(--color-primary); }
.hero-slide .banner-copy { flex: 1; }
.hero-slide .banner-media { flex: 1; }
.hero-slide .banner-media img { width: 100%; display: block; border-radius: var(--radius-md); }
.hero-slider-dots {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: .6rem;
  z-index: 5;
}
.hero-slider-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,.4); border: none; cursor: pointer; padding: 0;
}
.hero-slider-dot.active { background: #fff; }

/* ============================================================
   Premium visual layer — ghost-text watermarks, diagonal accent
   cuts, dotted-ring decorations, corner-badge cards, dash-underline
   footer headings, and scroll-reveal animation. Everything here
   reads its color from the existing theme CSS variables, so it
   still respects brand colours and theme switching.
   ============================================================ */

/* Ghost-text: an oversized, near-invisible outline of a heading's
   own text sitting behind it, for section headers with real weight */
[data-ghost] { position: relative; z-index: 1; }
[data-ghost]::before {
  content: attr(data-ghost);
  position: absolute;
  top: -0.4em;
  left: 50%;
  transform: translateX(-50%);
  font-size: 3.4em;
  font-weight: 800;
  white-space: nowrap;
  color: var(--color-dark);
  opacity: .05;
  -webkit-text-stroke: 1px var(--color-dark);
  z-index: -1;
  pointer-events: none;
}
.block-image-text [data-ghost]::before,
.block-image-image [data-ghost]::before { left: 0; transform: none; }

/* Dotted-ring decoration — a partial ring of dots, CSS-only */
.dotted-ring {
  position: absolute;
  width: 140px; height: 140px;
  border-radius: 50%;
  background-image: radial-gradient(circle, currentColor 1.5px, transparent 1.6px);
  background-size: 14px 14px;
  -webkit-mask: radial-gradient(circle, transparent 55%, #000 56%);
  mask: radial-gradient(circle, transparent 55%, #000 56%);
  opacity: .35;
  color: var(--color-highlight);
  pointer-events: none;
}
.dotted-ring-1 { bottom: -30px; right: 8%; }
.dotted-ring-light { color: #fff; }

/* Diagonal accent cut — the recurring red-diagonal motif, applied
   to the Banner block (used as the internal-page title header) */
.block-banner {
  position: relative;
  overflow: hidden;
}
.block-banner::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 45%;
  background: linear-gradient(160deg, var(--color-accent), var(--color-primary));
  clip-path: polygon(35% 0, 100% 0, 100% 100%, 0% 100%);
  opacity: .85;
  z-index: 0;
}
.block-banner > *:not(.bg-circle):not(.dotted-ring) { position: relative; z-index: 1; }

/* Corner-badge photo cards — Projects/Blog cards with a dark
   gradient scrim and a small floating badge over the image */
.project-card, .blog-card { position: relative; }
.project-card img, .blog-card img { position: relative; }
.card-corner-badge {
  position: absolute;
  top: .75rem; right: .75rem;
  background: #fff;
  color: var(--color-primary);
  font-weight: 700;
  font-size: .8rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  z-index: 2;
}

/* Footer — dash-underline column headings, per the reference design
   (rules consolidated into the main Footer section above) */

/* Scroll-reveal animation — fade + rise, applied to every block.
   Only activates once JS confirms it can run the reveal, via the
   .js-scroll-anim class added at runtime — this guarantees content
   is never hidden if JavaScript is blocked or fails. */
.js-scroll-anim .block { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.js-scroll-anim .block.in-view { opacity: 1; transform: translateY(0); }

/* ---- Feature Grid (icon + divider-line layout) ---- */
.feature-grid-heading { text-align: center; max-width: 700px; margin: 0 auto 3rem; position: relative; }
.eyebrow {
  display: inline-block;
  color: var(--color-primary);
  font-weight: 700;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .5rem;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 1100px;
  margin: 0 auto;
  border-top: 1px solid var(--color-line);
  border-left: 1px solid var(--color-line);
}
.feature-item {
  padding: 2rem;
  border-right: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.feature-icon { color: var(--color-primary); margin-bottom: .5rem; }
.feature-item h3 { margin: 0; font-size: 1.1rem; }
.feature-item p { margin: 0; opacity: .75; font-size: .92rem; }
.feature-readmore {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: .5rem;
  color: var(--color-dark);
  text-decoration: none;
  font-weight: 700;
  font-size: .88rem;
}
.feature-readmore svg { background: var(--color-background); border: 1px solid var(--color-line); border-radius: 50%; padding: 6px; }
@media (max-width: 900px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .feature-grid { grid-template-columns: 1fr; }
}

/* Italic accent word support — wrap a word in *asterisks* in any
   heading/subheading field to render it as an italic accent, e.g.
   "Launch *Ultra Modern* Effective Business" */
.accent-word { font-style: italic; color: var(--color-primary); font-weight: 600; }

/* Eyebrow label variant for use on colored banner/hero backgrounds */
.eyebrow-on-banner { color: #fff; background: rgba(255,255,255,.15); padding: .3rem .9rem; border-radius: 999px; }
.hero-slide .accent-word, .block-banner .accent-word { color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,.4); }

/* Full-bleed photo CTA band variant */
.cta-photo-band {
  background-size: cover;
  background-position: center;
  position: relative;
  padding: 0;
  overflow: hidden;
}
.cta-photo-overlay {
  background: linear-gradient(120deg, rgba(0,0,0,.55), var(--color-primary) 140%);
  padding: 3.5rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.cta-photo-overlay h2 { color: #fff; margin: 0; max-width: 600px; }

/* Testimonial with photo */
.testimonial-card.has-photo { display: flex; align-items: center; gap: 2rem; text-align: left; }
.testimonial-photo { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.testimonial-card.has-photo blockquote { margin: 0 0 .75rem; }

/* Team grid — hover overlay with a "+" icon */
.team-member { position: relative; overflow: hidden; border-radius: var(--radius-md); }
.team-member img { border-radius: var(--radius-md); transition: transform .4s ease; }
.team-member:hover img { transform: scale(1.06); }
.team-hover-icon {
  position: absolute;
  bottom: 12px; right: 12px;
  width: 34px; height: 34px;
  background: #fff;
  color: var(--color-primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(6px);
  transition: opacity .25s, transform .25s;
}
.team-member:hover .team-hover-icon { opacity: 1; transform: translateY(0); }

/* Blog/Project cards — image-overlay badge style (badge sits ON the
   photo, no separate white panel needed beneath it for the badge) */
.card-corner-badge { box-shadow: 0 2px 6px rgba(0,0,0,.15); }

/* ---- Page-title banner (Services/Blog/Projects listing+detail) ---- */
.page-title-banner {
  min-height: auto;
  padding: 3.5rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-title-banner .banner-copy { flex: 0 1 auto; }
.page-title-banner h1 { margin: 0; }
.breadcrumb-pill {
  background: #fff;
  color: var(--color-dark);
  padding: .6rem 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  position: relative;
  z-index: 1;
}
.breadcrumb-pill span { font-weight: 700; }

/* ---- Numbered corner badge (Services holder cards) ---- */
.numbered-badge {
  position: absolute;
  top: .75rem; right: .75rem;
  background: #fff;
  color: var(--color-primary);
  font-weight: 700;
  font-size: .8rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  z-index: 2;
}

/* ---- Two-column layout with sidebar (Blog listing/detail) ---- */
.content-with-sidebar { display: grid; grid-template-columns: 2fr 1fr; gap: 2.5rem; max-width: 1200px; margin: 0 auto; align-items: start; }
.sidebar-box { background: var(--color-background); border: 1px solid var(--color-line); border-radius: var(--radius-md); padding: 1.5rem; margin-bottom: 1.5rem; }
.sidebar-box h3 { margin: 0 0 1rem; font-size: 1.05rem; }
.sidebar-search { display: flex; gap: .5rem; }
.sidebar-search input { flex: 1; padding: .7rem 1rem; border-radius: 999px; border: 1px solid var(--color-line); }
.sidebar-search button { background: var(--color-primary); color: #fff; border: none; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.sidebar-cat-list { list-style: none; padding: 0; margin: 0; }
.sidebar-cat-list li { border-bottom: 1px solid var(--color-line); }
.sidebar-cat-list a { display: flex; justify-content: space-between; align-items: center; padding: .7rem 0; text-decoration: none; color: var(--color-dark); font-weight: 600; font-size: .92rem; }
.sidebar-recent-post { display: flex; gap: .75rem; align-items: center; margin-bottom: 1rem; text-decoration: none; color: var(--color-dark); }
.sidebar-recent-post img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.sidebar-recent-post span { font-size: .85rem; font-weight: 600; }

/* Blog card meta bar (author/category icons under the image) */
.blog-card-meta { display: flex; gap: 1rem; padding: .75rem 1.25rem 0; font-size: .78rem; opacity: .65; }
.blog-card-meta span { display: flex; align-items: center; gap: .3rem; }
.blog-card-meta svg { width: 13px; height: 13px; }

/* Blog post detail meta row + pull-quote */
.post-meta-row { display: flex; gap: 1.5rem; opacity: .7; font-size: .9rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.post-meta-row span { display: flex; align-items: center; gap: .4rem; }
.post-body blockquote {
  background: var(--color-background);
  border-left: 4px solid var(--color-primary);
  padding: 1.5rem 2rem;
  border-radius: var(--radius-md);
  font-style: italic;
  font-size: 1.1rem;
  margin: 2rem 0;
}

/* Hero Slider — full-bleed background image mode */
.hero-slide-full-bg {
  background-size: cover;
  background-position: center;
}
/* The active slide normally switches to position:relative so its
   own content can grow the parent's height — but full-bg mode needs
   the image to cover the ENTIRE parent box edge-to-edge regardless
   of content length, so it stays absolute+inset:0 even when active.
   !important is deliberate here: this must never lose to any other
   rule touching position/inset for this specific element. */
.hero-slide-full-bg.active {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  margin: 0 !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
}
.hero-slide-full-bg .banner-copy { padding: 4rem; }
.hero-slide-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.65) 0%, rgba(0,0,0,.35) 55%, transparent 100%);
  z-index: 0;
}
.hero-slide-full-bg .banner-copy { position: relative; z-index: 1; max-width: 600px; }

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s, transform .25s, visibility .25s;
  z-index: 200;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { filter: brightness(1.1); }
/* ---- Service card image (when a Card image is set in Page Settings) ---- */
.service-card-media { position: relative; margin: -2rem -2rem 1.25rem; border-radius: var(--radius-md) var(--radius-md) 0 0; overflow: hidden; }
.service-card-media img { width: 100%; height: 180px; object-fit: cover; display: block; }
.service-card-media .numbered-badge { position: absolute; top: 1rem; right: 1rem; }
/* ---- Multi-select category checkboxes (Blog & Projects edit screens) ---- */
.category-checkbox-list { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: .4rem 0; }
.category-checkbox-list .checkbox-field { display: flex; align-items: center; gap: .4rem; font-weight: 400; }
/* ---- Contact form status messages ---- */
.form-status-message { border-radius: var(--radius-md); padding: 1.25rem 1.5rem; margin: 1rem 0; }
.form-status-success { background: #E8F8EF; color: #1B7A43; border: 1px solid #B7E8CB; }
.form-status-error { background: #FDEEEE; color: #B42318; border: 1px solid #F5C2C0; }
.form-status-message p { margin: 0; font-weight: 600; }


/* ============================================================
   Mobile fixes — real navigation drawer (previously none existed
   at all: nav items just overflowed off-screen with no way to
   reach them, and the mega-menu was hover-only so it was entirely
   unreachable on a touchscreen regardless of screen width).
   ============================================================ */
.mobile-nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 32px; height: 32px; background: none; border: none; cursor: pointer; padding: 0; z-index: 210; }
.mobile-nav-toggle span { display: block; width: 100%; height: 3px; background: var(--color-dark); border-radius: 2px; transition: transform .25s ease, opacity .25s ease; }
.mobile-nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.mobile-nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mobile-nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-nav-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 190; opacity: 0; transition: opacity .25s ease; }
.mobile-nav-overlay.visible { display: block; opacity: 1; }
body.nav-open-lock { overflow: hidden; }

@media (max-width: 860px) {
  .mobile-nav-toggle { display: flex; }

  /* Previously this breakpoint stacked the header into a column
     because the old nav had nowhere else to go but wrap below the
     logo. Now that nav lives in a fixed drawer, logo + hamburger
     stay side by side at every mobile width. */
  .site-header { flex-direction: row; }

  .main-nav {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: var(--color-background);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 5rem 1.5rem 2rem;
    box-shadow: -4px 0 20px rgba(0,0,0,.15);
    z-index: 200;
    overflow-y: auto;
    transition: right .3s ease;
  }
  .main-nav.open { right: 0; }
  .main-nav > a, .main-nav .nav-item-has-children { width: 100%; padding: .9rem 0; border-bottom: 1px solid var(--color-line); }
  .main-nav .nav-item-has-children { display: flex; flex-direction: column; }

  /* On the mobile drawer, the mega-menu is tap-toggled (via the JS
     class below) instead of hover — hover doesn't exist on touch,
     so it simply never fires on a real touch device regardless. */
  .mega-menu { display: none; position: static; box-shadow: none; padding: .5rem 0 0 1rem; min-width: 0; }
  .nav-item-has-children.submenu-open .mega-menu { display: flex; }
}

/* ============================================================
   Mobile fixes — everything below addresses a real layout bug
   found in the CSS with no existing mobile handling at all.
   ============================================================ */

@media (max-width: 860px) {
  /* Home hero slider — was a fixed side-by-side flex row with no
     stacking rule, unlike the plain Banner block which already had
     one. Image now sits above the text, both full width. */
  .hero-slide { flex-direction: column; padding: 2.5rem 1.5rem; gap: 1.5rem; text-align: center; }
  .hero-slide .banner-media { order: -1; }
  .hero-slide-full-bg .banner-copy { padding: 2.5rem 1.5rem; max-width: none; }
  .block-hero-slider { min-height: auto; }

  /* Blog/Project sidebar layout — was a fixed 2fr/1fr grid with no
     mobile override, crushing both the article and the sidebar. */
  .content-with-sidebar { grid-template-columns: 1fr; }

  /* Stats band had no wrap at all — on a narrow screen, extra stats
     were silently clipped off-screen rather than wrapping to a new
     line (body has overflow-x:hidden site-wide). */
  .block-stats-band { flex-wrap: wrap; gap: 2rem; row-gap: 1.5rem; }

  /* Footer newsletter band's pill shape (border-radius:999px) only
     makes sense as a single-line row — once it stacks into a column
     here it becomes an oddly distorted rounded blob. */
  .footer-newsletter { border-radius: var(--radius-lg); padding: 2rem 1.5rem; }
  .newsletter-form { width: 100%; }
  .newsletter-form input[type=email] { width: 100%; min-width: 0; }

  /* Testimonial-with-photo had no stacking rule; a 100px photo next
     to squeezed text reads badly on a narrow screen. */
  .testimonial-card.has-photo { flex-direction: column; text-align: center; gap: 1.25rem; }

  /* Ghost-text watermark behind headings was sized for desktop
     headings — at mobile widths it can overflow or clash with the
     real (already-shrunk) heading text sitting in front of it. */
  [data-ghost]::before { display: none; }

  /* Detail-page and banner padding were fixed regardless of screen
     size; tightened here to match the pattern already used for
     the generic .block padding at this breakpoint. */
  .block-post-detail, .block-project-detail, .page-title-banner, .cta-photo-overlay {
    padding: 1.75rem 1.5rem;
  }

  /* Image+Text's align-items:center is needed for the desktop
     side-by-side row (vertically centers image against text), but
     the exact same property means something different once this
     block switches to a column on mobile: instead of centering two
     side-by-side items, it shrinks each stacked item to its own
     content width instead of stretching full-width. This is what
     was collapsing the image down to a tiny size and making a
     bullet list inside the text side look badly misaligned.

     !important is required here: when the image is set to "right"
     in Page Settings, a .reverse class carries flex-direction:
     row-reverse with TWO classes' worth of specificity — higher
     than this single-class mobile rule — so without !important,
     any right-image block silently keeps its desktop row layout
     at every screen width, never stacking at all. */
  .block-image-text {
    flex-direction: column !important;
    align-items: stretch !important;
}
