/* Participant Diversity — OJS 3.4 sidebar block + full page */

.block_participant_diversity {
    --pd-border: rgba(15, 23, 42, .10);
    --pd-muted: #64748b;
    --pd-text: #172033;
    --pd-soft: #f7f9fc;
    --pd-accent: #0f6f74;
    --pd-accent-soft: rgba(15, 111, 116, .10);
    color: var(--pd-text);
}

.block_participant_diversity .pd-sidebar-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 0;
}

.pd-sidebar-globe {
    font-size: 1.05em;
}

.block_participant_diversity .pd-sidebar-content {
    padding-top: .8rem;
}

.pd-sidebar-section {
    padding: .85rem 0;
    border-top: 1px solid var(--pd-border);
}

.pd-sidebar-section:first-child {
    padding-top: .15rem;
    border-top: 0;
}

.pd-sidebar-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .7rem;
    margin-bottom: .6rem;
}

.pd-sidebar-section-head h3 {
    margin: 0;
    color: inherit;
    font-size: .93rem;
    line-height: 1.25;
}

.pd-sidebar-country-count {
    display: block;
    margin-top: .16rem;
    color: var(--pd-muted);
    font-size: .71rem;
}

.pd-sidebar-total {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 28px;
    padding: 0 .45rem;
    border-radius: 9px;
    background: var(--pd-accent-soft);
    color: var(--pd-accent);
    font-size: .82rem;
    line-height: 1;
}

.pd-sidebar-country-list {
    display: grid;
    gap: .35rem;
}

.pd-sidebar-country-row {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: .45rem;
    padding: .35rem .4rem;
    border-radius: 8px;
    background: var(--pd-soft);
}

.pd-sidebar-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 21px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .10);
    border-radius: 4px;
    background: #fff;
    font-size: .95rem;
    line-height: 1;
    text-align: center;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .06);
}

.pd-sidebar-flag img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pd-flag-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.pd-sidebar-country-name {
    overflow: hidden;
    color: var(--pd-text);
    font-size: .78rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pd-sidebar-country-value {
    display: flex;
    align-items: baseline;
    gap: .25rem;
    color: var(--pd-text);
    white-space: nowrap;
}

.pd-sidebar-country-value strong {
    font-size: .76rem;
}

.pd-sidebar-country-value small {
    color: var(--pd-muted);
    font-size: .65rem;
}

.pd-sidebar-empty {
    margin: .35rem 0 0;
    color: var(--pd-muted);
    font-size: .76rem;
}

.pd-sidebar-view-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    width: 100%;
    box-sizing: border-box;
    margin-top: .15rem;
    padding: .66rem .75rem;
    border-radius: 9px;
    background: var(--pd-accent);
    color: #fff !important;
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none !important;
}

.pd-sidebar-view-all:hover,
.pd-sidebar-view-all:focus {
    filter: brightness(.95);
    text-decoration: none !important;
}

html[dir="rtl"] .pd-sidebar-view-all span {
    transform: rotate(180deg);
}

/* Full diversity page */
.page_participant_diversity {
    --pd-border: rgba(15, 23, 42, 0.10);
    --pd-muted: #64748b;
    --pd-text: #172033;
    --pd-soft: #f7f9fc;
    --pd-accent: #0f6f74;
    --pd-accent-soft: rgba(15, 111, 116, 0.10);
    color: var(--pd-text);
}

