/* Calendar photo check — scoped tool island.
 *
 * Warm gold on paper, taken from Photo Calendar's store artwork. The only
 * colour is the checked state, the focus ring and the verdict marks in the
 * per-photo list. */

.calendar-photo-check-page {
    --gold: #8a6a2f;
    --gold-deep: #5e4820;
    --gold-soft: #9a8a6c;
    --soft-mark: #a4492f;
    --ink: #23231f;
    --ink-soft: #5f5c55;
    --paper: #fdfbf7;
    --paper-raised: #f4f1e9;
    --rule: #e3ddd1;
    --font-reading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --tool-peek-bg: #5e4820;
}

.cp-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 72px 20px 60px;
    font-family: var(--font-reading);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.page-sketch .cp-container p,
body.page-sketch .cp-container li,
body.page-sketch .cp-container a,
body.page-sketch .cp-container span,
body.page-sketch .cp-container label,
body.page-sketch .cp-container legend,
body.page-sketch .cp-container h2,
body.page-sketch .cp-container h3 {
    font-family: var(--font-reading);
}

body.page-sketch .cp-container .cp-title,
body.page-sketch .cp-container .cp-result-headline {
    font-family: 'Kalam', sans-serif;
}

.cp-title {
    font-size: clamp(2rem, 1.4rem + 2.4vw, 2.7rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--ink);
    margin: 0 0 16px;
    text-wrap: balance;
}

.cp-lede {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--ink-soft);
    margin: 0 0 36px;
    text-wrap: pretty;
}

/* ---------------------------------------------------------------- form ---- */
.calendar-photo-check {
    background: var(--paper-raised);
    border-radius: 18px;
    padding: 26px 28px;
}

.cp-form {
    display: grid;
    gap: 20px;
    margin: 0;
}

.cp-field {
    border: none;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.cp-field legend {
    padding: 0;
    margin: 0 0 9px;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--ink);
}

.cp-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cp-options input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cp-options label {
    display: inline-flex;
    align-items: center;
    min-height: 40px;                 /* hit area */
    padding: 9px 16px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    background: var(--paper);
    color: var(--ink);
    font-size: 0.925rem;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    transition-property: background-color, border-color, color, scale;
    transition-duration: 0.15s;
    transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.cp-options label:hover { border-color: var(--gold); color: var(--gold); }
.cp-options label:active { scale: 0.96; }

.cp-options input:checked + label {
    background: var(--gold);
    border-color: var(--gold);
    color: #fff;
}

.cp-options input:focus-visible + label {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* ------------------------------------------------------------- numbers --- */
.cp-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.cp-number {
    flex: 1 1 200px;
    min-width: 0;
}

.cp-number label {
    display: block;
    margin: 0 0 9px;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--ink);
}

.cp-number input {
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-reading);
    font-size: 1.05rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cp-number input::placeholder {
    color: var(--gold-soft);
    font-weight: 500;
}

.cp-number input:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-color: var(--gold);
}

.cp-hint {
    display: block;
    margin: 6px 0 0;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--ink-soft);
}

/* -------------------------------------------------------------- result ---- */
.cp-result {
    margin-top: 22px;
    padding: 22px 24px;
    background: var(--paper);
    border-radius: 14px;
}

.cp-result-label {
    margin: 0 0 2px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--gold-soft);
}

.cp-result-headline {
    margin: 0 0 12px;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ink);
}

.cp-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.cp-stats li {
    flex: 1 1 150px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--paper-raised);
}

.cp-stat-value {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.cp-stat-label {
    display: block;
    margin-top: 2px;
    font-size: 0.8rem;
    line-height: 1.35;
    color: var(--ink-soft);
}

/* The three routes out of "doesn't fit". A list, because they are parallel
   options and not a sequence — the reader picks one. */
.cp-routes {
    margin: 0 0 12px;
    padding-left: 1.2rem;
}

.cp-routes li {
    margin: 0 0 10px;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink);
}

