/* Targets: motivation, my targets, the scorecard and setting targets.
   Owned by public/js/targets.js and public/js/targets/. Class names here belong to this module. */

.tg-month { width: auto; }

/* ---------- motivation: a card that moves on by itself ---------- */
.tg-motivation { margin-bottom: 1.2rem; border-radius: 16px; overflow: hidden; background: var(--brand-gradient); color: #fff; }
.tg-stage { min-height: 11rem; }
.tg-slide { display: grid; grid-template-columns: minmax(0, 1fr); gap: .9rem; padding: 1.4rem 1.5rem .8rem; animation: tg-fade .5s ease; }
.tg-slide:has(.tg-media) { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); align-items: center; }
.tg-words strong { display: block; font-size: 1.45rem; line-height: 1.25; }
.tg-words p { margin: .45rem 0 0; font-size: 1.02rem; opacity: .94; }
.tg-media { width: 100%; max-height: 12rem; border-radius: 10px; object-fit: cover; background: rgb(0 0 0 / .25); }
.tg-controls { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: 0 1.5rem .8rem; }
.tg-dots { display: flex; gap: .35rem; }
.tg-dot { width: .55rem; height: .55rem; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / .35); cursor: pointer; }
.tg-dot.active { background: #fff; }
@keyframes tg-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tg-slide { animation: none; } }

/* A department's colour on a message with no picture */
.tg-art-layby { box-shadow: inset 5px 0 0 var(--copper); }
.tg-art-sales { box-shadow: inset 5px 0 0 #6ee7b7; }
.tg-art-marketing { box-shadow: inset 5px 0 0 #f9a8d4; }
.tg-art-logistics { box-shadow: inset 5px 0 0 #fcd34d; }
.tg-art-accounts { box-shadow: inset 5px 0 0 #93c5fd; }
.tg-art-finance { box-shadow: inset 5px 0 0 #c4b5fd; }
.tg-art-it { box-shadow: inset 5px 0 0 #67e8f9; }

/* ---------- my targets ---------- */
.tg-dept { margin-bottom: 1.2rem; }
.tg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(21rem, 100%), 1fr)); gap: .8rem; }
.tg-target { display: grid; gap: .55rem; align-content: start; margin: 0; }
.tg-target h3 { margin: 0; font-size: 1rem; }
.tg-figure strong { font-size: 1.6rem; }
.tg-team { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); align-items: center; gap: .4rem; }
.tg-plan { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem .8rem; margin: .2rem 0 0; padding: .6rem .7rem; border-radius: 8px; background: var(--accent-soft); }
.tg-plan dt { color: var(--muted); }
.tg-plan dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.tg-ways summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.tg-ways ul { margin: .4rem 0 0; padding-left: 1.1rem; display: grid; gap: .3rem; }

/* ---------- home ---------- */
.tg-home { display: grid; gap: .4rem; margin-bottom: 1rem; color: inherit; text-decoration: none; }
.tg-home[hidden] { display: none; }
.tg-home-head { display: flex; align-items: center; gap: .45rem; }
.tg-home-row { display: grid; grid-template-columns: minmax(0, 1fr) 11rem; align-items: center; gap: .6rem; }

/* ---------- scorecard ---------- */
.tg-board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(30rem, 100%), 1fr)); gap: .8rem; margin-bottom: .8rem; }
.tg-board { margin: 0; min-width: 0; }
.tg-board-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.tg-board-head h2 { margin: 0; }
.tg-score { padding: .1rem .6rem; border-radius: 999px; background: var(--accent-soft); font-weight: 700; font-variant-numeric: tabular-nums; }
.tg-score.good { background: color-mix(in srgb, var(--ok) 22%, transparent); }
.tg-score.warn { background: color-mix(in srgb, var(--copper) 22%, transparent); }
.tg-score.bad { background: var(--second-soft); }
.tg-people { margin-top: .6rem; }
.tg-people summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .9rem; }

/* ---------- set targets ---------- */
.tg-setup { display: grid; gap: 1rem; }
.tg-setup h2 { margin: 0; }
.tg-measure { display: grid; gap: .5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.tg-measure > .field { max-width: 22rem; }
.tg-shares { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .5rem .7rem; }
.tg-share-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.tg-log { color: var(--muted); }

/* ---------- motivation editor ---------- */
.tg-word { display: flex; align-items: center; gap: .8rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.tg-word.off { opacity: .5; }
.tg-word-text { flex: 1; min-width: 0; }
.tg-word-text p { margin: .15rem 0 0; }
.tg-thumb { flex: none; width: 4.5rem; height: 3rem; border-radius: 6px; object-fit: cover; }

@media (max-width: 640px) {
  .tg-slide:has(.tg-media) { grid-template-columns: minmax(0, 1fr); }
  .tg-board-grid { grid-template-columns: minmax(0, 1fr); }
  .tg-word { flex-wrap: wrap; }
  .tg-home-row { grid-template-columns: minmax(0, 1fr); }
}