.pd-container { max-width: 1120px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.pd-hero { position: relative; overflow: hidden; padding: clamp(1.75rem, 4vw, 3.25rem); border: 1px solid var(--pd-border); border-radius: 24px; background: radial-gradient(circle at 85% 20%, rgba(15,111,116,.15), transparent 34%), linear-gradient(135deg,#fff 0%,#f6fbfb 100%); box-shadow: 0 20px 55px rgba(15,23,42,.07); }
.pd-eyebrow { display: inline-flex; align-items: center; padding: .35rem .7rem; margin-bottom: .8rem; border-radius: 999px; background: var(--pd-accent-soft); color: var(--pd-accent); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pd-hero h1 { margin: 0; font-size: clamp(2rem,5vw,3.4rem); line-height: 1.05; letter-spacing: -.035em; }
.pd-hero p { max-width: 760px; margin: 1rem 0 0; color: var(--pd-muted); font-size: 1.05rem; line-height: 1.75; }
.pd-summary-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; margin: 1.25rem 0 2rem; }
.pd-summary-card { display: flex; flex-direction: column; min-height: 135px; padding: 1.25rem; border: 1px solid var(--pd-border); border-radius: 18px; background: #fff; color: inherit; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.pd-summary-card:hover,.pd-summary-card:focus { transform: translateY(-2px); border-color: rgba(15,111,116,.35); box-shadow: 0 14px 35px rgba(15,23,42,.08); text-decoration: none; }
.pd-summary-card strong { margin: .25rem 0 .15rem; font-size: 2rem; line-height: 1; }
.pd-summary-label { font-weight: 700; }
.pd-summary-card > span:last-child { margin-top: auto; color: var(--pd-muted); font-size: .9rem; }
.pd-sections { display: grid; gap: 1.35rem; }
.pd-section { overflow: hidden; border: 1px solid var(--pd-border); border-radius: 22px; background: #fff; box-shadow: 0 14px 40px rgba(15,23,42,.045); }
.pd-section-head { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding: 1.5rem 1.6rem; border-bottom: 1px solid var(--pd-border); background: linear-gradient(180deg,#fff,#fbfcfd); }
.pd-section-head h2 { margin: 0; font-size: 1.4rem; }
.pd-section-head p { margin: .35rem 0 0; color: var(--pd-muted); }
.pd-total-badge { flex: 0 0 auto; min-width: 92px; padding: .75rem 1rem; border-radius: 15px; background: var(--pd-accent-soft); text-align: center; }
.pd-total-badge strong,.pd-total-badge span { display: block; }
.pd-total-badge strong { color: var(--pd-accent); font-size: 1.45rem; }
.pd-total-badge span { margin-top: .1rem; color: var(--pd-muted); font-size: .72rem; }
.pd-country-list { padding: .45rem 1.5rem 1rem; }
.pd-country-row { display: grid; grid-template-columns: minmax(210px,.9fr) minmax(160px,1.25fr) 100px; align-items: center; gap: 1.2rem; padding: 1rem .15rem; border-bottom: 1px solid rgba(15,23,42,.07); }
.pd-country-row:last-child { border-bottom: 0; }
.pd-country-main { display: flex; align-items: center; min-width: 0; gap: .9rem; }
.pd-flag { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 36px; flex: 0 0 48px; overflow: hidden; border: 1px solid rgba(15,23,42,.10); border-radius: 7px; background: #fff; font-size: 1.25rem; box-shadow: 0 2px 7px rgba(15,23,42,.07); }
.pd-flag img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pd-country-name { min-width: 0; }
.pd-country-name strong,.pd-country-name span { display: block; }
.pd-country-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-country-name span { margin-top: .18rem; color: var(--pd-muted); font-size: .76rem; letter-spacing: .06em; }
.pd-bar { overflow: hidden; height: 8px; border-radius: 999px; background: #edf1f5; }
.pd-bar span { display: block; height: 100%; min-width: 3px; border-radius: inherit; background: linear-gradient(90deg,#0f6f74,#4ba7a7); }
.pd-country-value { text-align: end; }
.pd-country-value strong,.pd-country-value span { display: block; }
.pd-country-value strong { font-size: 1.08rem; }
.pd-country-value span { margin-top: .12rem; color: var(--pd-muted); font-size: .82rem; }
.pd-empty { margin: 1.5rem; padding: 1.25rem; border: 1px dashed rgba(15,23,42,.18); border-radius: 16px; background: var(--pd-soft); text-align: center; }
.pd-empty p { margin: .35rem 0 0; color: var(--pd-muted); }
.pd-footnote { margin: 1.25rem .25rem 0; color: var(--pd-muted); font-size: .84rem; line-height: 1.6; }
html[dir="rtl"] .pd-country-value { text-align: start; }

@media (max-width: 820px) {
    .pd-summary-grid { grid-template-columns: 1fr; }
    .pd-country-row { grid-template-columns: minmax(0,1fr) 80px; }
    .pd-country-meter { display: none; }
}

@media (max-width: 540px) {
    .pd-container { padding: 1.5rem .75rem 3rem; }
    .pd-hero,.pd-section { border-radius: 16px; }
    .pd-section-head { align-items: flex-start; padding: 1.1rem; }
    .pd-country-list { padding: .3rem 1rem .8rem; }
    .pd-country-row { gap: .7rem; }
    .pd-total-badge { min-width: 70px; padding: .65rem .7rem; }
}
