/**
 * Britto IT — Service Details Page Dedicated Stylesheet
 * Strictly scoped to service-details.php layout, gallery showcase, and video integration.
 */

/* ==========================================================================
   1. HERO SECTION OVERRIDES (IMAGE MOVED OUT OF HERO)
   ========================================================================== */
.service-detail-hero .service-hero-split-layout {
  display: block;
  max-width: 920px;
}

.service-detail-hero .service-hero-content-col {
  max-width: 100%;
}

.service-detail-hero .service-hero-heading {
  font-size: clamp(2.1rem, 3.8vw, 2.9rem);
  line-height: 1.22;
  margin-bottom: 16px;
}

.service-detail-hero .service-hero-lead {
  max-width: 800px;
  font-size: 1.08rem;
  line-height: 1.65;
  margin-bottom: 24px;
}

/* ==========================================================================
   2. TWO-COLUMN WORKSPACE & RESPONSIVE REORDERING
   ========================================================================== */
.service-two-col-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 36px;
  align-items: start;
}

.service-left-column {
  min-width: 0;
}

.service-right-column {
  position: -webkit-sticky;
  position: sticky;
  top: 92px;
  z-index: 10;
}

/* Mobile & Tablet Ordering:
   1. Header (above container)
   2. Service Image / Gallery (order 1)
   3. Service Video (if any, order 2)
   4. Overview / About This Service (order 3)
   5. Service at a Glance Sticky Panel (order 4)
   6. Packages & Comparison (order 5)
   7. Remaining Sections (order 6+)
*/
@media (max-width: 991px) {
  .service-two-col-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .service-left-column {
    display: contents;
  }

  .service-gallery-showcase {
    order: 1;
    margin-bottom: 24px;
  }

  .service-video-card {
    order: 2;
    margin-bottom: 24px;
  }

  #about-service {
    order: 3;
    margin-bottom: 24px;
  }

  .service-right-column {
    order: 4;
    position: static !important;
    top: auto !important;
    width: 100%;
    margin-bottom: 24px;
  }

  #packages-comparison {
    order: 5;
    margin-bottom: 24px;
  }

  #deliverables-scope {
    order: 6;
    margin-bottom: 24px;
  }

  #client-requirements {
    order: 7;
    margin-bottom: 24px;
  }
}

/* ==========================================================================
   3. PROMINENT SERVICE GALLERY SHOWCASE
   ========================================================================== */
