/**
 * YGT Programmatic SEO - Frontend Styles
 * Apple/IKEA Minimalist Design
 * Version: 3.2.0
 */

/* ===== Design Tokens ===== */
:root {
    --ygt-primary: #f7931a;
    --ygt-primary-dark: #e67e00;
    --ygt-primary-light: rgba(247, 147, 26, 0.1);
    
    --ygt-text-primary: #1a1a1a;
    --ygt-text-secondary: #6b7280;
    --ygt-text-muted: #9ca3af;
    
    --ygt-bg-primary: #ffffff;
    --ygt-bg-secondary: #f9fafb;
    --ygt-bg-tertiary: #f3f4f6;
    
    --ygt-border: #e5e7eb;
    --ygt-border-light: #f3f4f6;
    
    --ygt-radius-sm: 8px;
    --ygt-radius-md: 12px;
    --ygt-radius-lg: 16px;
    
    --ygt-shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --ygt-shadow-md: 0 4px 12px rgba(0,0,0,0.05);
    --ygt-shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
    
    --ygt-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Main Wrapper ===== */
.ygt-pseo-wrapper {
    margin: 40px 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ===== Introduction Section ===== */
.ygt-pseo-intro {
    position: relative;
    padding: 28px 32px;
    background: linear-gradient(135deg, var(--ygt-bg-secondary) 0%, var(--ygt-bg-primary) 100%);
    border-radius: var(--ygt-radius-lg);
    margin-bottom: 32px;
    border-left: 4px solid var(--ygt-primary);
}

.ygt-pseo-intro::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at top right, var(--ygt-primary-light), transparent 70%);
    border-radius: 0 var(--ygt-radius-lg) 0 0;
    pointer-events: none;
}

.ygt-pseo-intro p {
    position: relative;
    margin: 0;
    font-size: 16px;
    line-height: 1.75;
    color: var(--ygt-text-primary);
    letter-spacing: -0.01em;
}

/* ===== Section Headers ===== */
.ygt-pseo-section {
    margin: 40px 0;
}

.ygt-pseo-section h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--ygt-text-primary);
    margin: 0 0 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ygt-border-light);
    letter-spacing: -0.02em;
}

/* ===== Related Posts Grid ===== */
.ygt-pseo-related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 640px) {
    .ygt-pseo-related-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Article Cards - Apple Style ===== */
.ygt-pseo-card {
    background: var(--ygt-bg-primary);
    border-radius: var(--ygt-radius-md);
    overflow: hidden;
    box-shadow: var(--ygt-shadow-sm);
    transition: transform var(--ygt-transition), box-shadow var(--ygt-transition);
    border: 1px solid var(--ygt-border-light);
}

.ygt-pseo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ygt-shadow-lg);
}

.ygt-pseo-card-image {
    display: block;
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 */
    overflow: hidden;
    background: var(--ygt-bg-tertiary);
}

.ygt-pseo-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.ygt-pseo-card:hover .ygt-pseo-card-image img {
    transform: scale(1.05);
}

.ygt-pseo-card-content {
    padding: 16px 18px;
}

.ygt-pseo-card-content h3 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.ygt-pseo-card-content h3 a {
    color: var(--ygt-text-primary);
    text-decoration: none;
    transition: color var(--ygt-transition);
}

.ygt-pseo-card-content h3 a:hover {
    color: var(--ygt-primary);
}

.ygt-pseo-card-content p {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--ygt-text-secondary);
}

.ygt-pseo-card-date {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    color: var(--ygt-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ===== FAQ Section - Accordion Style ===== */
.ygt-pseo-faq-section {
    background: var(--ygt-bg-secondary);
    padding: 28px;
    border-radius: var(--ygt-radius-lg);
}

.ygt-pseo-faq-section h2 {
    border: none;
    padding: 0;
    margin-bottom: 20px;
}

.ygt-pseo-faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ygt-pseo-faq-item {
    background: var(--ygt-bg-primary);
    border-radius: var(--ygt-radius-md);
    padding: 20px 24px;
    box-shadow: var(--ygt-shadow-sm);
    transition: box-shadow var(--ygt-transition);
}

.ygt-pseo-faq-item:hover {
    box-shadow: var(--ygt-shadow-md);
}

.ygt-pseo-faq-question {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ygt-text-primary);
    line-height: 1.5;
}

.ygt-pseo-faq-question::before {
    content: "Q";
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--ygt-primary);
    color: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.ygt-pseo-faq-answer {
    padding-left: 36px;
}

.ygt-pseo-faq-answer p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--ygt-text-secondary);
}

/* ===== AI Badge ===== */
.ygt-pseo-ai-badge {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--ygt-border-light);
}

.ygt-pseo-ai-badge small {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--ygt-text-muted);
    padding: 6px 12px;
    background: var(--ygt-bg-secondary);
    border-radius: var(--ygt-radius-sm);
}

/* ===== Schema FAQ Styling (for Google Rich Snippets) ===== */
[itemtype="https://schema.org/FAQPage"] {
    /* Schema container inherits styles */
}

[itemtype="https://schema.org/Question"] {
    /* Question items inherit styles */
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .ygt-pseo-wrapper {
        margin: 24px 0;
    }
    
    .ygt-pseo-intro {
        padding: 20px 24px;
    }
    
    .ygt-pseo-intro p {
        font-size: 15px;
    }
    
    .ygt-pseo-section h2 {
        font-size: 18px;
    }
    
    .ygt-pseo-faq-section {
        padding: 20px;
    }
    
    .ygt-pseo-faq-item {
        padding: 16px 18px;
    }
    
    .ygt-pseo-faq-answer {
        padding-left: 0;
        margin-top: 8px;
    }
}

/* ===== Print Styles ===== */
@media print {
    .ygt-pseo-wrapper {
        margin: 0;
    }
    
    .ygt-pseo-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .ygt-pseo-ai-badge {
        display: none;
    }
}

/* ===== Smooth Scroll for FAQ Links ===== */
html {
    scroll-behavior: smooth;
}

/* ===== Loading State ===== */
.ygt-pseo-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--ygt-text-muted);
}

.ygt-pseo-loading::after {
    content: "";
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid var(--ygt-border);
    border-top-color: var(--ygt-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
