/* Consistent spacing for every published project-post template. */
main.post-rhythm{--post-space:32px;--post-inset:24px;display:flex;flex-direction:column;gap:var(--post-space);min-width:0}
main.post-rhythm>header,main.post-rhythm>section,main.post-rhythm>aside,main.post-rhythm>.note,main.post-rhythm>.case-intro{margin-block:0}
main.post-rhythm>section>p{max-width:none;text-align:start;line-height:1.7;margin:0 0 16px}
main.post-rhythm>section>p:last-child{margin-bottom:0}
main.post-rhythm>.note,main.post-rhythm>.facts{padding:var(--post-inset);line-height:1.7}
main.post-rhythm .survey-pair>div,main.post-rhythm .editorial-grid>div,main.post-rhythm .survey-cta{padding:var(--post-inset)}
main.post-rhythm .survey-pair,main.post-rhythm .editorial-grid{gap:24px;align-items:stretch}
main.post-rhythm .survey-pair p,main.post-rhythm .editorial-grid p{max-width:none;line-height:1.7;margin:0 0 16px}
main.post-rhythm .survey-pair p:last-child,main.post-rhythm .editorial-grid p:last-child{margin-bottom:0}
main.post-rhythm .links{margin:20px 0 0}
main.post-rhythm.legacy-case{padding-block:var(--post-space)}
main.post-rhythm.legacy-case>section{padding-block:0!important;margin-block:0!important}
main.post-rhythm.legacy-case>section>.container{padding-block:0;min-width:0;width:100%}
main.post-rhythm.legacy-case .grid{align-items:stretch;gap:24px}
main.post-rhythm.legacy-case .card:not(.gallery){padding:var(--post-inset);min-width:0}
main.post-rhythm.legacy-case .card>p{max-width:none;text-align:start;line-height:1.7;margin:0 0 16px}
main.post-rhythm.legacy-case .card>:first-child{margin-top:0!important}
main.post-rhythm.legacy-case .card>:last-child{margin-bottom:0!important}
main.post-rhythm.legacy-case .grid>.card:has(>.btn){display:flex;flex-direction:column;align-items:flex-start}
main.post-rhythm.legacy-case .grid>.card>.btn{margin-top:auto}
main.post-rhythm.legacy-case .container>p:last-child{margin-bottom:0}
@media(max-width:800px){main.post-rhythm{--post-space:28px;--post-inset:20px}main.post-rhythm .survey-pair,main.post-rhythm .editorial-grid,main.post-rhythm.legacy-case .grid{gap:20px}}
/* Integrate the post ending with the common CTA instead of stacking padded wrappers. */
body:has(main.post-rhythm){--post-close-width:1160px;--post-close-inset:28px}
body:has(main.post-rhythm.case008){--post-close-width:940px;--post-close-inset:24px}
body:has(main.post-rhythm.legacy-case){--post-close-width:1100px}
main.post-rhythm{padding-bottom:28px!important}
body:has(main.post-rhythm) .footer-cta{padding:24px 0;margin:0}
body:has(main.post-rhythm) .footer-cta>.container{max-width:var(--post-close-width);width:100%;padding:0 var(--post-close-inset);margin:auto;text-align:left;display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:32px;row-gap:10px;align-items:center;box-sizing:border-box}
body:has(main.post-rhythm) .footer-cta h2{grid-column:1;grid-row:1;margin:0;font-size:26px;line-height:1.25}
body:has(main.post-rhythm) .footer-cta p{grid-column:1;grid-row:2;margin:0;font-size:16px;line-height:1.65;max-width:none}
body:has(main.post-rhythm) .footer-cta .cta-link{grid-column:2;grid-row:1 / span 2;margin:0;justify-self:end}
main.post-rhythm .survey-pair,main.post-rhythm .editorial-grid{row-gap:16px}
main.post-rhythm .survey-pair>div{display:grid;grid-template-rows:subgrid;grid-row:span 3;row-gap:16px}
main.post-rhythm .editorial-grid>div{display:grid;grid-template-rows:subgrid;grid-row:span 2;row-gap:14px}
main.post-rhythm .survey-pair>div>h3,main.post-rhythm .editorial-grid>div>h3{min-height:0;margin:0;text-wrap:pretty}
main.post-rhythm .survey-pair>div>p,main.post-rhythm .editorial-grid>div>p{margin:0;max-width:none}
main.post-rhythm.legacy-case .grid>.card>.btn{margin-top:4px}
@media(max-width:800px){body:has(main.post-rhythm){--post-close-inset:20px}main.post-rhythm{padding-bottom:24px!important}body:has(main.post-rhythm) .footer-cta{padding:22px 0}body:has(main.post-rhythm) .footer-cta>.container{grid-template-columns:1fr;gap:14px}body:has(main.post-rhythm) .footer-cta .cta-link{grid-column:1;grid-row:3;justify-self:start}main.post-rhythm .survey-pair>div,main.post-rhythm .editorial-grid>div{display:block}main.post-rhythm .survey-pair>div>h3,main.post-rhythm .editorial-grid>div>h3{margin-bottom:14px}main.post-rhythm .survey-pair>div>p+p{margin-top:16px}}
body:has(main.post-rhythm) .footer-news{padding:24px 0;margin:0}
body:has(main.post-rhythm) .footer-news>.container{max-width:var(--post-close-width);width:100%;padding:0 var(--post-close-inset);margin:auto;box-sizing:border-box}
body:has(main.post-rhythm) .footer-news .news-card{max-width:none;margin:0;padding:24px;box-shadow:none;border-radius:12px}
@media(max-width:800px){body:has(main.post-rhythm) .footer-news{padding:22px 0}body:has(main.post-rhythm) .footer-news .news-card{padding:20px}}

