/* Greenmoral v5 · content.css
   Page-scoped styles for the reference and knowledge sections (agent C2):
   /projekt/**, /kundprojekt/**, /kunskap/**. Loaded via <!--@head--> on those pages only.
   Uses the tokens and grounds from site.css; never overrides shared components globally. */

/* ---------- project hero ---------- */
.plogo { display: inline-flex; align-items: center; justify-content: center; height: 3.4rem; padding: 0 1rem; margin-bottom: 1.4rem; background: #fff; border-radius: 14px; box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 0.4rem 1.2rem -0.6rem rgba(0,0,0,.25); }
.plogo img { display: block; width: auto; height: 1.7rem; max-width: 10rem; object-fit: contain; }
.plogo--tall { height: 4.4rem; padding: 0 0.7rem; }
.plogo--tall img { height: 3.6rem; }
.plogo--text { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; color: var(--ink); }
.phero .plogo + .eyebrow { margin-top: 0; }
.phero__media--tall { aspect-ratio: 4 / 5; }
.phero__media figcaption, .pfig figcaption { margin-top: 0.6rem; font-size: 0.85rem; color: var(--sub); }
.phero__media.has-cap { aspect-ratio: auto; background: none; overflow: visible; border-radius: 0; }
.phero__media.has-cap img, .phero__media.has-cap video { border-radius: var(--radius); aspect-ratio: 4 / 3; height: auto; }
.phero__media--tall.has-cap img, .phero__media--tall.has-cap video { aspect-ratio: 4 / 5; }
@media (max-width: 959px) { .phero__media--tall.has-cap img, .phero__media--tall.has-cap video { aspect-ratio: 4 / 3.6; } }

/* ---------- facts box ---------- */
.pfacts { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr)); }
.pfacts .stat { border-top: 0; background: var(--card); border-radius: var(--radius-s); padding: 1.6rem 1.6rem 1.7rem; }
.pfacts .stat b { font-size: clamp(2.2rem, 3.4vw, 3rem); }
.pfacts .stat--word b { font-size: clamp(1.8rem, 2.6vw, 2.3rem); letter-spacing: -0.035em; }
.pnote { margin: 1.4rem 0 0; max-width: 72ch; font-size: 0.9rem; line-height: 1.55; color: var(--sub); }
.pnote a { color: inherit; text-decoration: underline; text-underline-offset: 0.15em; }

/* fact table used next to prose (project facts, requirements) */
.ptable { margin-top: 0; }
.ptable th[scope="row"] { width: 42%; color: var(--sub); font-weight: 500; }
.lt .ptable, .ms .table.ptable { background: var(--card); }

