/*
 * Testemunhos para PMEs — Frontend Styles v1.2.0
 *
 * Variáveis CSS para personalização via tema ou CSS adicional:
 *   --tpm-accent          Cor de destaque (label + estrelas preenchidas)
 *   --tpm-title-color     Cor do título principal
 *   --tpm-card-bg         Fundo dos cards
 *   --tpm-card-radius     Border-radius dos cards
 *   --tpm-card-shadow     Box-shadow dos cards
 *   --tpm-text-color      Cor do texto dos testemunhos
 *   --tpm-name-color      Cor do nome
 *   --tpm-cargo-color     Cor do cargo/empresa
 *   --tpm-avatar-size     Tamanho da imagem/avatar
 *   --tpm-avatar-radius   Forma do avatar: 50% = redondo, 0.5rem = quadrado
 */

/* ── Custom Properties ─────────────────────────────────────────────────────── */
.tpm-section {
    --tpm-accent:        #6c63ff;
    --tpm-title-color:   #111827;
    --tpm-card-bg:       #ffffff;
    --tpm-card-radius:   1rem;
    --tpm-card-shadow:   0 4px 24px rgba(0, 0, 0, 0.08);
    --tpm-text-color:    #4b5563;
    --tpm-name-color:    #111827;
    --tpm-cargo-color:   #6b7280;
    --tpm-avatar-size:   96px;
    --tpm-avatar-radius: 50%; /* padrão redondo; PHP sobrescreve conforme definição */
}

/* ── Section ────────────────────────────────────────────────────────────────── */
.tpm-section {
    width: 100%;
    padding: 3rem 0;
    box-sizing: border-box;
}

/* Isolamento total dos estilos — evita bleeding para o editor Elementor */
.tpm-section *,
.tpm-section *::before,
.tpm-section *::after {
    box-sizing: border-box;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
.tpm-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.tpm-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tpm-accent);
    margin-bottom: 0.4rem;
}

.tpm-title {
    font-size: clamp(1.5rem, 3.5vw, 2.2rem);
    font-weight: 700;
    color: var(--tpm-title-color);
    margin: 0;
    line-height: 1.2;
}

/* ── Grid — ocupa 100% da largura do contentor pai ─────────────────────────── */
.tpm-grid {
    display: grid;
    width: 100%;
    gap: 1.25rem;
    grid-template-columns: repeat(3, 1fr);
}

.tpm-layout-1 { grid-template-columns: 1fr; }
.tpm-layout-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 860px) {
    .tpm-grid        { grid-template-columns: repeat(2, 1fr); }
    .tpm-layout-1    { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .tpm-grid,
    .tpm-layout-2    { grid-template-columns: 1fr; }
    .tpm-section     { padding: 2rem 0; }
}

/* ── Card ───────────────────────────────────────────────────────────────────── */
.tpm-card {
    background: var(--tpm-card-bg);
    border-radius: var(--tpm-card-radius);
    box-shadow: var(--tpm-card-shadow);
    width: 100%;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tpm-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.tpm-card-inner {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
}

/* ── Avatar ─────────────────────────────────────────────────────────────────── */
.tpm-avatar-wrap {
    flex-shrink: 0;
    width: var(--tpm-avatar-size);
    height: var(--tpm-avatar-size);
    border-radius: var(--tpm-avatar-radius);
    overflow: hidden;       /* é este que faz o corte, independentemente da imagem */
    position: relative;
}

/* Força a imagem a preencher o contentor,
   sobrepondo width/height que o WordPress injeta na <img> */
.tpm-avatar-wrap img.tpm-avatar {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    object-position: center top;
    border-radius: 0;       /* o corte é feito pelo wrap, não pela img */
}

.tpm-avatar--initials {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--tpm-accent), #9c8fff);
    color: #ffffff;
    font-size: calc(var(--tpm-avatar-size) * 0.36);
    font-weight: 700;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

/* ── Content ────────────────────────────────────────────────────────────────── */
.tpm-content {
    flex: 1;
    min-width: 0;
}

.tpm-card-header {
    margin-bottom: 0.5rem;
}

.tpm-name {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--tpm-name-color);
    text-decoration: none;
    margin-bottom: 0.15rem;
    line-height: 1.3;
}

a.tpm-name:hover {
    color: var(--tpm-accent);
    text-decoration: underline;
}

.tpm-cargo {
    display: block;
    font-size: 0.78rem;
    color: var(--tpm-cargo-color);
    margin-bottom: 0.6rem;
}

.tpm-texto {
    font-size: 0.875rem;
    line-height: 1.65;
    color: var(--tpm-text-color);
    margin-bottom: 0.75rem;
}

.tpm-texto p:first-child { margin-top: 0; }
.tpm-texto p:last-child  { margin-bottom: 0; }

/* ── Stars ──────────────────────────────────────────────────────────────────── */
.tpm-estrelas {
    display: flex;
    gap: 3px;
    align-items: center;
}

.tpm-star          { display: block; fill: #d1d5db; transition: fill 0.15s; }
.tpm-star--filled  { fill: var(--tpm-accent); }

/* ── Print ──────────────────────────────────────────────────────────────────── */
@media print {
    .tpm-card       { box-shadow: none; border: 1px solid #e5e7eb; }
    .tpm-card:hover { transform: none; }
}
