/* Maatregel detail page enhancements — all single-page.php maatregelen */

/* Welkom-announcer (zelfde look als dashboard) */
.maatregel-welcome-announcer.welcome-announcer {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border-radius: 14px;
  padding: 10px 36px 10px 20px;
  margin-top: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 10px rgba(20, 16, 83, 0.1);
}

.maatregel-content-title-box > .maatregel-welcome-announcer.welcome-announcer {
  margin-top: 28px;
  margin-bottom: 28px;
}

.maatregel-welcome-announcer.is-dismissed {
  display: none;
}

.maatregel-welcome-announcer .welcome-announcer-text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.4;
  color: #141053;
}

.maatregel-welcome-announcer .welcome-announcer-text strong {
  font-weight: 700;
  margin-right: 6px;
}

.maatregel-welcome-announcer .welcome-announcer-text span {
  color: #555;
}

.maatregel-welcome-announcer .welcome-announcer-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #69d19c;
  color: #fff !important;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 30px;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.2s ease;
}

.maatregel-welcome-announcer .welcome-announcer-cta:hover {
  background: #6c63f9;
}

.maatregel-welcome-announcer .welcome-announcer-cta img {
  width: 20px;
  height: 20px;
}

.maatregel-welcome-announcer .welcome-announcer-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: #8a8aa3;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 6px;
}

.maatregel-welcome-announcer .welcome-announcer-close:hover {
  color: #141053;
  background: #f1f1f6;
}

@media (max-width: 768px) {
  .maatregel-welcome-announcer.welcome-announcer {
    flex-wrap: wrap;
    padding: 10px 34px 10px 12px;
  }

  .maatregel-welcome-announcer .welcome-announcer-text {
    flex: 1 1 100%;
  }

  .maatregel-welcome-announcer .welcome-announcer-cta {
    font-size: 13px;
    padding: 6px 12px;
  }
}

/* Hero image: mobile only */
@media (min-width: 769px) {
  .maatregel-hero-image {
    display: none;
  }

  body.maatregel-detail-page .maatregel-mobile-top {
    display: none;
  }

  body.maatregel-detail-page .maatregel-mobile-title-row {
    display: none;
  }

  body.maatregel-detail-page .checkbox-on-mobile-maatregel-page {
    display: none;
  }
}

