/* K-SOLAR design pass 2 (2026-10-30). Layout and presentation only; loaded after brand.css. */

/* ---------- Home hero: live preview inside the quote card ---------- */
.kp-preview {
  margin: 14px 0 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #f1f6fb;
  border: 1px solid var(--kp-line, #d8e1ea);
}
.kp-preview-label { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--kp-cell, #1c5d99); }
.kp-preview dl { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kp-preview dl div { min-width: 0; }
.kp-preview dt { font-size: 12px; color: var(--kp-muted, #50637a); }
.kp-preview dd { margin: 2px 0 0; font-size: 17px; font-weight: 800; color: var(--kp-navy, #0b2c4a); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kp-preview div:last-child dd { color: var(--kp-leaf, #2f8f46); }
.kp-preview-note { margin: 8px 0 0; font-size: 12px; color: var(--kp-muted, #50637a); }

/* ---------- Home: Philippine projects ---------- */
.kp-projects { padding: 72px 0 56px; background: #fff; }
.kp-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.kp-section-head h2 { margin: 0; }
.kp-section-head a { font-weight: 700; color: var(--kp-cell, #1c5d99); min-height: 44px; display: inline-flex; align-items: center; }
.kp-project-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 16px; }
.kp-project { position: relative; margin: 0; border-radius: 14px; overflow: hidden; background: #0b2c4a; min-height: 220px; }
.kp-project--lead { grid-row: 1 / span 2; min-height: 460px; }
.kp-project img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kp-project figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 20px 18px; background: linear-gradient(180deg, rgba(8, 31, 53, 0) 0%, rgba(8, 31, 53, 0.88) 100%); color: #fff; display: grid; gap: 2px; }
.kp-project strong { font-size: 20px; color: #fff; }
.kp-project--lead strong { font-size: 26px; }
.kp-project figcaption > span:last-child { color: rgba(255, 255, 255, 0.82); font-size: 14px; }
.kp-tag { justify-self: start; margin-bottom: 6px; padding: 3px 10px; border-radius: 999px; background: var(--kp-leaf, #2f8f46); color: #fff; font-size: 12px; font-weight: 700; }
.kp-tag--next { background: var(--kp-sun, #f5b301); color: #1d1404; }
.kp-projects .kp-proof-note { margin-top: 14px; color: var(--kp-muted, #50637a); }

/* ---------- Home: solutions, two featured + four compact, whole card clickable ---------- */
.kp-solutions--v2 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.kp-solutions--v2 .kp-sol { position: relative; transition: border-color 150ms ease, transform 150ms ease; }
.kp-solutions--v2 .kp-sol:hover { border-color: var(--kp-cell, #1c5d99); transform: translateY(-2px); }
.kp-solutions--v2 .kp-sol--feature { grid-column: span 2; }
.kp-solutions--v2 .kp-sol--feature img { aspect-ratio: 16 / 9; }
.kp-solutions--v2 .kp-sol--feature h3 { font-size: 23px; }
.kp-solutions--v2 .kp-sol:not(.kp-sol--feature) img { aspect-ratio: 4 / 3; }
.kp-solutions--v2 .kp-sol-primary::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.kp-solutions--v2 .kp-sol-links a:not(.kp-sol-primary) { position: relative; z-index: 1; color: var(--kp-muted, #50637a); font-size: 14px; }

/* ---------- Estimate page: wizard + guide panel ---------- */
.wz-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; padding-top: 32px; padding-bottom: 64px; }
.wz-main { min-width: 0; }
.wz-main .wizard-top, .wz-main .q-title { max-width: none; }
.wz-main .q-title { font-size: clamp(26px, 3vw, 36px); }
.wz-main .q-help { font-size: 16px; }
.wz-main .choices { gap: 12px; }
.wz-main .choice { min-height: 76px; padding: 16px 18px; font-size: 16px; border-radius: 12px; }
.wz-main .choice strong, .wz-main .choice b { font-size: 17px; }
.wz-aside { position: sticky; top: 96px; display: grid; gap: 10px; padding: 0 0 20px; background: #fff; border: 1px solid var(--kp-line, #d8e1ea); border-radius: 14px; overflow: hidden; }
.wz-aside > :not(figure) { margin-left: 20px; margin-right: 20px; }
.wz-aside h2 { margin-top: 10px; margin-bottom: 0; font-size: 15px; color: var(--kp-navy, #0b2c4a); }
.wz-aside p { margin-top: 0; margin-bottom: 0; font-size: 14px; color: var(--kp-muted, #50637a); }
.wz-aside-photo { margin: 0; }
.wz-aside-photo img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.wz-aside-photo figcaption { padding: 8px 20px 0; font-size: 12px; color: var(--kp-muted, #50637a); }
.wz-list { margin-top: 0; margin-bottom: 0; padding-left: 18px; font-size: 14px; color: var(--kp-text, #13263b); display: grid; gap: 4px; }

/* ---------- Solutions page: one clear action, quieter secondary links ---------- */
.product-actions { align-items: center; row-gap: 8px; }
.product-actions .product-link { font-size: 14px; font-weight: 600; color: var(--kp-muted, #50637a); text-decoration: underline; text-underline-offset: 3px; }
.product-actions .product-link:hover { color: var(--kp-cell, #1c5d99); }
.product-media img { border-radius: 12px; }

/* ---------- About: roles diagram ---------- */
.ab-roles h2 { margin-bottom: 24px; }
.ab-flow { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.ab-flow::before { content: ""; position: absolute; left: 12%; right: 12%; top: 50%; height: 2px; background: repeating-linear-gradient(90deg, var(--kp-line, #d8e1ea) 0 10px, transparent 10px 18px); z-index: 0; }
.ab-node { position: relative; z-index: 1; padding: 24px 22px; border-radius: 14px; background: #fff; border: 1px solid var(--kp-line, #d8e1ea); }
.ab-node h3 { margin: 6px 0 8px; font-size: 24px; color: var(--kp-navy, #0b2c4a); }
.ab-node p { margin: 0; color: var(--kp-muted, #50637a); }
.ab-node--center { background: var(--kp-navy, #0b2c4a); border-color: var(--kp-navy, #0b2c4a); }
.ab-node--center h3 { color: #fff; }
.ab-node--center p { color: rgba(255, 255, 255, 0.82); }
.ab-where { font-size: 13px; font-weight: 700; color: var(--kp-cell, #1c5d99); }
.ab-node--center .ab-where { color: var(--kp-sun, #f5b301); }

/* ---------- Contact: map + how we follow up ---------- */
.ct-more { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.ct-map { border-radius: 14px; overflow: hidden; border: 1px solid var(--kp-line, #d8e1ea); min-height: 320px; background: #e8eef4; }
.ct-map iframe { display: block; width: 100%; height: 100%; min-height: 320px; border: 0; }
.ct-steps { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 8px; }

/* ---------- Footer note on inner pages ---------- */
.kp-footer-note a { color: #fff; }

@media (max-width: 980px) {
  .kp-solutions--v2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wz-layout { grid-template-columns: 1fr; }
  .wz-aside { position: static; }
  .wz-aside-photo { display: none; }
  .wz-aside > h2:first-of-type { margin-top: 20px; }
}

@media (max-width: 760px) {
  .kp-project-grid { grid-template-columns: 1fr; grid-template-rows: none; }
  .kp-project--lead { grid-row: auto; min-height: 280px; }
  .kp-project { min-height: 200px; }
  .ab-flow { grid-template-columns: 1fr; }
  .ab-flow::before { left: 50%; right: auto; top: 8%; bottom: 8%; width: 2px; height: auto; background: repeating-linear-gradient(180deg, var(--kp-line, #d8e1ea) 0 10px, transparent 10px 18px); }
  .ct-more { grid-template-columns: 1fr; }
  .kp-section-head { flex-direction: column; align-items: flex-start; gap: 4px; }
}

@media (max-width: 640px) {
  .kp-solutions--v2 { grid-template-columns: 1fr; }
  .kp-solutions--v2 .kp-sol--feature { grid-column: auto; }
  .kp-preview dd { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .kp-solutions--v2 .kp-sol { transition: none; }
}

/* ---------- Header dropdown submenus (nav.js builds .nav-group) ---------- */
.topbar .nav-group { position: relative; display: inline-flex; align-items: center; }
.topbar .nav-group > a { padding-right: 4px; }
.topbar .nav-sub-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; min-height: 44px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--kp-muted, #50637a); cursor: pointer;
}
.topbar .nav-sub-toggle svg { transition: transform 150ms ease; }
.topbar .nav-sub-toggle:hover { background: #eef3f8; color: var(--kp-navy, #0b2c4a); }
.topbar .nav-sub {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  min-width: 230px; padding: 8px;
  display: none; flex-direction: column; gap: 2px;
  background: #fff; border: 1px solid var(--kp-line, #d8e1ea); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(11, 44, 74, 0.14);
}
.topbar .nav-sub::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.topbar .nav-sub a { min-height: 40px; padding: 0 12px; font-size: 14.5px; font-weight: 600; border-radius: 8px; }
.topbar .nav-sub a[aria-current="page"] { box-shadow: none; background: #eef3f8; }

@media (min-width: 1081px) {
  .topbar .nav-group:hover > .nav-sub,
  .topbar .nav-group:focus-within > .nav-sub,
  .topbar .nav-group.is-open > .nav-sub { display: flex; }
  .topbar .nav-group:hover .nav-sub-toggle svg,
  .topbar .nav-group.is-open .nav-sub-toggle svg { transform: rotate(180deg); }
}

/* mobile menu: sub items always listed right under their parent */
@media (max-width: 1080px) {
  .topbar .nav-group { display: flex; flex-wrap: wrap; align-items: center; }
  .topbar .nav-group > a { flex: 1; }
  .topbar .nav-sub-toggle { display: none; }
  .topbar .nav-sub {
    position: static; display: flex; flex-basis: 100%; min-width: 0;
    margin: 0 0 6px 12px; padding: 0 0 0 10px;
    border: 0; border-left: 2px solid var(--kp-line, #d8e1ea); border-radius: 0; box-shadow: none;
  }
  .topbar .nav-sub::before { display: none; }
  .topbar .nav-sub a { min-height: 40px; color: var(--kp-muted, #50637a); }
}

@media (prefers-reduced-motion: reduce) {
  .topbar .nav-sub-toggle svg { transition: none; }
}

/* mobile menu longer than the screen: scroll inside, estimate CTA first */
@media (max-width: 1080px) {
  .topbar .nav.open { max-height: calc(100vh - 84px); max-height: calc(100dvh - 84px); overflow-y: auto; overscroll-behavior: contain; }
  .topbar .nav a.nav-cta { order: -1; margin: 0 0 8px; min-height: 48px; }
}

/* Hero: balanced headline; on wide screens let the right side of the image show */
.kp-hero h1 { text-wrap: balance; word-break: keep-all; }
@media (min-width: 981px) {
  .kp-hero-media::after {
    background: linear-gradient(90deg, rgba(8, 31, 53, 0.9) 0%, rgba(8, 31, 53, 0.72) 42%, rgba(8, 31, 53, 0.28) 72%, rgba(8, 31, 53, 0.18) 100%) !important;
  }
  .kp-hero-media img { object-position: 50% 45%; }
}
