/* ============================================
   Artigos Front - Frontend Styles
   ============================================ */

/* Container principal */
.af-create-post-wrap {
    max-width: 800px;
    margin: 30px auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Mensagens de feedback */
.af-message {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 15px;
}

.af-message p {
    margin: 0;
}

.af-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.af-success a {
    color: #047857;
    font-weight: 600;
    text-decoration: underline;
}

.af-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Formulário */
.af-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.af-field {
    display: flex;
    flex-direction: column;
}

.af-field label {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 6px;
}

.af-field .required {
    color: #dc2626;
    margin-left: 2px;
}

/* Campos de input */
.af-field input[type="text"],
.af-field input[type="url"],
.af-field input[type="email"],
.af-field textarea {
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.5;
    color: #1f2937;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.af-field input[type="text"]:focus,
.af-field input[type="url"]:focus,
.af-field input[type="email"]:focus,
.af-field textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.af-field textarea {
    min-height: 80px;
    resize: vertical;
}

/* Editor WP personalizado */
.af-field .wp-editor-wrap {
    border-radius: 8px;
    overflow: hidden;
    border: 1.5px solid #d1d5db;
}

.af-field .wp-editor-wrap .wp-editor-container {
    border: none !important;
}

/* Seletor de categorias */
.af-field select {
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    color: #1f2937;
    background: #fff url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
    min-width: 250px;
}

.af-field select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* Upload de imagem */
.af-image-upload-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.af-image-preview {
    width: 100%;
    max-width: 400px;
    min-height: 120px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    overflow: hidden;
    position: relative;
    transition: border-color 0.2s ease;
}

.af-image-preview.has-image {
    border-style: solid;
    border-color: #d1d5db;
    min-height: 200px;
}

.af-image-preview img {
    max-width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
}

.af-image-preview .af-image-placeholder {
    color: #9ca3af;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

/* Botões */
.af-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.4;
}

.af-btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
}

.af-btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.af-btn-primary:active {
    transform: translateY(0);
}

.af-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1.5px solid #d1d5db;
}

.af-btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.af-btn-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1.5px solid #fecaca;
}

.af-btn-danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

/* Campo de submit */
.af-field-submit {
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.af-field-submit .af-btn-primary {
    min-width: 200px;
    font-size: 16px;
    padding: 12px 28px;
}

/* Login form */
.af-login-wrap {
    max-width: 420px;
    margin: 60px auto;
    padding: 40px 36px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.af-login-wrap h2 {
    margin: 0 0 24px;
    font-size: 22px;
    color: #1f2937;
}

.af-login-wrap form {
    text-align: left;
}

.af-login-wrap form label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.af-login-wrap form input[type="text"],
.af-login-wrap form input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    margin: 6px 0 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.af-login-wrap form input[type="text"]:focus,
.af-login-wrap form input[type="password"]:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    outline: none;
}

.af-login-wrap form input[type="checkbox"] {
    margin-right: 6px;
}

.af-login-wrap form input[type="submit"] {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s ease;
}

.af-login-wrap form input[type="submit"]:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-1px);
}

.af-register-link {
    margin-top: 18px;
    font-size: 14px;
}

.af-register-link a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
}

.af-register-link a:hover {
    text-decoration: underline;
}

/* ============================================
   Página de Autores - [af_autores]
   ============================================ */

.af-autores-wrap {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ── Header ── */
.af-autores-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid #f0f0f4;
}

.af-autores-title {
    font-size: 38px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 12px;
    letter-spacing: -0.8px;
    line-height: 1.15;
}

.af-autores-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 2px;
    margin: 16px auto 0;
}

.af-autores-subtitle {
    font-size: 17px;
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
}

/* ── Barra de busca e ordenação ── */
.af-autores-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 32px;
    padding: 16px 20px;
    background: #f9fafb;
    border: 1px solid #f0f0f4;
    border-radius: 14px;
}

.af-autores-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 360px;
}

.af-autores-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    opacity: 0.5;
    pointer-events: none;
}