/* Mobile maatregel detail top — Figma ITEM PAGE (MAATREGEL) node 1:7174 */
@media (max-width: 768px) {
  html:has(body.maatregel-detail-page),
  body.maatregel-detail-page {
    overscroll-behavior-y: none;
  }

  body.maatregel-detail-page {
    background: #141053;
  }

  body.maatregel-detail-page nav.mobile-screen-navigetion {
    display: none !important;
  }

  body.maatregel-detail-page .page {
    padding-top: 0 !important;
    margin-top: 0 !important;
    overflow-x: clip;
  }

  body.maatregel-detail-page .main-header {
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none;
    padding: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    overflow: visible;
  }

  body.maatregel-detail-page main,
  body.maatregel-detail-page .deshboard-wrapper,
  body.maatregel-detail-page .deshboard-wrapper > .container-fluid,
  body.maatregel-detail-page .deshboard-wrapper > .container-fluid > .row,
  body.maatregel-detail-page .right-column-width,
  body.maatregel-detail-page .maatregel-page-enhanced,
  body.maatregel-detail-page .maatregel-page-enhanced > .row,
  body.maatregel-detail-page .single-middle-column-width {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-top: 0 !important;
  }

  body.maatregel-detail-page .deshboard-wrapper > .container-fluid > .row,
  body.maatregel-detail-page .maatregel-page-enhanced > .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    --bs-gutter-x: 0;
  }

  body.maatregel-detail-page .deshboard-wrapper > .container-fluid > .row > [class*="col-"],
  body.maatregel-detail-page .maatregel-page-enhanced > .row > [class*="col-"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body.maatregel-detail-page .main-header .header-logo,
  body.maatregel-detail-page .main-header .header-profile-col,
  body.maatregel-detail-page .main-header nav.navigatione.desktop-nav {
    display: none;
  }

  body.maatregel-detail-page .responsive-back-arrow {
    display: block !important;
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: 25px;
    z-index: 100;
    margin: 0;
  }

  body.maatregel-detail-page .responsive-back-arrow a img {
    width: 28px;
    margin-left: 0;
    filter: brightness(0) invert(1);
  }

  body.maatregel-detail-page .maatregel-content-main-box {
    padding: 0;
    margin-top: 0;
    background: transparent;
    overflow: visible;
  }

  body.maatregel-detail-page .maatregel-mobile-top {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    z-index: 3;
    /* Ruimte voor stats-kaart die half over hero/content hangt — niet clippen */
    min-height: 275px;
    padding-bottom: 48px;
    overflow: visible;
  }

  body.maatregel-detail-page .maatregel-hero-image {
    display: block !important;
    width: 125vw;
    max-width: none;
    margin: 0 !important;
    margin-left: calc(50% - 62.5vw) !important;
    height: 275px;
    border-radius: 0 !important;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    box-sizing: border-box;
  }

  body.maatregel-detail-page .maatregel-details-mobile {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: absolute;
    left: 50%;
    top: 213px;
    transform: translateX(-50%);
    width: min(319px, calc(100% - 32px));
    height: 89px;
    margin-left: 0;
    padding: 0 8px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
    z-index: 10;
  }

  body.maatregel-detail-page .maatregel-details-mobile .pie {
    width: 72px !important;
    height: 72px !important;
    flex-shrink: 0;
    margin-top: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body.maatregel-detail-page .maatregel-details-mobile .pie svg {
    width: 72px !important;
    height: 72px !important;
    margin-top: 0 !important;
    display: block;
  }

  body.maatregel-detail-page .maatregel-details-mobile .pie svg text,
  body.maatregel-detail-page .maatregel-details-mobile .pie svg text tspan[class*="pie-percent"] {
    font-size: 13px !important;
  }

  body.maatregel-detail-page .maatregel-details-mobile .pie svg text tspan[class*="pie-symbol"] {
    font-size: 11px !important;
  }

  body.maatregel-detail-page .maatregel-details-mobile .pie:first-child {
    margin-left: 4px;
  }

  body.maatregel-detail-page .maatregel-details-mobile .invest-pie-link-mobile {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
  }

  body.maatregel-detail-page .maatregel-details-mobile .invest-range-mobile {
    display: none;
  }

  body.maatregel-detail-page .maatregel-details-mobile .label-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    margin-left: 2px;
  }

  body.maatregel-detail-page .maatregel-details-mobile .categorie-status {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    padding: 0 0 0 12px;
    margin-left: 4px;
    border-left: 1px solid #e4e4e4;
    min-height: 72px;
  }

  body.maatregel-detail-page .maatregel-details-mobile .triangle-right-box {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin: 0;
  }

  body.maatregel-detail-page .maatregel-details-mobile .triangle-right-box .tag-label {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 5px 10px;
    line-height: 1;
    font-size: 10px;
    border-radius: 8px 0 0 8px;
    box-sizing: border-box;
  }

  body.maatregel-detail-page .maatregel-details-mobile .triangle-right {
    align-self: center;
    border-top: 13px solid transparent;
    border-bottom: 13px solid transparent;
    border-left: 12px solid #6C63FF;
  }

  body.maatregel-detail-page .maatregel-details-mobile .triangle-right-box .tag-label[data-category="elektrificeren"] ~ .triangle-right {
    border-left-color: #6C63FF;
  }

  body.maatregel-detail-page .maatregel-details-mobile .triangle-right-box .tag-label[data-category="besparen"] ~ .triangle-right {
    border-left-color: #452e7e;
  }

  body.maatregel-detail-page .maatregel-details-mobile .triangle-right-box .tag-label[data-category="opwekken"] ~ .triangle-right {
    border-left-color: #005fac;
  }

  body.maatregel-detail-page .maatregel-details-mobile .triangle-right-box .tag-label[data-category="opslag"] ~ .triangle-right {
    border-left-color: #6b7280;
  }

  body.maatregel-detail-page .maatregel-details-mobile .triangle-right-box .tag-label[data-category="specialist"] ~ .triangle-right {
    border-left-color: #FCAD20;
  }

  body.maatregel-detail-page .maatregel-details-mobile .triangle-right-box span {
    font-size: 10px;
    line-height: 1;
  }

  body.maatregel-detail-page .maatregel-details-mobile .status-value,
  body.maatregel-detail-page .maatregel-details-mobile #maatregel_status_value {
    font-size: 12px;
    line-height: 1.2;
    color: #141053;
    font-weight: 400;
  }

  body.maatregel-detail-page .maatregel-content-title-box {
    position: relative;
    background: #fff;
    border-radius: 20px 20px 0 0;
    margin-top: -48px;
    padding: 80px 28px 0;
    z-index: 2;
  }

  body.maatregel-detail-page .maatregel-mobile-title-row {
    position: absolute;
    /* Uitlijnen met midden van eerste titelregel (line-height 30px, checkbox 45px) */
    top: 72px;
    right: 28px;
    z-index: 4;
  }

  body.maatregel-detail-page .checkbox-on-mobile-maatregel-page {
    position: static;
  }

  body.maatregel-detail-page .checkbox-on-mobile-maatregel-page .checkbox-round {
    position: relative;
    top: auto;
    right: auto;
    display: block;
    width: 45px;
    height: 45px;
    border: 2px solid #707070;
    background-color: #fff !important;
    box-shadow: none;
  }

  /* Todo: oranje fill met wit vinkje */
  body.maatregel-detail-page .checkbox-on-mobile-maatregel-page .checkbox-round[switchstatus="todo"] {
    background-color: #FCAD20 !important;
    border-color: #FCAD20 !important;
  }

  body.maatregel-detail-page .checkbox-on-mobile-maatregel-page .checkbox-round[switchstatus="todo"]::after,
  body.maatregel-detail-page .checkbox-on-mobile-maatregel-page .checkbox-round[switchstatus="todo"]:hover::after {
    background: none !important;
    border: 2px solid #fff !important;
    border-top: none !important;
    border-right: none !important;
    border-radius: 0 !important;
    content: "" !important;
    height: 7px !important;
    width: 14px !important;
    opacity: 1 !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -55%) rotate(-45deg) !important;
  }

  body.maatregel-detail-page .checkbox-on-mobile-maatregel-page .checkbox-round[switchstatus="todo"]:hover {
    background-color: #FCAD20 !important;
  }

  /* Leeg / nieuw: wit met grijs vinkje */
  body.maatregel-detail-page .checkbox-on-mobile-maatregel-page .checkbox-round[switchstatus=""],
  body.maatregel-detail-page .checkbox-on-mobile-maatregel-page .checkbox-round[switchstatus="nieuw"],
  body.maatregel-detail-page .checkbox-on-mobile-maatregel-page .checkbox-round:not([switchstatus]) {
    background-color: #fff !important;
    border-color: #707070 !important;
  }

  body.maatregel-detail-page .checkbox-on-mobile-maatregel-page .checkbox-round[switchstatus=""]::after,
  body.maatregel-detail-page .checkbox-on-mobile-maatregel-page .checkbox-round[switchstatus="nieuw"]::after,
  body.maatregel-detail-page .checkbox-on-mobile-maatregel-page .checkbox-round:not([switchstatus])::after,
  body.maatregel-detail-page .checkbox-on-mobile-maatregel-page .checkbox-round[switchstatus=""]:hover::after {
    background: none !important;
    border: 2px solid #c0c0c0 !important;
    border-top: none !important;
    border-right: none !important;
    border-radius: 0 !important;
    content: "" !important;
    height: 7px !important;
    width: 14px !important;
    opacity: 1 !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -55%) rotate(-45deg) !important;
  }

  body.maatregel-detail-page .checkbox-on-mobile-maatregel-page .checkbox-round[switchstatus=""]:hover {
    background-color: #fff !important;
  }

  /* Done: groen met wit vinkje */
  body.maatregel-detail-page .checkbox-on-mobile-maatregel-page .checkbox-round[switchstatus="done"] {
    background-color: #69D19C !important;
    border-color: #69D19C !important;
  }

  body.maatregel-detail-page .checkbox-on-mobile-maatregel-page .checkbox-round[switchstatus="done"]::after,
  body.maatregel-detail-page .checkbox-on-mobile-maatregel-page .checkbox-round.just-completed::after {
    background: none !important;
    border: 2px solid #fff !important;
    border-top: none !important;
    border-right: none !important;
    border-radius: 0 !important;
    content: "" !important;
    height: 7px !important;
    width: 14px !important;
    opacity: 1 !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -55%) rotate(-45deg) !important;
  }

  body.maatregel-detail-page .checkbox-on-mobile-maatregel-page .checkbox-round[switchstatus="done"]:hover {
    background-color: #69D19C !important;
  }

  body.maatregel-detail-page .checkbox-on-mobile-maatregel-page .checkbox-round[switchstatus="done"]:hover::after {
    background: none !important;
    border: 2px solid #fff !important;
    border-top: none !important;
    border-right: none !important;
    height: 7px !important;
    width: 14px !important;
    transform: translate(-50%, -55%) rotate(-45deg) !important;
  }

  body.maatregel-detail-page .maatregel-content-title-box > h1:first-child,
  body.maatregel-detail-page .maatregel-content-title-box > h2:first-child,
  body.maatregel-detail-page .maatregel-content-title-box > .maatregel-seo-h1:first-child,
  body.maatregel-detail-page .maatregel-content-title-box h1:first-of-type,
  body.maatregel-detail-page .maatregel-content-title-box h2:first-of-type,
  body.maatregel-detail-page .maatregel-content-title-box .maatregel-seo-h1 {
    font-size: 25px;
    line-height: 30px;
    color: #141053;
    margin: 0 0 20px;
    padding-right: 56px;
    max-width: 100%;
    width: auto !important;
    font-family: 'museo-medium', sans-serif;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 60px;
    word-break: break-word;
  }

  body.maatregel-detail-page .maatregel-content-title-box > p:first-of-type {
    font-size: 18px;
    line-height: 26px;
    color: #141053;
    margin-bottom: 20px;
  }

  body.maatregel-detail-page .maatregel-seo-h1 {
    font-size: 25px;
    line-height: 30px;
  }
}

