/**
 * Plasterboard Installation Malta — page-scoped.
 * Root: .mg-plasterboard-page
 */

body.page-template-page-plasterboard-installation-malta #main-content,
body.page-template-plasterboard-installation-malta #main-content {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #fff !important;
}

body.page-template-page-plasterboard-installation-malta #main-content .entry-content,
body.page-template-plasterboard-installation-malta #main-content .entry-content,
body.page-template-page-plasterboard-installation-malta .et_pb_section,
body.page-template-plasterboard-installation-malta .et_pb_section {
  max-width: none !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

.mg-plasterboard-page {
  --mg-navy: #0c3d6e;
  --mg-navy-dark: #061f37;
  --mg-ink: #0a2944;
  --mg-cyan: #18c6df;
  --mg-wash: #f3f7f9;
  --mg-muted: #536271;
  --mg-max: 1180px;
  --mg-gutter: 40px;
  color: var(--mg-ink);
  background: #fff;
  overflow-x: clip;
  padding-bottom: 96px; /* Nesli ≥88px clearance */
  font-family: inherit;
}

@media (max-width: 700px) {
  .mg-plasterboard-page {
    --mg-gutter: 20px;
  }
}

.mg-plasterboard-page,
.mg-plasterboard-page h1,
.mg-plasterboard-page h2,
.mg-plasterboard-page h3,
.mg-plasterboard-page p,
.mg-plasterboard-page a,
.mg-plasterboard-page button {
  font-family: inherit !important;
}

.mg-pb-wrap {
  width: min(100% - (var(--mg-gutter) * 2), var(--mg-max));
  margin-inline: auto;
}

.mg-pb-section {
  padding-block: clamp(72px, 8vw, 120px);
  scroll-margin-top: 120px;
}

.mg-pb-eyebrow {
  margin: 0 0 14px;
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mg-cyan);
}

.mg-pb-accent {
  display: block;
  width: 72px;
  height: 2px;
  margin-top: 28px;
  background: var(--mg-cyan);
}

.mg-plasterboard-page h1,
.mg-plasterboard-page h2,
.mg-plasterboard-page h3 {
  margin: 0;
  color: var(--mg-ink);
}

.mg-plasterboard-page h1 {
  font-size: clamp(3rem, 5.8vw, 5.6rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.045em;
  max-width: 14ch;
}

.mg-plasterboard-page h2 {
  font-size: clamp(2.15rem, 3.8vw, 3.8rem);
  font-weight: 650;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.mg-plasterboard-page h3 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-weight: 650;
  line-height: 1.15;
}

.mg-plasterboard-page p {
  margin: 0 0 1em;
  font-size: clamp(1rem, 1.2vw, 1.12rem);
  line-height: 1.65;
  max-width: 65ch;
  text-align: left;
}

.mg-plasterboard-page p:last-child {
  margin-bottom: 0;
}

.mg-pb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.mg-pb-figure {
  margin: 0;
  min-width: 0;
}

.mg-pb-figure__media {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 4px;
  background: #d7e2ea;
}

.mg-pb-figure__media--skill {
  aspect-ratio: 16 / 10;
  background: var(--mg-navy-dark);
}

.mg-pb-figure__caption {
  margin: 8px 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--mg-muted);
  max-width: none;
}

.mg-pb-lead {
  color: var(--mg-muted);
  margin-top: 16px;
}

.mg-pb-qualifier {
  color: var(--mg-muted);
  font-size: 0.95rem !important;
  margin-top: 10px;
}

/* —— Buttons —— */
.mg-pb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  font-weight: 650;
  text-decoration: none;
  line-height: 1.2;
  border-radius: 2px;
}

.mg-pb-btn--cyan {
  background: var(--mg-cyan);
  color: var(--mg-navy-dark) !important;
}

.mg-pb-btn--cyan:hover {
  background: #3ad3e8;
}

.mg-pb-btn--ghost {
  border: 1px solid rgba(12, 61, 110, 0.28);
  color: var(--mg-navy) !important;
  background: transparent;
}

.mg-pb-btn--ghost:hover {
  border-color: var(--mg-navy);
}

.mg-pb-btn:focus-visible {
  outline: 3px solid var(--mg-cyan);
  outline-offset: 4px;
}

.mg-pb-text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 650;
  color: var(--mg-navy) !important;
  text-decoration: none;
  border-bottom: 2px solid var(--mg-cyan);
  padding-bottom: 2px;
}

