/* Original Endorze layouts. All content remains in the shared semantic renderer. */
.document-page { position:relative; }
.preview-watermark { position:absolute; inset:0; z-index:5; pointer-events:none; user-select:none; background-image:url('../images/preview-watermark.svg'); background-repeat:repeat; background-size:285px 180px; }
.template-minimal .document-head { border:0; margin-bottom:44px; }
.template-minimal h2 { color:#202d36; font-weight:400; }
.template-minimal .document-contact,.template-compact .document-contact,.template-centered .document-contact,.template-framed .document-contact { display:flex; flex-wrap:wrap; gap:4px 18px; }
.template-minimal .document-section h3 { font-size:var(--body-size); letter-spacing:2px; text-transform:uppercase; }
.template-minimal .document-section { margin-top:36px; }
.template-executive .document-head { border-top:5px solid var(--cv-accent); border-bottom:4px double var(--cv-accent); padding-top:25px; }
.template-executive .document-section h3 { background:color-mix(in srgb,var(--cv-accent) 9%,white); padding:8px 12px; text-transform:uppercase; letter-spacing:1px; }
.template-centered .document-head,.template-centered .document-section h3 { text-align:center; }
.template-centered .document-contact,.template-framed .document-contact { justify-content:center; }
.template-centered .document-head { border:0; }
.template-centered .document-section h3 { display:flex; align-items:center; gap:18px; }
.template-centered .document-section h3:before,.template-centered .document-section h3:after { content:''; height:1px; background:#c5cdd2; flex:1; }
.template-ledger .document-head { padding-left:155px; border-bottom:5px solid var(--cv-accent); }
.template-ledger .document-job { display:grid; grid-template-columns:130px minmax(0,1fr); gap:25px; }
.template-ledger .document-job>.job-dates { color:var(--cv-accent); border-right:1px solid #cbd4d7; padding-right:15px; }
.template-ledger .document-section h3 { text-transform:uppercase; letter-spacing:1px; border-bottom:1px solid #cbd4d7; padding-bottom:8px; }
.template-ribbon .document-head { border:0; border-left:12px solid var(--cv-accent); padding:12px 0 12px 25px; }
.template-ribbon .document-section h3 { color:white; background:var(--cv-accent); padding:8px 16px; }
.template-framed { border:1px solid var(--cv-accent); outline:7px solid white; outline-offset:-9px; padding:50px; }
.template-framed .document-head { text-align:center; border-bottom:4px double var(--cv-accent); }
.template-framed h2 { font-weight:400; }
.template-framed .document-section h3 { border-bottom:1px solid var(--cv-accent); padding-bottom:6px; font-variant:small-caps; }
.template-horizon { padding:0 50px 50px; }
.template-horizon .document-head { display:flex; align-items:center; gap:28px; padding:42px 50px; margin:0 -50px 30px; border-bottom:8px solid var(--cv-accent); background:color-mix(in srgb,var(--cv-accent) 10%,white); }
.template-horizon .portrait,.template-portfolio .portrait { width:148px; height:148px; border-radius:50%; }
.template-horizon .portrait-button { border-radius:50%; overflow:hidden; flex-shrink:0; }
.template-horizon .document-section h3 { border-bottom:1px solid #c6d3d5; padding-bottom:9px; }
.template-monogram { position:relative; }
.identity-seal { position:absolute; top:58px; left:60px; width:90px; height:90px; display:grid; place-items:center; border:2px solid var(--cv-accent); border-radius:50%; font-size:28px; color:var(--cv-accent); }
.template-monogram .document-head { padding-left:120px; border:0; min-height:110px; }
.template-monogram .document-section h3 { border-top:1px solid #c6d3d5; padding-top:12px; letter-spacing:1px; }
.template-compact { padding:38px 44px; line-height:1.35; }
.template-compact h2 { font-size:25pt; margin-bottom:5px; }
.template-compact .document-title { margin-bottom:5px; }
.template-compact .document-head { padding-bottom:13px; margin-bottom:18px; }
.template-compact .document-section { margin-top:16px; }
.template-compact .document-section h3 { border-bottom:1px solid #c6d3d5; margin-bottom:8px; font-size:calc(var(--heading-size) * .9); }
.template-compact .document-job { margin-bottom:12px; }
.template-portfolio .document-head { display:flex; align-items:center; gap:30px; border-bottom:0; }
.template-portfolio .portrait { width:165px; height:200px; border-radius:80px 80px 8px 8px; }
.template-portfolio .portrait-button { border-radius:80px 80px 8px 8px; overflow:hidden; flex-shrink:0; }
.template-portfolio .document-sections { counter-reset:cv-section; }
.template-portfolio .document-section h3 { display:flex; align-items:center; gap:15px; border-bottom:1px solid #c6d3d5; padding-bottom:8px; }
.template-portfolio .document-section h3:before { counter-increment:cv-section; content:counter(cv-section,decimal-leading-zero); font-size:.8em; font-weight:400; color:var(--cv-accent); }
/* Profile, summary, skills and structured links form the secondary column. */
.layout-rail { --rail-width:270px; display:grid; grid-template-columns:var(--rail-width) minmax(0,1fr); padding:0; position:relative; isolation:isolate; }
.layout-rail .document-head { border:0; margin:0; padding:55px 26px 35px; background:var(--cv-accent); color:white; min-width:0; }
.layout-rail .document-sections { padding:48px 32px; min-width:0; }
.layout-rail .document-head .document-section { margin-top:32px; }
.layout-rail .document-head h3 { color:inherit; border-bottom:2px solid currentColor; padding-bottom:8px; }
.layout-rail .document-head .document-contact { color:inherit; margin:24px 0; }
.layout-rail .document-head .document-contact p { margin:8px 0; }
.layout-rail .document-head .document-section { font-size:.9em; }
.layout-rail .document-head .document-social-links { display:block; }
.layout-rail .document-head .document-social-links li { margin:8px 0; background:#ffffffed; color:#263640; }
.layout-rail .document-head .document-languages li { padding:9px 0; }
.layout-rail .document-head .document-languages li:nth-child(even) { background:#ffffff14; }
.layout-rail .document-head .rating-dot { border-color:currentColor; }
.layout-rail .document-head .rating-dot.filled { background:currentColor; }
.layout-rail .document-head .competency-level { color:inherit; border-color:currentColor; }
.layout-rail .portrait { width:180px; height:180px; border-radius:50%; border:4px solid white; }
.layout-rail .portrait-button { display:block; width:fit-content; margin:0 auto; border-radius:50%; overflow:hidden; }
.layout-rail .document-head>.portrait { margin:0 auto; }
.rail-name { margin-bottom:32px; min-height:155px; display:flex; flex-direction:column; justify-content:center; }
.layout-rail .document-sections .document-section h3 { border-top:3px solid var(--cv-accent); padding-top:9px; }
.template-split .document-head { background:linear-gradient(to bottom,var(--cv-accent) 0 145px,#555b60 145px); }
.template-split .portrait { border-color:var(--cv-accent); }
.template-atelier { padding:25px; gap:30px; --rail-width:235px; }
.template-atelier .document-head { background:color-mix(in srgb,var(--cv-accent) 9%,white); color:#263640; border-radius:115px 115px 0 0; padding:30px 22px; }
.template-atelier .portrait { width:180px; height:180px; border-color:white; }
.template-atelier .document-sections { padding:35px 0; }
.template-atelier .document-head h3 { color:var(--cv-accent); border-width:1px; }
.template-atelier .document-sections h2 { font-weight:400; }
.template-column-right { grid-template-columns:minmax(0,1fr) var(--rail-width); }
.template-column-right .document-head { grid-column:2; grid-row:1; }
.template-column-right .document-sections { grid-column:1; grid-row:1; }
.template-column-right .portrait { border-radius:12px; height:210px; }
.template-column-right .portrait-button { border-radius:12px; }
.template-balance { --rail-width:397px; }
.template-balance .document-head { padding:45px 35px; background:color-mix(in srgb,var(--cv-accent) 14%,white); color:#263640; }
.template-balance .portrait { width:210px; height:210px; border:5px double var(--cv-accent); }
.template-balance .document-head h3 { color:var(--cv-accent); border-width:1px; }
.template-balance .document-sections { padding:45px 28px; }
.template-balance .document-sections h2 { font-size:28pt; }
/* Fit a real A4 document to its canvas; desktop default is 120% (formerly 80%). */
@media screen {
    .studio-canvas { overflow:visible; }
    .paper-zoom { width:794px; zoom:var(--preview-scale,.35); margin:auto; }
    .canvas-caption { width:min(100%,952px); }
    .studio-templates { align-self:start; position:sticky; top:164px; max-height:calc(100vh - 164px); overflow-y:auto; }
    .color-palette { display:grid; grid-template-columns:repeat(5,29px); justify-content:space-between; max-width:260px; }
    .template-filter { display:grid; gap:7px; font-size:12px; margin:15px 0; }
    .template-filter select { width:100%; min-width:0; padding:9px; border:1px solid #cdd8df; border-radius:5px; color:#193c50; background:white; }
    .template-thumbnail { aspect-ratio:210/297; height:auto; container-type:inline-size; }
    .template-thumbnail .document-page { transform:none; zoom:calc(100cqw / 794px); }
    .catalog-preview { aspect-ratio:210/297; height:auto; container-type:inline-size; }
    .catalog-preview .document-page { transform:none; zoom:calc(100cqw / 794px); }
}
@media screen and (max-width:950px) { .studio-templates { position:static; max-height:none; } }
@media screen and (max-width:600px) {
    .studio-sections nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); overflow:visible; }
    .section-link { width:100%; min-width:0; }
    .studio-flow-steps { flex-wrap:wrap; gap:8px; }
    .template-gallery { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media print {
    /* Only an access-restricted CV has this overlay; retain it in browser printing. */
    .preview-watermark { display:block; position:fixed; print-color-adjust:exact; -webkit-print-color-adjust:exact; }
    .template-horizon .document-head { margin:0 0 25px; padding:25px; }
    .template-framed { padding:20px; }
    .identity-seal { top:0; left:0; }
    .layout-rail { --rail-width:240px; display:grid; }
    .layout-rail::before { content:''; position:fixed; top:0; bottom:0; left:0; width:var(--rail-width); background:var(--cv-accent); z-index:-1; }
    .layout-rail .document-head { background:transparent; padding:35px 22px; }
    .layout-rail .document-sections { padding:30px 24px; }
    .template-split::before { background:linear-gradient(to bottom,var(--cv-accent) 0 125px,#555b60 125px); }
    .template-atelier { padding:0; gap:25px; --rail-width:225px; }
    .template-atelier::before { background:color-mix(in srgb,var(--cv-accent) 9%,white); }
    .template-atelier .document-sections { padding:30px 0; }
    .template-column-right::before { left:auto; right:0; }
    .template-balance { --rail-width:50%; }
    .template-balance::before { background:color-mix(in srgb,var(--cv-accent) 14%,white); }
    .template-balance .document-sections h2 { font-size:25pt; }
}

/* The paper layer repeats on each printed page, underneath template panels. */
.document-page { background:var(--paper-color,#fff)!important; isolation:isolate; }
.paper-background { position:absolute; inset:0; background:var(--paper-color,#fff); z-index:-2; pointer-events:none; }
@media print {
    .document-page { background:transparent!important; }
    .paper-background { position:fixed; inset:0; print-color-adjust:exact; -webkit-print-color-adjust:exact; }
}