.af-autores-search {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    color: #1f2937;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.af-autores-search:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.af-autores-search::placeholder {
    color: #9ca3af;
}

.af-autores-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}

.af-autores-sort-label {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    white-space: nowrap;
}

.af-autores-sort-select {
    padding: 8px 30px 8px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 13px;
    color: #1f2937;
    background: #fff url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.af-autores-sort-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.af-autores-count {
    font-size: 13px;
    color: #9ca3af;
    white-space: nowrap;
}

/* ── Grid de autores ── */
.af-autores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* ── Card ── */
.af-autor-card {
    display: block;
    text-decoration: none;
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    border: 1px solid #f0f0f4;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    opacity: 0;
    animation: af-card-fade-in 0.5s ease forwards;
}

.af-autor-card:nth-child(1)  { animation-delay: 0.00s; }
.af-autor-card:nth-child(2)  { animation-delay: 0.05s; }
.af-autor-card:nth-child(3)  { animation-delay: 0.10s; }
.af-autor-card:nth-child(4)  { animation-delay: 0.15s; }
.af-autor-card:nth-child(5)  { animation-delay: 0.20s; }
.af-autor-card:nth-child(6)  { animation-delay: 0.25s; }
.af-autor-card:nth-child(7)  { animation-delay: 0.30s; }
.af-autor-card:nth-child(8)  { animation-delay: 0.35s; }
.af-autor-card:nth-child(9)  { animation-delay: 0.40s; }
.af-autor-card:nth-child(10) { animation-delay: 0.45s; }
.af-autor-card:nth-child(11) { animation-delay: 0.50s; }
.af-autor-card:nth-child(12) { animation-delay: 0.55s; }

@keyframes af-card-fade-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Borda gradiente no hover */
.af-autor-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
    border-radius: 19px;
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: -1;
}

.af-autor-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(99, 102, 241, 0.13), 0 6px 16px rgba(0, 0, 0, 0.06);
    border-color: transparent;
}

.af-autor-card:hover::before {
    opacity: 1;
}

.af-autor-card-inner {
    padding: 32px 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 17px;
    height: 100%;
    box-sizing: border-box;
}

/* ── Foto ── */
.af-autor-photo {
    position: relative;
    margin-bottom: 18px;
}

.af-autor-photo::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: -1;
}

.af-autor-card:hover .af-autor-photo::after {
    opacity: 1;
}

.af-autor-photo img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
}

.af-autor-card:hover .af-autor-photo img {
    transform: scale(1.08);
}

.af-autor-photo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.af-autor-photo-emoji {
    font-size: 40px;
    line-height: 1;
}

/* ── Badge de artigos ── */
.af-autor-posts-badge {
    position: absolute;
    bottom: -4px;
    right: -10px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
}

.af-autor-card:hover .af-autor-posts-badge {
    transform: scale(1.12);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
}

.af-autor-posts-badge span {
    font-size: 7px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

/* ── Info ── */
.af-autor-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex: 1;
}

.af-autor-name {
    font-size: 19px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px;
    line-height: 1.3;
    transition: color 0.25s ease;
}

.af-autor-card:hover .af-autor-name {
    color: #4f46e5;
}

.af-autor-role-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    color: #6366f1;
    background: #eef2ff;
    padding: 2px 10px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.af-autor-bio {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 16px;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 280px;
}

/* ── Redes sociais ── */
.af-autor-social {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.af-autor-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #6b7280;
    background: #f3f4f6;
}

.af-autor-social-link:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Cores individuais para hover das redes */
.af-autor-social-link[title="Facebook"]:hover {
    background: #1877f2;
    color: #fff;
}
.af-autor-social-link[title="Instagram"]:hover {
    background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
    color: #fff;
}
.af-autor-social-link[title="Twitter / X"]:hover {
    background: #111827;
    color: #fff;
}
.af-autor-social-link[title="LinkedIn"]:hover {
    background: #0a66c2;
    color: #fff;
}
.af-autor-social-link[title="YouTube"]:hover {
    background: #ff0000;
    color: #fff;
}
.af-autor-social-link[title="TikTok"]:hover {
    background: #111827;
    color: #fff;
}
.af-autor-social-link[title="Pinterest"]:hover {
    background: #e60023;
    color: #fff;
}

