/**
 * SEO & AI-Friendly Components Styles
 * 
 * Styling for FAQ accordion, Related content, and Definition box components.
 * These components are designed for accessibility and AI discoverability.
 * 
 * @package Rigtig_For_Mig
 * @since 3.18.0
 */

/* ==========================================================================
   FAQ SECTION
   ========================================================================== */

.rfm-faq-section {
    margin: 2rem 0;
    padding: 0;
}

.rfm-faq-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--rfm-heading-color, #1a1a1a);
}

.rfm-faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rfm-faq-item {
    border: 1px solid var(--rfm-border-color, #e5e7eb);
    border-radius: 8px;
    overflow: hidden;
    background: var(--rfm-bg-white, #fff);
    transition: box-shadow 0.2s ease;
}

.rfm-faq-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.rfm-faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1rem 1.25rem;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    color: var(--rfm-text-color, #374151);
    transition: background-color 0.15s ease;
}

.rfm-faq-question:hover {
    background-color: var(--rfm-bg-secondary, #f9fafb);
}

.rfm-faq-question:focus {
    outline: 2px solid var(--rfm-primary-color, #00CED1);
    outline-offset: -2px;
}

.rfm-faq-icon {
    flex-shrink: 0;
    margin-left: 1rem;
    color: var(--rfm-text-muted, #6b7280);
    transition: transform 0.2s ease;
}

.rfm-faq-question[aria-expanded="true"] .rfm-faq-icon {
    transform: rotate(180deg);
}

.rfm-faq-answer {
    padding: 0 1.25rem 1.25rem;
    color: var(--rfm-text-color, #4b5563);
    line-height: 1.7;
}

.rfm-faq-answer[hidden] {
    display: none;
}

.rfm-faq-answer p {
    margin: 0 0 0.75rem;
}

.rfm-faq-answer p:last-child {
    margin-bottom: 0;
}

.rfm-faq-answer ul,
.rfm-faq-answer ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.rfm-faq-answer li {
    margin: 0.25rem 0;
}

/* ==========================================================================
   RELATED CONTENT SECTION
   ========================================================================== */

.rfm-related-section {
    margin: 2.5rem 0;
    padding: 1.5rem;
    background: var(--rfm-bg-secondary, #f9fafb);
    border-radius: 12px;
}

.rfm-related-block {
    margin-bottom: 1.5rem;
}

.rfm-related-block:last-child {
    margin-bottom: 0;
}

.rfm-related-block h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
    color: var(--rfm-heading-color, #1a1a1a);
}

.rfm-related-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rfm-related-list li {
    margin: 0;
    padding: 0;
}

.rfm-related-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    color: var(--rfm-primary-color, #00CED1);
    text-decoration: none;
    border-bottom: 1px solid var(--rfm-border-color, #e5e7eb);
    transition: color 0.15s ease;
}

.rfm-related-list a:hover {
    color: var(--rfm-primary-dark, #00a8a8);
}

.rfm-related-list li:last-child a {
    border-bottom: none;
}

.rfm-related-count {
    font-size: 0.85rem;
    color: var(--rfm-text-muted, #6b7280);
}

/* Related Questions (no links) */
.rfm-related-questions .rfm-related-list li {
    padding: 0.5rem 0;
    color: var(--rfm-text-color, #4b5563);
    border-bottom: 1px solid var(--rfm-border-color, #e5e7eb);
}

.rfm-related-questions .rfm-related-list li:last-child {
    border-bottom: none;
}

.rfm-related-questions .rfm-related-list li::before {
    content: "?";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--rfm-primary-light, #e0f7f7);
    color: var(--rfm-primary-color, #00CED1);
    border-radius: 50%;
}

/* Related Experts Cards */
.rfm-related-experts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rfm-related-expert-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--rfm-bg-white, #fff);
    border-radius: 8px;
    text-decoration: none;
    transition: box-shadow 0.15s ease;
}

.rfm-related-expert-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.rfm-related-expert-image {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--rfm-bg-secondary, #f3f4f6);
}

.rfm-related-expert-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rfm-related-expert-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.rfm-related-expert-name {
    font-weight: 500;
    color: var(--rfm-heading-color, #1a1a1a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rfm-related-expert-city {
    font-size: 0.85rem;
    color: var(--rfm-text-muted, #6b7280);
}

.rfm-related-expert-rating {
    font-size: 0.85rem;
}

/* CTA Button */
.rfm-related-cta {
    margin-top: 1.5rem;
    text-align: center;
}

.rfm-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
}

.rfm-btn-primary {
    background: var(--rfm-primary-color, #00CED1);
    color: #fff;
}

.rfm-btn-primary:hover {
    background: var(--rfm-primary-dark, #00a8a8);
    color: #fff;
}

/* ==========================================================================
   DEFINITION BOX
   ========================================================================== */

.rfm-definition-box {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--rfm-bg-secondary, #f0f9fa) 0%, var(--rfm-bg-white, #fff) 100%);
    border: 2px solid var(--rfm-primary-light, #b3e6e6);
    border-radius: 12px;
}

.rfm-definition-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--rfm-border-color, #e5e7eb);
}

.rfm-definition-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--rfm-heading-color, #1a1a1a);
}

.rfm-definition-content {
    margin-bottom: 1.5rem;
    line-height: 1.7;
    color: var(--rfm-text-color, #374151);
}

.rfm-definition-content p {
    margin: 0 0 1rem;
}

.rfm-definition-content p:last-child {
    margin-bottom: 0;
}

.rfm-definition-details {
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .rfm-definition-details {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

.rfm-definition-section {
    padding: 1rem;
    background: var(--rfm-bg-white, #fff);
    border-radius: 8px;
}

.rfm-definition-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--rfm-heading-color, #374151);
}

.rfm-definition-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rfm-definition-section li {
    position: relative;
    padding: 0.25rem 0 0.25rem 1.25rem;
    color: var(--rfm-text-color, #4b5563);
    font-size: 0.9rem;
}

.rfm-definition-section li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--rfm-text-muted, #9ca3af);
}

/* Section variants */
.rfm-definition-helps {
    border-left: 3px solid var(--rfm-success-color, #10b981);
}

.rfm-definition-helps h3 .rfm-icon {
    color: var(--rfm-success-color, #10b981);
}

.rfm-definition-not-for {
    border-left: 3px solid var(--rfm-warning-color, #f59e0b);
}

.rfm-definition-not-for h3 .rfm-icon {
    color: var(--rfm-warning-color, #f59e0b);
}

.rfm-definition-questions {
    border-left: 3px solid var(--rfm-primary-color, #00CED1);
}

.rfm-definition-questions h3 .rfm-icon {
    color: var(--rfm-primary-color, #00CED1);
}

/* ==========================================================================
   CSS CUSTOM PROPERTIES (Defaults)
   ========================================================================== */

:root {
    --rfm-primary-color: #00CED1;
    --rfm-primary-dark: #00a8a8;
    --rfm-primary-light: #e0f7f7;
    --rfm-heading-color: #1f2937;
    --rfm-text-color: #374151;
    --rfm-text-muted: #6b7280;
    --rfm-bg-white: #ffffff;
    --rfm-bg-secondary: #f9fafb;
    --rfm-border-color: #e5e7eb;
    --rfm-success-color: #10b981;
    --rfm-warning-color: #f59e0b;
}

/* Dark mode support (if theme uses prefers-color-scheme) */
@media (prefers-color-scheme: dark) {
    .rfm-definition-box:root:not([data-theme="light"]),
    .rfm-faq-section:root:not([data-theme="light"]),
    .rfm-related-section:root:not([data-theme="light"]) {
        /* Extend with dark mode colors if needed */
    }
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .rfm-faq-icon,
    .rfm-faq-item,
    .rfm-related-expert-card,
    .rfm-btn {
        transition: none;
    }
}

/* Focus visible styles */
.rfm-faq-question:focus-visible,
.rfm-related-list a:focus-visible,
.rfm-related-expert-card:focus-visible,
.rfm-btn:focus-visible {
    outline: 2px solid var(--rfm-primary-color, #00CED1);
    outline-offset: 2px;
}
