/* Minimalist Theme - TrainerD Profile Builder */
/* Clean, uncluttered design — whitespace and typography do the work */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ===================================================================
   A4 PAPER WRAPPER
   =================================================================== */

.a4-paper {
    box-sizing: border-box;
    margin: auto;
    width: 210mm;
    min-height: 297mm;
    background-color: #ffffff;

    /* Company header logo layer — set these from the builder */
    --header-logo:          none;
    --header-logo-size:     auto 25mm;
    --header-logo-position: 5mm 5mm;
    --header-logo-repeat:   no-repeat;

    background-image:    var(--header-logo);
    background-size:     var(--header-logo-size);
    background-position: var(--header-logo-position);
    background-repeat:   var(--header-logo-repeat);
}

.a4-paper .paper-margin {
    padding: 30mm 20mm 20mm 20mm;
}

/* ===================================================================
   THEME VARIABLES
   =================================================================== */

#trainer-profile {
    --primary-color: #18181b;
    --secondary-color: #52525b;
    --accent-color: #a1a1aa;
    --text-dark: #27272a;
    --text-muted: #71717a;
    --bg-light: #fafafa;
    --border-color: #e4e4e7;
    --font-family: 'DM Sans', Arial, sans-serif;
    --border-radius: 2px;
    --spacing-unit: 1rem;
}

/* ===================================================================
   BASE STYLES
   =================================================================== */

#trainer-profile * {
    box-sizing: border-box;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

#trainer-profile {
    position: relative;
    font-family: var(--font-family);
    min-height: 297mm;
    color: var(--text-dark);
    font-size: 11pt;
    line-height: 1.6;
}

#trainer-profile section {
    margin-bottom: 9mm;
    break-inside: avoid;
}

/* ===================================================================
   SECTION HEADINGS
   =================================================================== */

#trainer-profile h2 {
    color: var(--primary-color);
    font-family: var(--font-family);
    font-size: 8.5pt;
    font-weight: 600;
    margin-top: 2mm;
    margin-bottom: 2mm;
    page-break-after: avoid;
    text-transform: uppercase;
    letter-spacing: 2pt;
    padding-bottom: 2.5mm;
    border-bottom: 0.4mm solid var(--primary-color);
}

/* ===================================================================
   TRAINER DETAILS SECTION
   =================================================================== */

#trainer-profile section#trainer-details {
    position: relative;
}

#trainer-profile section#trainer-details header {
    position: relative;
    margin-bottom: 7mm;
    min-height: 60mm;
}

/* Profile photo */
#trainer-profile section#trainer-details header img {
    position: absolute;
    left: 0;
    top: 0;
    width: 50mm;
    height: 60mm;
    object-fit: cover;
    object-position: top center;
    filter: grayscale(15%);
    padding: 2mm;
    background-color: #fff;
    border: 0.3mm solid var(--border-color);
}

/* Trainer name */
#trainer-profile section#trainer-details header h1 {
    font-family: var(--font-family);
    font-size: 22pt;
    font-weight: 300;
    color: var(--primary-color);
    margin-left: 55mm;
    margin-bottom: 1.5mm;
    line-height: 1.15;
    letter-spacing: -0.5pt;
    padding-top: 5mm;
}

#trainer-profile section#trainer-details header h1::before {
    content: 'TRAINER PROFILE';
    display: block;
    color: var(--text-muted);
    font-size: 7.5pt;
    font-weight: 500;
    letter-spacing: 2.5pt;
    padding-top: 0;
    margin-bottom: 4mm;
}

/* Specialty pill badges */
#trainer-profile section#trainer-details header ul {
    list-style: none;
    padding: 0;
    margin: 2mm 0 2mm 60mm;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5mm;
}

#trainer-profile section#trainer-details header ul li {
    background-color: transparent;
    color: var(--text-dark);
    font-size: 8pt;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8pt;
    padding: 0.8mm 2.5mm;
    border-radius: 1px;
    border: 0.3mm solid var(--border-color);
    margin: 0;
}

/* Horizontal rule below header */

#trainer-profile section#trainer-details header > div:nth-child(4) {
    margin-left: -5mm;
    margin-right: -5mm;
    padding-top: 3mm;
    margin-top: 3mm;
    border-top: 0.3mm solid var(--border-color);
    overflow: hidden;
}

/* For public profile at /profile/{slug} */

