/**
 * TP P-SEO Engine — front end
 *
 * The generated pages render hospital/doctor grids, a cost-comparison table
 * and a visa block. Until now the plugin shipped NO stylesheet at all, so
 * those came out as unstyled markup whose appearance depended entirely on
 * whatever the active theme happened to do with a bare <div> or <table>.
 *
 * ── SHARED DESIGN TOKENS ─────────────────────────────────────────────────
 * Every value below reads a --hpp-* custom property with an identical
 * literal fallback. When Hospital Partner Portal is active its stylesheet
 * defines those properties and the two plugins render as one system; when
 * it is not, the fallbacks keep this file self-sufficient and visually
 * identical. Keep the fallbacks in sync with HPP's frontend.css :root block.
 */

/* ===== Grids ===== */
.pseo-hospital-grid,
.pseo-doctor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
    margin: 24px 0;
}

/* Explicit column counts from the shortcode's columns="" attribute. */
.pseo-cols-1 { grid-template-columns: 1fr; }
.pseo-cols-2 { grid-template-columns: repeat(2, 1fr); }
.pseo-cols-3 { grid-template-columns: repeat(3, 1fr); }
.pseo-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Defeat theme nth-child / column-span rules, and hide stray <br> that
   wpautop can inject between grid children. */
.pseo-hospital-grid > *,
.pseo-doctor-grid > * {
    width: auto;
    max-width: none;
    margin: 0;
    float: none;
    clear: none;
}

.pseo-hospital-grid > br,
.pseo-doctor-grid > br,
.pseo-card > br { display: none; }

/* ===== Cards ===== */
.pseo-card {
    display: flex;
    flex-direction: column;
    background: var(--hpp-bg, #ffffff);
    border: 1px solid var(--hpp-line, #e2e8f0);
    border-radius: var(--hpp-r, 10px);
    overflow: hidden;
    padding: 0 0 16px;
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}

.pseo-card:hover {
    border-color: var(--hpp-accent-line, #bae6fd);
    box-shadow: var(--hpp-shadow-lg, 0 4px 12px rgba(15,23,42,.08), 0 12px 28px rgba(15,23,42,.06));
    transform: translateY(-2px);
}

.pseo-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    background: var(--hpp-bg-alt, #f8fafc);
    margin-bottom: 14px;
}

.pseo-doctor-card .pseo-doctor-photo {
    aspect-ratio: 1 / 1;
}

.pseo-card h3 {
    font-size: 1.05rem;
    line-height: 1.35;
    margin: 0 0 6px;
    padding: 0 16px;
    color: var(--hpp-ink, #0f172a);
}

.pseo-card h3 a {
    color: inherit;
    text-decoration: none;
}

.pseo-card h3 a:hover { color: var(--hpp-accent, #0369a1); }

.pseo-card p {
    margin: 0 0 5px;
    padding: 0 16px;
    font-size: .875rem;
    line-height: 1.45;
    color: var(--hpp-muted, #64748b);
}

/* Meaningful distinctions between the card's lines. */
.pseo-desig  { color: var(--hpp-body, #334155); }
.pseo-city,
.pseo-qual   { color: var(--hpp-muted, #64748b); }
.pseo-exp,
.pseo-beds   { color: var(--hpp-faint, #94a3b8); font-size: .82rem; }

.pseo-accred {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    font-size: .76rem;
    color: var(--hpp-accent-hover, #075985);
}

.pseo-affil {
    margin-top: auto;
    padding-top: 10px;
    font-size: .82rem;
}

.pseo-affil a {
    color: var(--hpp-accent, #0369a1);
    text-decoration: none;
    font-weight: 600;
}

.pseo-affil a:hover { color: var(--hpp-accent-hover, #075985); }

/* ===== Cost comparison table ===== */
.pseo-cost-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: .95rem;
    border: 1px solid var(--hpp-line, #e2e8f0);
    border-radius: var(--hpp-r, 10px);
    overflow: hidden;
}

.pseo-cost-table thead th {
    background: var(--hpp-bg-alt, #f8fafc);
    color: var(--hpp-faint, #94a3b8);
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 11px 16px;
    border-bottom: 1px solid var(--hpp-line, #e2e8f0);
}

.pseo-cost-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--hpp-line-soft, #f1f5f9);
    color: var(--hpp-body, #334155);
}

.pseo-cost-table tbody tr:last-child td { border-bottom: 0; }

/* India leads the table (the query forces it first) — mark it as the
   destination price rather than just another row. */
.pseo-cost-table tbody tr:first-child td {
    background: var(--hpp-accent-soft, #f0f9ff);
    font-weight: 650;
    color: var(--hpp-ink, #0f172a);
}

/* ===== Visa block ===== */
.pseo-visa-block {
    border: 1px solid var(--hpp-line, #e2e8f0);
    border-radius: var(--hpp-r, 10px);
    overflow: hidden;
    margin: 20px 0;
}

.pseo-visa-block table {
    width: 100%;
    border-collapse: collapse;
    font-size: .93rem;
}

.pseo-visa-block th {
    width: 210px;
    text-align: left;
    vertical-align: top;
    padding: 12px 16px;
    background: var(--hpp-bg-alt, #f8fafc);
    color: var(--hpp-muted, #64748b);
    font-size: 12px;
    font-weight: 600;
    border-bottom: 1px solid var(--hpp-line-soft, #f1f5f9);
    border-right: 1px solid var(--hpp-line, #e2e8f0);
}

.pseo-visa-block td {
    padding: 12px 16px;
    color: var(--hpp-body, #334155);
    line-height: 1.55;
    border-bottom: 1px solid var(--hpp-line-soft, #f1f5f9);
}

.pseo-visa-block tr:last-child th,
.pseo-visa-block tr:last-child td { border-bottom: 0; }

/* ===== Editable content slots ===== */
.pseo-extra { margin: 20px 0; }
.pseo-extra > :first-child { margin-top: 0; }
.pseo-extra > :last-child { margin-bottom: 0; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .pseo-cols-3,
    .pseo-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .pseo-hospital-grid,
    .pseo-doctor-grid,
    .pseo-cols-2,
    .pseo-cols-3,
    .pseo-cols-4 { grid-template-columns: 1fr; }

    /* Stack the visa table's label/value pairs. */
    .pseo-visa-block th,
    .pseo-visa-block td {
        display: block;
        width: auto;
        border-right: 0;
    }

    .pseo-visa-block th {
        border-bottom: 0;
        padding-bottom: 2px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pseo-card { transition: none; }
    .pseo-card:hover { transform: none; }
}