/* ── CTA ── */
.af-autor-cta {
    font-size: 13px;
    font-weight: 600;
    color: #6366f1;
    padding: 8px 22px;
    border-radius: 20px;
    border: 1.5px solid #e0e7ff;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
}

.af-autor-cta::after {
    content: '→';
    transition: transform 0.25s ease;
    display: inline-block;
}

.af-autor-card:hover .af-autor-cta {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25);
}

.af-autor-card:hover .af-autor-cta::after {
    transform: translateX(4px);
}

/* ── Estado vazio ── */
.af-autores-empty {
    text-align: center;
    padding: 70px 20px;
    background: #f9fafb;
    border: 2px dashed #e5e7eb;
    border-radius: 18px;
}

.af-autores-empty-icon {
    font-size: 60px;
    display: block;
    margin-bottom: 16px;
}

.af-autores-empty h3 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #374151;
}

.af-autores-empty p {
    margin: 0;
    color: #6b7280;
}

/* ── Mensagem de filtro sem resultados ── */
.af-autores-no-results {
    display: none;
    text-align: center;
    padding: 50px 20px;
    color: #6b7280;
}
.af-autores-no-results.visible {
    display: block;
}
.af-autores-no-results h3 {
    font-size: 18px;
    color: #374151;
    margin: 0 0 8px;
}
.af-autores-no-results p {
    margin: 0;
    font-size: 14px;
}

/* ============================================
   Página de Arquivo de Autor (/author/)
   ============================================ */

.af-author-archive-header {
    max-width: 800px;
    margin: 0 auto 36px;
    padding: 44px 32px 36px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f4;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.af-author-archive-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #a78bfa);
}

.af-author-archive-header .af-autor-photo {
    margin-bottom: 18px;
}

.af-author-archive-header .af-autor-photo::after {
    opacity: 1;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
}

.af-author-archive-header .af-autor-photo img {
    width: 120px;
    height: 120px;
    border: 4px solid #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.af-author-archive-header .af-autor-photo-placeholder {
    width: 120px;
    height: 120px;
    border: 4px solid #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.af-author-archive-header h1 {
    font-size: 30px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 6px;
    letter-spacing: -0.3px;
}

.af-author-archive-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 16px 0 20px;
    flex-wrap: wrap;
}

.af-author-archive-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #6b7280;
}

.af-author-archive-stat strong {
    color: #111827;
}

.af-author-archive-description {
    max-width: 640px;
    margin: 0 auto;
}

.af-author-archive-description .af-autor-bio {
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 16px;
    line-height: 1.7;
    -webkit-line-clamp: none;
    overflow: visible;
}

.af-author-archive-description .af-autor-social {
    margin-bottom: 0;
}

/* ============================================
   Responsividade
   ============================================ */

@media screen and (max-width: 640px) {
    .af-create-post-wrap {
        padding: 20px 16px;
        margin: 16px;
        border-radius: 8px;
    }

    .af-login-wrap {
        margin: 30px 16px;
        padding: 28px 20px;
    }

    .af-field select {
        min-width: 100%;
    }

    .af-autores-title {
        font-size: 28px;
    }

    .af-autores-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 14px 16px;
    }

    .af-autores-search-wrap {
        max-width: 100%;
    }

    .af-autores-sort {
        justify-content: space-between;
    }

    .af-autores-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .af-autor-card-inner {
        padding: 24px 16px 20px;
    }

    .af-author-archive-header {
        padding: 32px 20px 28px;
    }

    .af-author-archive-header .af-autor-photo img {
        width: 90px;
        height: 90px;
    }

    .af-author-archive-header h1 {
        font-size: 24px;
    }

    .af-author-archive-stats {
        gap: 16px;
        font-size: 13px;
    }
}

/* ── Animações para transição de filtro ── */
.af-autores-grid.is-filtering .af-autor-card {
    animation: none;
    opacity: 1;
}
