/*
 * overrides.css — Third-party component overrides and WYSIWYG field wrapper styles.
 *
 * This file is always linked directly (works with both CDN dev and compiled CSS).
 * It is also @imported in src.css so these rules are included in the production build.
 *
 * Do not put Tailwind utilities here — they belong in src.css and page markup.
 */

/* ── Swiper hero pagination ────────────────────────────────────────────────
   Swiper generates its own bullet markup at runtime; we cannot apply Tailwind
   utilities to dynamically-inserted elements server-side. These overrides match
   the Figma exactly: 8px circles, full white, 50% → 100% opacity for active.
*/
.hero-swiper .swiper-pagination-bullet {
  width:         8px;
  height:        8px;
  border-radius: 8px;
  background:    #ffffff;
  opacity:       0.5;
  margin:        0 2px !important;
  transition:    opacity 0.2s ease;
}
.hero-swiper .swiper-pagination-bullet-active {
  opacity: 1;
}

/* ── WYSIWYG field wrapper (generic) ───────────────────────────────────────
   Applied via a parent class on the container element. ACF WYSIWYG output
   carries no utility classes, so raw <p>/<ul>/<h3>/<a> must look correct here.
*/
.wysiwyg-content p    { margin-bottom: 1em; }
.wysiwyg-content ul   { list-style: disc;    padding-left: 1.5em; margin-bottom: 1em; }
.wysiwyg-content ol   { list-style: decimal; padding-left: 1.5em; margin-bottom: 1em; }
.wysiwyg-content h3   { font-size: 1.25em;  font-weight: 600; margin-bottom: 0.5em; }
.wysiwyg-content a    { text-decoration: underline; opacity: 0.85; }
.wysiwyg-content a:hover { opacity: 1; }

/* ── Articles listing — pagination ────────────────────────────────────────
   paginate_links() generates its own markup (.page-numbers, .current, .next,
   .prev). We cannot apply Tailwind utilities to that server-rendered output,
   so the visual spec is encoded here instead.
   Static build uses the same class names so no WP wrapper surgery is needed.
*/
.page-numbers {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.page-numbers a,
.page-numbers span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-family: 'Cabin', sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  color: #231d18;
  border: 1px solid #f2f2f2;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.page-numbers a:hover {
  background-color: #f8f4ef;
}
.page-numbers span.current {
  background-color: #231d18;
  border-color: #231d18;
  color: #fefbf6;
}
/* "Next »" — hide the default WP arrow, design shows text only */
.page-numbers .next::after { content: none; }

/* ── Article detail — body WYSIWYG wrapper ────────────────────────────────
   Maps to the_content() output on the single article template. Figma spec
   (347:1322 "Article" body region):
     p        Cabin Regular 18px/32px #666666 (no letter-spacing override)
     h2       Cabin Regular 34px/44.2px tracking -0.68px #231d18 (= article-title token)
     blockquote  4px #231d18 left border, quote 18px/32px #231d18, cite 14px/18px #666666
     figure/figcaption  16px/23.4px #555555, centered
     strong/em   render at the SAME regular weight / non-italic as body text in Figma —
       reproduced faithfully rather than "fixed" to the browser bold/italic default.
   Block-level spacing (p/h2/blockquote/figure margins) is generalised from the
   ~40-50px rhythm observed between the sample blocks in Figma, since exact dynamic
   WYSIWYG content has no single fixed gap to match.
*/
.article-wysiwyg {
  font-family: 'Cabin', sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 32px;
  color: #231d18;
}
.article-wysiwyg > *:first-child { margin-top: 0; }
.article-wysiwyg > *:last-child  { margin-bottom: 0; }
.article-wysiwyg p { margin: 0 0 32px; }
.article-wysiwyg h2 {
  font-size: 34px;
  line-height: 44.2px;
  letter-spacing: -0.68px;
  color: #231d18;
  font-weight: 400;
  margin: 48px 0 24px;
}
.article-wysiwyg h3 {
  font-size: 24px;
  line-height: 31.2px;
  color: #231d18;
  font-weight: 400;
  margin: 40px 0 20px;
}
.article-wysiwyg blockquote {
  border-left: 4px solid #231d18;
  padding: 20px 0 20px 48px;
  margin: 32px 0;
}
.article-wysiwyg blockquote p {
  font-size: 18px;
  line-height: 32px;
  color: #231d18;
  margin-bottom: 12px;
}
.article-wysiwyg blockquote cite {
  display: block;
  font-size: 14px;
  line-height: 18px;
  color: #231d18;
  font-style: normal;
}
.article-wysiwyg figure { margin: 32px 0; }
.article-wysiwyg figure img { margin: 0; }
.article-wysiwyg figcaption {
  font-size: 16px;
  line-height: 23.4px;
  color: #555555;
  text-align: center;
  margin-top: 24px;
}
.article-wysiwyg strong,
.article-wysiwyg b { font-weight: 400; }
.article-wysiwyg em,
.article-wysiwyg i { font-style: normal; }
.article-wysiwyg ul { list-style: disc;    padding-left: 1.5em; margin-bottom: 32px; }
.article-wysiwyg ol { list-style: decimal; padding-left: 1.5em; margin-bottom: 32px; }
.article-wysiwyg a {
  color: #005be2;
  text-decoration: underline;
}
.article-wysiwyg a:hover { opacity: 0.8; }
.article-wysiwyg img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 32px 0;
}

