/*
 * Compliance calendar (#compliance-calendar), shared by index.html and
 * compliance-calendar.html (#4753). One definition of:
 *   - the --cf-* custom properties the calendar rules read;
 *   - the 51-jurisdiction list (.cfx-jur-*), moved verbatim from index.html.
 * Change it here, then bump the ?v= key on both pages.
 */

/* Self-contained CSS vars so component renders correctly on any page */
#compliance-calendar {
 --cf-brand: #22388d;
 --cf-brand-deep: #1a2b6e;
 --cf-brand-steel: #698acf;
 --cf-brand-ink: #0e1530;
 --cf-brand-gold: #a0782a;
 --cf-text: #1c2540;
 --cf-text-soft: #5a6280;
 --cf-text-faint: #8089a3;
 --cf-border: #e3e6ee;
 --cf-border-strong: #d0d5e3;
 --cf-bg-soft: #f7f8fa;
 --cf-bg-faint: #fcfcfb;
 --cf-success: #079455;
 --cf-warn: #b54708;
 --cf-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* 51-jurisdiction expandable reference */
#compliance-calendar .cfx-jur-block { margin-top: 16px; border: 1px solid var(--cf-border); border-radius: 12px; overflow: hidden; }
#compliance-calendar .cfx-jur-summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; font-size: 13.5px; font-weight: 500; color: var(--cf-brand-ink); background: var(--cf-bg-faint); transition: background 0.12s ease; }
#compliance-calendar .cfx-jur-summary::-webkit-details-marker { display: none; }
#compliance-calendar .cfx-jur-summary:hover { background: rgba(0,0,0,0.025); }
#compliance-calendar .cfx-jur-summary-label { display: inline-flex; align-items: center; gap: 9px; }
#compliance-calendar .cfx-jur-summary-label svg { color: var(--cf-text-soft); }
#compliance-calendar .cfx-jur-chevron { transition: transform 0.18s ease; color: var(--cf-text-soft); flex-shrink: 0; }
#compliance-calendar .cfx-jur-block[open].cfx-jur-chevron { transform: rotate(180deg); }
#compliance-calendar .cfx-jur-block[open].cfx-jur-summary { border-bottom: 1px solid var(--cf-border); }
#compliance-calendar .cfx-jur-body { padding: 16px 18px 18px; }
#compliance-calendar .cfx-jur-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
#compliance-calendar .cfx-jur-tab { padding: 6px 12px; background: #fff; border: 1px solid var(--cf-border); border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--cf-text); cursor: pointer; font-family: inherit; transition: all 0.15s var(--cf-ease); display: inline-flex; align-items: center; gap: 6px; }
#compliance-calendar .cfx-jur-tab:hover { border-color: var(--cf-brand-steel); }
#compliance-calendar .cfx-jur-tab.is-active { background: var(--cf-brand-ink); color: #fff; border-color: var(--cf-brand-ink); }
#compliance-calendar .cfx-jur-tab-c { font-size: 10px; padding: 1px 6px; background: var(--cf-bg-soft); color: var(--cf-text-faint); border-radius: 999px; font-weight: 400; }
#compliance-calendar .cfx-jur-tab.is-active.cfx-jur-tab-c { background: rgba(255,255,255,0.18); color: rgba(255,255,255,0.85); }
#compliance-calendar .cfx-jur-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }
#compliance-calendar .cfx-jur { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fff; border: 1px solid var(--cf-border); border-radius: 8px; transition: all 0.15s var(--cf-ease); }
#compliance-calendar .cfx-jur:hover { border-color: var(--cf-brand-steel); }
#compliance-calendar .cfx-jur-flag { width: 26px; height: 26px; background: linear-gradient(135deg, var(--cf-brand-steel), var(--cf-brand)); color: #fff; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }
#compliance-calendar .cfx-jur-text { flex: 1; min-width: 0; }
#compliance-calendar .cfx-jur-name { font-size: 12.5px; font-weight: 600; color: var(--cf-brand-ink); letter-spacing: -0.01em; }
#compliance-calendar .cfx-jur-meta { font-size: 10.5px; color: var(--cf-text-soft); font-weight: 500; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#compliance-calendar .cfx-jur-when { font-size: 10.5px; font-weight: 600; color: var(--cf-brand); font-family: 'JetBrains Mono', monospace; flex-shrink: 0; }
#compliance-calendar .cfx-jur.is-hidden { display: none; }
#compliance-calendar .cfx-jur-list { grid-template-columns: 1fr; }

/*
 * #4752: on a phone the single 1fr track grew to the rows' min-content (the
 * nowrap meta line plus the nowrap date), so rows ran past the card's
 * overflow:hidden edge and the date was cut off. Below 600px the track may
 * shrink to the card, and the date wraps at its spaces in a right-aligned
 * column of at most 14 characters ("May 1 to Nov 1" on one line,
 * "Anniversary / quarter" on two). Wider screens keep the rules above as-is.
 */
@media (max-width: 600px) {
#compliance-calendar .cfx-jur-list { grid-template-columns: minmax(0, 1fr); }
#compliance-calendar .cfx-jur { min-width: 0; }
#compliance-calendar .cfx-jur-when { flex-shrink: 1; min-width: 0; max-width: 14ch; white-space: normal; text-align: right; line-height: 1.35; }
}
