/* =====================================================================
   CV Examples — additions on top of articles.css
   articles.css supplies the guest base (nav, footer, hero, cards, tags,
   buttons, typography). This file adds only the example-specific pieces:
   the CV preview frame, example cards, guidance blocks and chips.
   ===================================================================== */

/* ---------- listing ---------- */
.cvx-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    padding: 8px 8px 8px 20px;
    max-width: 560px;
    margin: 0 auto;
    box-shadow: var(--sh-2);
}

.cvx-search svg { width: 20px; height: 20px; color: var(--faint); flex-shrink: 0; }

.cvx-search input {
    border: none;
    outline: none;
    flex: 1;
    font-family: var(--sans);
    font-size: 16px;
    color: var(--ink);
    background: transparent;
    min-width: 0;
}

.cvx-search .btn { padding: 10px 20px; }

.cvx-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.cvx-card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--sh-1);
    transition: transform .2s, box-shadow .2s;
}

.cvx-card:hover { transform: translateY(-4px); box-shadow: var(--sh-2); }
.cvx-card:hover h3 { color: var(--green-d); }

.cvx-thumb {
    position: relative;
    background: linear-gradient(160deg, var(--soft), var(--soft-2));
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.cvx-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

/* CSS placeholder when no thumbnail exists yet: an abstract A4 page. */
.cvx-thumb .ph {
    position: absolute;
    left: 50%;
    top: 14px;
    transform: translateX(-50%);
    width: 62%;
    aspect-ratio: 210 / 297;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: var(--sh-2);
    padding: 10% 9%;
}

.cvx-thumb .ph i {
    display: block;
    height: 6px;
    border-radius: 3px;
    background: var(--soft-2);
    margin-bottom: 7%;
}

.cvx-thumb .ph i:first-child { width: 55%; height: 9px; background: var(--blue-m); }
.cvx-thumb .ph i:nth-child(2) { width: 38%; background: var(--green-m); }
.cvx-thumb .ph i:nth-child(4) { width: 80%; }
.cvx-thumb .ph i:nth-child(5) { width: 68%; }
.cvx-thumb .ph i:nth-child(6) { width: 74%; }

.cvx-ats {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--green-l);
    color: var(--green-d);
    border: 1px solid var(--green-m);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 5px 10px;
    border-radius: 999px;
}

.cvx-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 18px 18px 20px;
}

.cvx-card-body .tag { align-self: flex-start; margin-bottom: 10px; }
.cvx-card-body h3 { font-size: 19px; line-height: 1.22; margin: 0 0 8px; }
.cvx-card-body p { font-size: 14px; color: var(--muted); margin: 0 0 14px; flex: 1; }

.cvx-view {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--green-d);
    font-weight: 700;
    font-size: 14px;
    margin-top: auto;
}

/* ---------- detail: layout ---------- */
.cvx-detail {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 480px;
    gap: 44px;
    align-items: start;
}

.cvx-detail-main { min-width: 0; }

.cvx-preview-col { position: sticky; top: 90px; }

/* The real template renders inside an iframe at A4 width, scaled to fit. */
.cvx-frame {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--sh-3);
    overflow: hidden;
}

.cvx-frame .cvx-frame-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
    /* A4 ratio incl. small chrome allowance; height driven by JS scale */
    aspect-ratio: 210 / 297;
}

.cvx-frame iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 900px;          /* render width the templates are designed for */
    height: 1273px;        /* 900 * 297/210 */
    border: 0;
    transform-origin: top left;
    pointer-events: none;  /* preview, not an app */
    background: #fff;
}

.cvx-frame-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    background: var(--soft);
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

.cvx-frame-meta b { color: var(--ink); }

.cvx-cta-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 18px 0 6px;
}

/* ---------- detail: guidance blocks ---------- */
.cvx-sec { margin: 34px 0 0; }
.cvx-sec h2 {
    font-size: 24px;
    margin-bottom: 12px;
}

.cvx-why {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cvx-why li {
    display: flex;
    gap: 11px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 15px;
    color: var(--ink-2);
    line-height: 1.55;
}

.cvx-why li::before {
    content: "✓";
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--green-l);
    color: var(--green-d);
    font-weight: 800;
    font-size: 13px;
    display: grid;
    place-items: center;
    margin-top: 1px;
}

.cvx-advice {
    background: var(--blue-l);
    border: 1px solid var(--blue-m);
    border-radius: 14px;
    padding: 16px 18px;
    font-size: 15px;
    color: var(--ink-2);
    line-height: 1.6;
}

.cvx-quote {
    background: var(--soft);
    border-left: 4px solid var(--green);
    border-radius: 0 14px 14px 0;
    padding: 16px 20px;
    font-family: var(--read, Georgia, serif);
    font-size: 16.5px;
    line-height: 1.7;
    color: #2b333f;
}

/* weak vs strong achievement pairs */
.cvx-pair { display: grid; gap: 12px; }

