/*
 * The plugin's blocks on ordinary Pages: Exam Hub, its Papers page and the
 * Home (approved demo screens 1, 1b and 5, 2026-11-05). Each block carries
 * its own look so it sits well inside any theme; columns adapt by
 * themselves, nothing scrolls sideways, buttons keep to their label width.
 */

.pyb {
    --pyb-ink: #0f172a;
    --pyb-muted: #64748b;
    --pyb-line: #e2e8f0;
    --pyb-line-lt: #f1f5f9;
    --pyb-blue: #2563eb;
    --pyb-blue-bg: #eff6ff;
    --pyb-amber: #b45309;
    --pyb-amber-bg: #fef3c7;
    --pyb-red: #dc2626;
    --pyb-red-bg: #fee2e2;
    --pyb-green: #15803d;
    box-sizing: border-box;
    margin-top: 0;
    margin-bottom: 1.5em;
    color: var(--pyb-ink);
}

.pyb *,
.pyb *::before,
.pyb *::after {
    box-sizing: border-box;
}

.pyb ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* A block that is itself a list (facts, years, trust points): no bullets
   or theme indent, which showed as an empty grey strip on the facts. */
body ul.pyb {
    margin-right: 0;
    margin-left: 0;
    padding: 0;
    list-style: none;
}

.pyb a {
    text-decoration: none;
}

.pyb-svg {
    width: 18px;
    height: 18px;
    flex: none;
}

h2.pyb-h,
.pyb-sec__h h2 {
    margin: 0 0 10px;
    font-size: 19px;
    line-height: 1.3;
    font-weight: 800;
}

/* Section head with an "All ›" link on the right */
.pyb-sec__h {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 12px;
}

.pyb-sec__h a {
    font-size: 14px;
    font-weight: 700;
    color: var(--pyb-blue);
}

/* ── Exam facts: one framed row of small facts ── */
.pyb-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--pyb-line);
    border-radius: 12px;
    background: var(--pyb-line);
}

.pyb-facts li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px 12px;
    background: #fff;
}

.pyb-facts .pyb-svg {
    color: var(--pyb-blue);
}

.pyb-facts span {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.pyb-facts small {
    font-size: 12px;
    color: var(--pyb-muted);
}

.pyb-facts b {
    font-size: 14.5px;
}

/* ── Tiles: Hub links, Exam tiles ── */
.pyb-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
    gap: 10px;
}

.pyb-tiles li {
    margin: 0;
}

.pyb .pyb-tile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
    padding: 12px 30px 12px 12px;
    border: 1px solid var(--pyb-line);
    border-radius: 12px;
    background: #fff;
    color: var(--pyb-ink);
}

.pyb .pyb-tile:hover,
.pyb .pyb-tile:focus-visible {
    border-color: var(--pyb-blue);
}

.pyb-tile__ic {
    width: 38px;
    height: 38px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--pyb-blue-bg);
    color: var(--pyb-blue);
}

.pyb-tile--test .pyb-tile__ic,
.pyb-tile--pdf .pyb-tile__ic {
    background: var(--pyb-amber-bg);
    color: var(--pyb-amber);
}

.pyb-tile--yt .pyb-tile__ic {
    background: var(--pyb-red-bg);
    color: var(--pyb-red);
}

.pyb-tile--post .pyb-tile__ic,
.pyb-tile--layers .pyb-tile__ic,
.pyb-tile--q .pyb-tile__ic,
.pyb-tile--marks .pyb-tile__ic {
    background: var(--pyb-line-lt);
    color: #475569;
}

.pyb-tile__t {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.pyb-tile__t b {
    font-size: 15px;
    overflow-wrap: anywhere;
}

.pyb-tile__t small {
    font-size: 12.5px;
    color: var(--pyb-muted);
}

.pyb-svg.pyb-tile__go {
    position: absolute;
    top: 50%;
    right: 10px;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    color: #94a3b8;
}

/* ── Papers year-wise: links only ── */
.pyb-years {
    overflow: hidden;
    border: 1px solid var(--pyb-line);
    border-radius: 12px;
    background: #fff;
}

.pyb-y {
    margin: 0;
}

.pyb-y + .pyb-y {
    border-top: 1px solid var(--pyb-line);
}

.pyb-y__h {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    padding: 10px 14px 4px;
}

.pyb-y__h b {
    font-size: 18px;
    font-weight: 800;
}

.pyb-y__h small {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    color: var(--pyb-muted);
}

.pyb-y__h .pyb-svg {
    width: 13px;
    height: 13px;
}

.pyb-y ul {
    padding: 0 0 6px;
}

.pyb-y li li {
    margin: 0;
}

.pyb-y li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--pyb-ink);
}

.pyb-y li a:hover span {
    color: var(--pyb-blue);
    text-decoration: underline;
}

.pyb-y li a > .pyb-svg:first-child {
    width: 16px;
    height: 16px;
    color: var(--pyb-blue);
}

.pyb-y li a span {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.pyb-y li a small {
    font-weight: 400;
    font-size: 12.5px;
    color: #94a3b8;
    white-space: nowrap;
}

.pyb-y .pyb-go {
    width: 16px;
    height: 16px;
    color: #94a3b8;
}

/* A heading only Google and screen readers get (the Home's H1). In the
   editor it stays visible so it can be edited. */
.pyb-sr:not(.block-editor-block-list__block) {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Quick buttons (Hub links, look "quick"): plain icon + name ── */
.pyb-quick ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
    gap: 10px;
}

.pyb-quick li,
.pyb-ets > li,
.pyb-latest li {
    margin: 0;
}

.pyb-qb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 100%;
    padding: 14px 10px;
    border: 1px solid var(--pyb-line);
    border-radius: 14px;
    background: #fff;
    color: var(--pyb-ink);
    text-align: center;
}

