/**
 * Avaliações GuiaWP — estilos do bloco público.
 *
 * @author Dante Testa <https://dantetesta.com.br>
 * @since 1.0.0 - 2026-07-17
 */

.avgw {
	--avgw-gold: #f59e0b;
	--avgw-ink: #1e293b;
	--avgw-muted: #64748b;
	--avgw-line: #e2e8f0;
	--avgw-accent: #2563eb;
	max-width: 100%;
	margin: 2.5rem 0 0;
	font-family: inherit;
	color: var(--avgw-ink);
}

.avgw-title {
	font-size: 1.5rem;
	font-weight: 800;
	margin: 0 0 1.25rem;
	letter-spacing: -0.01em;
}

.avgw .is-hidden { display: none !important; }

.avgw-sr {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0,0,0,0);
	white-space: nowrap; border: 0;
}

/* Estrelas (exibição) — cor literal (usadas também fora do escopo .avgw, no header do single) */
.avgw-stars { display: inline-flex; line-height: 1; white-space: nowrap; }
.avgw-star { color: #d1d5db; font-size: 1rem; }
.avgw-star--on { color: #f59e0b; }
.avgw-stars--lg .avgw-star { font-size: 1.6rem; }
.avgw-stars--md .avgw-star { font-size: 1.15rem; }
.avgw-stars--sm .avgw-star { font-size: 0.85rem; }

/* Resumo compacto no header do single (fora do container .avgw → cores literais) */
.avgw-single-summary { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.75rem; justify-content: center; }
@media (min-width: 768px) { .avgw-single-summary { justify-content: flex-start; } }
.avgw-single-summary__media { font-weight: 800; font-size: 1rem; color: #1e293b; }
.avgw-single-summary__total { font-size: 0.85rem; color: #64748b; }
.avgw-single-summary__link { font-size: 0.8rem; color: #2563eb; text-decoration: none; font-weight: 600; margin-left: 0.25rem; }
.avgw-single-summary__link:hover { text-decoration: underline; }

/* Resumo */
.avgw-summary {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem 2rem;
	align-items: center;
	padding: 1.25rem;
	border: 1px solid var(--avgw-line);
	border-radius: 1rem;
	background: #fff;
}
.avgw-summary__score {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.25rem;
	min-width: 110px;
}
.avgw-summary__media { font-size: 2.75rem; font-weight: 800; line-height: 1; }
.avgw-summary__total { font-size: 0.8rem; color: var(--avgw-muted); }

.avgw-dist {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	flex: 1 1 260px;
	min-width: 0;
}
.avgw-dist__row {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	width: 100%;
	background: none;
	border: 0;
	padding: 0.15rem 0.25rem;
	border-radius: 0.5rem;
	cursor: pointer;
	color: var(--avgw-muted);
	font: inherit;
	transition: background 0.15s;
}
.avgw-dist__row:hover { background: #f8fafc; }
.avgw-dist__row.is-active { background: #eff6ff; }
.avgw-dist__label { display: inline-flex; align-items: center; gap: 2px; font-size: 0.8rem; font-weight: 600; width: 32px; flex-shrink: 0; }
.avgw-dist__label .avgw-star { font-size: 0.8rem; }
.avgw-dist__bar { flex: 1; height: 8px; background: #eef2f6; border-radius: 999px; overflow: hidden; }
.avgw-dist__fill { display: block; height: 100%; background: var(--avgw-gold); border-radius: 999px; transition: width 0.3s; }
.avgw-dist__count { font-size: 0.75rem; width: 28px; text-align: right; flex-shrink: 0; }
.avgw-dist__clear { align-self: flex-start; background: none; border: 0; color: var(--avgw-accent); font: inherit; font-size: 0.8rem; cursor: pointer; padding: 0.15rem 0.25rem; text-decoration: underline; }

/* Formulário */
.avgw-form {
	margin: 1.5rem 0;
	padding: 1.25rem;
	border: 1px solid var(--avgw-line);
	border-radius: 1rem;
	background: #fff;
}
.avgw-form__title { font-size: 1rem; font-weight: 700; margin: 0 0 0.75rem; }

.avgw-rating {
	display: inline-flex;
	flex-direction: row-reverse;
	justify-content: flex-end;
	border: 0; padding: 0; margin: 0 0 0.75rem;
}
.avgw-rating__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.avgw-rating__label {
	font-size: 2rem;
	line-height: 1;
	color: #d1d5db;
	cursor: pointer;
	padding: 0 2px;
	transition: color 0.12s;
}
.avgw-rating__input:checked ~ .avgw-rating__label { color: var(--avgw-gold); }
.avgw-rating:hover .avgw-rating__label { color: #d1d5db; }
.avgw-rating__label:hover,
.avgw-rating__label:hover ~ .avgw-rating__label { color: var(--avgw-gold); }
.avgw-rating__input:focus-visible + .avgw-rating__label { outline: 2px solid var(--avgw-accent); outline-offset: 2px; border-radius: 4px; }

.avgw-form__textarea,
.avgw-form__input {
	width: 100%;
	border: 1px solid var(--avgw-line);
	border-radius: 0.75rem;
	padding: 0.65rem 0.85rem;
	font: inherit;
	font-size: 0.9rem;
	color: var(--avgw-ink);
	background: #fff;
}
.avgw-form__textarea:focus,
.avgw-form__input:focus { outline: none; border-color: var(--avgw-accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.avgw-form__textarea { margin-bottom: 0.75rem; resize: vertical; }
/* auto-fit: 1 campo ocupa a largura toda; 2 campos dividem em duas colunas quando cabe. */
.avgw-form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; margin-bottom: 0.75rem; }

.avgw-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.avgw-form__footer { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; }
.avgw-form__submit {
	background: var(--avgw-accent);
	color: #fff;
	border: 0;
	border-radius: 0.75rem;
	padding: 0.7rem 1.4rem;
	font: inherit;
	font-weight: 700;
	font-size: 0.9rem;
	cursor: pointer;
	transition: opacity 0.15s, transform 0.1s;
}
.avgw-form__submit:hover { opacity: 0.92; }
.avgw-form__submit:disabled { opacity: 0.6; cursor: default; }

.avgw-msg { margin: 0; font-size: 0.85rem; font-weight: 600; }
.avgw-msg--ok { color: #059669; }
.avgw-msg--info { color: var(--avgw-accent); }
.avgw-msg--err { color: #e11d48; }

/* Lista — cada avaliação é um card; layout escolhível (lista x grade) */
.avgw-list { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 1rem; }
.avgw-list--grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.85rem; }
/* No celular fica sempre um embaixo do outro, independente da escolha do admin. */
@media (max-width: 640px) { .avgw-list--grade { display: flex; flex-direction: column; } }
.avgw-empty { color: #94a3b8; font-style: italic; padding: 1.5rem 0; text-align: center; }
.avgw-list--grade .avgw-empty { grid-column: 1 / -1; }

.avgw-item {
	display: flex;
	flex-direction: column;
	padding: 1.1rem 1.2rem;
	background: #fff;
	border: 1px solid var(--avgw-line);
	border-radius: 0.9rem;
	transition: box-shadow 0.15s, border-color 0.15s;
}
.avgw-item:hover { box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07); border-color: #dbe3ec; }
.avgw-item__head { display: flex; align-items: center; gap: 0.75rem; }
.avgw-item__avatar {
	position: relative;
	overflow: hidden;
	flex-shrink: 0;
	width: 44px; height: 44px;
	border-radius: 50%;
	color: #fff;
	display: flex; align-items: center; justify-content: center;
	font-weight: 700; font-size: 1.05rem;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.avgw-item__avatar-ini { line-height: 1; }
.avgw-item__avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avgw-item__ident { min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.avgw-item__name { font-weight: 700; font-size: 0.92rem; color: var(--avgw-ink); overflow-wrap: anywhere; }
.avgw-item__meta { line-height: 1; }
.avgw-item__content { flex: 1; margin-top: 0.75rem; }
.avgw-item__text { margin: 0; font-size: 0.9rem; color: #334155; line-height: 1.6; overflow-wrap: anywhere; }
/* Comentário longo: no máximo 3 linhas no card (o resto vai pro modal "Ver mais"). */
.avgw-clamp { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.avgw-item__more { background: none; border: 0; color: var(--avgw-accent); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; padding: 0.3rem 0 0; }
.avgw-item__more:hover { text-decoration: underline; }
.avgw-item__foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.9rem; }
.avgw-item__date { font-size: 0.78rem; color: #94a3b8; }
.avgw-item__check { color: #22c55e; font-size: 18px; line-height: 1; }

.avgw-more {
	margin-top: 1.25rem;
	width: 100%;
	background: #fff;
	border: 1px solid var(--avgw-line);
	border-radius: 0.75rem;
	padding: 0.7rem;
	font: inherit;
	font-weight: 700;
	font-size: 0.88rem;
	color: var(--avgw-accent);
	cursor: pointer;
	transition: background 0.15s;
}
.avgw-more:hover { background: #f8fafc; }

/* #ID discreto no rodapé do card */
.avgw-item__foot-left { display: inline-flex; align-items: center; gap: 0.6rem; }
.avgw-item__id { font-size: 0.72rem; color: #cbd5e1; font-weight: 600; }

/* Link discreto de pedido de remoção */
.avgw-removal-cta { text-align: center; margin-top: 1.25rem; }
.avgw-removal-open { background: none; border: 0; color: #94a3b8; font: inherit; font-size: 0.8rem; cursor: pointer; text-decoration: underline; padding: 0.25rem; }
.avgw-removal-open:hover { color: var(--avgw-accent); }

/* Modal de remoção */
.avgw-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.avgw-modal[hidden] { display: none; }
.avgw-modal__backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.55); }
.avgw-modal__box { position: relative; background: #fff; border-radius: 1rem; padding: 1.5rem; width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25); }
.avgw-modal__x { position: absolute; top: 0.6rem; right: 0.85rem; background: none; border: 0; font-size: 1.6rem; line-height: 1; color: #94a3b8; cursor: pointer; }
.avgw-modal__x:hover { color: #334155; }
.avgw-modal__title { font-size: 1.15rem; font-weight: 800; margin: 0 0 0.35rem; color: var(--avgw-ink); }
.avgw-modal__sub { font-size: 0.85rem; color: var(--avgw-muted); margin: 0 0 1rem; line-height: 1.5; }
.avgw-removal-form { display: flex; flex-direction: column; gap: 0.7rem; }
.avgw-removal-file { display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem 0.85rem; border: 1px dashed #cbd5e1; border-radius: 0.75rem; cursor: pointer; color: var(--avgw-muted); font-size: 0.85rem; }
.avgw-removal-file:hover { border-color: var(--avgw-accent); color: var(--avgw-accent); }
.avgw-removal-file input[type="file"] { display: none; }
.avgw-removal-file__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Modal "Ver mais" — comentário completo */
.avgw-read__head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.25rem; flex-wrap: wrap; }
.avgw-read__name { font-weight: 700; color: var(--avgw-ink); }
.avgw-read__date { font-size: 0.78rem; color: #94a3b8; margin: 0 0 0.9rem; }
.avgw-read__text { font-size: 0.95rem; color: #334155; line-height: 1.65; overflow-wrap: anywhere; white-space: normal; }