.cvx-pair .row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.cvx-pair .weak,
.cvx-pair .strong {
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 14.5px;
    line-height: 1.55;
    border: 1px solid var(--line);
}

.cvx-pair .weak { background: #FEF2F2; border-color: #FADDDD; color: #7f2d2d; }
.cvx-pair .strong { background: var(--green-l); border-color: var(--green-m); color: #14532d; }

.cvx-pair .lbl {
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 6px;
}

.cvx-pair .weak .lbl { color: #B91C1C; }
.cvx-pair .strong .lbl { color: var(--green-d); }

/* skills chips */
.cvx-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.cvx-chips span {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-2);
    background: var(--soft-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 14px;
}

/* tips lists */
.cvx-tips { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }

.cvx-tips li {
    display: flex;
    gap: 11px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink-2);
}

.cvx-tips li::before {
    content: "→";
    color: var(--green-d);
    font-weight: 800;
    flex: 0 0 auto;
}

/* FAQ reuses the tutorial accordion pattern */
.cvx-faq { border-top: 1px solid var(--line); }
.cvx-faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.cvx-faq summary {
    cursor: pointer;
    list-style: none;
    font-family: var(--disp);
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    padding: 15px 34px 15px 0;
    position: relative;
}
.cvx-faq summary::-webkit-details-marker { display: none; }
.cvx-faq summary::after {
    content: "+";
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    color: var(--faint);
}
.cvx-faq details[open] summary::after { content: "\2013"; }
.cvx-faq .a { font-size: 15.5px; color: var(--muted); line-height: 1.65; padding: 0 0 16px; margin: 0; }

/* related grid reuses cvx-card */
.cvx-related { max-width: 1120px; margin: 48px auto 0; padding: 0 24px; }
.cvx-related h2 { font-size: 24px; text-align: center; margin-bottom: 22px; }

/* bottom CTA reuses the site's dark card */
.cvx-bottom {
    max-width: 1120px;
    margin: 48px auto 60px;
    padding: 0 24px;
}

.cvx-bottom .inner {
    background: radial-gradient(120% 150% at 100% 0, #0C2A47, #0A1A33 62%);
    color: #cfe0f4;
    border-radius: 22px;
    padding: 40px 28px;
    text-align: center;
}

.cvx-bottom h2 { color: #fff; font-size: clamp(23px, 3vw, 30px); margin-bottom: 8px; }
.cvx-bottom p { color: #9db4d0; max-width: 52ch; margin: 0 auto 20px; }
.cvx-bottom .row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- pagination (resources/views/partials/pagination.blade.php) ---------- */
.cvx-pager-wrap {
    margin-top: 34px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.cvx-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cvx-pager-nav,
.cvx-pager-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 42px;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 700;
    color: var(--ink-2);
    text-decoration: none;
    transition: .15s;
}

.cvx-pager-nav {
    padding: 0 18px;
}

.cvx-pager-num {
    min-width: 42px;
    padding: 0 12px;
}

.cvx-pager-nav svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.cvx-pager-nav:hover,
.cvx-pager-num:hover {
    border-color: var(--blue-m);
    color: var(--ink);
    background: var(--soft);
}

.cvx-pager-num.is-on {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
    cursor: default;
}

.cvx-pager-num.is-on:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.cvx-pager-nav.is-disabled {
    opacity: .45;
    cursor: not-allowed;
    background: var(--soft);
}

.cvx-pager-nav.is-disabled:hover {
    border-color: var(--line);
    color: var(--ink-2);
    background: var(--soft);
}

.cvx-pager-nums {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.cvx-pager-gap {
    color: var(--faint);
    font-weight: 700;
    padding: 0 2px;
}

.cvx-pager-count {
    font-size: 13.5px;
    color: var(--faint);
    font-weight: 600;
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
    .cvx-detail { grid-template-columns: minmax(0, 1fr) 400px; gap: 30px; }
}

@media (max-width: 940px) {
    .cvx-grid { grid-template-columns: repeat(2, 1fr); }
    .cvx-detail { grid-template-columns: 1fr; }
    .cvx-preview-col { position: static; order: -1; max-width: 560px; margin: 0 auto; width: 100%; }
}

@media (max-width: 640px) {
    .cvx-grid { grid-template-columns: 1fr; }
    /* Keep the pager on one line: arrows shrink to icons, numbers stay tappable. */
    .cvx-pager { gap: 6px; }
    .cvx-pager-nav { padding: 0 13px; }
    .cvx-pager-word { display: none; }
    .cvx-pager-nums { gap: 6px; }
    .cvx-pager-num { min-width: 40px; height: 40px; padding: 0 9px; }
    .cvx-pair .row { grid-template-columns: 1fr; }
    .cvx-sec { margin-top: 28px; }
    .cvx-sec h2 { font-size: 21px; }
    .cvx-cta-row .btn { flex: 1 1 100%; justify-content: center; }
    .cvx-detail { padding: 0 18px; }
    .cvx-related, .cvx-bottom { padding: 0 18px; }
}
