/**
 * Área de Membros fooba.studio — estilização da área de comentários.
 * Escopo: body.amf-comments-styled (aplicado apenas quando a opção estiver ativa).
 *
 * Usa variáveis CSS do design system do WordPress (theme.json / Personalizador),
 * com fallbacks para temas que não as definem.
 */

/* ── Variáveis do design system ─────────────────────────────────── */
body.amf-comments-styled {
	--amf-c-fg:        var(--wp--preset--color--foreground,   #1d2327);
	--amf-c-bg:        var(--wp--preset--color--background,   #ffffff);
	--amf-c-muted:     var(--wp--preset--color--secondary,    #6b7280);
	--amf-c-link:      var(--wp--preset--color--primary,      #005bea);
	--amf-c-border:    var(--wp--preset--color--tertiary,     #e5e7eb);
	--amf-c-surface:   var(--wp--preset--color--base,         #f9fafb);
	--amf-c-avatar:    44px;
	--amf-c-gap:       12px;
	--amf-fz-base:     var(--wp--preset--font-size--small,    14px);
	--amf-fz-meta:     12px;
	--amf-fz-username: 13px;
	--amf-radius:      10px;
}

/* ── Reset da lista de comentários ──────────────────────────────── */
body.amf-comments-styled .comment-list,
body.amf-comments-styled .comment-list ol,
body.amf-comments-styled .comment-list ul {
	list-style: none !important;
	padding:    0 !important;
	margin:     0 !important;
}

/* ── Cada item de comentário ────────────────────────────────────── */
body.amf-comments-styled .comment-list > li,
body.amf-comments-styled .comment-list li {
	padding:       16px 0;
	border-bottom: 1px solid var(--amf-c-border);
}

body.amf-comments-styled .comment-list > li:last-child,
body.amf-comments-styled .comment-list li:last-child {
	border-bottom: none;
}

/* ── Article: layout em coluna com avatar posicionado ───────────── */
body.amf-comments-styled article.comment-body {
	position:    relative;
	padding-left: calc( var(--amf-c-avatar) + var(--amf-c-gap) );
	min-height:  var(--amf-c-avatar);
}

/* ── Avatar ─────────────────────────────────────────────────────── */
body.amf-comments-styled .comment-author .avatar {
	position:      absolute !important;
	left:          0 !important;
	top:           2px !important;
	width:         var(--amf-c-avatar) !important;
	height:        var(--amf-c-avatar) !important;
	border-radius: 50% !important;
	object-fit:    cover !important;
	border:        none !important;
	box-shadow:    none !important;
}

/* ── Cabeçalho: nome de usuário + tempo ─────────────────────────── */
body.amf-comments-styled .comment-meta {
	display:     flex;
	align-items: baseline;
	gap:         8px;
	flex-wrap:   wrap;
	margin-bottom: 4px;
}

body.amf-comments-styled .comment-author {
	display: inline;
}

body.amf-comments-styled .comment-author .fn,
body.amf-comments-styled .comment-author .fn a {
	font-size:       var(--amf-fz-username);
	font-weight:     700;
	color:           var(--amf-c-fg) !important;
	text-decoration: none !important;
}

body.amf-comments-styled .comment-author .says {
	display: none !important;
}

body.amf-comments-styled .comment-metadata {
	display: inline;
}

body.amf-comments-styled .comment-metadata a,
body.amf-comments-styled .comment-metadata time {
	font-size:       var(--amf-fz-meta);
	color:           var(--amf-c-muted) !important;
	text-decoration: none !important;
}

/* ── Texto do comentário ────────────────────────────────────────── */
body.amf-comments-styled .comment-content {
	margin: 0 0 8px;
}

body.amf-comments-styled .comment-content p {
	font-size:   var(--amf-fz-base);
	color:       var(--amf-c-fg);
	line-height: 1.55;
	margin:      0 0 4px;
}

body.amf-comments-styled .comment-content p:last-child {
	margin-bottom: 0;
}

/* ── Aviso de moderação ─────────────────────────────────────────── */
body.amf-comments-styled .comment-awaiting-moderation {
	display:      inline-block;
	font-size:    var(--amf-fz-meta);
	color:        var(--amf-c-muted);
	font-style:   italic;
	margin-bottom: 6px;
}

/* ── Responder ──────────────────────────────────────────────────── */
body.amf-comments-styled .reply {
	margin-top: 6px;
}

body.amf-comments-styled .reply a.comment-reply-link,
body.amf-comments-styled .reply a {
	font-size:       var(--amf-fz-meta);
	font-weight:     600;
	color:           var(--amf-c-muted) !important;
	text-decoration: none !important;
	text-transform:  uppercase;
	letter-spacing:  0.05em;
}

body.amf-comments-styled .reply a:hover {
	color: var(--amf-c-fg) !important;
}

/* ── Comentários filhos (respostas) ─────────────────────────────── */
body.amf-comments-styled .comment-list .children {
	margin-left:  calc( var(--amf-c-avatar) + var(--amf-c-gap) );
	border-left:  2px solid var(--amf-c-border);
	padding-left: 16px;
}

/* ── Heading "N comentários" ─────────────────────────────────────── */
body.amf-comments-styled #comments > h2,
body.amf-comments-styled .comments-title {
	font-size:     16px;
	font-weight:   700;
	color:         var(--amf-c-fg);
	margin-bottom: 20px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--amf-c-border);
}

/* ── Sem comentários ─────────────────────────────────────────────── */
body.amf-comments-styled .no-comments {
	color:      var(--amf-c-muted);
	font-size:  var(--amf-fz-base);
	text-align: center;
	padding:    24px 0;
}

/* ── Formulário de comentário ────────────────────────────────────── */
body.amf-comments-styled #respond {
	margin-top:    32px;
	padding-top:   24px;
	border-top:    2px solid var(--amf-c-border);
}

body.amf-comments-styled #respond h3#reply-title {
	font-size:     15px;
	font-weight:   700;
	color:         var(--amf-c-fg);
	margin-bottom: 16px;
}

body.amf-comments-styled #respond input[type="text"],
body.amf-comments-styled #respond input[type="email"],
body.amf-comments-styled #respond input[type="url"],
body.amf-comments-styled #respond textarea {
	width:         100%;
	padding:       10px 12px;
	border:        1px solid var(--amf-c-border);
	border-radius: calc( var(--amf-radius) / 2 );
	background:    var(--amf-c-bg);
	color:         var(--amf-c-fg);
	font-size:     var(--amf-fz-base);
	box-sizing:    border-box;
	transition:    border-color 0.15s;
}

body.amf-comments-styled #respond input:focus,
body.amf-comments-styled #respond textarea:focus {
	outline:       none;
	border-color:  var(--amf-c-link);
}

body.amf-comments-styled #respond textarea {
	min-height: 100px;
	resize:     vertical;
}

