/* Free PDF guides listing page */

.free-pdf-page {
    --pdf-blue: #0d56f9;
    --pdf-ink: #212121;
    --pdf-muted: #555c68;
    --pdf-line: #e3eaf5;
    --pdf-soft: #eef6ff;
}

.free-pdf-page .pdf-row.is-pte,
.free-pdf-page .pdf-exam-btn.is-pte,
.pdf-hero-doc.is-pte { --exam: #0d56f9; --exam-soft: #eef4ff; }
.free-pdf-page .pdf-row.is-ielts,
.free-pdf-page .pdf-exam-btn.is-ielts,
.pdf-hero-doc.is-ielts { --exam: #e31837; --exam-soft: #fdeef0; }
.free-pdf-page .pdf-row.is-celpip,
.free-pdf-page .pdf-exam-btn.is-celpip,
.pdf-hero-doc.is-celpip { --exam: #a8935a; --exam-soft: #f8f4ea; }
.free-pdf-page .pdf-row.is-det,
.free-pdf-page .pdf-exam-btn.is-det,
.pdf-hero-doc.is-det { --exam: #4fae00; --exam-soft: #effae6; }

/* Section grids carry their own spacing below the heading */
.free-pdf-page .main-heading {
    margin-bottom: 0;
}

/* ---------- Hero ---------- */
.pdf-hero {
    background: linear-gradient(180deg, #f5faff 0%, #fff 100%);
    overflow: hidden;
}

.pdf-hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    column-gap: 60px;
}

.pdf-hero-content {
    max-width: 660px;
}

.pdf-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--pdf-blue);
    background: var(--pdf-soft);
    border-radius: 50px;
    padding: 6px 14px;
    margin-bottom: 18px;
}

.pdf-hero-content p {
    margin: 22px 0 36px;
    line-height: 190%;
    color: var(--pdf-ink);
    max-width: 580px;
}

.pdf-hero-content .comman-btn {
    position: relative;
    overflow: hidden;
}

.pdf-hero-visual {
    position: relative;
    flex: 0 0 440px;
    height: 410px;
}

.pdf-hero-doc {
    position: absolute;
    width: 190px;
    height: 240px;
    background: #fff;
    border-radius: 16px;
    border-top: 6px solid var(--exam);
    box-shadow: 0 18px 45px rgba(13, 40, 120, 0.12);
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.pdf-hero-doc.doc-1 { left: 0; top: 50px; transform: rotate(-8deg); z-index: 1; }
.pdf-hero-doc.doc-2 { left: 125px; top: 0; transform: rotate(-2deg); z-index: 2; }
.pdf-hero-doc.doc-3 { left: 250px; top: 40px; transform: rotate(6deg); z-index: 3; }
.pdf-hero-doc.doc-4 { left: 75px; top: 165px; transform: rotate(3deg); z-index: 4; }

.pdf-hero-doc img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 12px;
}

.pdf-hero-doc strong {
    font-size: 20px;
    font-weight: 700;
    color: var(--pdf-ink);
}

.pdf-hero-doc > span:not(.pdf-hero-doc-badge) {
    font-size: 13px;
    color: var(--pdf-muted);
    margin-bottom: 14px;
}

.pdf-hero-doc i {
    display: block;
    height: 7px;
    width: 100%;
    border-radius: 4px;
    background: #edf1f7;
    margin-top: 8px;
}

.pdf-hero-doc i:last-child {
    width: 60%;
}

.pdf-hero-doc-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    background: var(--exam);
    border-radius: 6px;
    padding: 3px 8px;
}

/* ---------- PDF library ---------- */
.pdf-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.pdf-library {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
    margin-top: 50px;
}

/* Filters */
.pdf-filters {
    position: sticky;
    top: 100px;
    background: #fff;
    border: 1px solid var(--pdf-line);
    border-radius: 18px;
    padding: 22px 18px;
}

.pdf-filter-block + .pdf-filter-block {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--pdf-line);
}

