/* Manody stylesheet, part 14 — Newsletter: campaigns, e-mail editor, sending and report.
   Loaded in order by core/templates/core/includes/stylesheets.html. */

/* ---------- Campaign list and report ---------- */

.nl-overview { margin-bottom: 12px; }

.nl-meter {
    height: 6px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--bg-soft);
}

.nl-meter span {
    display: block;
    height: 100%;
    max-width: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 0.3s var(--ease);
}

.nl-progress { margin: 16px 0 20px; }
.nl-progress .nl-meter { height: 8px; }

.nl-status { white-space: nowrap; }
.nl-status-draft { background: var(--bg-soft); color: var(--text-muted); }
.nl-status-scheduled { background: #eff6ff; color: #1d4ed8; }
.nl-status-sending { background: #fffbeb; color: #b45309; }
.nl-status-sent { background: #ecfdf5; color: #047857; }
.nl-status-canceled { background: var(--danger-soft); color: var(--danger); }

.nl-url { max-width: 480px; overflow-wrap: anywhere; }

/* ---------- Editor ---------- */

.nl-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.nl-name {
    flex: 1 1 220px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 600;
}

.nl-name:hover { border-color: var(--border); }
.nl-name:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--focus); }

.nl-save-status { margin-right: auto; }

.nl-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 16px;
    align-items: start;
}

.nl-left {
    display: grid;
    gap: 16px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.nl-left > .card { margin: 0; }

.nl-right {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    margin: 0;
}

.nl-statuses {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: 8px 0 4px 24px;
}

.nl-style-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
}

.nl-style-grid input[type="color"] {
    width: 100%;
    height: 40px;
    padding: 2px;
    cursor: pointer;
}

.nl-blocks {
    display: grid;
    gap: 10px;
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
}

.nl-block {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.nl-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px 8px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-soft);
    border-radius: var(--radius) var(--radius) 0 0;
}

.nl-block-head:last-child { border-bottom: 0; border-radius: var(--radius); }
.nl-block-head strong { font-size: 0.88rem; }
.nl-block-tools { display: flex; gap: 2px; }
.nl-block-fields { padding: 12px 14px 2px; }
.nl-empty { padding: 12px 0; }

.nl-image {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.nl-image img {
    width: 72px;
    height: 48px;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.nl-palette {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.nl-right .segmented-sm { margin-bottom: 0; }

.segmented button {
    padding: 5px 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
}

.segmented button[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); }

.nl-frame-wrap {
    display: flex;
    justify-content: center;
    padding: 12px;
    border-radius: var(--radius);
    background: var(--bg-soft);
}

.nl-frame {
    width: 100%;
    height: min(78vh, 900px);
    border: 0;
    border-radius: var(--radius-sm);
    background: #ffffff;
    transition: width 0.25s var(--ease);
}

.nl-frame-wrap.is-mobile .nl-frame { width: 375px; max-width: 100%; }

/* ---------- Sending ---------- */

.nl-send { max-width: 720px; }

.nl-summary {
    display: grid;
    gap: 10px;
    margin: 0 0 20px;
}

.nl-summary > div {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.nl-summary dt { color: var(--text-muted); font-size: 0.9rem; }
.nl-summary dd { margin: 0; overflow-wrap: anywhere; }

.nl-when {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    border: 0;
    padding: 0;
}

.nl-when legend { width: 100%; margin-bottom: 6px; padding: 0; font-weight: 600; }

@media (max-width: 960px) {
    .nl-columns { grid-template-columns: minmax(0, 1fr); }
    .nl-right { position: static; }
}

@media (max-width: 560px) {
    .nl-style-grid { grid-template-columns: minmax(0, 1fr); }
    .nl-summary > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .nl-save-status { width: 100%; order: 3; }
}

/* ---------- Public unsubscribe page ---------- */

.unsub {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 18px;
    min-height: calc(100vh - var(--header-h) - 120px);
    padding: 56px 16px 72px;
    align-content: center;
    overflow: hidden;
}

/* Soft brand glow behind the card. */
.unsub::before {
    content: "";
    position: absolute;
    inset: 10% 15% auto;
    height: 420px;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--brand-2) 22%, transparent), transparent 70%),
                radial-gradient(closest-side at 70% 60%, color-mix(in srgb, var(--brand-4) 16%, transparent), transparent 70%);
    filter: blur(20px);
    z-index: -1;
    pointer-events: none;
}