body.amf-comments-styled #respond .submit,
body.amf-comments-styled #respond input[type="submit"] {
	display:          inline-block;
	padding:          10px 24px;
	background:       var(--amf-c-fg);
	color:            var(--amf-c-bg);
	border:           none;
	border-radius:    calc( var(--amf-radius) / 2 );
	font-size:        var(--amf-fz-base);
	font-weight:      600;
	cursor:           pointer;
	transition:       opacity 0.15s;
}

body.amf-comments-styled #respond .submit:hover,
body.amf-comments-styled #respond input[type="submit"]:hover {
	opacity: 0.85;
}

body.amf-comments-styled #respond .comment-form label {
	display:       block;
	font-size:     var(--amf-fz-meta);
	font-weight:   600;
	color:         var(--amf-c-fg);
	margin-bottom: 5px;
}

body.amf-comments-styled #respond p {
	margin-bottom: 14px;
}

/* ── Área de login após comentários (botões CTA) ─────────────────── */
.amf-comment-login-area {
	margin-top:    28px;
	padding:       20px;
	border:        1px solid var(--amf-c-border, #e5e7eb);
	border-radius: var(--amf-radius, 10px);
	background:    var(--amf-c-surface, #f9fafb);
	text-align:    center;
}

.amf-comment-login-msg {
	font-size:     14px;
	color:         var(--amf-c-muted, #6b7280);
	margin:        0 0 16px;
}

.amf-comment-login-btns {
	display:        flex;
	flex-wrap:      wrap;
	gap:            10px;
	justify-content: center;
}

.amf-comment-btn {
	display:         inline-flex;
	align-items:     center;
	justify-content: center;
	gap:             8px;
	padding:         10px 20px;
	border-radius:   8px;
	font-size:       14px;
	font-weight:     600;
	text-decoration: none;
	transition:      opacity 0.15s;
	cursor:          pointer;
}

.amf-comment-btn:hover { opacity: 0.85; }

.amf-comment-btn-primary {
	background: var(--amf-c-fg, #1d2327);
	color:      var(--amf-c-bg, #fff);
}

.amf-comment-btn-ghost {
	background: transparent;
	color:      var(--amf-c-fg, #1d2327);
	border:     1px solid var(--amf-c-border, #e5e7eb);
}

.amf-comment-btn-google {
	background: #fff;
	color:      #3c4043;
	border:     1px solid #dadce0;
	font-weight: 500;
}

.amf-comment-google-icon {
	display:     flex;
	align-items: center;
	flex-shrink: 0;
}

.amf-comment-google-icon svg {
	width:  17px;
	height: 17px;
}