#public-profile #trainer-profile section#trainer-details header > div:nth-child(3) {
    margin-left: -5mm;
    margin-right: -5mm;
    padding-top: 3mm;
    margin-top: 3mm;
    border-top: 0.3mm solid var(--border-color);
    overflow: hidden;
}

#trainer-profile section#trainer-details header .specialty {
    color: var(--text-muted);
    font-size: 10pt;
    font-weight: 400;
}

#trainer-profile section#trainer-details > h2:first-of-type {
    margin-top: 6mm;
}

/* ===================================================================
   TABLES (shared base styles)
   =================================================================== */

#trainer-profile table {
    box-sizing: border-box;
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
    padding: 0;
    margin: 0 0 5mm 0;
    /* border-top: 0.3mm solid var(--border-color); */
}

#trainer-profile table th {
    background: none;
    border: none;
    border-bottom: 0.3mm solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 8pt;
    letter-spacing: 0.5pt;
    text-transform: uppercase;
    padding: 2.5mm 4mm;
    line-height: 1.2em;
    text-align: left;
    vertical-align: bottom;
}

#trainer-profile table td {
    background: none;
    border: none;
    border-bottom: 0.3mm solid var(--border-color);
    font-size: 10pt;
    padding: 2mm 4mm;
    vertical-align: top;
    color: var(--text-dark);
}

#trainer-profile table tr:nth-of-type(even) td {
    background-color: #fafafa;
}

/* ===================================================================
   KEY-VALUE TABLES (Current Position)
   =================================================================== */

#trainer-profile section#current-position table td:first-child {
    font-weight: 600;
    color: var(--secondary-color);
    width: 30%;
    font-size: 9.5pt;
}

/* ===================================================================
   TRAINER DETAILS TABLE
   =================================================================== */

#trainer-profile section#trainer-details table {
    border-collapse: collapse;
    border-spacing: 0;
    margin: 0 0 5mm 0;
    /* border-top: 0.3mm solid var(--border-color); */
}

#trainer-profile section#trainer-details table td {
    background: none;
    border: none;
    border-bottom: 0.3mm solid var(--border-color);
    color: var(--text-dark);
    font-size: 10pt;
    padding: 2mm 4mm;
    vertical-align: top;
}

#trainer-profile section#trainer-details table td:first-child {
    font-weight: 600;
    color: var(--secondary-color);
    width: 30%;
    font-size: 9.5pt;
}

#trainer-profile section#trainer-details table tr:nth-of-type(even) td {
    background-color: #fafafa;
}

/* ===================================================================
   PUBLICATIONS
   =================================================================== */

.a4-paper #trainer-profile section#publications table td.cover-cell {
    background-color: white !important;
    padding: 0;
    text-align: center;
}

#trainer-profile section#publications table td.cover-cell img {
    max-width: 50mm;
    max-height: 75mm;
    object-fit: cover;
    border: 0.2mm solid var(--border-color);
    margin-top: 3mm;
    margin-right: 5mm;
}

#trainer-profile section#publications table td.label-cell {
    font-weight: 600;
    padding: 2.5mm 4mm;
    font-size: 9.5pt;
    line-height: 1.2em;
    text-align: left;
    width: 20%;
    color: var(--secondary-color);
    border-bottom: 0.3mm solid var(--border-color);
}

#trainer-profile section#publications table td.data-cell {
    font-size: 10pt;
    padding: 2mm 4mm;
    vertical-align: top;
    font-weight: 400;
    border-bottom: 0.3mm solid var(--border-color);
}

/* ===================================================================
   COLUMN WIDTHS
   =================================================================== */

#trainer-profile section#academic table td:nth-child(3),
#trainer-profile section#professional table td:nth-child(3),
#trainer-profile section#academic table th:nth-child(3),
#trainer-profile section#professional table th:nth-child(3) {
    width: 25mm;
}

#trainer-profile section#previous-companies table td:nth-child(3),
#trainer-profile section#previous-companies table td:nth-child(4),
#trainer-profile section#previous-companies table th:nth-child(3),
#trainer-profile section#previous-companies table th:nth-child(4) {
    width: 18mm;
}

#trainer-profile section#training-programmes table td:nth-child(3),
#trainer-profile section#training-programmes table td:nth-child(4),
#trainer-profile section#training-programmes table th:nth-child(3),
#trainer-profile section#training-programmes table th:nth-child(4) {
    width: 18mm;
}

#trainer-profile section#training-programmes table td:nth-child(1),
#trainer-profile section#training-programmes table th:nth-child(1),
#trainer-profile section#previous-companies table td:nth-child(1),
#trainer-profile section#previous-companies table th:nth-child(1) {
    width: 10mm;
}