/* Category badge — desktop only (mobile shows category in header) */
.maatregel-category-badge {
  display: none;
}

@media (min-width: 769px) {
  .maatregel-category-badge {
    display: inline-block;
    background: #6c63ff;
    color: #fff;
    font-size: 11px;
    font-family: 'museo-semibold', sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 20px;
    margin-bottom: 16px;
  }
}

/* SEO h1 for batterijen (replaces DB h2) */
.maatregel-seo-h1 {
  font-size: 42px;
  font-family: 'Museo-medium', sans-serif;
  color: #141053;
  margin: 0 0 20px;
  line-height: 1.15;
}

@media (max-width: 768px) {
  .maatregel-seo-h1 {
    font-size: 28px;
  }
}

/* Wider content column + fixed sidebar on desktop */
@media (min-width: 992px) {
  .maatregel-page-enhanced > .row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 32px;
    align-items: start;
  }

  .maatregel-page-enhanced .single-middle-column-width,
  .maatregel-page-enhanced .single-right-column-width {
    width: 100% !important;
    max-width: none !important;
    flex: none;
  }

  .maatregel-page-enhanced .col-md-7,
  .maatregel-page-enhanced .col-md-5 {
    padding: 0;
    flex: none;
    max-width: none;
  }

  .maatregel-page-enhanced > .row {
    padding-right: clamp(20px, 3vw, 48px);
  }

  .maatregel-page-enhanced .single-right-column-width {
    padding-right: 8px;
  }

  .maatregel-page-enhanced .maatregel-details-main-box {
    display: flex;
    justify-content: flex-start;
  }

  .maatregel-page-enhanced .maatregel-details-card {
    width: 360px !important;
    max-width: 100%;
    margin-right: auto;
  }

  .maatregel-page-enhanced .maatregel-details-card .card-title h4 {
    padding-right: 44px;
  }
}

