/**
 * Enhancements CSS — complemento ao style.css
 *
 * @package Revista_Laticinios
 */

/* ==========================================================================
   SEARCH FORM (header compact)
   ========================================================================== */
.header-actions .search-form {
    display: flex;
    align-items: center;
    gap: 0;
    max-width: 220px;
}
.header-actions .search-form label {
    display: flex;
    align-items: center;
    margin: 0;
    flex: 1;
}
.header-actions .search-field {
    padding: .45rem .85rem;
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-size: .875rem;
    outline: none;
    transition: var(--transition);
    width: 160px;
}
.header-actions .search-field:focus { border-color: var(--primary-color); width: 200px; }
.header-actions .search-submit {
    padding: .45rem .75rem;
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: #fff;
    cursor: pointer;
    font-size: .875rem;
    transition: var(--transition);
}
.header-actions .search-submit:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

/* ==========================================================================
   DROPDOWN ARROW SVG
   ========================================================================== */
.dropdown-arrow {
    display: inline-block;
    vertical-align: middle;
    margin-left: 3px;
    transition: transform .2s ease;
    flex-shrink: 0;
}
#primary-menu li:hover > a .dropdown-arrow,
#primary-menu li:focus-within > a .dropdown-arrow {
    transform: rotate(180deg);
}

/* ==========================================================================
   BACK TO TOP
   ========================================================================== */
.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 44px;
    height: 44px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 998;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
}
.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-3px); }

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp .5s ease-out both; }

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to   { transform: translateY(0); }
}

/* ==========================================================================
   COMMENTS
   ========================================================================== */
.comments-area {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border-color);
    max-width: 780px;
}
.comments-title { margin-bottom: var(--spacing-lg); font-size: 1.2rem; }
.comment-list { list-style: none; }
.comment {
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-light);
}
.comment-author { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.comment-author img { border-radius: 50%; width: 42px; height: 42px; }
.comment-author .fn { font-weight: 700; font-size: .9rem; }
.comment-metadata { font-size: .75rem; color: var(--text-muted); }
.comment-content { font-size: .9375rem; }
.reply { margin-top: .5rem; }
.reply a { font-size: .8rem; font-weight: 700; color: var(--primary-dark); }
.comment-respond { margin-top: var(--spacing-xl); }
.comment-form input, .comment-form textarea {
    width: 100%;
    padding: .65rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    margin-bottom: var(--spacing-sm);
    outline: none;
    transition: var(--transition);
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--primary-color); }
.comment-form textarea { min-height: 140px; resize: vertical; }
.comment-form .submit {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: .7rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.comment-form .submit:hover { background: var(--primary-dark); }

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ==========================================================================
   NEWSLETTER FORM IN SECTION (override shortcode inline styles)
   ========================================================================== */
.newsletter-form-wrapper {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color)) !important;
}
.newsletter-form-wrapper button {
    background: var(--footer-bg) !important;
}
.newsletter-form-wrapper button:hover {
    background: #000 !important;
}

/* ==========================================================================
   LOADING SPINNER
   ========================================================================== */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: middle;
    margin-left: .4rem;
}

/* ==========================================================================
   MOBILE RESPONSIVE EXTRAS
   ========================================================================== */
@media (max-width: 768px) {
    .back-to-top { bottom: 16px; right: 16px; width: 40px; height: 40px; font-size: 1rem; }
    .header-actions .search-form { display: none; }
}