/* One horizontal system for project posts, including Castalla and legacy wrappers. */
body:has(main.post-rhythm){--post-close-width:1160px;--post-close-inset:28px}
body:has(main.post-rhythm.case008),body:has(main.post-rhythm.legacy-case){--post-close-width:1160px;--post-close-inset:28px}
main.post-rhythm.project-case{box-sizing:border-box;width:100%;max-width:1160px;margin-inline:auto;padding-inline:28px}
main.post-rhythm.project-case>header{max-width:none}
main.post-rhythm.legacy-case>section>.container,body:has(main.post-rhythm.legacy-case)>header.hero>.container{box-sizing:border-box;width:100%;max-width:1160px;padding-inline:28px}
main.post-rhythm .plans,main.post-rhythm .editorial-grid,main.post-rhythm .survey-pair{column-gap:24px}
main.post-rhythm .survey-cta{padding:0;border:0;border-radius:0;background:none}
main.post-rhythm .editorial-grid>div,main.post-rhythm .survey-pair>div{padding:var(--post-inset)}
@media(max-width:800px){
body:has(main.post-rhythm),body:has(main.post-rhythm.case008),body:has(main.post-rhythm.legacy-case){--post-close-inset:20px}
main.post-rhythm.project-case,main.post-rhythm.legacy-case>section>.container,body:has(main.post-rhythm.legacy-case)>header.hero>.container{padding-inline:20px}
main.post-rhythm .plans,main.post-rhythm .editorial-grid,main.post-rhythm .survey-pair{column-gap:20px}
}

/* Match the opening block to the shared content edges in both post templates. */
main.post-rhythm.project-case>header{width:100%;box-sizing:border-box}
main.post-rhythm.project-case>header>h1,main.post-rhythm.project-case>header>.lead{width:100%;max-width:none;box-sizing:border-box}
body:has(main.post-rhythm.legacy-case)>header.hero>.container>.panel{display:block;width:100%;max-width:none;box-sizing:border-box}
body:has(main.post-rhythm.legacy-case)>header.hero>.container>.panel>h1,body:has(main.post-rhythm.legacy-case)>header.hero>.container>.panel>p{max-width:none!important}

/* A quieter editorial ending: local references, project sequence, then contact. */
main.post-rhythm.project-case .links{display:block;margin:20px 0 0;padding:16px 0 0;border-top:1px solid #e5dfd6;font-size:14px;line-height:1.9;color:#68635d}
main.post-rhythm.project-case .links a{display:inline;margin:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;color:#87522b;font-weight:500;line-height:inherit;text-decoration:underline;text-decoration-color:#c7ac95;text-underline-offset:3px}
main.post-rhythm.project-case .links a:hover{background:none;color:#603b20;text-decoration-color:currentColor}
main.post-rhythm.project-case .project-pagination{gap:0;padding:0;border-top:1px solid #ded8cf;border-bottom:1px solid #ded8cf}
main.post-rhythm.project-case .project-pagination a{display:flex;flex-direction:column;justify-content:center;min-width:0;padding:22px 24px 22px 0;border:0;border-radius:0;background:transparent;box-shadow:none;font-size:16px;line-height:1.5}
main.post-rhythm.project-case .project-pagination a+a{padding:22px 0 22px 24px;border-left:1px solid #ded8cf;text-align:right;align-items:flex-end}
main.post-rhythm.project-case .project-pagination span{font-size:12px;letter-spacing:.04em;margin-bottom:6px;color:#87522b}
main.post-rhythm.project-case .project-pagination a:hover{background:rgba(255,255,255,.45);color:#603b20}
body:has(main.post-rhythm) .footer-cta{background:rgba(255,255,255,.4);border:0;padding:28px 0}
body:has(main.post-rhythm) .footer-cta h2{font-size:24px;line-height:1.3}
body:has(main.post-rhythm) .footer-news{background:transparent;border:0;padding:0 0 28px}
body:has(main.post-rhythm) .footer-news .news-card{border:0;border-top:1px solid #ded8cf;border-radius:0;background:transparent;padding:28px 0;box-shadow:none}
@media(max-width:700px){
main.post-rhythm.project-case .project-pagination{grid-template-columns:1fr;gap:0}
main.post-rhythm.project-case .project-pagination a{padding:18px 0}
main.post-rhythm.project-case .project-pagination a+a{padding:18px 0;border-left:0;border-top:1px solid #e5dfd6;text-align:left;align-items:flex-start}
main.post-rhythm.project-case .links{margin-top:16px;padding-top:14px;line-height:2}
body:has(main.post-rhythm) .footer-cta{padding:24px 0}
body:has(main.post-rhythm) .footer-news{padding-bottom:20px}
body:has(main.post-rhythm) .footer-news .news-card{padding:24px 0}
}
