/* Coxheath APM front-end.
   Mirrors the planning tracker plugin's visual language so the two
   widgets feel like part of the same family on an Elementor page:
   same accent + soft-tint, same header underline, same focus rings,
   same WCAG AA touch targets. Intentionally light so it inherits
   theme typography. */

.capm {
    --capm-accent: #535d29;
    --capm-accent-soft: #f1f3e7;
    --capm-border: #d8ddc1;
    --capm-muted: #5f5f5f;
    accent-color: var(--capm-accent);
    margin: 2rem 0;
    color: #222;
}

/* ---------- Header (title + date) ---------- */

.capm__header {
    border-top: 3px solid var(--capm-accent);
    border-bottom: 1px solid var(--capm-border);
    background: var(--capm-accent-soft);
    padding: 1.1rem 1.25rem .9rem;
    border-radius: 6px 6px 0 0;
    margin-bottom: 1.25rem;
}

.capm__title {
    margin: 0 0 .25rem;
    color: var(--capm-accent);
    font-size: 1.5rem;
    line-height: 1.2;
    font-weight: 700;
}

.capm__date {
    margin: 0;
    color: var(--capm-muted);
    font-size: 1rem;
    font-weight: 600;
}

/* ---------- Body (post editor content) ---------- */

.capm__body {
    margin: 0 0 1.5rem;
    line-height: 1.55;
}

.capm__body p:last-child { margin-bottom: 0; }

/* ---------- Reports list ---------- */

.capm__reports-heading {
    margin: 1.25rem 0 .65rem;
    color: var(--capm-accent);
    font-size: 1.15rem;
    line-height: 1.3;
    font-weight: 700;
}

.capm__reports {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .5rem;
}

.capm__report-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 44px;
    padding: .75rem 1rem;
    background: #fff;
    border: 1px solid var(--capm-border);
    border-left: 4px solid var(--capm-accent);
    border-radius: 4px;
    text-decoration: none;
    color: #2c3018;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.capm__report-link:hover,
.capm__report-link:focus {
    background: var(--capm-accent-soft);
    text-decoration: none;
}

.capm__report-link:focus-visible {
    outline: 2px solid var(--capm-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .capm__report-link { transition: none; }
}

.capm__report-label {
    flex: 1 1 auto;
    font-weight: 600;
    line-height: 1.3;
}

.capm__report-meta {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    flex-shrink: 0;
    font-size: .85rem;
    color: var(--capm-muted);
}

.capm__report-type {
    background: var(--capm-accent);
    color: #fff;
    padding: .15rem .55rem;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: .02em;
    font-size: .8rem;
}

.capm__report-size {
    color: var(--capm-muted);
}

/* Visually hidden but available to screen readers. */
.capm__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Empty state ---------- */

.capm-empty {
    padding: 1.5rem;
    background: var(--capm-accent-soft);
    border-radius: 4px;
    color: var(--capm-muted);
    text-align: center;
}

/* ---------- Stack vertically on narrow screens ---------- */

@media (max-width: 540px) {
    .capm__report-link {
        flex-direction: column;
        align-items: flex-start;
        gap: .35rem;
    }
    .capm__report-meta { width: 100%; }
}
