/* Brutalist Theme - TrainerD Profile Builder */
/* Raw structural honesty — exposed grid, heavy borders, high-contrast type */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

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

.a4-paper {
    box-sizing: border-box;
    margin: auto;
    width: 210mm;
    min-height: 297mm;
    border: 10mm solid #000000;
}

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

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

#trainer-profile {
    --primary-color: #000000;
    --accent-color: #ffd600;
    --text-dark: #000000;
    --text-muted: #333333;
    --bg-stripe: #f5f5f5;
    --bg-accent: #ffd600;
    --border: 1.2mm solid #000000;
    --border-thin: 0.5mm solid #000000;
    --font-heading: 'Space Grotesk', Arial, sans-serif;
    --font-body: 'Space Grotesk', Arial, sans-serif;
    --font-mono: 'Space Mono', 'Courier New', monospace;
}

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

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

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

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

/* ===================================================================
   SECTION HEADINGS — inverted block
   =================================================================== */

#trainer-profile h2 {
    background-color: #000000;
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 9pt;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 3.5mm;
    margin-left: -16mm;
    margin-right: -16mm;
    padding: 2.5mm 16mm;
    page-break-after: avoid;
    text-transform: uppercase;
    letter-spacing: 3pt;
}

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

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

#trainer-profile section#trainer-details header {
    position: relative;
    margin-bottom: 6mm;
    min-height: 72mm;
    padding-bottom: 5mm;
}

/* Profile photo — hard box */
#trainer-profile section#trainer-details header img {
    position: absolute;
    left: 0;
    top: 0;
    width: 52mm;
    height: 70mm;
    object-fit: cover;
    object-position: top center;
    border: var(--border);
}

/* TRAINER PROFILE label */
#trainer-profile section#trainer-details header h1::before {
    content: 'TRAINER PROFILE';
    display: block;
    font-family: var(--font-mono);
    font-size: 7pt;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 2pt;
    margin-bottom: 2.5mm;
}

/* Trainer name — oversized, heavy */
#trainer-profile section#trainer-details header h1 {
    font-family: var(--font-heading);
    font-size: 26pt;
    font-weight: 700;
    color: #000000;
    margin-left: 58mm;
    margin-bottom: 3mm;
    line-height: 1.1;
    letter-spacing: -0.5pt;
    padding-top: 5mm;
}

/* Specialty pill badges — square, thick border */
#trainer-profile section#trainer-details header ul {
    list-style: none;
    padding: 0;
    margin: 3mm 0 0 58mm;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2mm;
}

#trainer-profile section#trainer-details header ul li {
    background-color: var(--bg-accent);
    color: #000000;
    font-family: var(--font-mono);
    font-size: 7.5pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1pt;
    padding: 1mm 3mm;
    border: var(--border-thin);
    margin: 0;
}

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

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

/* ===================================================================
   TABLES — full grid borders
   =================================================================== */

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

#trainer-profile table th {
    background-color: #000000;
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 7.5pt;
    font-weight: 700;
    letter-spacing: 1pt;
    text-transform: uppercase;
    border: var(--border-thin);
    border-color: #444444;
    padding: 2.5mm 4mm;
    line-height: 1.2;
    text-align: left;
    vertical-align: bottom;
}

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

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

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

#trainer-profile section#current-position table td:first-child {
    font-family: var(--font-mono);
    font-size: 8.5pt;
    font-weight: 700;
    background-color: var(--bg-stripe);
    color: #000000;
    width: 30%;
    border-right: var(--border);
}

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

#trainer-profile section#trainer-details table {
    border-collapse: collapse;
    margin: 0 0 5mm 0;
    border: var(--border);
}

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

#trainer-profile section#trainer-details table td:first-child {
    font-family: var(--font-mono);
    font-size: 8.5pt;
    font-weight: 700;
    background-color: var(--bg-stripe);
    width: 30%;
    border-right: var(--border);
}

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

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

/* ===================================================================
   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: var(--border);
    margin-top: 3mm;
    margin-right: 5mm;
}

#trainer-profile section#publications table td.label-cell {
    font-family: var(--font-mono);
    font-size: 8.5pt;
    font-weight: 700;
    padding: 2.5mm 4mm;
    line-height: 1.2;
    text-align: left;
    width: 20%;
    border-right: var(--border);
    background-color: var(--bg-stripe);
}

#trainer-profile section#publications table td.data-cell {
    font-size: 10pt;
    padding: 2mm 4mm;
    vertical-align: top;
}

/* ===================================================================
   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;
}

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

.certificate-block .certificate-title {
    font-family: var(--font-mono);
    font-size: 8.5pt;
    font-weight: 700;
    color: #000000;
    margin: 0;
    width: 100%;
    text-align: left;
    background-color: var(--bg-accent);
    padding: 1mm 2mm;
    border: var(--border-thin);
    border-top: none;
}

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

.acknowledgement-letter-block .letter-title {
    font-family: var(--font-mono);
    font-size: 8.5pt;
    font-weight: 700;
    color: #000000;
    margin: 0;
    width: 100%;
    text-align: left;
    background-color: var(--bg-accent);
    padding: 1mm 2mm;
    border: var(--border-thin);
    border-top: none;
}

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

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

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

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

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

@media print {

  @page {
      size: A4;
      padding: 0mm;
      margin: 0px;
      background-repeat: repeat-y;
      background-size: 100% auto;
      background-position: 0mm 0;
      background-image: url('./print-bg.png');
      padding-top: 12mm;
      padding-bottom: 20mm;
  }   

  @page :first {
    padding-top: 0mm;
  }

    .a4-paper {
        margin: 0;
        padding: 0;
        border: none;
    }

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

    #trainer-profile h2 {
        margin-left: -16mm;
        margin-right: -16mm;
        padding-left: 16mm;
        padding-right: 16mm;
    }

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

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

    #trainer-profile .gallery-container {
        width: 178mm;
        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%;
    }
}
