/*
############################################################################
# Full d'estils de l'informe de tendències
############################################################################
*/

:root {
    --bg: #f3f5f8;
    --card: #ffffff;
    --text: #1f2a37;
    --muted: #64748b;
    --line: #dfe5ec;
    --head-bg: #e9eef4;
    --head-text: #2c3e50;
    --accent: #11557c;
    --accent-dark: #0b3a57;
    --accent-soft: #e4f0f7;
    --warm: #b3261e;
    --cold: #1d4ed8;
    --wet: #1d4ed8;
    --dry: #b45309;
    --radius: 12px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

a { color: var(--accent); }

.wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- Capçalera i peu ---------- */

.site-header {
    background: linear-gradient(135deg, var(--accent-dark), var(--accent) 60%, #1f7aa8);
    color: #fff;
    padding: 18px 0;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(11, 58, 87, .25);
}
.site-header .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 14px;
}
.site-header .brand { font-size: 1.35rem; font-weight: 700; letter-spacing: .01em; }
.site-header .brand-sub { font-size: .95rem; opacity: .8; }

body.embedded { padding-top: 16px; }

.site-footer {
    color: var(--muted);
    font-size: .78rem;
    text-align: right;
    padding: 20px 0 32px;
}
.site-footer a { color: inherit; }

/* ---------- Targeta ---------- */

#main-copy {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
    padding: 24px;
    overflow-x: auto;
}

#report h1 {
    margin: 0 0 4px;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent-dark);
}

#report .report-head {
    text-align: center;
    margin-bottom: 20px;
    color: var(--muted);
    font-size: .9rem;
}
#report .report-head p { margin: 4px 0 0; }

#report .note {
    font-size: .8rem;
    color: var(--muted);
    margin: 8px 0 14px;
}

/* ---------- Taules ---------- */

#report table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

#report .trend-table { margin-bottom: 24px; }

#report td,
#report th {
    border: 1px solid #fff;
    text-align: center;
    padding: 6px 8px;
    font-size: .88rem;
}

#report .tableheading {
    background-color: var(--accent);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    padding: 8px;
    border-radius: 8px 8px 0 0;
}

#report .labels,
#report .reportttl {
    background-color: var(--head-bg);
    color: var(--head-text);
    font-weight: 600;
}
#report .reportttl { text-align: left; padding-left: 12px; }

#report .row-light td { background: #f8fafc; }
#report .row-dark td  { background: #eef2f6; }
#report td.month { font-weight: 600; color: var(--head-text); text-align: left; padding-left: 12px; }
#report .year { color: var(--muted); font-size: .78rem; }

#report .yeartotals {
    background-color: #e3f1e6;
    color: #1e4a2b;
    font-weight: 600;
}

#report .separator {
    background: transparent;
    border: none;
    height: 10px;
    padding: 0;
}

/* Diferències i fletxes */
#report .diff { font-weight: 600; white-space: nowrap; cursor: help; }
#report .temp-up   { color: var(--warm); }
#report .temp-down { color: var(--cold); }
#report .rain-up   { color: var(--wet); }
#report .rain-down { color: var(--dry); }
#report .trend { font-size: .65rem; vertical-align: middle; }

#report .infotext {
    background-color: var(--accent-soft);
    border: none;
    border-left: 4px solid var(--accent);
    border-radius: 6px;
    text-align: left;
    font-size: .85rem;
    padding: 10px 14px;
}

/* ---------- Mòbil i impressió ---------- */

@media (max-width: 700px) {
    body { font-size: 14px; }
    #main-copy { padding: 14px; border-radius: 0; margin: 0 -16px; border-left: none; border-right: none; }
    #report h1 { font-size: 1.3rem; }
    #report td, #report th { padding: 5px 4px; font-size: .8rem; }
    #report td.month, #report .reportttl { padding-left: 6px; }
}

@media print {
    body { background: #fff; font-size: 11px; }
    .site-header { display: none !important; }
    #main-copy { border: none; box-shadow: none; padding: 0; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
