/* =========================================================
   COMENTÁRIOS DAS NOTÍCIAS
   ========================================================= */
.cm-wrap { max-width: 780px; margin: 0 auto; }
.cm-section-head { margin-bottom: 26px; }
.cm-section-head h2 { display: flex; align-items: center; gap: 10px; font-size: clamp(20px, 2.2vw, 26px); text-transform: none; margin: 0; }
.cm-section-head h2 .ico { color: var(--accent); }
.cm-count { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 800; }
html[data-theme="dark"] .cm-count, html[data-theme="dark"] .cm-section-head h2 .ico, html[data-theme="dark"] .cm-reply-btn { color: color-mix(in srgb, var(--accent) 45%, #9fe0b9); }
.cm-section-head p { margin: 8px 0 0; color: var(--muted); }

.cm-list { display: grid; gap: 18px; margin-bottom: 40px; }
.cm-thread { display: grid; gap: 12px; }
.cm { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 14px; }
.cm.cm-reply { margin-left: 60px; }
.cm-avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--accent-2))); color: #fff; font-family: var(--font-head); font-weight: 800; font-size: 15px; }
.cm-avatar.anon { background: var(--bg-alt); color: var(--muted); border: 1px dashed var(--input-border, var(--border)); }
.cm-avatar img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 6px; }
.cm-content { padding: 14px 18px 12px; border-radius: 4px 14px 14px 14px; background: var(--surface); border: 1px solid var(--border); }
.cm-staff .cm-content { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.cm-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 6px; }
.cm-head strong { font-family: var(--font-head); font-size: 14.5px; color: var(--heading); }
.cm-head time { font-size: 12.5px; color: var(--muted); }
.cm-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.cm-text { font-size: 15px; line-height: 1.75; color: var(--text); overflow-wrap: anywhere; }
.cm-reply-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 0; border: 0; background: none; font-family: var(--font-head); font-size: 12.5px; font-weight: 700; color: var(--accent); cursor: pointer; }
.cm-reply-btn:hover { text-decoration: underline; }

.cm-form { padding: clamp(22px, 3vw, 32px); border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); display: grid; gap: 16px; scroll-margin-top: 120px; }
.cm-form-title { margin: 0; font-size: 18px; text-transform: none; }
.cm-form .cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cm-form .cf-field { display: grid; gap: 6px; margin: 0; }
.cm-form .cf-field > span { font-family: var(--font-head); font-size: 12.5px; font-weight: 700; color: var(--heading); }
.cm-form .cf-field em { font-style: normal; }
.cm-form input[type=text], .cm-form input[type=email], .cm-form textarea { width: 100%; border: 1px solid var(--input-border, var(--border)); background: var(--input-bg, var(--surface)); border-radius: 10px; padding: 12px 14px; font-size: 15px; color: var(--heading); }
.cm-form textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.cm-form input:focus, .cm-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cm-form .is-optional { opacity: .7; }
.cm-replying { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--heading); font-size: 14px; }
.cm-replying[hidden] { display: none; }
.cm-replying button { margin-left: auto; border: 0; background: none; color: var(--accent); font-weight: 700; cursor: pointer; }

/* Interruptor "comentar de forma anónima" */
.cm-anon { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--input-border, var(--border)); cursor: pointer; }
.cm-anon input { position: absolute; opacity: 0; pointer-events: none; }
.cm-anon-switch { position: relative; flex-shrink: 0; width: 42px; height: 24px; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--input-border, var(--border)); transition: background .2s; }
.cm-anon-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.cm-anon input:checked + .cm-anon-switch { background: var(--accent); border-color: var(--accent); }
.cm-anon input:checked + .cm-anon-switch::after { transform: translateX(18px); }
.cm-anon input:focus-visible + .cm-anon-switch { box-shadow: 0 0 0 3px var(--accent-soft); }
.cm-anon strong { display: block; font-family: var(--font-head); font-size: 14px; color: var(--heading); }
.cm-anon small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

.cm-form-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; }
.cm-note { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--muted); }

@media (max-width: 640px) {
    .cm-form .cf-row { grid-template-columns: 1fr; }
    .cm.cm-reply { margin-left: 28px; }
    .cm { grid-template-columns: 38px minmax(0, 1fr); gap: 10px; }
    .cm-avatar { width: 38px; height: 38px; font-size: 13px; }
    .cm-form-foot .btn { width: 100%; justify-content: center; }
}