/* Hide header meters on maatregel detail pages (PHP also skips render) */
body.maatregel-detail-page .header-pies-col {
  display: none !important;
}

body.maatregel-detail-page nav.navigatione.desktop-nav > .row > .col.header-profile-col {
  margin-left: auto;
}

/* Sticky header: profielicoon blijft in de header, niet los over content scrollen */
@media (min-width: 992px) {
  body.maatregel-detail-page .main-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: #fff;
  }

  body.maatregel-detail-page nav.navigatione.desktop-nav > .row > .col.header-profile-col {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    z-index: auto;
  }
}

/* Batterijen extras — capacity table */
.maatregel-enhanced__section {
  margin-top: 40px;
}

.maatregel-enhanced__section h3 {
  font-family: 'museo-semibold', sans-serif;
  font-size: 20px;
  margin: 28px 0 12px;
  color: #141053;
}

.maatregel-enhanced__section > p {
  font-size: 16px;
  line-height: 1.6;
  color: #414141;
  margin: 0 0 16px;
}

.maatregel-enhanced__table-wrap {
  overflow-x: auto;
  margin: 24px 0;
}

.maatregel-enhanced__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.maatregel-enhanced__table th {
  background: #141053;
  color: #fff;
  text-align: left;
  padding: 12px 14px;
  font-family: 'museo-semibold', sans-serif;
}

