/* Dividend Calendar — uses the global design tokens from style.css.
   Only two feature-specific colors are introduced, matching the house palette:
   pay date = brand green (--brand), ex-date = amber (estimate/caution hue). */

.divcal {
    --divcal-pay: var(--brand, #008254);
    --divcal-pay-soft: var(--brand-soft, #e4f0ea);
    --divcal-ex: #d97706;
    --divcal-ex-soft: #fdf1e3;
    --divcal-radius: 10px;
    color: var(--ink-strong, #1a1f26);
    padding-top: 0.9rem;
    padding-left: 32px;
    padding-right: 32px;
    margin-bottom: 3rem;
}

/* ---- Hero ---- */
.divcal-hero {
    margin-bottom: 1.5rem;
}
.divcal-eyebrow {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand, #008254);
    margin: 0 0 0.35rem;
}
.divcal-title {
    font-weight: 700;
    font-size: 1.85rem;
    letter-spacing: -0.02em;
    margin: 0 0 0.4rem;
}
.divcal-subtitle {
    font-size: 0.98rem;
    color: var(--ink-muted, #5c656f);
    line-height: 1.6;
    margin: 0;
    max-width: 60ch;
}

/* ---- Toolbar ---- */
.divcal-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.divcal-monthnav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.divcal-navbtn {
    width: 2.2rem;
    height: 2.2rem;
    border: 1px solid var(--border-soft, #d8ddd6);
    background: #fff;
    border-radius: 999px;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--ink-strong, #1a1f26);
    cursor: pointer;
    transition: all 0.2s ease;
}
.divcal-navbtn:hover {
    border-color: #b9d6c8;
    background: var(--accent-soft, #e4f0ea);
    color: var(--accent-deep, #065f46);
}
.divcal-month-label {
    min-width: 9.5rem;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
}
.divcal-todaybtn {
    margin-left: 0.25rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border-soft, #d8ddd6);
    background: #fff;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--ink-muted, #5c656f);
    cursor: pointer;
    transition: all 0.2s ease;
}
.divcal-todaybtn:hover {
    border-color: #b9d6c8;
    background: var(--accent-soft, #e4f0ea);
    color: var(--accent-deep, #065f46);
}
.divcal-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem;
    font-size: 0.84rem;
    color: var(--ink-muted, #5c656f);
}
.divcal-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.divcal-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
    display: inline-block;
}
.divcal-dot-ex { background: var(--divcal-ex); }
.divcal-dot-pay { background: var(--divcal-pay); }
.divcal-legend-est { font-style: italic; }

/* ---- Filters ---- */
.divcal-filters { padding: 1rem 1.1rem; margin-bottom: 1.25rem; }
.divcal-filters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.7rem;
}
.divcal-filters-title { font-weight: 700; font-size: 0.92rem; }
.divcal-filters-actions { display: flex; gap: 0.75rem; }
.divcal-linkbtn {
    border: none;
    background: none;
    color: var(--brand, #008254);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.divcal-linkbtn:hover { text-decoration: underline; }
.divcal-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.divcal-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.2rem;
    padding: 0.35rem 0.7rem 0.35rem 0.4rem;
    border: 1px solid var(--border-soft, #d8ddd6);
    border-radius: 999px;
    background: #fff;
    color: var(--ink-muted, #5c656f);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}
.divcal-chip .reit-logo-wrap { width: 1.55rem; height: 1.55rem; border-radius: 0.5rem; }
.divcal-chip.is-active {
    border-color: #b9d6c8;
    background: var(--accent-soft, #e4f0ea);
    color: var(--accent-deep, #065f46);
}
.divcal-chip.is-inactive { opacity: 0.5; }

/* ---- Layout ---- */
.divcal-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.25rem;
    align-items: start;
    margin-bottom: 1.25rem;
}
.divcal-grid-card { padding: 1rem; }

/* ---- Calendar grid ---- */
.divcal-weekdays,
.divcal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}
.divcal-weekdays {
    margin-bottom: 6px;
}
.divcal-weekday {
    text-align: center;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--ink-muted, #5c656f);
    padding: 0.25rem 0;
}
.divcal-weekday.is-sun { color: #c4453b; }
.divcal-weekday.is-sat { color: var(--market-down, #1d56c8); }

.divcal-day {
    min-height: 96px;
    border: 1px solid var(--border-soft, #d8ddd6);
    border-radius: 8px;
    background: #fff;
    padding: 0.35rem 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow: hidden;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.divcal-day.is-other { background: var(--surface-muted, #ecefea); opacity: 0.6; }
.divcal-day.is-clickable { cursor: pointer; }
.divcal-day.is-clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(18, 32, 25, 0.08);
}
.divcal-day.is-selected { border-color: var(--brand, #008254); box-shadow: 0 0 0 1px var(--brand, #008254) inset; }
.divcal-daynum {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ink-strong, #1a1f26);
}
.divcal-day.is-today .divcal-daynum {
    background: var(--brand, #008254);
    color: #fff;
    border-radius: 999px;
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.divcal-day.is-sun .divcal-daynum { color: #c4453b; }
.divcal-day.is-sat .divcal-daynum { color: var(--market-down, #1d56c8); }

.divcal-evt {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.12rem 0.3rem;
    border-radius: 5px;
    border-left: 3px solid transparent;
    font-size: 0.72rem;
    line-height: 1.2;
    background: var(--surface-muted, #ecefea);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.divcal-evt-pay { border-left-color: var(--divcal-pay); background: var(--divcal-pay-soft); }
.divcal-evt-ex { border-left-color: var(--divcal-ex); background: var(--divcal-ex-soft); }
.divcal-evt-logo { width: 14px; height: 14px; border-radius: 3px; object-fit: contain; flex-shrink: 0; background: #fff; }
.divcal-evt-name { overflow: hidden; text-overflow: ellipsis; }
.divcal-evt-amt { margin-left: auto; font-weight: 700; }
.divcal-evt-est { color: var(--ink-muted, #5c656f); }
.divcal-evt-more {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--ink-muted, #5c656f);
    padding-left: 0.3rem;
}

/* ---- Side panel ---- */
.divcal-side { display: flex; flex-direction: column; gap: 1.25rem; }
.divcal-day-detail { padding: 1rem 1.1rem; }
.divcal-day-detail-empty { color: var(--ink-muted, #5c656f); font-size: 0.9rem; margin: 0; }
.divcal-day-detail-date { font-weight: 700; font-size: 1rem; margin: 0 0 0.6rem; }
.divcal-detail-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border-soft, #d8ddd6);
}
.divcal-detail-row:first-of-type { border-top: none; }
.divcal-detail-name { font-weight: 600; font-size: 0.88rem; }
.divcal-detail-meta { font-size: 0.76rem; color: var(--ink-muted, #5c656f); }
.divcal-detail-amt { margin-left: auto; font-weight: 700; color: var(--brand-deep, #065f46); }

.divcal-summary { padding: 1rem 1.1rem; }
.divcal-summary-title { font-size: 0.95rem; font-weight: 700; margin: 0 0 0.6rem; }
.divcal-summary-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-deep, #065f46);
}
.divcal-summary-sub { font-size: 0.8rem; color: var(--ink-muted, #5c656f); margin-top: 0.2rem; }
.divcal-summary-empty { font-size: 0.86rem; color: var(--ink-muted, #5c656f); }

.divcal-shares { margin-top: 0.9rem; }
.divcal-shares > summary {
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand, #008254);
}
.divcal-shares-hint { font-size: 0.74rem; color: var(--ink-muted, #5c656f); margin: 0.4rem 0; }
.divcal-shares-inputs { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.4rem; max-height: 240px; overflow-y: auto; }
.divcal-share-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; }
.divcal-share-row label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divcal-share-row input {
    width: 6.5rem;
    padding: 0.25rem 0.45rem;
    border: 1px solid var(--border-soft, #d8ddd6);
    border-radius: 6px;
    font-size: 0.8rem;
    text-align: right;
}
.divcal-share-row input:focus {
    border-color: var(--brand, #008254);
    outline: none;
    box-shadow: 0 0 0 0.15rem rgba(0, 130, 84, 0.14);
}

/* ---- Upcoming table ---- */
.divcal-upcoming { padding: 1.1rem 1.25rem; }
.divcal-upcoming-title { font-size: 1rem; font-weight: 700; margin: 0 0 0.8rem; }
.divcal-upcoming-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.divcal-upcoming-table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
}
.divcal-upcoming-table thead th {
    text-align: left;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink-muted, #5c656f);
    background: var(--table-header-bg, #e6e0cc);
    height: var(--table-header-height, 40px);
    vertical-align: middle;
    padding: 0 0.6rem;
    white-space: nowrap;
}
.divcal-upcoming-table tbody td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--border-soft, #d8ddd6);
    font-size: 0.86rem;
    vertical-align: middle;
}
.divcal-upcoming-table tbody tr:hover td { background: var(--surface-muted, #ecefea); }
.divcal-up-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.divcal-up-dps { font-weight: 700; white-space: nowrap; }
.divcal-reit-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: max-content;
    white-space: nowrap;
}
.divcal-reit-cell .reit-logo-wrap { width: 1.8rem; height: 1.8rem; border-radius: 0.55rem; }
.divcal-reit-name {
    font-weight: 600;
    white-space: nowrap;
    word-break: keep-all;
}

/* ---- Badges ---- */
.divcal-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}
.divcal-badge-pay { background: var(--divcal-pay-soft); color: var(--brand-deep, #065f46); }
.divcal-badge-ex { background: var(--divcal-ex-soft); color: #b45309; }
.divcal-est-mark { color: var(--ink-muted, #5c656f); font-weight: 700; }
.divcal-est-mark, .divcal-evt-est { font-size: 0.85em; }

.divcal-note { font-size: 0.78rem; color: var(--ink-muted, #5c656f); margin-top: 0.5rem; }
.divcal-noscript, .divcal-empty { color: var(--ink-muted, #5c656f); font-size: 0.9rem; }

/* ---- SEO landing pages (per-REIT / per-month) ---- */
.divcal-reit-head {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}
.divcal-reit-head .reit-logo-wrap { width: 3.2rem; height: 3.2rem; border-radius: 0.9rem; }
.divcal-reit-head .divcal-title { margin: 0 0 0.25rem; }
.divcal-reit-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem;
    margin: 0;
    font-size: 0.88rem;
    color: var(--ink-muted, #5c656f);
}
.divcal-reit-sub .yield-value { color: var(--brand-deep, #065f46); font-weight: 700; }
.divcal-reit-detaillink { color: var(--brand, #008254); text-decoration: none; font-weight: 600; }
.divcal-reit-detaillink:hover { text-decoration: underline; }

.divcal-next { padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.divcal-next-title { font-size: 0.95rem; font-weight: 700; margin: 0 0 0.7rem; }
.divcal-next-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.divcal-next-grid > div { display: flex; flex-direction: column; gap: 0.2rem; }
.divcal-next-label { font-size: 0.78rem; color: var(--ink-muted, #5c656f); font-weight: 600; }
.divcal-next-value { font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.divcal-ex-color { color: #b45309; }
.divcal-pay-color { color: var(--brand-deep, #065f46); }

@media (max-width: 480px) {
    .divcal-next-grid { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .divcal-layout { grid-template-columns: minmax(0, 1fr); }
    .divcal-side { flex-direction: column; }
}
@media (max-width: 420px) {
    .divcal-toolbar {
        align-items: flex-start;
    }
    .divcal-monthnav {
        display: grid;
        grid-template-columns: 2.2rem minmax(0, 1fr) 2.2rem;
        gap: 0.5rem;
        width: 100%;
    }
    .divcal-month-label {
        min-width: 0;
        text-align: center;
    }
    .divcal-todaybtn {
        grid-column: 1 / -1;
        justify-self: flex-start;
        margin-left: 0;
    }
    .divcal-legend {
        gap: 0.6rem;
        font-size: 0.8rem;
    }
    .divcal-upcoming-table {
        min-width: 31rem;
    }
}
@media (max-width: 560px) {
    .divcal-title { font-size: 1.5rem; }
    .divcal-grid-card { padding: 0.6rem; }
    .divcal-weekdays, .divcal-grid { gap: 3px; }
    .divcal-day { min-height: 64px; padding: 0.25rem 0.28rem; }
    .divcal-day-detail,
    .divcal-summary,
    .divcal-upcoming {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }
    .divcal-evt-more { font-size: 0.65rem; }
    .divcal-evt-name, .divcal-evt-amt { display: none; }
    .divcal-evt { justify-content: center; padding: 0.1rem; }
    .divcal-evt-logo { width: 12px; height: 12px; }
}
