/**
 * DDC default styles.
 *
 * Themes override by re-declaring these CSS variables in their own stylesheet
 * (loaded AFTER ddc.css). Example in theme style.css:
 *
 *   :root {
 *     --ddc-bg:        #0d1b2a;
 *     --ddc-text:      #e0e1dd;
 *     --ddc-border:    rgba(255,255,255,0.08);
 *     --ddc-warn-bg:   rgba(255, 200, 80, 0.1);
 *   }
 */

:root {
    --ddc-bg:          transparent;
    --ddc-text:        inherit;
    --ddc-border:      rgba(0, 0, 0, 0.08);
    --ddc-radius:      8px;
    --ddc-pad:         14px;
    --ddc-warn-bg:     #fff8e5;
    --ddc-warn-border: #f0c040;
    --ddc-error-bg:    #fde8e8;
    --ddc-error-text:  #b91c1c;
}

.ddc-chart {
    background: var(--ddc-bg);
    color:      var(--ddc-text);
    border:     1px solid var(--ddc-border);
    border-radius: var(--ddc-radius);
    padding:    var(--ddc-pad);
    margin:     16px 0;
}

/* Titled chart box — the chart title sits in the TOP-LEFT corner with
   consistent, attractive typography. Injected by ddc-core.js around every
   chart mount; matches the title baked into the server-rendered PNG.
   The card chrome (border/padding/bg) moves onto the box so the title lives
   INSIDE the card, above the plot. */
.ddc-chart-box {
    position: relative;
    width: 100%;
    margin: 16px 0;
    background: var(--ddc-bg);
    border: 1px solid var(--ddc-border);
    border-radius: var(--ddc-radius);
    padding: var(--ddc-pad);
}
.ddc-chart-box > .ddc-chart {
    margin: 0;
    border: none;
    padding: 0;
    background: none;
}
.ddc-chart-title {
    font-family: var(--ddc-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--ddc-title, #1d2327);
    margin: 0 0 6px 2px;
    text-align: left;
}
@media (min-width: 782px) {
    .ddc-chart-title { font-size: 16px; }
}

.ddc-warn {
    background:    var(--ddc-warn-bg);
    border:        1px dashed var(--ddc-warn-border);
    padding:       10px 14px;
    border-radius: var(--ddc-radius);
    font-size:     13px;
    margin:        12px 0;
}

.ddc-error {
    background:    var(--ddc-error-bg);
    color:         var(--ddc-error-text);
    padding:       10px 14px;
    border-radius: var(--ddc-radius);
    font-size:     13px;
}

/* Circular packing — dependency-free SVG. */
.ddc-circular-svg { display: block; width: 100%; }
.ddc-circular-svg circle { transition: fill-opacity .12s ease; cursor: default; }
.ddc-circular-svg circle:hover { fill-opacity: 1; }
.ddc-circular-svg text { pointer-events: none; user-select: none; }

/* Choropleth maps (vnmap / worldmap) — rendered as dependency-free SVG. */
.ddc-map {
    position: relative;
}
.ddc-map-svg {
    display: block;
    width: 100%;
}
.ddc-map-svg .ddc-region {
    stroke: #fff;
    stroke-width: 0.5;
    transition: opacity .12s ease;
    cursor: pointer;
}
.ddc-map-svg .ddc-region:hover {
    opacity: 0.78;
}
.ddc-map-hint {
    background:    var(--ddc-warn-bg);
    border:        1px dashed var(--ddc-warn-border);
    padding:       12px 14px;
    border-radius: var(--ddc-radius);
    font-size:     13px;
}
.ddc-map-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #666;
    margin-top: 6px;
}
.ddc-map-legend i {
    display: inline-block;
    width: 120px;
    height: 10px;
    border-radius: 5px;
}

/* Grid helper for the demo HTML page (paste in WP post too). */
.ddc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 16px;
    margin: 24px 0;
}
.ddc-grid > .ddc-card {
    background: #fff;
    border: 1px solid var(--ddc-border);
    border-radius: var(--ddc-radius);
    padding: 16px;
}
.ddc-grid > .ddc-card h3 {
    margin: 0 0 4px;
    font-size: 15px;
}
.ddc-grid > .ddc-card p.sub {
    margin: 0 0 10px;
    color: #666;
    font-size: 12px;
}
