/* B-POETRY-2026-11-19 — Diamond Urdu Books poetry detail + list fixes.
 * Pack B (audit 2026-11-19, workstream B). Loaded ONLY on the poetry
 * detail + list templates (patch/apply-b-poetry.php E2/E3 injects the
 * <link> and the body classes). Every rule is scoped under
 * body.b-poetry-detail / body.b-poetry-list (or a b-* class the patcher
 * adds), so it cannot leak onto book, dictionary, admin or Shah Zar PDF
 * pages. Palette matches the live site: teal #0f766e, green #15966b,
 * gold #c49a55, Nastaliq 'Jameel Noori Nastaliq'.
 *
 * FONT SIZE NOTE (audit §3 + print-submit audit §1): the exact computed
 * font size was NEVER verified — DevTools would not open in the audit
 * browser. The 28-32px Nastaliq body estimate is a MEASURED ON-SCREEN
 * ESTIMATE, not a CSS value. The sizes below are therefore chosen
 * against the audit's measured ink heights (title ink 13px vs book
 * title 29px; poem line pitch 66-78px), not against a verified
 * computed value. Verify the rendered result live (§6 of the README).
 */

/* ---- Defect 2: poem title + poem text ---- */
body.b-poetry-detail h1.b-poem-title,
body.b-poetry-detail h1 {
    font-family: 'Jameel Noori Nastaliq', 'Noto Nastaliq Urdu', serif;
    font-size: 34px;
    line-height: 1.9;
    margin: 0 0 6px;
}

.b-poem-text,
body.b-poetry-detail .poem {
    font-family: 'Jameel Noori Nastaliq', 'Noto Nastaliq Urdu', serif;
    font-size: 34px;
    line-height: 1.9;
    text-align: center;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* ---- Defect 1: poet block (matches the book-page author block) ---- */
.b-poet-card {
    display: flex;
    direction: rtl;
    gap: 16px;
    align-items: flex-start;
    text-align: right;
}

.b-poet-avatar {
    order: -1;
    width: 120px !important;
    height: 120px !important;
    min-width: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #c49a55;
}

.b-poet-card strong,
.b-poet-card h2,
.b-poet-card h3 {
    font-size: 22px;
    line-height: 1.8;
}

.b-poet-card p {
    font-size: 16px;
    line-height: 2;
}

.b-poet-meta {
    font-size: 15px;
    color: #4b5563;
    line-height: 1.9;
    margin: 4px 0;
}

.b-read-more {
    color: #0f766e;
    font-size: 15px;
    text-decoration: none;
}

.b-read-more:hover {
    text-decoration: underline;
}

/* ---- Defect 1: Details grid as book-page stat boxes ---- */
.b-details-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.b-details-grid > * {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    text-align: center;
    min-width: 0;
}

/* Icons assume the audit's label order: Poet / Type / Views / Likes /
   Submitted by. The patcher warns (not stops) if the live order
   differs — verify each icon against its label in README §6. */
.b-details-grid > *::before {
    content: "";
    display: block;
    width: 22px;
    height: 22px;
    margin: 0 auto 4px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.b-details-grid > *:nth-child(1)::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f766e' stroke-width='2'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 3.6-6 8-6s8 2 8 6'/%3E%3C/svg%3E");
}

.b-details-grid > *:nth-child(2)::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f766e' stroke-width='2'%3E%3Cpath d='M3 11V4h7l10 10-7 7L3 11z'/%3E%3Ccircle cx='8' cy='9' r='1.5'/%3E%3C/svg%3E");
}

.b-details-grid > *:nth-child(3)::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f766e' stroke-width='2'%3E%3Cpath d='M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6-10-6-10-6z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

.b-details-grid > *:nth-child(4)::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f766e' stroke-width='2'%3E%3Cpath d='M12 20s-7-4.5-9-9c-1.5-3.5 1-7 4.5-7 2 0 3.5 1.2 4.5 3 1-1.8 2.5-3 4.5-3 3.5 0 6 3.5 4.5 7-2 4.5-9 9-9 9z'/%3E%3C/svg%3E");
}

.b-details-grid > *:nth-child(5)::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f766e' stroke-width='2'%3E%3Cpath d='M17 3l4 4L8 20l-5 1 1-5L17 3z'/%3E%3C/svg%3E");
}

/* ---- Defect 4: windowed pagination ---- */
.b-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: center;
    margin: 16px 0;
}

.b-pagination a,
.b-pagination span {
    display: inline-block;
    min-width: 36px;
    padding: 6px 10px;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #0f766e;
    text-decoration: none;
    font-size: 15px;
    line-height: 1.6;
}

.b-pagination a.active,
.b-pagination .current,
.b-pagination span.current {
    background: #0f766e;
    color: #fff;
    border-color: #0f766e;
}

.b-pagination .b-page-gap {
    border: 0;
    color: #6b7280;
    min-width: 0;
    padding: 6px 2px;
}

/* ---- Defect 4: list filters match the site ---- */
.b-filter-input {
    padding: 10px 12px;
    border: 1.5px solid #0f766e;
    border-radius: 10px;
    background: #fff;
    font-family: 'Jameel Noori Nastaliq', 'Noto Nastaliq Urdu', serif;
    font-size: 16px;
    line-height: 1.8;
    color: #172a43;
    width: 100%;
    box-sizing: border-box;
}

/* ---- Defect 4: Sher of the Day — tighten the empty area ---- */
.b-sher-day {
    padding: 14px 16px !important;
}

.b-sher-day h2 {
    font-size: 20px;
    line-height: 1.8;
    margin: 0 0 4px;
}

.b-sher-day p {
    margin: 0;
}

/* ---- Defect 6: prev/next poem navigation ---- */
.b-poem-nav {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* ---- Mobile: 390px (NOT tested in the audit — verify live, README §6) ---- */
@media (max-width: 640px) {
    .b-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .b-poet-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .b-poet-avatar {
        order: 0;
    }
}

@media (max-width: 390px) {
    body.b-poetry-detail h1.b-poem-title,
    body.b-poetry-detail h1 {
        font-size: 28px;
    }

    .b-poem-text,
    body.b-poetry-detail .poem {
        font-size: 28px;
    }

    .b-details-grid {
        grid-template-columns: 1fr;
    }
}

/* C-r7 (2026-11-20): compact Details/meta boxes on mobile — the owner
 * asked for smaller boxes and an end to the long single-column queue
 * ("خانے چھوٹے کرو اور لمبی قطار ختم کرو"). The B r7 file set
 * grid-template-columns: 1fr below 390px, so the 5 boxes stacked into
 * one long vertical queue of full-width boxes. Below 720px they now
 * wrap into a compact 2-per-row grid with smaller padding, type and
 * icons. Desktop (above 720px) is UNCHANGED. */
@media (max-width: 720px) {
    .b-details-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px;
    }

    .b-details-grid > * {
        padding: 6px 8px;
        font-size: 13px;
        line-height: 1.6;
    }

    .b-details-grid > *::before {
        width: 16px;
        height: 16px;
        margin: 0 auto 2px;
    }
}