.mg-pb-text-link:hover {
  color: var(--mg-navy-dark) !important;
}

.mg-pb-text-link:focus-visible {
  outline: 3px solid var(--mg-cyan);
  outline-offset: 3px;
}

/* —— Hero —— */
.mg-pb-hero {
  background: var(--mg-navy-dark);
  color: #fff;
  padding-block: clamp(56px, 7vw, 100px);
}

.mg-pb-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.mg-pb-hero h1,
.mg-pb-hero p {
  color: #fff;
}

.mg-pb-hero__intro {
  margin-top: 22px;
  max-width: 42ch;
  color: rgba(255, 255, 255, 0.9);
}

.mg-pb-hero__support {
  color: rgba(255, 255, 255, 0.72) !important;
  font-size: 0.98rem !important;
}

.mg-pb-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.mg-pb-hero .mg-pb-btn--ghost {
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff !important;
}

.mg-pb-hero .mg-pb-btn--ghost:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.mg-pb-hero__figure .mg-pb-figure__caption {
  color: rgba(255, 255, 255, 0.72);
}

.mg-pb-hero__figure .mg-pb-figure__media {
  max-height: 520px;
}

/* —— Intro —— */
.mg-pb-intro {
  background: #fff;
}

.mg-pb-intro__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(28px, 10%, 96px);
  align-items: start;
}

.mg-pb-intro__text {
  color: var(--mg-muted);
  padding-top: 10px;
}

/* —— Showcase —— */
.mg-pb-showcase {
  background: var(--mg-wash);
}

.mg-pb-collage {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr);
  gap: clamp(24px, 4vw, 40px);
  margin-top: clamp(28px, 4vw, 48px);
  align-items: start;
}

.mg-pb-collage__primary .mg-pb-figure__media {
  aspect-ratio: 16 / 10;
  max-height: 520px;
}

.mg-pb-facts {
  background: #fff;
  border: 1px solid rgba(12, 61, 110, 0.12);
  padding: 22px 22px 8px;
}

.mg-pb-facts dl {
  margin: 0;
}

.mg-pb-facts dl > div {
  padding: 14px 0;
  border-bottom: 1px solid rgba(12, 61, 110, 0.1);
}

.mg-pb-facts dl > div:last-child {
  border-bottom: 0;
}

.mg-pb-facts dt {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mg-cyan);
}

.mg-pb-facts dd {
  margin: 0;
  color: var(--mg-ink);
  font-size: 0.98rem;
  line-height: 1.45;
}

.mg-pb-collage__support {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.5vw, 28px);
  align-items: stretch;
}

.mg-pb-collage__support .mg-pb-figure {
  display: flex;
  height: 100%;
  flex-direction: column;
}

.mg-pb-collage__support .mg-pb-figure__media {
  aspect-ratio: 4 / 3;
  max-height: 280px;
}

/* —— Application services —— */
.mg-pb-service--a,
.mg-pb-service--c {
  background: #fff;
}

.mg-pb-service--b {
  background: var(--mg-wash);
}

.mg-pb-service__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: stretch;
}

.mg-pb-service__grid--flip .mg-pb-service__body {
  order: -1;
}

.mg-plasterboard-page .mg-pb-service__media {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.mg-plasterboard-page .mg-pb-service__media .mg-pb-figure__media {
  aspect-ratio: 16 / 10;
  max-height: 480px;
}

.mg-plasterboard-page .mg-pb-service__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.mg-plasterboard-page .mg-pb-service__body > p {
  color: var(--mg-muted);
}

.mg-plasterboard-page .mg-pb-service__link {
  margin-top: auto;
  padding-top: 24px;
  margin-bottom: 0;
}

/* —— Coordination —— */
.mg-pb-coord {
  background: var(--mg-navy-dark);
  color: #fff;
}

.mg-pb-coord h2,
.mg-pb-coord p {
  color: #fff;
}

.mg-pb-coord__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(36px, 6vw, 80px);
  align-items: center;
}

.mg-pb-coord__copy > p {
  color: rgba(255, 255, 255, 0.86);
  margin-top: 16px;
}

.mg-plasterboard-page .mg-pb-coord__note {
  max-width: 680px;
  margin-top: 34px;
  margin-bottom: 0;
  padding-left: 16px;
  border-left: 3px solid #18c6df;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.6;
  font-size: 0.95rem;
}

