/* Home area styles (loaded after styles.css). */

/* Status colours for the publishing donut (fixed status steps; see pages/home.js for ring order). */
:root {
  --home-st-scheduled: var(--series-1);
  --home-st-published: #0ca30c;
  --home-st-partial: #fab219;
  --home-st-failed: #d03b3b;
}

.home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-width: 0; }
.home-head h1 { font-size: 21px; }
.home-date { color: var(--text-2); margin-top: 4px; }
.home-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.home-compose .btn-icon { width: 36px; }

/* widget grid: publishing · to-do · plan usage / upcoming (wide) · inbox */
.home-grid-wrap { container-type: inline-size; min-width: 0; }
.home-grid {
  display: grid; gap: 16px; align-items: start; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "pub" "todo" "inbox" "upcoming" "usage";
}
.home-grid.no-inbox { grid-template-areas: "pub" "todo" "upcoming" "usage"; }
@container (min-width: 620px) {
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "pub todo" "usage inbox" "upcoming upcoming"; }
  .home-grid.no-inbox { grid-template-areas: "pub todo" "usage usage" "upcoming upcoming"; }
}
@container (min-width: 940px) {
  .home-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "pub todo usage" "upcoming upcoming inbox"; }
  .home-grid.no-inbox { grid-template-areas: "pub todo usage" "upcoming upcoming upcoming"; }
}
.home-area-pub { grid-area: pub; }
.home-area-todo { grid-area: todo; }
.home-area-usage { grid-area: usage; }
.home-area-inbox { grid-area: inbox; }
.home-area-upcoming { grid-area: upcoming; }
.home-card { height: auto; }

/* content publishing */
.home-pub { display: flex; align-items: center; justify-content: center; gap: 16px 20px; flex-wrap: wrap; min-height: 160px; transition: opacity .15s; }
.home-pub.is-loading { opacity: .5; }
.home-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; flex: 1 1 150px; min-width: 0; }
.home-legend-link { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 7px; color: var(--text); font-size: 13px; text-decoration: none; }
.home-legend-link:hover { background: var(--hover); text-decoration: none; }
.home-legend-link strong { font-variant-numeric: tabular-nums; }
.home-key { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.home-period { gap: 6px; }

/* to-do */
.home-todos { display: flex; flex-direction: column; }
.home-todo { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; min-width: 0; }
.home-todo:last-child { border-bottom: 0; }
.home-todo:hover { background: var(--hover); text-decoration: none; }
.home-todo-icon { --tone: var(--accent); width: 30px; height: 30px; border-radius: 8px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--tone) 14%, var(--surface)); color: var(--tone); }

/* plan usage: no limit → a hairline track instead of an empty bar */
.home-meter-open { background: repeating-linear-gradient(90deg, var(--surface-3) 0 6px, transparent 6px 10px); }

/* inbox summary */
.home-inbox { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.home-inbox-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); color: inherit; text-decoration: none; min-width: 0; }
.home-inbox-stat:hover { background: var(--hover); text-decoration: none; }
.home-inbox-n { font-size: 22px; font-weight: 700; line-height: 1.15; }
.home-inbox-stat .muted { overflow-wrap: anywhere; }

@media (max-width: 480px) {
  .home-hide-sm { display: none; }
  .home-head h1 { font-size: 19px; }
}
