/**
 * PPBN Public Styles
 *
 * Consolidated frontend styles for the Baby Names DB plugin.
 */

/* Layout */
.ppbn-two {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 1025px) {
    .ppbn-two {
        display: flex;
        gap: 24px;
        align-items: flex-start;
    }
    .ppbn-main {
        flex: 0 0 900px;
        max-width: 900px;
    }
    .ppbn-sidebar {
        flex: 1 1 auto;
        min-width: 300px;
    }
}

@media (max-width: 1024px) {
    .ppbn-sidebar {
        display: none;
    }
}

/* Chart wrapper */
.ppbn-main .ppbn-chartwrap {
    position: relative;
    width: 100%;
    height: 360px;
}

#ppbnChart {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Top states section */
.ppbn-topstates {
    margin-top: 18px;
}

.ppbn-topstates .bar {
    height: 10px;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.ppbn-topstates .bar > span {
    display: block;
    height: 100%;
    min-width: 2px;
    background: #3b82f6;
}

.ppbn-topstates table {
    width: 100%;
    border-collapse: collapse;
}

.ppbn-topstates th,
.ppbn-topstates td {
    padding: 6px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    vertical-align: middle;
}

.ppbn-share-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ppbn-share-row .pct {
    min-width: 3ch;
    text-align: right;
}

@media (max-width: 640px) {
    .ppbn-share-row {
        gap: 6px;
    }
}

/* Pills */
.ppbn-pill {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: #f1f5f9;
    text-decoration: none;
    color: inherit;
}

.ppbn-pill-up {
    background: #e8f7ee;
}

.ppbn-pill-down {
    background: #fdecec;
}

.ppbn-pill-flat {
    background: #eef2f7;
}

/* Chip (used in headings) */
.ppbn-chip {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    background: #e0f2fe;
    color: #0369a1;
    vertical-align: middle;
    margin-left: 8px;
}

/* Name list items */
.ppbn-nameitem {
    position: relative;
    padding: 10px 10px 0 0;
    border-bottom: 1px solid #eef2f7;
}

.ppbn-lirow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ppbn-liname {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ppbn-name {
    font-weight: 600;
    color: inherit;
    text-decoration: none;
}

.ppbn-name:hover {
    text-decoration: underline;
}

.ppbn-toggle {
    margin-left: auto;
    flex: 0 0 auto;
    cursor: pointer;
    border: 0;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    padding: 6px;
    border-radius: 8px;
}

.ppbn-toggle:focus {
    outline: 2px solid #94a3b8;
    outline-offset: 2px;
}

.ppbn-toggle:hover {
    background: #f1f5f9;
}

/* Glance dropdown */
.ppbn-glance {
    display: none;
    padding: 10px 0 12px;
}

.ppbn-glance.open {
    display: block;
}

.ppbn-glance .row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.ppbn-glance .col {
    flex: 1 1 260px;
}

.ppbn-glance p {
    margin: 0.25rem 0;
}

.ppbn-glance .label {
    font-weight: 600;
}

/* Enrichment section */
.ppbn-enrich {
    --ppbn-divider: #eaecef;
    --ppbn-head: #0f172a;
}

.ppbn-enrich .ppbn-section {
    margin: 28px 0;
}

.ppbn-enrich .ppbn-h {
    font-size: 1.5rem;
    line-height: 1.25;
    margin: 0 0 0.6rem;
    color: var(--ppbn-head);
    font-weight: 700;
}

p.ppbn-line {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--ppbn-divider, #eaecef);
    margin: 0;
}

p.ppbn-line:first-of-type {
    border-top: 1px solid var(--ppbn-divider, #eaecef);
}

.ppbn-enrich .ppbn-term {
    font-weight: 700;
    display: inline;
}

.ppbn-enrich .ppbn-desc {
    display: inline;
    opacity: 0.95;
}

.ppbn-enrich .ppbn-term + .ppbn-desc::before {
    content: " — ";
    opacity: 0.55;
}

.ppbn-enrich .ppbn-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0.3rem 0 0.5rem;
}

.ppbn-enrich .ppbn-pill {
    display: inline-block;
    padding: 0.4rem 0.7rem;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    background: #fff;
    font-size: 0.95rem;
    line-height: 1;
    text-decoration: none;
    color: inherit;
    margin-left: 0;
}

.ppbn-enrich .ppbn-pill:hover {
    background: #f3f4f6;
}

/* Pronunciation pill */
.ppbn-pron-pill {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 999px;
    background: #f1f5f9;
    font-size: 0.95rem;
    margin: 0.5rem 0 1rem;
}

.ppbn-pron-pill strong {
    margin-right: 6px;
}

/* Legacy pronunciation (float style) */
.ppbn-pron {
    float: right;
    font-weight: 600;
    opacity: 0.9;
    margin-left: 12px;
}

@media (max-width: 640px) {
    p.ppbn-line {
        padding: 0.75rem 0;
    }
    .ppbn-pron {
        float: none;
        display: block;
        margin: 6px 0 0;
    }
    .ppbn-pron-pill {
        display: block;
        text-align: center;
    }
}

/* Tables */
.ppbn-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.ppbn-table th,
.ppbn-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.ppbn-table th {
    background: #f9f9f9;
    font-weight: 600;
}

.ppbn-table tbody tr:hover {
    background: #f9f9f9;
}

.ppbn-table .num {
    text-align: right;
}

/* Lists */
.ppbn-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ppbn-lead {
    font-size: 1.1rem;
    opacity: 0.85;
    margin-bottom: 1rem;
}

.ppbn-meta-line {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

/* Floating action button */
.ppbn-fab {
    position: fixed;
    z-index: 9999;
    left: 24px;
    top: 30vh;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ppbn-fab button,
.ppbn-fab select {
    font-size: 14px;
    line-height: 1;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 10px 14px;
}

.ppbn-fab .ppbn-fab-small {
    padding: 8px 12px;
}

.ppbn-fab .ppbn-fab-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.ppbn-fab .ppbn-fab-note {
    font-size: 12px;
    opacity: 0.7;
    text-align: center;
}

@media (max-width: 800px) {
    .ppbn-fab {
        left: auto;
        right: 14px;
        top: 12px;
        flex-direction: row;
        background: transparent;
    }
}