.service-gallery-showcase {
  background: var(--color-white, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 32px;
  box-shadow: 0 3px 14px rgba(6, 61, 46, 0.04);
}

.service-gallery-main-frame {
  position: relative;
  width: 100%;
  height: 440px;
  border-radius: 12px;
  overflow: hidden;
  background: #f4f8f6;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  user-select: none;
}

@media (max-width: 768px) {
  .service-gallery-main-frame {
    height: 280px;
  }
  .service-gallery-showcase {
    padding: 14px;
  }
}

@media (max-width: 480px) {
  .service-gallery-main-frame {
    height: 220px;
  }
}

.service-main-image-display {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f4f8f6;
  transition: opacity 0.22s ease-in-out;
  display: block;
}

/* Navigation Arrow Buttons */
.gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1e293b;
  cursor: pointer;
  z-index: 5;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.gallery-nav-btn:hover {
  background: #009F58;
  color: #ffffff;
  border-color: #009F58;
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 6px 18px rgba(0, 159, 88, 0.32);
}

.gallery-nav-btn:active {
  transform: translateY(-50%) scale(0.96);
}

.gallery-nav-btn.prev-btn {
  left: 14px;
}

.gallery-nav-btn.next-btn {
  right: 14px;
}

/* Counter & Zoom Badges */
.gallery-counter-badge {
  position: absolute;
  bottom: 12px;
  right: 14px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  z-index: 5;
  pointer-events: none;
}

.gallery-zoom-badge {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all 0.2s ease;
  outline: none;
}

.gallery-zoom-badge:hover {
  background: #009F58;
  color: #ffffff;
  border-color: #009F58;
  transform: scale(1.08);
}

/* Thumbnail Carousel Strip */
.service-gallery-thumbnails {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  padding: 4px 2px 8px 2px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.service-gallery-thumbnails::-webkit-scrollbar {
  height: 6px;
}

.service-gallery-thumbnails::-webkit-scrollbar-track {
  background: #f1f5f3;
  border-radius: 4px;
}

.service-gallery-thumbnails::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.service-gallery-thumbnails::-webkit-scrollbar-thumb:hover {
  background: #009F58;
}

.gallery-thumb-item {
  flex: 0 0 86px;
  height: 62px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #e2e8f0;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0.65;
  outline: none;
}

@media (max-width: 480px) {
  .gallery-thumb-item {
    flex: 0 0 72px;
    height: 52px;
  }
}

.gallery-thumb-item:hover {
  opacity: 0.95;
  transform: translateY(-2px);
}

.gallery-thumb-item.is-active {
  border-color: #009F58;
  opacity: 1;
  box-shadow: 0 0 0 3px rgba(0, 159, 88, 0.25);
  transform: translateY(-2px);
}

.gallery-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   4. VIDEO SHOWCASE SECTION
   ========================================================================== */
.service-video-card {
  background: var(--color-white, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 16px;
  padding: 28px 30px;
  margin-bottom: 32px;
  box-shadow: 0 3px 14px rgba(6, 61, 46, 0.04);
}

@media (max-width: 768px) {
  .service-video-card {
    padding: 20px 18px;
  }
}

.service-video-frame-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  border-radius: 12px;
  overflow: hidden;
  background: #0b1320;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.09);
}

.service-video-frame-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ==========================================================================
   5. LIGHTBOX MODAL (EXPANDED GALLERY VIEW)
   ========================================================================== */
.service-lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(7, 13, 17, 0.94);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.service-lightbox-modal.is-open {
  display: flex;
  animation: lightboxFadeIn 0.22s ease-out forwards;
}

@keyframes lightboxFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-close-btn {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 1.8rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  outline: none;
}

.lightbox-close-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  transform: rotate(90deg);
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  outline: none;
}

.lightbox-nav-btn:hover {
  background: #009F58;
  border-color: #009F58;
  transform: translateY(-50%) scale(1.1);
}

.lightbox-nav-btn.prev-btn {
  left: 24px;
}

.lightbox-nav-btn.next-btn {
  right: 24px;
}

@media (max-width: 768px) {
  .lightbox-nav-btn.prev-btn {
    left: 10px;
  }
  .lightbox-nav-btn.next-btn {
    right: 10px;
  }
}

.lightbox-content-box {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.lightbox-content-box img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
  transition: opacity 0.2s ease;
}

.lightbox-caption {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  font-weight: 500;
}

.lightbox-counter {
  background: rgba(255, 255, 255, 0.16);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #4ade80;
}

/* ==========================================================================
   6. DETAILED SERVICE DESCRIPTION RICH TEXT TYPOGRAPHY & SPACING FIX
   Strictly scoped to rich-text content inside .service-overview-text.
   Preserves section header, hero H1 dominance, and Key Benefits boundary.
   ========================================================================== */

/* 1. Container Spacing & Boundary Protection */
.service-overview-text {
  padding-top: 6px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  font-size: 0.98rem;
  line-height: 1.72;
  color: #334155;
}

/* 2. Vertical Spacing: Section Heading ("About This Service") to Description */
.service-overview-text > *:first-child {
  margin-top: 0.35rem;
}

/* 3. Balanced Heading Hierarchy (H1, H2, H3, H4) */
/* Description H1 (1.35rem) is visually subordinate to Main Service Hero H1 (2.1-2.9rem) */
.service-overview-text h1,
.service-overview-text h2,
.service-overview-text h3,
.service-overview-text h4 {
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: #0f172a;
}

.service-overview-text h1 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.015em;
}

.service-overview-text h2 {
  font-size: 1.25rem;
  font-weight: 750;
  margin-top: 1.55rem;
  margin-bottom: 0.65rem;
  letter-spacing: -0.01em;
}

.service-overview-text h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 1.35rem;
  margin-bottom: 0.55rem;
}

.service-overview-text h4 {
  font-size: 1.05rem;
  font-weight: 650;
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
}

