/* ==========================================================================
   Nordic Compact Template (Refined Production Styles)
   Target: toolsgrid.online
   Key: nordic
   ========================================================================== */

#nordicPreview,
.tpl-nordic {
    width: 210mm;
    min-height: 297mm;
    box-sizing: border-box;
    background-color: #ffffff !important;
    color: #0f172a !important;
    padding: 12mm 16mm 14mm 16mm;
    margin: 0 auto;
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
}

/* Nordic Top Accent Strip */
.nordic-top-bar {
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #0d9488 0%, #14b8a6 60%, #cbd5e1 100%);
    border-radius: 2px;
    margin-bottom: 12px;
}

/* Header: Clean Linear Flow (Zero Truncation) */
.nordic-header {
    width: 100%;
    padding-bottom: 10px;
    border-bottom: 1.5px solid #0f172a;
    margin-bottom: 14px;
    box-sizing: border-box;
}

.nordic-top-identity-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.nordic-identity {
    flex: 1 1 auto;
    min-width: 0;
}

.nordic-name {
    font-size: calc(24px * var(--resume-font-scale, 1)) !important;
    font-weight: 800 !important;
    letter-spacing: -0.3px !important;
    color: #0f172a !important;
    line-height: 1.15 !important;
    margin: 0 !important;
}

.nordic-title {
    font-size: calc(12.5px * var(--resume-font-scale, 1)) !important;
    font-weight: 600 !important;
    color: #0d9488 !important; /* Nordic Teal */
    margin-top: 3px !important;
    letter-spacing: 0.3px !important;
}

/* Horizontal Full Contact Bar (No Truncation, Never Cuts Text) */
.nordic-contact-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #f1f5f9;
    font-size: calc(10px * var(--resume-font-scale, 1));
    color: #475569;
    width: 100%;
}

.nordic-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.nordic-contact-item span {
    white-space: nowrap;
    font-size: calc(10px * var(--resume-font-scale, 1));
    color: #475569;
}

.nordic-contact-item svg,
.nordic-contact-item i {
    width: 12px;
    height: 12px;
    min-width: 12px;
    stroke: #0d9488;
    flex-shrink: 0;
}

.nordic-photo-wrapper {
    width: 72px;
    height: 72px;
    min-width: 72px;
    min-height: 72px;
    border-radius: 8px;
    border: 1.5px solid #0d9488;
    overflow: hidden;
    flex-shrink: 0;
    margin-left: 14px;
    aspect-ratio: 1 / 1;
}

.nordic-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Section Containers & Headings */
.nordic-section {
    margin-top: 12px;
    break-inside: auto;
    page-break-inside: auto;
}

.nordic-section-heading {
    font-size: calc(11px * var(--resume-font-scale, 1)) !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 1.2px !important;
    color: #0f172a !important;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    break-after: avoid;
    page-break-after: avoid;
}

.nordic-section-heading::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: #e2e8f0;
}

/* Summary */
.nordic-summary {
    font-size: calc(10.5px * var(--resume-font-scale, 1));
    color: #334155;
    line-height: 1.5;
    margin: 0;
}

/* Experience Timeline */
.nordic-exp-timeline {
    border-left: 1.5px solid #e2e8f0;
    margin-left: 4px;
    padding-left: 14px;
}

.nordic-exp-item {
    position: relative;
    margin-bottom: 12px;
    break-inside: auto;
    page-break-inside: auto;
}

.nordic-exp-item::before {
    content: "";
    position: absolute;
    left: -18px;
    top: 5px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #0d9488;
    border: 1.5px solid #ffffff;
    box-sizing: border-box;
}

.nordic-exp-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    width: 100%;
    break-after: avoid;
    page-break-after: avoid;
}

.nordic-role-company-wrap {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.35;
}

.nordic-role {
    font-size: calc(11px * var(--resume-font-scale, 1));
    font-weight: 700;
    color: #0f172a;
}

.nordic-company {
    font-size: calc(10.5px * var(--resume-font-scale, 1));
    color: #0d9488;
    font-weight: 600;
    margin-left: 3px;
}

.nordic-dates {
    font-size: calc(9.5px * var(--resume-font-scale, 1));
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: right;
}

.nordic-bullets {
    list-style-type: disc !important;
    list-style-position: outside !important;
    margin: 4px 0 0 16px !important;
    padding: 0 !important;
}

.nordic-bullets li {
    font-size: calc(10.5px * var(--resume-font-scale, 1)) !important;
    color: #334155 !important;
    line-height: 1.42 !important;
    margin-bottom: 2.5px !important;
}

/* 2-Column Split: Education & Skills */
.nordic-grid-2col {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
    margin-top: 10px !important;
}

.nordic-edu-item {
    margin-bottom: 6px;
}

.nordic-edu-degree {
    font-size: calc(11px * var(--resume-font-scale, 1));
    font-weight: 700;
    color: #0f172a;
}

.nordic-edu-meta {
    font-size: calc(10px * var(--resume-font-scale, 1));
    color: #64748b;
}

/* Badge Skills */
.nordic-skills-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 4px;
}

.nordic-skill-badge {
    display: inline-block;
    padding: 2.5px 7px;
    background-color: #f0fdfa;
    border: 1px solid #ccfbf1;
    color: #0f766e;
    font-size: calc(9.5px * var(--resume-font-scale, 1));
    font-weight: 600;
    border-radius: 4px;
    line-height: 1.25;
}

.nordic-lang-text {
    font-size: calc(10.5px * var(--resume-font-scale, 1));
    color: #334155;
    line-height: 1.4;
}

/* ==========================================================================
   FORCE ZERO BROWSER MARGINS IN PRINT ENGINE
   Overrides Chrome/Edge/Firefox 'Default' margin behavior automatically.
   ========================================================================== */
@page {
    size: A4 portrait;
    margin: 0 !important; /* Forces browser default margins to zero */
}

/* Print Engine Standard for Nordic */
@media print {
    body.print-nordic {
        margin: 0 !important;
        padding: 0 !important;
        background-color: #ffffff !important;
    }

    body.print-nordic #template-nordic {
        display: block !important;
        width: 100% !important;
    }

    body.print-nordic #template-classic,
    body.print-nordic #template-modern,
    body.print-nordic #template-executive,
    body.print-nordic #template-tech,
    body.print-nordic #template-creative,
    body.print-nordic #template-ivy,
    body.print-nordic #template-corporate {
        display: none !important;
    }

    body.print-nordic #nordicPreview {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        box-shadow: none !important;
        border: none !important;
    }

    body.print-nordic .print-layout-table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    body.print-nordic thead {
        display: table-header-group !important;
    }

    body.print-nordic tfoot {
        display: table-footer-group !important;
    }

    body.print-nordic .print-page-spacer-top {
        display: table-cell !important;
        height: 14mm !important;
        padding: 0 !important;
        border: none !important;
    }

    body.print-nordic .print-page-spacer-bottom {
        display: table-cell !important;
        height: 6mm !important;
        padding: 0 !important;
        border: none !important;
    }
}
