/**
 * cv.css — Styles for Compact C.V. and Extended C.V. pages
 *
 * Used by:  page-cv-compact.php, page-cv-extended.php
 * Includes: web view + @media print (browser Save-as-PDF)
 */


/* ============================================================
   WEB VIEW
   ============================================================ */

.cv-page {
    max-width: 860px;
    margin: 0 auto;
    padding: 2em 1.5em 5em;
}

.cv-container {
    font-family: var(--font-body, 'IBM Plex Sans', sans-serif);
    font-size: 1rem;
    line-height: 1.6;
    color: #222;
}


/* ---- Header ---- */

.cv-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5em;
    margin-bottom: 2.5em;
    padding-bottom: 1.25em;
    border-bottom: 2px solid #222;
}

.cv-header-text {
    flex: 1 1 auto;
}

.cv-title {
    font-family: var(--font-heading, 'DIN Condensed', sans-serif);
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.1;
    margin: 0 0 0.2em;
}

.cv-intro {
    font-size: 0.9rem;
    color: #555;
    margin-top: 0.5em;
    line-height: 1.5;
}

/* Hidden on screen; replaces .cv-title in print */
.cv-pdf-header {
    display: none;
}

/* Hidden on screen; shown above sections in print */
.cv-pdf-about {
    display: none;
}


/* ---- Download / print button ---- */

.cv-print-btn {
    flex: 0 0 auto;
    align-self: center;
    background: transparent;
    border: 1px solid #888;
    color: #555;
    font-family: var(--font-body, 'IBM Plex Sans', sans-serif);
    font-size: 0.75rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 0.5em 1.2em;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.cv-print-btn:hover {
    border-color: #f22218;
    color: #f22218;
}


/* ---- Sections ---- */

.cv-section {
    margin-bottom: 2.5em;
}

.cv-section-title {
    font-family: var(--font-heading, 'DIN Condensed', sans-serif);
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 0.65em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid #ccc;
}


/* ---- Entry list ---- */

.mainContent ul.cv-entries {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cv-entry {
    padding: 0.2em 0;
    font-size: 0.93rem;
    line-height: 1.55;
}

/* Subtle divider between entries — remove if not wanted */
/*.cv-entry + .cv-entry {
    border-top: 1px solid #f0f0f0;
}*/

.cv-entry a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: #aaa;
}

.cv-entry a:hover {
    color: #f22218;
    text-decoration-color: #f22218;
}


/* ---- Admin action links (edit + delete, shown only to logged-in editors) ---- */
/*
 * Uses .cv-admin-actions rather than .editLink to avoid the specificity conflict
 * with toggle-edit-links.php's `body.show-edit-links .editLink { display: block !important }`.
 * Visibility is handled by the PHP capability check in hwd_cv_action_links().
 */

.cv-entry .cv-admin-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    margin-left: 0.5em;
    vertical-align: middle;
}

.cv-entry .cv-admin-actions .cv-edit-link {
    text-decoration: none;
    color: inherit;
    line-height: 1;
}

.cv-entry .cv-admin-actions .svg-icon {
    width: 11px;
    height: 11px;
    fill: currentColor;
    display: block;
}

.cv-entry .cv-remove-link {
    font-size: 0.8rem;
    color: #c00;
    text-decoration: none;
    white-space: nowrap;
}

.cv-entry .cv-remove-link:hover {
    color: #900;
    text-decoration: underline;
}


/* ============================================================
   RESPONSIVE — iPad and smaller
   ============================================================ */

@media (max-width: 640px) {

    .cv-page {
        padding: 1.5em 1em 4em;
    }

    .cv-header {
        flex-direction: column;
        gap: 0.9em;
    }

    .cv-print-btn {
        align-self: flex-start;
    }

    .cv-title {
        font-size: 1.6rem;
    }

    .cv-section-title {
        font-size: 1.05rem;
    }

    .cv-entry {
        font-size: 0.9rem;
    }
}


/* ============================================================
   PRINT  /  SAVE AS PDF
   ============================================================ */

@media print {

    /* --- Hide all site chrome --- */
    #wpadminbar,
    .site-header,
    .navbar,
    nav,
    footer,
    .site-footer,
    .no-print,
    .cv-print-btn,
    .editLink,
    .cv-admin-actions,
    .breadcrumbs,
    .edit-link {
        display: none !important;
    }

    /* --- Page setup --- */
    @page {
        margin: 18mm 20mm 18mm 20mm;
    }

    /* WP adds margin-top: 32px to <html> for the admin bar when logged in.
       The bar is hidden above, but the margin persists and causes a blank
       first page. Reset it here. */
    html {
        margin-top: 0 !important;
    }

    html,
    body {
        margin: 0;
        padding: 0;
        background: #fff;
        color: #000;
        font-size: 10pt;
    }

    .cv-page {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    .cv-container {
        font-size: 10pt;
        color: #000;
    }

    /* --- Header --- */
    .cv-header {
        display: block;
        border-bottom: 1.5pt solid #000;
        margin-bottom: 16pt;
        padding-bottom: 8pt;
    }

    .cv-title {
        display: none; /* replaced by .cv-pdf-header */
    }

    .cv-pdf-header {
        display: block;
        margin-bottom: 0;
    }

    .cv-pdf-name {
        font-family: var(--font-heading, 'DIN Condensed', sans-serif);
        font-size: 18pt;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        line-height: 1.1;
        margin: 0 0 3pt;
    }

    .cv-pdf-contact {
        font-size: 8.5pt;
        color: #333;
        line-height: 1.4;
        margin: 0;
    }

    .cv-intro {
        font-size: 9pt;
        color: #333;
        margin-top: 4pt;
    }

    .cv-pdf-about {
        display: block;
        font-size: 9pt;
        color: #333;
        line-height: 1.5;
        margin-bottom: 14pt;
    }

    /* --- Sections --- */
    .cv-section {
        margin-bottom: 14pt;
    }

    .cv-section-title {
        font-size: 10.5pt;
        border-bottom: 0.5pt solid #999;
        margin-bottom: 5pt;
        margin-top: 20pt;
        padding-bottom: 2pt;
        break-after: avoid;
    }

    /* --- Entries --- */
    .cv-entry {
        font-size: 9.5pt;
        line-height: 1.4;
        padding: 1pt 0;
        break-inside: avoid;
    }

    .cv-entry + .cv-entry {
        border-top: none;
    }

    /* Keep links readable but don't show raw URLs */
    .cv-entry a {
        color: #000;
        text-decoration: underline;
    }

    a[href]::after {
        content: none;
    }
}