#trainer-profile section#previous-companies table tr:nth-of-type(even) td,
#trainer-profile section#training-programmes table tr:nth-of-type(even) td {
    background-color: #fafafa;
}

/* ===================================================================
   CERTIFICATES
   =================================================================== */

.certificates-container {
    text-align: center;
}

.certificate-block {
    display: inline-block;
    vertical-align: bottom;
    text-align: left;
    margin: 0 1.5mm 5mm 1.5mm;
    page-break-inside: avoid;
    line-height: normal;
}

.certificate-block.orientation-portrait {
    width: 45%;
    max-width: 90mm;
}

.certificate-block.orientation-landscape {
    width: 70%;
    max-width: 140mm;
}

.certificate-block .certificate-image {
    margin-bottom: 2mm;
}

.certificate-block .certificate-img {
    width: 100%;
    height: auto;
    display: block;
    border: 0.3mm solid var(--border-color);
}

.certificate-block .certificate-title {
    font-size: 9.5pt;
    font-weight: 600;
    color: var(--secondary-color);
    margin: 0;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
}

/* ===================================================================
   ACKNOWLEDGEMENT LETTERS
   =================================================================== */

.acknowledgement-letters-container {
    text-align: center;
}

.acknowledgement-letter-block {
    display: inline-block;
    vertical-align: bottom;
    text-align: left;
    margin: 0 1.5mm 8mm 1.5mm;
    page-break-inside: avoid;
    line-height: normal;
}

.acknowledgement-letter-block.orientation-portrait {
    width: 45%;
    max-width: 90mm;
}

.acknowledgement-letter-block.orientation-landscape {
    width: 80%;
    max-width: 175mm;
}

.acknowledgement-letter-block .acknowledgement-letter-image {
    margin-bottom: 2mm;
}

.acknowledgement-letter-block .acknowledgement-img {
    width: 100%;
    height: auto;
    display: block;
}

.acknowledgement-letter-block .letter-title {
    font-size: 9.5pt;
    font-weight: 600;
    color: var(--secondary-color);
    margin: 0;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
}

/* ===================================================================
   GALLERY
   =================================================================== */

#trainer-profile .gallery-container {
    margin: 5mm 0 15mm 0;
}

/* ===================================================================
   PARAGRAPH SPACING
   =================================================================== */

#trainer-profile p {
    margin-bottom: 3mm;
    text-align: justify;
    color: var(--text-dark);
}

/* ===================================================================
   PRINT OPTIMIZATIONS
   =================================================================== */

@media print {

    @page {
        size: A4;
        padding: 22mm 0 20mm 0;
        margin: 0;
        background-color: #fff;

        /* Company header logo layer — injected by PDF job via --header-logo */
        --header-logo: none;

        background-repeat:   no-repeat;
        background-size:     auto 25mm;
        background-position: 5mm 5mm;
        background-image:    var(--header-logo);
    }

    @page :first {

        background-repeat:   no-repeat;
        background-size:     auto 25mm;
        background-position: 5mm 5mm;
        background-image:    var(--header-logo);
    }

    .a4-paper {
        background: #ffffff;
        margin: 0;
        padding: 0;
    }

    .paper-margin {
        margin: 0;
        padding: 0 20mm 0 20mm;
    }

    /* section#trainer-details {
        margin-top: -60mm;
    } */

    #trainer-profile {
        margin: 0;
        page-break-inside: avoid;
        margin-top: -30mm;
    }

    /* Specialty pill badges */
    #trainer-profile section#trainer-details header ul {
        margin: 2mm 0 2mm 60mm;
    }

    #trainer-profile section#trainer-details header > div:nth-child(3) {
        margin-left: -5mm;
        margin-right: -5mm;
        padding-top: 3mm;
        margin-top: 3mm;
        border-top: 0.3mm solid var(--border-color);
        overflow: hidden;
    }    

    

    #trainer-profile section {
        page-break-inside: avoid;
        margin-top: 8mm;
        margin-bottom: 8mm;
    }

    #trainer-profile .gallery-container {
        width: 180mm;
        padding: 0;
        margin: auto;
        margin-left: 0;
    }

    #trainer-profile .gallery-container .gallery-img {
        margin-bottom: 1mm;
    }

    #trainer-profile .gallery-container .orientation-portrait {
        width: 24%;
    }

    #trainer-profile .gallery-container .orientation-landscape {
        width: 48.3%;
    }
}