.unsub-card {
    position: relative;
    width: 100%;
    max-width: 540px;
    padding: 36px 36px 30px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    text-align: center;
    overflow: hidden;
}

.unsub-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--brand-gradient);
}

.unsub-art { display: grid; place-items: center; margin-bottom: 8px; }
.unsub-envelope { width: 200px; max-width: 70%; height: auto; overflow: visible; }
.unsub-body { transform-origin: 100px 92px; animation: unsub-float 4s var(--ease) infinite; }
.unsub-paper { fill: var(--bg-soft); stroke: var(--text); stroke-width: 3.5; }
.unsub-line { fill: none; stroke: var(--text); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.unsub-ink { fill: var(--text); }
.unsub-stamp { transform-box: fill-box; transform-origin: center; transform: rotate(6deg); }
.unsub-drop { fill: #60a5fa; animation: unsub-drop 2.4s ease-in infinite; }
.unsub-heart { fill: #ec4899; transform-box: fill-box; transform-origin: center; animation: unsub-pop 1.8s var(--ease) infinite; }
.unsub-heart-2 { fill: #a855f7; animation-delay: 0.6s; }
.unsub-z { fill: var(--text-muted); font: 700 18px var(--font); animation: unsub-z 3s ease-in-out infinite; }
.unsub-z-2 { font-size: 13px; animation-delay: 0.8s; }

/* The unsubscribed envelope is calm: it no longer floats, it rests. */
.unsub-unsubscribed .unsub-body,
.unsub-already .unsub-body { animation-duration: 6s; }

.unsub-eyebrow {
    margin: 0 0 6px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.unsub-card h1 {
    margin: 0 0 12px;
    font-size: clamp(1.5rem, 4.5vw, 1.9rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.unsub-text { margin: 0 auto; max-width: 420px; color: var(--text-muted); line-height: 1.6; overflow-wrap: anywhere; }
.unsub-text strong { color: var(--text); font-weight: 600; }

.unsub-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 26px 0 0;
}

.unsub-note { margin: 18px 0 0; font-size: 0.85rem; color: var(--text-muted); }
.unsub-legal { max-width: 540px; margin: 0; font-size: 0.8rem; color: var(--text-muted); text-align: center; }

@keyframes unsub-float {
    0%, 100% { transform: translateY(0) rotate(-1.5deg); }
    50% { transform: translateY(-6px) rotate(1.5deg); }
}

@keyframes unsub-drop {
    0% { opacity: 0; transform: translateY(-4px); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translateY(14px); }
}

@keyframes unsub-pop {
    0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
    50% { transform: translateY(-6px) scale(1.15); opacity: 0.85; }
}

@keyframes unsub-z {
    0% { opacity: 0; transform: translate(0, 4px); }
    40% { opacity: 1; }
    100% { opacity: 0; transform: translate(6px, -8px); }
}

@media (prefers-reduced-motion: reduce) {
    .unsub-body, .unsub-drop, .unsub-heart, .unsub-z { animation: none; }
}

@media (max-width: 560px) {
    .unsub { padding-top: 32px; }
    .unsub-card { padding: 28px 20px 24px; }
    .unsub-actions .btn { width: 100%; }
}

.unsub-preview {
    margin: -8px 0 18px;
    padding: 8px 12px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ---------- Reply address ---------- */

.nl-reply { margin: 0 0 12px; overflow-wrap: anywhere; }
.nl-reply a { margin-left: 4px; white-space: nowrap; }
.nl-reply-inline { margin: 0; }
.nl-reply-current {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
}

.nl-replies { max-width: 720px; }

.nl-reply-modes {
    display: grid;
    gap: 10px;
    margin: 16px 0 8px;
    padding: 0;
    border: 0;
}

.nl-reply-mode {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
}

.nl-reply-mode:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.nl-reply-mode input { margin-top: 4px; }
.nl-reply-mode > span { display: grid; gap: 2px; }