.maatregel-enhanced__table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e8e8e8;
  color: #414141;
}

.maatregel-enhanced__table tr:nth-child(even) td {
  background: #f7f6fb;
}

/* Batterijen extras — FAQ accordion */
.maatregel-enhanced__faq {
  background: #f7f6fb;
  border-radius: 20px;
  padding: 40px 32px;
  margin-top: 40px;
  margin-bottom: 32px;
}

.maatregel-enhanced__faq-header {
  text-align: center;
  margin-bottom: 32px;
}

.maatregel-enhanced__faq-header h3 {
  font-family: 'museo-semibold', sans-serif;
  font-size: 20px;
  margin: 0 0 8px;
  color: #141053;
}

.maatregel-enhanced__faq-header p {
  color: #627d9a;
  margin: 0;
  font-size: 15px;
}

.maatregel-enhanced__faq-item {
  border-bottom: 1px solid #ddd;
  padding: 16px 0;
}

.maatregel-enhanced__faq-item summary {
  font-family: 'museo-semibold', sans-serif;
  font-size: 17px;
  color: #141053;
  cursor: pointer;
  list-style: none;
}

.maatregel-enhanced__faq-item summary::-webkit-details-marker {
  display: none;
}

.maatregel-enhanced__faq-item p {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: #414141;
}

@media (max-width: 768px) {
  .maatregel-enhanced__faq {
    padding: 28px 20px;
    border-radius: 12px;
  }
}

/* Sectie 5 blueprint: lead generation block */
.maatregel-enhanced__lead {
  background: #141053;
  color: #fff;
  border-radius: 20px;
  padding: clamp(40px, 5vw, 56px) clamp(28px, 4vw, 48px);
  text-align: center;
  margin-top: 48px;
  margin-bottom: 16px;
}

.maatregel-enhanced__lead h2,
.maatregel-content-title-box .maatregel-enhanced__lead h2,
.single-middle-column-width .maatregel-enhanced__lead h2 {
  font-family: 'museo-semibold', sans-serif;
  font-size: clamp(24px, 3.5vw, 34px);
  color: #fff !important;
  margin: 0 0 16px;
  line-height: 1.2;
}

.maatregel-enhanced__lead > p:not(.maatregel-enhanced__lead-foot),
.maatregel-content-title-box .maatregel-enhanced__lead > p:not(.maatregel-enhanced__lead-foot),
.single-middle-column-width .maatregel-enhanced__lead > p:not(.maatregel-enhanced__lead-foot) {
  font-size: clamp(16px, 2vw, 19px);
  color: #fff !important;
  opacity: 0.85;
  margin: 0 auto 28px;
  max-width: 560px;
  line-height: 1.55;
}

.maatregel-enhanced__lead-btn {
  display: inline-block;
  background: #69d19c;
  color: #141053;
  font-family: 'museo-semibold', sans-serif;
  font-size: 17px;
  padding: 16px 40px;
  border-radius: 30px;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease, transform 0.15s ease;
}

.maatregel-enhanced__lead-btn:hover {
  background: #5bc48a;
  color: #141053;
  transform: translateY(-1px);
}

.maatregel-enhanced__lead-foot {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55) !important;
  margin: 20px 0 0;
}

@media (max-width: 768px) {
  body.maatregel-detail-page .maatregel-enhanced__lead {
    margin-bottom: 100px;
  }

  body.maatregel-detail-page .maatregel-mobile-bottom-spacer {
    display: block;
    height: 48px;
    background: #fff;
  }
}