/* ---------- photo gallery ---------- */
.pgal { display: grid; gap: 1.25rem; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.pgal--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pgal figure { margin: 0; }
.pgal img, .pgal video { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-s); background: var(--card); }
.pgal--tall img, .pgal--tall video { aspect-ratio: 3 / 4; }
.pgal figcaption { margin-top: 0.6rem; font-size: 0.85rem; line-height: 1.45; color: var(--sub); }
.pgal figcaption b { color: var(--ink); font-weight: 600; margin-right: 0.35rem; }
@media (max-width: 900px) { .pgal { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pgal > :nth-child(3):last-child { grid-column: 1 / -1; } .pgal > :nth-child(3):last-child img { aspect-ratio: 16 / 9; } .pgal--tall > :nth-child(3):last-child img { aspect-ratio: 4 / 3; } }
@media (max-width: 560px) { .pgal, .pgal--2 { grid-template-columns: 1fr; } .pgal > :nth-child(3):last-child img { aspect-ratio: 4 / 3; } .pgal--tall img { aspect-ratio: 4 / 4.4; } }

/* text + media split used inside project pages */
.pfig { margin: 0; }
.pfig img, .pfig video { display: block; width: 100%; height: auto; border-radius: var(--radius); background: var(--card); }
.psplit { display: grid; gap: clamp(2.5rem, 5vw, 5rem); align-items: start; }
@media (min-width: 960px) { .psplit { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } .psplit--media-left > :first-child { order: 2; } }
.psplit .prose { max-width: 62ch; }
.psplit .prose > h2:first-child { margin-top: 0; }

/* process row: numbered steps in one line on desktop */
.pproc { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(7.6rem, 1fr)); counter-reset: p; }
.pproc li { background: var(--card); border-radius: 14px; padding: 0.9rem 1rem; font-weight: 600; font-size: 0.95rem; color: var(--ink); line-height: 1.25; }
.pproc li::before { counter-increment: p; content: "0" counter(p); display: block; font-size: 0.78rem; font-weight: 600; color: var(--blue-d); margin-bottom: 0.25rem; }
@media (max-width: 420px) { .pproc { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.prose .pproc { padding-left: 0; }
.prose .pproc li { margin: 0; }

/* before/after kWh comparison bars */
.pbars { margin: 1.6rem 0 0; display: grid; gap: 1rem; }
.pbars__row { display: grid; gap: 0.45rem; }
.pbars__row span { font-size: 0.9rem; color: var(--sub); }
.pbars__row i { display: block; height: 0.9rem; border-radius: 99px; background: #C7C7CC; width: var(--w, 100%); }
.pbars__row--new i { background: var(--blue-d); }
.pbars__row b { font-size: 1.1rem; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; color: var(--ink); }
.pbars__diff { border-top: 1px solid var(--line); padding-top: 0.9rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: 0.95rem; }
.pbars__diff b { color: var(--blue-d); font-variant-numeric: tabular-nums; }

/* customer quote (only real, published quotes) */
.pquote { max-width: 860px; margin: 0 auto; }
.pquote blockquote { margin: 0; font-family: var(--font-display); font-size: clamp(1.25rem, 1rem + 1vw, 1.7rem); line-height: 1.38; letter-spacing: -0.02em; font-weight: 500; }
.pquote blockquote p { margin: 0 0 1em; }
.pquote blockquote p:last-child { margin-bottom: 0; }
.pquote figcaption { margin-top: 1.8rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: 0.95rem; color: var(--sub); }
.pquote figcaption b { display: block; color: var(--ink); font-weight: 600; }
.pquote figcaption img { height: 1.4rem; width: auto; }

/* ---------- project hub: filter + grid ---------- */
.pfilter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 clamp(1.8rem, 3vw, 2.6rem); padding: 0; border: 0; }
.pfilter legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pfilter input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pfilter label { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.15rem; border-radius: 99px; background: var(--white); color: var(--ink); font-size: 0.95rem; font-weight: 500; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); transition: background 200ms var(--ease), color 200ms var(--ease); }
.pfilter input:checked + label { background: var(--ink); color: #fff; box-shadow: none; }
.pfilter input:focus-visible + label { outline: 2px solid var(--blue-d); outline-offset: 3px; }
@media (hover: hover) { .pfilter label:hover { box-shadow: inset 0 0 0 1px rgba(0,0,0,.28); } }
.pgrid { display: grid; gap: 1.25rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .pgrid { grid-template-columns: 1fr; } }
.pgrid .card__img { aspect-ratio: 4 / 3; }
.pgrid .card__b .n { font-size: 2.6rem; }
.pgrid .card__b .n--word { font-size: 2rem; }
/* CSS-only filter (no script, CSP-safe). Browsers without :has() simply show every card. */
body:has(#pf-butik:checked) .pgrid > :not([data-typ~="butik"]),
body:has(#pf-lager:checked) .pgrid > :not([data-typ~="lager"]),
body:has(#pf-kontor:checked) .pgrid > :not([data-typ~="kontor"]) { display: none; }

/* summary table on the hub */
.psum td:first-child a { color: var(--ink); font-weight: 600; text-decoration: none; }
.psum td:first-child a:hover { text-decoration: underline; }

/* ---------- knowledge articles ---------- */
.kmeta { margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; font-size: 0.88rem; color: var(--sub); }
.kshort { position: relative; background: var(--card); border-radius: var(--radius-s); padding: 1.5rem 1.7rem 1.6rem; margin: 0 0 2.4rem; border-left: 4px solid var(--blue-d); }
.kshort h2 { margin: 0 0 0.5rem !important; font-size: 0.85rem !important; letter-spacing: 0.02em !important; text-transform: uppercase; color: var(--blue-d) !important; line-height: 1.3 !important; }
.kshort p { margin: 0 0 0.7em; color: var(--ink); font-size: 1.08rem; line-height: 1.6; }
.kshort p:last-child, .kshort ul:last-child { margin-bottom: 0; }
.kshort ul { margin: 0.4rem 0 0; }
.prose .ans { font-weight: 500; color: var(--ink); }
.kgrid { max-width: 1160px; margin: 0 auto; display: grid; gap: clamp(2.5rem, 5vw, 4.5rem); }
@media (min-width: 1100px) { .kgrid { grid-template-columns: minmax(0, 1fr) 17rem; } .kside { position: sticky; top: calc(var(--nav-h) + 2rem); align-self: start; } }
.kgrid .prose { max-width: 70ch; }
.kside { display: grid; gap: 1.25rem; align-content: start; }
.kside .toc { background: var(--card); }
.kside .toc p, .kside .kbox p { margin: 0; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--sub); }
.kside .toc ol { margin: 0.6rem 0 0; padding-left: 1.1em; line-height: 1.45; }
.kside .toc li { margin: 0.35rem 0; }
.kside .toc a { text-decoration: none; }
.kside .toc a:hover { text-decoration: underline; }
.kbox { background: var(--card); border-radius: var(--radius-s); padding: 1.3rem 1.5rem; font-size: 0.95rem; }
.kbox ul { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.kbox li { margin: 0.5rem 0 0; line-height: 1.4; }
.kbox a { color: var(--blue-d); text-decoration: none; font-weight: 500; }
.kbox a:hover { text-decoration: underline; }
.kbox .pill { margin-top: 0.9rem; }
@media (max-width: 1099px) { .kside { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); } .kside .toc { display: none; } }
.ksrc { font-size: 0.92rem; }
.ksrc li { margin: 0.5em 0; }
.prose .table td, .prose .table th { font-size: 0.93rem; }
.prose .callout p { margin: 0 0 0.6em; }
.prose .callout p:last-child { margin-bottom: 0; }
.prose .callout h3 { margin-top: 0; }
.prose .kcalc { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }

/* knowledge hub list */
.klist { display: grid; gap: 1.25rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .klist { grid-template-columns: 1fr; } }
.klist .lcard__b { padding: 1.8rem 1.9rem 2rem; }
.klist .lcard h2, .klist .lcard h3 { font-size: 1.45rem; letter-spacing: -0.022em; line-height: 1.15; }
.klist + .sec-head { margin-top: clamp(3rem, 6vw, 4.5rem); }
.klist .lcard__b p:not(.lcard__k) { font-size: 1rem; }

/* next-step tile next to related project cards */
.pnext { position: relative; border-radius: var(--radius); background: var(--ink); color: #F5F5F7; padding: 2rem 1.9rem 2.1rem; display: flex; flex-direction: column; text-decoration: none; min-height: 100%; }
.pnext small { font-size: 0.85rem; font-weight: 600; color: var(--blue); }
.pnext h3 { font-size: 1.6rem; letter-spacing: -0.025em; line-height: 1.12; margin-top: 0.6rem; color: #fff; }
.pnext p { margin: 0.8rem 0 0; color: #C7C7CC; font-size: 0.97rem; line-height: 1.5; }
.pnext .more { margin-top: auto; padding-top: 1.4rem; color: var(--blue); }
.pnext ul { list-style: none; margin: 1rem 0 1.6rem; padding: 0; display: grid; gap: 0.55rem; }
.pnext li a { color: #fff; text-decoration: underline; text-underline-offset: 0.15em; text-decoration-color: rgba(255,255,255,.4); font-size: 0.97rem; }
.pnext li a:hover { text-decoration-color: currentColor; }
.pnext .pill { align-self: flex-start; margin-top: auto; }
.pnext .pnext__alt { margin-top: 0.9rem; font-size: 0.92rem; }
.pnext .pnext__alt a { color: var(--blue); }

/* logo wall inside a split column (project hub) */
.psplit .logos__h { text-align: left; margin: 0 0 1.2rem; }
.psplit .logos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.psplit .logos li { background: var(--white); }

.psplit .pquote blockquote { font-size: clamp(1.1rem, 0.95rem + 0.5vw, 1.32rem); line-height: 1.45; }
.psplit .pquote { margin: 0; padding-top: 0.4rem; }

/* tablet balance: no orphan tiles */
.pfacts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pfacts:has(> :nth-child(4)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .pfacts:has(> :nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .pfacts, .pfacts:has(> :nth-child(4)) { grid-template-columns: 1fr; } }
@media (min-width: 641px) and (max-width: 1000px) { .pgrid > .pnext:first-child { grid-column: 1 / -1; min-height: 0; } }
@media (min-width: 560px) and (max-width: 899px) { .psteps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .psteps .step { padding: 1.7rem; } }
@media (max-width: 1099px) { .kgrid { max-width: 760px; } }
@media (max-width: 959px) { .pfig img { aspect-ratio: 4 / 3; object-fit: cover; } }
.kgrid { grid-template-columns: minmax(0, 1fr); } @media (min-width: 1100px) { .kgrid { grid-template-columns: minmax(0, 1fr) 17rem; } }
.ksrc li, .ksrc a { overflow-wrap: anywhere; }
/* projekt hub: 8 logos, 4 per row (2 on phone) */
.psplit .logos--8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .psplit .logos--8 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
