/*
 * Terphoeve child theme styles. Plain CSS, no build step.
 * Typography (fonts, sizes, colours) lives in Salient > Typography; this file only adds
 * layout fixes and the editor styles (.lead, .chapeau, .h1-.h6).
 * No native CSS nesting: iOS supports it only from 17.2.
 */

body {
  overflow-y: auto;
}

body .contact p {
  display: flex;
  align-items: center;
  justify-items: center;
}

body .contact p:first-child {
  margin-top: 40px;
}

body .contact p > * {
  display: inline-block;
}

body .contact p img {
  max-height: 55px !important;
  max-width: 40px !important;
  display: inline-block;
  margin-right: 1rem;
  margin-bottom: 0 !important;
}

@media (min-width: 1199px) {
  body .hide-desktop {
    display: none !important;
  }
}

@media (max-width: 1198px) {
  body .hide-mobile {
    display: none !important;
  }
}

@media (max-width: 999px) {
  body .column-bg {
    min-height: auto !important;
  }

  body .column-bg .vc_column-inner {
    min-height: 50vh !important;
  }
}

.vc_row-o-equal-height .vc_col-sm-6 .wpb_wrapper {
  height: 100%;
}

.vc_row-o-equal-height .vc_col-sm-6 .wpb_wrapper .nectar-google-map {
  min-height: 100%;
}

/*
 * Intro paragraph, available in the editor's Styles dropdown ("Lead").
 * Family and colour come from Salient's body settings; only size, spacing and weight differ.
 * Heading classes .h1-.h6 need no CSS: the dropdown adds data-inherit-heading-family,
 * which Salient's typography settings already style.
 */
.lead {
  font-size: 22px;
  line-height: 1.5;
  font-weight: 700;
}

/* Salient's phone breakpoint */
@media (max-width: 690px) {
  .lead {
    font-size: 20px;
  }
}

/*
 * Short atmospheric line above a heading ("Altijd welkom!"), Styles dropdown "Chapeau".
 * Text colour inherits (body text, or white on photo rows); the underline matches the
 * menu's active underline: Salient accent colour, 2px.
 */
