/* Celadon Theme - TrainerD Profile Builder */
/* Classical elegance — Cinzel headings, deep teal on warm cream parchment */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Lato:ital,wght@0,300;0,400;0,700;1,400&display=swap');

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

.a4-paper {
    background-color: #EFEAE5;
    box-sizing: border-box;
    margin: auto;
    width: 210mm;
    min-height: 297mm;
    background-image: url('./bg-first.png');
    background-size: contain;
    background-position: top center;
    background-repeat: no-repeat;
}

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

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

#trainer-profile {
    --primary-color:   #03494D;
    --secondary-color: #2D6A6E;
    --accent-color:    #A8BFC0;
    --text-dark:       #1A2F30;
    --text-muted:      #5A7A7C;
    --bg-light:        #F7F4F0;
    --border-color:    #C5D5D6;
    --font-family:     'Lato', Arial, sans-serif;
    --font-heading:    'Cinzel', Georgia, 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 — Cinzel, teal with bottom rule
   =================================================================== */

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

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

#trainer-profile section#trainer-details {
    height: auto;
    overflow: hidden;
}

#trainer-profile section#trainer-details header {
    position: relative;
    margin-bottom: 7mm;
    min-height: 110mm;
    padding-top: 1px;
}

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

/* "TRAINER PROFILE" label */
#trainer-profile section#trainer-details header h1::before {
    content: 'TRAINER PROFILE';
    display: block;
    color: #ccc;
    font-family: var(--font-heading);
    font-size: 10pt;
    font-weight: 400;
    letter-spacing: 3pt;
    margin-bottom: 4mm;
}

/* Trainer name — Cinzel, teal */
#trainer-profile section#trainer-details header h1 {
    font-family: var(--font-heading);
    font-size: 30pt;
    font-weight: 600;
    color: #fff;
    margin-left: 80mm;
    margin-bottom: 1.5mm;
    line-height: 1.2;
    letter-spacing: 1pt;
    padding-top: 5mm;
}

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

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

/* Horizontal rule below header */
#trainer-profile section#trainer-details header > div:nth-child(4) {

    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) {
    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 {
    display: none;
}

#trainer-profile section#trainer-details > div {
    float: right;
    width: 90mm;
    margin-top: -105mm;
}

#public-profile #trainer-profile section#trainer-details > div {
    float: none;
    margin-top: 0;
    width: 100%;
}


/* ===================================================================
   TRAINER DETAILS TABLE — stacked label/value layout
   =================================================================== */

#trainer-profile section#trainer-details table {
    border-collapse: collapse;
    border-spacing: 0;
    border: 0.5pt solid #fff;
    width: 75mm;
}

#trainer-profile section#trainer-details table tbody,
#trainer-profile section#trainer-details table tr {
    display: block;
    margin-left: 2mm;
    margin-right: 2mm;
}

#trainer-profile section#trainer-details table tr {
    margin-top: 4mm;
    padding-bottom: 4mm;
    border-bottom: 0.3mm solid #fff;
}

#trainer-profile section#trainer-details table tr:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

#trainer-profile section#trainer-details table td {
    text-align: center;
    display: block;
    border: none;
    padding: 0;
    background: none;
    width: 100% !important;
}

/* Label — first td: small uppercase muted text */
#trainer-profile section#trainer-details table td:first-child {
    font-family: var(--font-section);
    font-size: 7pt;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1pt;
    margin-bottom: 0;
}

/* Value — second td: normal body text */
#trainer-profile section#trainer-details table td:nth-child(2) {
    font-size: 10.5pt;
    font-weight: 400;
    color: var(--text-muted);
    width: 100% !important;
}


/* ===================================================================
   TABLES
   =================================================================== */

#trainer-profile table {
    box-sizing: border-box;
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
    padding: 0;
    margin: 0 0 5mm 0;
}

#trainer-profile table th {
    background: none;
    border: none;
    border-bottom: 0.3mm solid var(--primary-color);
    color: var(--primary-color);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 7.5pt;
    letter-spacing: 1pt;
    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: #F7F4F0;
}

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

#trainer-profile section#current-position table td:first-child {
    font-weight: 700;
    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;
}

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

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



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

.a4-paper #trainer-profile section#publications table td.cover-cell {
    background-color: #EFEAE5 !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: 700;
    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: #F7F4F0;
}

/* ===================================================================
   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: 700;
    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: 700;
    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);
    font-family: var(--font-family);
}

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

@media print {

    @page {
        size: A4;
        padding: 20mm 0 20mm 0;
        margin: 0px;

        background-repeat: repeat-y;
        background-size: 100% auto;
        background-position: 0mm 0;        
        background-image: url('./bg-page.png');              
    }

    @page :first {
        padding-top: 0mm;
        background-repeat: no-repeat;
        background-size: 100% auto;
        background-position: 0mm 0;
        background-image: url('./bg-first.png');
    }

    .a4-paper {
        margin: 0;
        padding: 0;
        background-color: rgba(0,0,0,0);
    }

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

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

    #trainer-profile section#trainer-details {
        margin-top: 0mm;
    }

    /* #trainer-profile section#trainer-details header ul {
        margin: 2mm 0 2mm 80mm;
    }

    #trainer-profile section#trainer-details header > div:nth-child(3) {
        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%;
    }
}