.pdf-filter-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #8a93a3;
    margin-bottom: 10px;
}

.pdf-exam-list,
.pdf-skill-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pdf-exam-btn,
.pdf-skill-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--pdf-ink);
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: 0.2s ease-out;
}

.pdf-exam-btn img {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    object-fit: contain;
}

.pdf-exam-btn span {
    flex: 1;
}

.pdf-exam-btn em,
.pdf-skill-btn em {
    margin-left: auto;
    font-style: normal;
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    background: #f1f4f9;
    border-radius: 50px;
    padding: 2px 9px;
}

.pdf-exam-btn:hover,
.pdf-skill-btn:hover {
    background: #f5f8fd;
}

.pdf-exam-btn.active {
    background: var(--exam-soft);
    border-color: var(--exam);
    color: var(--exam);
}

.pdf-exam-btn.active em {
    background: var(--exam);
    color: #fff;
}

.pdf-skill-btn.active {
    background: var(--pdf-blue);
    color: #fff;
}

.pdf-skill-btn.active em {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.pdf-skill-btn[hidden] {
    display: none;
}

/* While searching, every exam is included, so the filters step back */
.pdf-library.is-searching .pdf-filters {
    opacity: 0.45;
}

/* Results */
.pdf-search {
    position: relative;
    color: #8a93a3;
}

.pdf-search svg {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.pdf-search input {
    width: 100%;
    height: 56px;
    padding: 0 18px 0 50px;
    border: 1px solid var(--pdf-line);
    border-radius: 14px;
    background: #fff;
    font-size: 16px;
    color: var(--pdf-ink);
    outline: none;
    transition: border-color 0.2s ease-out, box-shadow 0.2s ease-out;
}

.pdf-search input:focus {
    border-color: var(--pdf-blue);
    box-shadow: 0 0 0 4px rgba(13, 86, 249, 0.12);
}

.pdf-results-summary {
    font-size: 14px;
    font-weight: 600;
    color: var(--pdf-muted);
    margin: 16px 2px 12px;
    min-height: 21px;
}

.pdf-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #fff;
    border: 1px solid var(--pdf-line);
    border-radius: 18px;
    overflow: hidden;
}

.pdf-item + .pdf-item {
    border-top: 1px solid #eef1f6;
}

/* With JS, hidden rows drop out and the next visible row keeps its divider */
.pdf-item[hidden] {
    display: none;
}

.pdf-library.is-ready .pdf-item:not([hidden]) ~ .pdf-item:not([hidden]) {
    border-top: 1px solid #eef1f6;
}

.pdf-library.is-ready .pdf-item + .pdf-item {
    border-top: 0;
}

.pdf-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    transition: background 0.2s ease-out;
}

.pdf-row:hover,
.pdf-row:focus-visible {
    background: #f7faff;
}

.pdf-row-icon {
    flex: 0 0 42px;
    height: 46px;
    border-radius: 8px;
    background: var(--exam-soft);
    color: var(--exam);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-row-text {
    flex: 1;
    min-width: 0;
}

.pdf-row-title {
    display: block;
    font-size: 16px;
    font-weight: 600;
    line-height: 140%;
    color: var(--pdf-ink);
}

.pdf-row-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    font-size: 13px;
    color: var(--pdf-muted);
    margin-top: 4px;
}

.pdf-row-exam,
.pdf-row-skill {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    border-radius: 5px;
    padding: 2px 7px;
}

.pdf-row-exam {
    color: #fff;
    background: var(--exam);
}

.pdf-row-skill {
    color: var(--exam);
    background: var(--exam-soft);
}

/* The exam tag only matters when results mix exams (search) */
.pdf-library.is-ready:not(.is-searching) .pdf-row-exam {
    display: none;
}

.pdf-row-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    background: var(--pdf-soft);
    color: var(--pdf-blue);
    font-size: 14px;
    font-weight: 700;
    transition: 0.2s ease-out;
}