.cp-routes li:last-child { margin-bottom: 0; }

.cp-result-body {
    margin: 0 0 12px;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--ink);
}

.cp-result-body:last-child { margin-bottom: 0; }

.cp-result-body a,
.cp-result-meta a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--gold-soft);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.cp-result-meta {
    margin: 0;
    padding-top: 12px;
    border-top: 1px solid var(--rule);
    font-size: 0.925rem;
    line-height: 1.6;
    color: var(--ink-soft);
}

.cp-note {
    margin: 12px 0 0;
    padding-left: 14px;
    border-left: 3px solid var(--gold-soft);
    font-size: 0.925rem;
    line-height: 1.6;
    color: var(--ink-soft);
}

/* ---------------------------------------------------------------- prose --- */
.cp-prose {
    margin-top: 48px;
}

.cp-prose h2 {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ink);
    margin: 36px 0 14px;
}

.cp-prose h3 {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--ink);
    margin: 24px 0 8px;
}

.cp-prose p,
.cp-prose li {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--ink);
}

.cp-prose p { margin: 0 0 16px; }
.cp-prose ul { margin: 0 0 16px; padding-left: 1.35rem; }
.cp-prose li { margin-bottom: 8px; }

.cp-prose a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--gold-soft);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

/* The source numbers, quoted as a table so the reader can check the tool's
   arithmetic against the article's without leaving the page. */
.cp-table-wrap {
    overflow-x: auto;
    margin: 0 0 16px;
}

.cp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    line-height: 1.5;
}

.cp-table th,
.cp-table td {
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid var(--rule);
    color: var(--ink);
    white-space: nowrap;
}

.cp-table th {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gold-soft);
}

.cp-table td:not(:first-child) { font-variant-numeric: tabular-nums; }

/* Fields that only apply to one destination are hidden, not disabled: a
   paper size means nothing for a widget. */
.cp-field[hidden] { display: none; }

/* --------------------------------------------------------------- photo --- */
.cp-photo {
    display: grid;
    gap: 14px;
}

.cp-drop {
    position: relative;
    display: block;
    padding: 22px 18px;
    border: 2px dashed var(--rule);
    border-radius: 14px;
    background: var(--paper);
    text-align: center;
    cursor: pointer;
    transition-property: border-color, background-color;
    transition-duration: 0.15s;
}

.cp-drop:hover,
.cp-drop.is-over { border-color: var(--gold); }
.cp-drop.is-over { background: #fbf6ea; }

.cp-drop input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.cp-drop input:focus-visible + .cp-drop-main {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
    border-radius: 6px;
}

.cp-drop-main {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
}

.cp-drop-status {
    display: block;
    margin-top: 4px;
    font-size: 0.82rem;
    color: var(--ink-soft);
}

.cp-or {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--gold-soft);
}

.cp-numbers .cp-number { flex: 1 1 140px; }

/* --------------------------------------------------------- photo list --- */
.cp-rows {
    margin: 4px 0 4px;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--rule);
}

.cp-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: baseline;
    padding: 9px 0;
    border-bottom: 1px solid var(--rule);
    font-size: 0.925rem;
    line-height: 1.4;
}

.cp-row-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink);
}

.cp-row-size {
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}

.cp-row-verdict {
    min-width: 6.5em;
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cp-row.is-sharp .cp-row-verdict { color: var(--gold); }
.cp-row.is-soft .cp-row-verdict,
.cp-row.is-error .cp-row-verdict { color: var(--soft-mark); }

@media (max-width: 640px) {
    .cp-container { padding: 56px 16px 40px; }
    .calendar-photo-check { padding: 20px 18px; }
    .cp-result { padding: 18px 18px; }
    .cp-options label { flex: 1 1 100%; }
    .cp-result-headline { font-size: 1.55rem; }
    .cp-row { grid-template-columns: minmax(0, 1fr) auto; }
    .cp-row-size { grid-column: 1; grid-row: 2; font-size: 0.82rem; }
    .cp-row-verdict { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
}