.mg-pb-coord__rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.mg-pb-coord__rows li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 72px;
  padding: 22px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.35;
}

.mg-pb-coord__num {
  color: var(--mg-cyan);
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* —— Album —— */
.mg-pb-album {
  background: #fff;
}

.mg-pb-album__strip-wrap {
  margin-top: 28px;
}

.mg-pb-album__strip {
  list-style: none;
  margin: 0;
  padding: 0 0 6px;
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.mg-pb-album__strip li {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.mg-pb-album__thumb {
  position: relative;
  display: block;
  width: 140px;
  height: 96px;
  aspect-ratio: 3 / 2;
  padding: 0;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: #c9d6e0;
}

.mg-pb-album__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mg-pb-album__num {
  position: absolute;
  right: 6px;
  bottom: 5px;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 2px;
  background: rgba(6, 31, 55, 0.72);
  color: #fff;
  font-size: 0.68rem;
  line-height: 1.3;
}

.mg-pb-album__thumb:focus-visible {
  outline: 3px solid var(--mg-cyan);
  outline-offset: 3px;
}

/* —— Process —— */
.mg-pb-process {
  background: var(--mg-wash);
}

.mg-pb-process__list {
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 36px);
  position: relative;
  align-items: start;
}

.mg-pb-process__list::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 12px;
  right: 12px;
  height: 1px;
  background: rgba(12, 61, 110, 0.16);
  z-index: 0;
  pointer-events: none;
}

.mg-pb-process__item {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding-top: 36px;
}

.mg-pb-process__num {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--mg-cyan);
  font-size: 0.85rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  background: var(--mg-wash);
  padding-right: 10px;
}

.mg-pb-process__item h3 {
  margin-bottom: 10px;
  font-size: clamp(1.1rem, 1.4vw, 1.3rem);
}

.mg-pb-process__item p {
  color: var(--mg-muted);
  max-width: 28ch;
}

@media (min-width: 701px) {
  .mg-plasterboard-page .mg-pb-process__item {
    min-height: 220px;
  }

  .mg-plasterboard-page .mg-pb-process__item h3 {
    min-height: 2.6em;
  }
}

.mg-plasterboard-page .mg-pb-process__note {
  max-width: 70ch;
  margin-top: 34px;
  margin-bottom: 0;
  padding-left: 16px;
  border-left: 3px solid var(--mg-cyan);
  color: var(--mg-muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* —— Trust —— */
.mg-pb-trust {
  background: #fff;
}

.mg-pb-trust__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.mg-pb-trust__copy p {
  color: var(--mg-muted);
  margin-top: 16px;
}

/* —— FAQ —— */
.mg-pb-faq {
  background: var(--mg-wash);
}

.mg-pb-faq__list {
  margin-top: 28px;
  border-top: 1px solid rgba(12, 61, 110, 0.16);
}

.mg-pb-faq__item {
  border-bottom: 1px solid rgba(12, 61, 110, 0.16);
  padding: 0;
}

.mg-pb-faq__item summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 0;
  font-weight: 650;
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--mg-ink);
}

.mg-pb-faq__item summary::-webkit-details-marker {
  display: none;
}

.mg-pb-faq__answer {
  padding: 0 0 20px;
}

.mg-pb-faq__answer p {
  color: var(--mg-muted);
  margin: 0;
}

/* —— CTA —— */
.mg-pb-cta {
  background: var(--mg-navy);
  color: #fff;
}

.mg-pb-cta h2,
.mg-pb-cta p {
  color: #fff;
}

.mg-pb-cta .mg-pb-accent {
  margin: 0 0 28px;
}

.mg-pb-cta > .mg-pb-wrap > p {
  margin-top: 16px;
  max-width: 48ch;
  color: rgba(255, 255, 255, 0.88);
}

.mg-pb-cta__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.mg-pb-email {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  color: #ffffff !important;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.mg-pb-email:hover {
  border-color: #ffffff;
  background: #ffffff;
  color: #0c3d6e !important;
}

.mg-pb-email:focus-visible {
  outline: 3px solid #18c6df;
  outline-offset: 4px;
}

.mg-plasterboard-page .mg-pb-related {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 30px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.88rem;
  align-items: center;
}