.pdf-row:hover .pdf-row-action {
    background: var(--pdf-blue);
    color: #fff;
}

.pdf-empty {
    text-align: center;
    background: #fff;
    border: 1px dashed #cdd8ea;
    border-radius: 18px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.pdf-empty[hidden] {
    display: none;
}

.pdf-empty strong {
    font-size: 18px;
    color: var(--pdf-ink);
}

.pdf-empty span {
    color: var(--pdf-muted);
}

.pdf-clear-search,
.pdf-show-more {
    margin-top: 12px;
    border: 1.5px solid var(--pdf-blue);
    background: #fff;
    color: var(--pdf-blue);
    font-size: 15px;
    font-weight: 700;
    border-radius: 10px;
    padding: 11px 24px;
    cursor: pointer;
    transition: 0.2s ease-out;
}

.pdf-show-more {
    display: block;
    width: 100%;
    margin-top: 16px;
}

.pdf-show-more[hidden] {
    display: none;
}

.pdf-clear-search:hover,
.pdf-show-more:hover {
    background: var(--pdf-blue);
    color: #fff;
}

/* ---------- Why download ---------- */
.pdf-why-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 50px;
}

.pdf-why-item {
    background: #fff;
    border-radius: 18px;
    padding: 30px 26px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.05);
}

.pdf-why-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: var(--pdf-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.pdf-why-item h3 {
    font-size: 19px;
    font-weight: 700;
    color: var(--pdf-ink);
    margin-bottom: 10px;
}

.pdf-why-item p {
    font-size: 15px;
    line-height: 175%;
    color: var(--pdf-muted);
}

.free-pdf-page .faq .faq-inner {
    margin-top: 40px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
    .pdf-why-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pdf-hero-visual {
        flex-basis: 380px;
        transform: scale(0.88);
        transform-origin: right center;
    }
}

@media (max-width: 991px) {
    .pdf-hero-inner {
        flex-direction: column;
        row-gap: 30px;
    }
    .pdf-hero-visual {
        flex-basis: auto;
        width: 440px;
        max-width: 100%;
        transform-origin: center top;
    }
}

@media (max-width: 991px) {
    .pdf-library {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }
    .pdf-filters {
        min-width: 0;
    }
    /* Filters become two scrollable chip rows above the results */
    .pdf-filters {
        position: static;
        background: transparent;
        border: 0;
        padding: 0;
    }
    .pdf-filter-block + .pdf-filter-block {
        margin-top: 12px;
        padding-top: 0;
        border-top: 0;
    }
    .pdf-filter-label {
        display: none;
    }
    .pdf-exam-list,
    .pdf-skill-list {
        flex-direction: row;
        overflow-x: auto;
        margin: 0 -15px;
        padding: 0 15px 4px;
        scrollbar-width: none;
    }
    .pdf-exam-list::-webkit-scrollbar,
    .pdf-skill-list::-webkit-scrollbar {
        display: none;
    }
    .pdf-exam-btn,
    .pdf-skill-btn {
        width: auto;
        flex: 0 0 auto;
        white-space: nowrap;
        background: #fff;
        border-color: var(--pdf-line);
        border-radius: 50px;
    }
    .pdf-skill-btn {
        min-height: 38px;
        font-size: 14px;
        padding: 6px 14px;
    }
    .pdf-exam-btn span {
        flex: 0 0 auto;
    }
}

@media (max-width: 767px) {
    .pdf-why-grid {
        grid-template-columns: 1fr;
    }
    .pdf-hero-visual {
        display: none;
    }
    .pdf-search input {
        height: 50px;
        font-size: 15px;
    }
    .pdf-row {
        padding: 14px;
        gap: 12px;
    }
    .pdf-row-title {
        font-size: 15px;
    }
    /* Icon-only download button on phones */
    .pdf-row-action {
        width: 40px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
    .pdf-row-action span {
        display: none;
    }
}