.chapeau {
  width: fit-content;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .75em;
  padding-bottom: .25em; /* also replaces Salient's 1.5em paragraph padding */
  border-bottom: 2px solid var(--nectar-accent-color, #ffb026);
}

/*
 * Headings (and paragraphs styled as headings): no single-word last lines, and a bottom
 * margin that scales with the heading size (half its font size), capped at 1rem.
 * The .row .col variants match Salient's own ".row .col h3, .row .col h4 { margin-bottom: 8px }".
 */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.row .col h1, .row .col h2, .row .col h3, .row .col h4, .row .col h5, .row .col h6 {
  text-wrap: pretty;
  margin-bottom: min(.5em, 1rem);
}

/*
 * Section spacing: one default for every row, set here instead of per row in the content.
 * A row with its own padding (Salient row setting) keeps it: Salient renders that as an
 * inline calc(), and writes "padding-top: 0px" inline when no padding is set, so the
 * default targets only that placeholder (inline styles need !important to override).
 * "Full width content" rows (photo edge to edge beside text) get no padding; their text
 * column brings its own.
 */
:root {
  --row-spacer: 7rem; /* 112px, today's 8% at 1440px */
}

/* Salient stacks columns below 1000px */
@media (max-width: 999px) {
  :root {
    --row-spacer: 2.5rem;
  }
}

.wpb_row:not(.inner_row):not(.full-width-content)[style*="padding-top: 0px"] {
  padding-top: var(--row-spacer) !important;
}

.wpb_row:not(.inner_row):not(.full-width-content)[style*="padding-bottom: 0px"] {
  padding-bottom: var(--row-spacer) !important;
}

/* The last element in a column (often a button with a 10px bottom margin) would add to the
   row spacing above; let the row end flush. */
.wpb_column > .vc_column-inner > .wpb_wrapper > :last-child {
  margin-bottom: 0;
}

/* Stacked columns (below 1000px): empty spacer columns (used for centring on desktop) would
   still add Salient's 25px column margin, and so would the last column with content.
   Browsers without :has() keep Salient's default. */
@media (max-width: 999px) {
  .wpb_column:not(:has(> .vc_column-inner > .wpb_wrapper > *)) {
    display: none;
  }

  .wpb_column:not(:has(~ .wpb_column > .vc_column-inner > .wpb_wrapper > *)) {
    margin-bottom: 0;
  }
}

/*
 * Split rows: "full width content" row with one text column beside a photo column
 * (el_class "column-bg"). The photo runs to the viewport edge; the text lines up with the
 * container (logo on the left, last menu item on the right). Salient's container is
 * max 1425px wide including 90px padding (above 1000px), and 88% wide below that.
 * The row is a size container so 100cqw is the row width without the scrollbar;
 * browsers without container units use 100vw instead (at most half a scrollbar off).
 */
.full-width-content:has(> .row_col_wrap_12 > .column-bg) {
  container-type: inline-size;
}

.full-width-content > .row_col_wrap_12:has(> .column-bg):has(> .wpb_column:nth-child(2):last-child) > .wpb_column:not(.column-bg) > .vc_column-inner {
  padding: var(--row-spacer) 4rem;
}

/* Side by side: outer edge on the container, 4rem towards the photo */
@media (min-width: 1000px) {
  .full-width-content > .row_col_wrap_12:has(> .column-bg):has(> .wpb_column:nth-child(2):last-child) > .wpb_column:not(.column-bg):first-child > .vc_column-inner {
    padding-left: calc(max(0px, (100vw - 1425px) / 2) + 90px);
    padding-left: calc(max(0px, (100cqw - 1425px) / 2) + 90px);
  }

  .full-width-content > .row_col_wrap_12:has(> .column-bg):has(> .wpb_column:nth-child(2):last-child) > .wpb_column:not(.column-bg):last-child > .vc_column-inner {
    padding-right: calc(max(0px, (100vw - 1425px) / 2) + 90px);
    padding-right: calc(max(0px, (100cqw - 1425px) / 2) + 90px);
  }
}

/* Stacked: same side margin as the 88% container */
@media (max-width: 999px) {
  .full-width-content > .row_col_wrap_12:has(> .column-bg):has(> .wpb_column:nth-child(2):last-child) > .wpb_column:not(.column-bg) > .vc_column-inner {
    padding-left: 6vw;
    padding-left: 6cqw;
    padding-right: 6vw;
    padding-right: 6cqw;
  }
}

/*
 * Buttons: [terphoeve_button] (inc/button.php). Two variants, both with an arrow.
 * Primary: Salient accent colour with dark text (7.8:1). Secondary: dark outline.
 * On rows with light text (data-midnight="light", usually photos) secondary turns white.
 */
.tp-btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  min-height: 48px;
  margin: 0 1rem 1rem 0;
  /* Forma DJR sits low in its line box (more room above the letters than below):
     .075em less padding on top centres the capitals in the button. */
  padding: .675em 1.5em .825em;
  border: 2px solid currentColor;
  border-radius: 4px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.tp-btn::after {
  content: "";
  flex: none;
  width: 1em;
  height: 1em;
  transform: translateY(.04em); /* centre on the capitals rather than the line box */
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13.3 5.3a1 1 0 0 1 1.4 0l6 6a1 1 0 0 1 0 1.4l-6 6a1 1 0 0 1-1.4-1.4l4.3-4.3H4a1 1 0 1 1 0-2h13.6l-4.3-4.3a1 1 0 0 1 0-1.4z'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13.3 5.3a1 1 0 0 1 1.4 0l6 6a1 1 0 0 1 0 1.4l-6 6a1 1 0 0 1-1.4-1.4l4.3-4.3H4a1 1 0 1 1 0-2h13.6l-4.3-4.3a1 1 0 0 1 0-1.4z'/%3E%3C/svg%3E") no-repeat center / contain;
}

.tp-btn:focus-visible {
  outline: 3px solid #2b2b2b;
  outline-offset: 3px;
}

/* Salient's link styles (underline, colour) must not reach the buttons */
body .tp-btn,
body .tp-btn:hover,
body .tp-btn:focus {
  text-decoration: none;
}

body .tp-btn--primary {
  background-color: var(--nectar-accent-color, #ffb026);
  border-color: var(--nectar-accent-color, #ffb026);
  color: #2b2b2b;
}

body .tp-btn--secondary {
  background-color: transparent;
  border-color: #2b2b2b;
  color: #2b2b2b;
}

body .tp-btn--primary:hover,
body .tp-btn--secondary:hover {
  background-color: #2b2b2b;
  border-color: #2b2b2b;
  color: #fff;
}

/* Surface awareness: rows with light text */
body [data-midnight="light"] .tp-btn--secondary,
body .span_12.light .tp-btn--secondary {
  border-color: #fff;
  color: #fff;
}

body [data-midnight="light"] .tp-btn--primary:hover,
body [data-midnight="light"] .tp-btn--secondary:hover,
body .span_12.light .tp-btn--primary:hover,
body .span_12.light .tp-btn--secondary:hover {
  background-color: #fff;
  border-color: #fff;
  color: #2b2b2b;
}

[data-midnight="light"] .tp-btn:focus-visible,
.span_12.light .tp-btn:focus-visible {
  outline-color: #fff;
}

/*
 * Mobile menu close button. Salient's "close button background" setting (#2b2b2b) loses to
 * Salient's own default "...material a.slide_out_area_close:before { rgba(0,0,0,.06) }", which has
 * an extra "a" in the selector, leaving a white x on orange (about 2:1). Same selector with the
 * class doubled so the setting's value applies. Keep in sync with
 * header-slide-out-widget-area-close-bg-color in Salient.
 */
body[data-slide-out-widget-area-style="slide-out-from-right"].material a.slide_out_area_close.slide_out_area_close::before {
  background-color: #2b2b2b;
}

/* Main menu: Salient removes the focus outline and shows nothing instead (WCAG 2.4.7).
   currentColor follows the link, so it also works on a transparent header with light text. */
body #top nav > ul > li > a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/*
 * Cookie popup (67 Primo, bottom-left layout): the plugin gives the "Voorkeuren opslaan" link
 * margin-right: auto, which pushes it to the far left, away from the "Alles accepteren" button,
 * and aligns the two on the baseline despite their different sizes. Keep them together on the
 * right, centred on each other. Below the popup's width they still wrap.
 */
body .primo-cookie-compliance .primo-cookie-compliance-footer {
  justify-content: flex-end;
  align-items: center;
  gap: .5rem 1rem;
}

body .primo-cookie-compliance .primo-cookie-compliance-footer .btn-unstyled {
  margin: 0;
}

/* Footer copyright line: Salient's default #777 is 4.47:1 on the white footer (needs 4.5).
   The link colour is inline in Salient > Footer > copyright text, also #666666. */
body #footer-outer #copyright {
  color: #666666;
}

/*
 * Photo tiles (fancy box "parallax hover", Home and Vacatures): body text colour instead of
 * Salient's white, which was about 1.7:1 on the bright overlays. With dark text the overlay must
 * stay mostly opaque on hover too; that is set per tile (overlay opacity on hover 0.8; Salient only supports steps of 0.1).
 */
/* Salient sets ".inner * { color: #fff }"; the icon path follows that colour too */
body .nectar-fancy-box[data-style="parallax_hover"] .inner,
body .nectar-fancy-box[data-style="parallax_hover"] .inner * {
  color: var(--nectar-page-text-color, #333);
}

/* Icons are coloured with fill (Salient: "... .im-icon-wrap path { fill: #fff }") */
body .nectar-fancy-box[data-style="parallax_hover"] .im-icon-wrap path {
  fill: currentColor;
}

/* Photo tiles below 1000px (stacked, 2x2 on tablet): no 600px minimum height (inline style from
   the tile's "min height" setting) and the section spacing instead of Salient's ~98px padding. */
@media (max-width: 999px) {
  body .nectar-fancy-box[data-style="parallax_hover"] .meta-wrap {
    min-height: 0 !important;
  }

  body .nectar-fancy-box[data-style="parallax_hover"] .inner {
    padding-top: var(--row-spacer);
    padding-bottom: var(--row-spacer);
  }

  /* Keep the tiles one continuous band, as on desktop (no stacked-column margin between them) */
  .wpb_column:has(> .vc_column-inner > .wpb_wrapper > .nectar-fancy-box[data-style="parallax_hover"]) {
    margin-bottom: 0;
  }
}

/* Tablet (2x2): one shared height so a tile with a two-line heading ("Kleinschalig wonen")
   doesn't leave an empty strip under its neighbour. 16.5rem fits a two-line heading. */
@media (min-width: 691px) and (max-width: 999px) {
  body .nectar-fancy-box[data-style="parallax_hover"] .meta-wrap {
    min-height: 16.5rem !important;
  }
}