.mg-plasterboard-page .mg-pb-related a {
  color: #ffffff !important;
  text-underline-offset: 3px;
  text-decoration: underline;
}

/* —— Final viewer (body-level; shared class with stretch) —— */
.mg-final-viewer {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483640 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 13, 23, 0.94);
  backdrop-filter: blur(8px);
}

.mg-final-viewer.is-open {
  display: flex !important;
}

.mg-final-viewer__panel {
  position: relative;
  width: min(1180px, 100%);
  height: min(820px, calc(100dvh - 48px));
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #041522;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.7);
}

.mg-final-viewer__figure {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.mg-final-viewer__stage {
  width: 100%;
  height: min(72dvh, 700px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #020b12;
}

.mg-final-viewer__image {
  width: 100%;
  height: 100%;
  display: block !important;
  object-fit: contain !important;
  object-position: center;
  opacity: 1 !important;
  visibility: visible !important;
}

.mg-final-viewer__caption {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 15px 20px;
  background: #061f37;
  color: rgba(255, 255, 255, 0.9);
}

.mg-final-viewer__count {
  flex: 0 0 auto;
  color: #18c6df;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.mg-final-viewer__close,
.mg-final-viewer__previous,
.mg-final-viewer__next {
  display: grid !important;
  place-items: center;
  border: 0;
  color: #ffffff;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}

.mg-final-viewer__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(2, 13, 23, 0.88);
  font-size: 1.8rem;
}

.mg-final-viewer__previous,
.mg-final-viewer__next {
  width: 48px;
  height: 76px;
  margin: auto;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.11);
  font-size: 2.5rem;
}

.mg-final-viewer__close:focus-visible,
.mg-final-viewer__previous:focus-visible,
.mg-final-viewer__next:focus-visible {
  outline: 3px solid #18c6df;
  outline-offset: 3px;
}

html.mg-viewer-open,
html.mg-viewer-open body {
  overflow: hidden !important;
}

/* —— Mobile ≤700px —— */
@media (max-width: 700px) {
  .mg-pb-hero__grid,
  .mg-pb-intro__grid,
  .mg-pb-collage,
  .mg-pb-service__grid,
  .mg-pb-coord__grid,
  .mg-pb-trust__grid,
  .mg-pb-process__list {
    grid-template-columns: 1fr;
  }

  .mg-pb-service__grid--flip .mg-pb-service__body {
    order: 0;
  }

  .mg-pb-collage__support {
    grid-template-columns: 1fr;
  }

  .mg-pb-hero__figure .mg-pb-figure__media,
  .mg-pb-collage__primary .mg-pb-figure__media,
  .mg-plasterboard-page .mg-pb-service__media .mg-pb-figure__media,
  .mg-pb-collage__support .mg-pb-figure__media {
    max-height: 380px;
  }

  .mg-pb-hero__actions,
  .mg-pb-cta__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .mg-pb-btn,
  .mg-pb-email {
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  .mg-pb-process__list {
    gap: 0;
    padding-left: 28px;
  }

  .mg-pb-process__list::before {
    top: 8px;
    bottom: 8px;
    left: 7px;
    right: auto;
    width: 1px;
    height: auto;
  }

  .mg-pb-process__item {
    padding: 0 0 28px 18px;
  }

  .mg-plasterboard-page .mg-pb-process__item,
  .mg-plasterboard-page .mg-pb-process__item h3 {
    min-height: 0;
  }

  .mg-pb-process__num {
    left: -28px;
    top: 2px;
    padding: 0;
    background: transparent;
  }

  .mg-pb-album__thumb {
    width: 118px;
    height: 82px;
  }

  .mg-final-viewer {
    padding: 0;
  }

  .mg-final-viewer__panel {
    width: 100%;
    height: 100dvh;
    display: block;
    border: 0;
  }

  .mg-final-viewer__figure {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .mg-final-viewer__stage {
    height: 72dvh;
  }

  .mg-final-viewer__previous,
  .mg-final-viewer__next {
    position: absolute;
    top: 50%;
    z-index: 5;
    transform: translateY(-50%);
    background: rgba(2, 13, 23, 0.82);
  }

  .mg-final-viewer__previous {
    left: 8px;
  }

  .mg-final-viewer__next {
    right: 8px;
  }

  .mg-final-viewer__caption {
    min-height: 100px;
    align-items: flex-start;
    padding: 16px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mg-pb-btn {
    transition: none;
  }
}