/* ── Featured client carousel pagination ───────────────────────────────────
   Figma: inactive dots at 30% opacity (hero slider uses 50% — different spec).
   Same 8px size and 4px gap as hero, but different inactive opacity.
*/
.featured-client-swiper .swiper-pagination-bullet {
  width:         8px;
  height:        8px;
  border-radius: 8px;
  background:    #ffffff;
  opacity:       0.3;
  margin:        0 2px !important;
  transition:    opacity 0.2s ease;
}
.featured-client-swiper .swiper-pagination-bullet-active {
  opacity: 1;
}

/* ── Client row WYSIWYG wrapper ────────────────────────────────────────────
   Applied to the body-copy div in sections/client-rows.php.
   Figma spec (nodes 357:2536, 357:2606, 357:2615, 357:2621, 357:2633):
     Cabin Regular 18px/28px, color #231d18, opacity 0.6, tracking -0.1px.
   ACF WYSIWYG output carries no utility classes, so raw <p> must look correct here.
*/
.client-row-wysiwyg {
  font-family:     'Cabin', sans-serif;
  font-weight:     400;
  font-size:       18px;
  line-height:     28px;
  letter-spacing:  -0.1px;
  color:           #231d18;
}
.client-row-wysiwyg > *:first-child { margin-top: 0; }
.client-row-wysiwyg > *:last-child  { margin-bottom: 0; }
.client-row-wysiwyg p { margin-bottom: 28px; }

/* ── Vimeo lightbox modal ──────────────────────────────────────────────────
   The modal container in clientele.php uses .vimeo-modal for display toggling.
   JS adds/removes .is-open; Tailwind flex/positioning classes handle layout.
   z-[90] places the modal above the mobile nav drawer (z-[60]).
*/
.vimeo-modal         { display: none; }
.vimeo-modal.is-open { display: flex; }

/* ── Contact Form 7 — contact page form ───────────────────────────────────
   CF7 generates its own <form class="wpcf7-form"> wrapper and wraps every
   field in <span class="wpcf7-form-control-wrap">. These overrides reproduce
   the hand-coded form layout and visual spec exactly.
   Scoped to .gp-cf7-contact-wrap so homepage section is unaffected.
*/
.gp-cf7-contact-wrap .wpcf7 { width: 100%; margin: 0; padding: 0; }
.gp-cf7-contact-wrap .wpcf7-form br { display: none; }

/* Mirror the original <form> flex layout */
.gp-cf7-contact-wrap .wpcf7-form {
  display:    flex;
  flex-wrap:  wrap;
  column-gap: 50px; /* contact page default */
  row-gap:    1.5rem; /* half of original gap-y-12 */
}