/* Spacing when heading is the very first element in description */
.service-overview-text > h1:first-child,
.service-overview-text > h2:first-child,
.service-overview-text > h3:first-child,
.service-overview-text > h4:first-child {
  margin-top: 0.35rem;
}

/* 4. Paragraphs: Comfortable Line Height & Spacing */
.service-overview-text p {
  font-size: 0.98rem;
  line-height: 1.72;
  color: #334155;
  margin-top: 0;
  margin-bottom: 1rem;
}

.service-overview-text p:last-child {
  margin-bottom: 0;
}

/* 5. Preserve Manual Colors from Admin Editor */
/* Inline color styles (style="color: ...") naturally prevail; guarantee no overrides */
.service-overview-text [style*="color"] {
  /* Author-selected colors preserved */
}

/* 6. Professional Hyperlinks */
.service-overview-text a {
  color: #009F58;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  font-weight: 500;
  word-break: break-word;
  overflow-wrap: break-word;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.service-overview-text a:hover {
  color: #007A43;
  text-decoration-color: #007A43;
}

.service-overview-text a:focus-visible {
  outline: 2px solid #009F58;
  outline-offset: 2px;
  border-radius: 2px;
}

/* 7. Professional Unordered & Ordered Lists */
.service-overview-text ul,
.service-overview-text ol {
  margin: 0.9rem 0 1.2rem 0;
  padding-left: 1.45rem;
}

.service-overview-text ul {
  list-style-type: disc;
}

.service-overview-text ol {
  list-style-type: decimal;
}

.service-overview-text li {
  margin-bottom: 0.45rem;
  line-height: 1.68;
  color: #334155;
}

.service-overview-text li:last-child {
  margin-bottom: 0;
}

.service-overview-text ul ul,
.service-overview-text ol ol,
.service-overview-text ul ol,
.service-overview-text ol ul {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
  padding-left: 1.25rem;
}

.service-overview-text ul ul {
  list-style-type: circle;
}

.service-overview-text ol ol {
  list-style-type: lower-alpha;
}

/* 8. Professional Blockquotes */
.service-overview-text blockquote {
  margin: 1.25rem 0;
  padding: 0.85rem 1.25rem;
  border-left: 3.5px solid #009F58;
  background: #f8fafc;
  color: #475569;
  font-style: italic;
  font-size: 0.97rem;
  line-height: 1.7;
  border-radius: 0 8px 8px 0;
}

.service-overview-text blockquote p {
  margin-bottom: 0.5rem;
  color: inherit;
  font-style: inherit;
  line-height: inherit;
}

.service-overview-text blockquote p:last-child {
  margin-bottom: 0;
}

/* 9. Inline Code and Preformatted Blocks */
.service-overview-text code {
  background: #f1f5f9;
  color: #0f172a;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.service-overview-text pre {
  background: #0f172a;
  color: #f8fafc;
  padding: 14px 18px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 1.1rem 0;
  max-width: 100%;
}

.service-overview-text pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
}

.service-overview-text hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 1.5rem 0;
}

/* 10. Prevention of Overlap with Key Package Benefits Box */
.service-overview-text pre,
.service-overview-text table {
  max-width: 100%;
  overflow-x: auto;
}

.service-overview-text img {
  max-width: 100%;
  height: auto;
}

/* 11. Scoped Responsive Typography (Mobile / Tablet) */
@media (max-width: 768px) {
  .service-overview-text {
    padding-top: 4px;
    font-size: 0.95rem;
  }

  .service-overview-text h1 {
    font-size: 1.22rem;
    margin-top: 1.4rem;
    margin-bottom: 0.6rem;
  }

  .service-overview-text h2 {
    font-size: 1.15rem;
    margin-top: 1.3rem;
    margin-bottom: 0.55rem;
  }

  .service-overview-text h3 {
    font-size: 1.08rem;
    margin-top: 1.15rem;
    margin-bottom: 0.45rem;
  }

  .service-overview-text h4 {
    font-size: 1.00rem;
    margin-top: 1.05rem;
    margin-bottom: 0.4rem;
  }

  .service-overview-text ul,
  .service-overview-text ol {
    padding-left: 1.25rem;
  }

  .service-overview-text blockquote {
    padding: 0.75rem 1rem;
  }
}