.pyb-qb:hover {
    border-color: #cbd5e1;
}

.pyb-qb .pyb-svg {
    width: 24px;
    height: 24px;
    color: var(--pyb-blue);
}

.pyb-qb--pdf .pyb-svg {
    color: var(--pyb-amber);
}

.pyb-qb--yt .pyb-svg {
    color: var(--pyb-red);
}

.pyb-qb b {
    font-size: 14px;
    line-height: 1.25;
}

/* Phone: four in a row, icon over name */
@media (max-width: 600px) {
    .pyb-quick ul {
        grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
        gap: 6px;
    }

    .pyb-qb {
        flex-direction: column;
        gap: 6px;
        padding: 12px 4px;
    }

    .pyb-qb b {
        font-size: 12px;
    }
}

/* ── Underline tabs (Exams, Popular) ── */
.pyb-tabs {
    display: flex;
    gap: 18px;
    margin-bottom: 12px;
    overflow-x: auto;
    box-shadow: inset 0 -1px var(--pyb-line);
    scrollbar-width: none;
}

.pyb-tabs[hidden] {
    display: none;
}

.pyb-tabs button,
.pyb-tabs button:hover,
.pyb-tabs button:focus {
    flex: none;
    margin: 0;
    padding: 8px 2px;
    border: 0;
    border-bottom: 2.5px solid transparent;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: var(--pyb-muted);
    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    cursor: pointer;
}

.pyb-tabs button[aria-pressed="true"] {
    border-bottom-color: var(--pyb-blue);
    color: var(--pyb-blue);
}

.pyb-tabs button:focus-visible {
    outline: 2px solid var(--pyb-blue);
    outline-offset: 2px;
}

/* ── Exam tiles: plain paper icon by the name ── */
.pyb-ets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
    gap: 8px;
}

.pyb-ets > li[hidden] {
    display: none;
}

.pyb-et {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    height: 100%;
    padding: 11px 12px;
    border: 1px solid var(--pyb-line);
    border-radius: 12px;
    background: #fff;
    color: var(--pyb-ink);
}

.pyb-et:hover {
    border-color: #cbd5e1;
}

.pyb-et .pyb-svg {
    margin-top: 1px;
    color: var(--pyb-blue);
}

.pyb-et span {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.pyb-et b {
    font-size: 14px;
}

.pyb-et small {
    font-size: 12px;
    color: var(--pyb-muted);
}

@media (max-width: 560px) {
    .pyb-ets {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ── Latest posts: a short list, NEW on fresh ones ── */
.pyb-latest ul {
    overflow: hidden;
    border: 1px solid var(--pyb-line);
    border-radius: 14px;
    background: #fff;
}

.pyb-latest li + li {
    border-top: 1px solid var(--pyb-line-lt);
}

.pyb-latest li a {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    color: var(--pyb-ink);
}

.pyb-latest .pyb-svg {
    margin-top: 2px;
    color: var(--pyb-blue);
}

.pyb-latest li span {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pyb-latest b {
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.4;
}

.pyb-latest small {
    font-size: 12.5px;
    color: var(--pyb-muted);
}

.pyb-new {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--pyb-red);
    color: #fff;
    font-size: 10.5px;
    font-style: normal;
    font-weight: 800;
    letter-spacing: .03em;
    vertical-align: 2px;
}

/* ── Latest beside the Daily Quiz (Columns block "pyb-duo") ── */
.pyb-duo .pyb-latest,
.pyb-duo .pyb-quizbox {
    margin-bottom: 0;
}

.pyb-duo .pyb-quizbox .pth-quiz,
.pyb-duo .pyb-quizbox .pth-qstart {
    max-width: none;
}

/* Phone and tablet: stacked, three posts, then the one-line quiz (the
   quiz turns into its Start line below 860px, so the columns stack there
   too, not at the editor's usual 781px). */
@media (max-width: 860px) {
    .wp-block-columns.pyb-duo {
        flex-wrap: wrap !important;
    }

    .wp-block-columns.pyb-duo > .wp-block-column {
        flex-basis: 100% !important;
    }

    .pyb-duo .pyb-latest li:nth-child(n+4) {
        display: none;
    }
}

/* ── Product cards (Popular): the Store's own cards, kind tabs on top ── */
.pyb-prods__row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 10px;
}

.pyb-prods__row > .pth-card[hidden] {
    display: none;
}

/* ── Trust points: small icon + two lines, side by side ── */
.pyb-trust {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
    gap: 10px;
}

.pyb-trust li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f0fdf4;
}

.pyb-trust .pyb-svg {
    color: var(--pyb-green);
}

.pyb-trust span {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.pyb-trust b {
    font-size: 14.5px;
}

.pyb-trust small {
    font-size: 12.5px;
    color: var(--pyb-muted);
}

/* ── Home blocks that use the Home's own look (pyq-dashboard.css) ── */
.pyb-home {
    margin-top: 0;
    margin-bottom: 1.5em;
}

.pyb-search {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pyb-search .pth-search {
    width: 100%;
    max-width: 580px;
}

.pyb-search .pth-count {
    justify-content: flex-start;
}

.pyb-quizbox .pth-quiz,
.pyb-quizbox .pth-qstart {
    width: 100%;
    max-width: 620px;
}

/* Phone and tablet: the one-line Start button. The Home page's own rule
   needs .pt-home above .pth-hero; in the block both are on one box. */
@media (max-width: 860px) {
    .pyb-quizbox.is-js .pth-qstart:not([hidden]) {
        display: flex;
    }
}

.pyb-reviews {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (max-width: 400px) {
    .pyb-tile__ic {
        width: 34px;
        height: 34px;
    }
}