/* Name and Email side by side on all pages — flex:1 fills half the row regardless of gap size */
.gp-cf7-contact-wrap .wpcf7-form > div:nth-of-type(2),
.gp-cf7-contact-wrap .wpcf7-form > div:nth-of-type(3) {
  flex: 1;
  min-width: 0;
}

/* Inline section (#contact on homepage etc.) used a 15px column gap */
#contact .gp-cf7-contact-wrap .wpcf7-form {
  column-gap: 15px;
}

/* CF7 wraps fields in inline-block spans by default — make them block */
.gp-cf7-contact-wrap .wpcf7-form-control-wrap {
  display: block;
  width:   100%;
}

/* Textarea */
.gp-cf7-textarea {
  display:          block;
  width:            100%;
  height:           176px;
  background-color: rgba(255,255,255,.4);
  border:           2px solid #e5e5e5;
  color:            #fff;
  font-family:      'Cabin', sans-serif;
  font-weight:      400;
  font-size:        16px;
  line-height:      1.3;
  padding:          1rem;
  resize:           none;
  outline:          none;
  transition:       border-color .15s ease;
}
.gp-cf7-textarea::placeholder { color: #fff; }
.gp-cf7-textarea:focus        { border-color: #fff; }

/* Text / Email inputs */
.gp-cf7-input {
  display:          block;
  width:            100%;
  height:           56px;
  background-color: rgba(255,255,255,.4);
  border:           2px solid #e5e5e5;
  color:            #fff;
  font-family:      'Cabin', sans-serif;
  font-weight:      400;
  font-size:        16px;
  line-height:      1.3;
  padding:          0 1rem;
  outline:          none;
  transition:       border-color .15s ease;
}
.gp-cf7-input::placeholder { color: #fff; }
.gp-cf7-input:focus        { border-color: #fff; }

/* Acceptance field — CF7 nests checkbox+label inside <label> together */
.gp-cf7-contact-wrap .wpcf7-acceptance label {
  display:     flex;
  align-items: flex-start;
  gap:         0.5rem;
  cursor:      pointer;
}
.gp-cf7-checkbox {
  position:           relative;
  width:              14px;
  height:             14px;
  min-width:          14px;
  margin-top:         7px;
  border:             1px solid rgba(255,255,255,.6);
  appearance:         none;
  -webkit-appearance: none;
  background:         transparent;
  cursor:             pointer;
  flex-shrink:        0;
}
.gp-cf7-checkbox:checked {
  background:   #fff;
  border-color: #fff;
}
.gp-cf7-checkbox:checked::after {
  content:      '';
  position:     absolute;
  top:          1px;
  left:         4px;
  width:        4px;
  height:       8px;
  border:       2px solid #231d18;
  border-top:   none;
  border-left:  none;
  transform:    rotate(45deg);
}
.gp-cf7-contact-wrap .wpcf7-list-item-label {
  font-family:  'Cabin', sans-serif;
  font-weight:  400;
  font-size:    13.6px;
  line-height:  28px;
  color:        #fff;
  cursor:       pointer;
}

/* Submit button — CF7 renders <input type="submit"> not <button> */
.gp-cf7-submit {
  display:          block;
  width:            100%;
  height:           56px;
  background-color: #fff;
  color:            #111;
  font-family:      'Cabin', sans-serif;
  font-weight:      400;
  font-size:        18px;
  text-transform:   uppercase;
  border:           none;
  cursor:           pointer;
  transition:       background-color .15s ease;
  outline-offset:   2px;
}
.gp-cf7-submit:hover        { background-color: #fefbf6; }
.gp-cf7-submit:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Hide CF7's built-in spinner */
.gp-cf7-contact-wrap .wpcf7-spinner { display: none; }

/* Inline validation error tip */
.gp-cf7-contact-wrap .wpcf7-not-valid-tip {
  display:     block;
  color:       #ffb3b3;
  font-family: 'Cabin', sans-serif;
  font-size:   0.8125rem;
  margin-top:  0.25rem;
}

/* Success / error response message bar */
.gp-cf7-contact-wrap .wpcf7-response-output {
  width:       100%;
  margin:      0 !important;
  padding:     0.75rem 1rem;
  font-family: 'Cabin', sans-serif;
  font-size:   14px;
  color:       #fff;
  border:      1px solid rgba(255,255,255,.5) !important;
}

/* ── Fancybox v5 — Portfolio gallery: custom right-side 2-column thumb panel ─
   A vanilla-JS panel (.fb-thumb-panel) is appended to .fancybox__container by
   the inline init script. Using a custom panel (not the built-in Thumbs
   carousel) lets us use CSS Grid freely without fighting carousel transforms.
   The main carousel gets margin-right equal to the panel width so it never
   slides under the thumbnails.
*/

/* Push main carousel, toolbar, and nav arrows left of the thumb panel */
.fancybox__container .fancybox__carousel,
.fancybox__container .fancybox__toolbar { margin-right: 184px; }

/* Custom thumb panel — absolute, right-anchored, full-height */
.fb-thumb-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 184px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 90px;
  gap: 2px;
  padding: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 20;
  background: rgba(0, 0, 0, 0.55);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.fb-thumb-btn {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  transition: border-color 0.15s;
}

.fb-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}

.fb-thumb-btn:hover img    { opacity: 0.72; }
.fb-thumb-btn.is-active    { border-color: rgba(255, 255, 255, 0.9); }

/* Mobile + portrait tablet: move panel to a bottom strip so the media gets
   the full width. --fb-strip is the strip height (thumb size + 4px padding). */
@media (max-width: 640px), (max-width: 1024px) and (orientation: portrait) {
  .fancybox__container { --fb-strip: 82px; }

  .fancybox__container .fancybox__toolbar  { margin-right: 0; }
  .fancybox__container .fancybox__carousel { margin-right: 0; margin-bottom: var(--fb-strip); }

  .fb-thumb-panel {
    right: 0;
    left: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    height: var(--fb-strip);
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: calc(var(--fb-strip) - 4px);
    grid-auto-rows: calc(var(--fb-strip) - 4px);
    overflow-x: auto;
    overflow-y: hidden;
  }

  /* Compact mode pins the caption footer to bottom:0 — lift it above the strip */
  .fancybox__container.is-compact .fancybox__footer { bottom: var(--fb-strip); }
}

/* Tablet portrait: larger thumbs */
@media (min-width: 641px) and (max-width: 1024px) and (orientation: portrait) {
  .fancybox__container { --fb-strip: 108px; }
}

/* ── About page — hero intro WYSIWYG wrapper ──────────────────────────────
   Figma spec (347:2178): Cabin Regular 18px/28px, #231d18 at 60% opacity,
   tracking -0.1px. ACF WYSIWYG raw <p> output requires these rules here.
*/
.about-hero-intro {
  font-family:    'Cabin', sans-serif;
  font-weight:    400;
  font-size:      18px;
  line-height:    28px;
  letter-spacing: -0.1px;
  color:          #231d18;
}
.about-hero-intro p { margin-bottom: 28px; }
.about-hero-intro p:last-child { margin-bottom: 0; }

/* ── About page — bio WYSIWYG wrapper ─────────────────────────────────────
   The bio body copy maps to ACF wysiwyg fields. Raw <p> output from ACF must
   inherit the correct size, line-height and colour without extra utility classes.
   Figma spec: Cabin Regular 18px / 32px, #666666, letter-spacing -0.1px.
*/
.bio-wysiwyg {
  font-family: 'Cabin', sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 32px;
  letter-spacing: -0.1px;
  color: #231d18;
}
.bio-wysiwyg p {
  margin-bottom: 0;
}
.bio-wysiwyg a {
  color: #005be2;
  text-decoration: underline;
}
.bio-wysiwyg a:hover {
  opacity: 0.8;
}

/* ── Instagram section — Smash Balloon layout ───────────────────────────────
   When no ACF photos, drop the fixed/min heights and let the text block flow
   with 40px top/bottom padding, followed by the photo strip in normal flow.
*/
@media (min-width: 768px) {
  #instagram.instagram-live { min-height: 0; }
  #instagram .instagram-text-container { height: auto; padding-top: 40px; padding-bottom: 40px; }
  #instagram .instagram-text-container > div { position: static; margin-left: 40px; margin-right: 40px; }
  #instagram.instagram-live .instagram-footer-feed { position: relative; }
}
@media (min-width: 1024px) {
  #instagram .instagram-text-container > div { margin-left: 120px; }
}

/* ── Instagram footer feed (Smash Balloon) ─────────────────────────────────
   Flush full-width photo strip with zero gaps, matching the ACF image strip above.
*/
.instagram-footer-feed #sb_instagram,
.instagram-footer-feed #sb_instagram * { box-sizing: border-box; }

.instagram-footer-feed #sb_instagram { padding: 0 !important; margin: 0 !important; height: 100% !important; }

.instagram-footer-feed #sb_instagram #sbi_images {
  display: flex !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  gap: 0 !important;
}

.instagram-footer-feed #sb_instagram .sbi_item {
  height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

.instagram-footer-feed #sb_instagram .sbi_photo_wrap {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

.instagram-footer-feed #sb_instagram .sbi_photo {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
}

.instagram-footer-feed #sb_instagram .sbi_photo a,
.instagram-footer-feed #sb_instagram .sbi_photo_wrap a {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

.instagram-footer-feed #sb_instagram .sbi_photo img,
.instagram-footer-feed #sb_instagram .sbi_item img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  padding: 0 !important;
  margin: 0 !important;
  transition: transform 0.5s ease;
}

.instagram-footer-feed #sb_instagram .sbi_photo:hover img { transform: scale(1.05); }

/* Hide header, load-more, follow button */
.instagram-footer-feed #sbi_mod_error,
.instagram-footer-feed .sbi_header_text,
.instagram-footer-feed .sbi_header,
.instagram-footer-feed .sbi_follow_btn,
.instagram-footer-feed .sbi_load_btn { display: none !important; }

/* ── Instagram strip slider ─────────────────────────────────────────────────
   Shows the latest posts at a fixed size: 2 per view on mobile, 6 on desktop.
   When there are more posts than fit, JS in sections/instagram.php slides
   the track and adds prev/next arrows (.ig-slider--active).
*/
#instagram .ig-slider { overflow: hidden; }
#instagram .ig-track,
#instagram .instagram-footer-feed #sb_instagram #sbi_images {
  display: flex !important;
  flex-wrap: nowrap !important;
  transition: transform 0.6s ease;
  will-change: transform;
}
#instagram .ig-track > *,
#instagram .instagram-footer-feed #sb_instagram .sbi_item {
  flex: 0 0 50% !important;
  width: 50% !important;
  max-width: 50% !important;
  min-width: 0 !important;
}
@media (max-width: 767px) {
  #instagram .ig-slider { position: relative; }
  #instagram .instagram-footer-feed #sb_instagram .sbi_item {
    height: auto !important;
    aspect-ratio: 1 / 1;
  }
}
@media (min-width: 768px) {
  #instagram .ig-track > *,
  #instagram .instagram-footer-feed #sb_instagram .sbi_item {
    flex-basis: calc(100% / 6) !important;
    width: calc(100% / 6) !important;
    max-width: calc(100% / 6) !important;
  }
}

#instagram .ig-nav {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.9);
  color: #1a1a1a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background 0.2s ease;
}
#instagram .ig-nav:hover { background: #fff; }
#instagram .ig-nav:focus-visible { outline: 2px solid #005be2; outline-offset: 2px; }
#instagram .ig-nav--prev { left: 16px; }
#instagram .ig-nav--next { right: 16px; }
#instagram .ig-slider--active .ig-nav { display: flex; }
