/*
Theme Name: SEO Affiliate Pro
Theme URI: https://example.com/seo-affiliate-pro
Author: Your Name
Author URI: https://example.com
Description: A complete SEO-friendly WordPress theme designed for affiliate marketing, referral codes, and content sharing. Features include click-to-copy referral codes, FAQ schema markup, social sharing, responsive design, and user registration for multi-author blogs.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: seo-affiliate-pro
Tags: blog, two-columns, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, sticky-post, theme-options, threaded-comments, translation-ready, responsive-layout, accessibility-ready, seo-friendly, affiliate, referral

This theme is optimized for SEO, affiliate marketing, and content sharing.
*/

/* ===================================
   RESET & BASE STYLES
=================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
    background: #f9f9f9;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: #0066cc;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #004499;
}

/* ===================================
   CONTAINER & LAYOUT
=================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-content {
    display: flex;
    gap: 40px;
    margin: 40px 0;
}

.content-area {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 320px;
    flex-shrink: 0;
}

/* ===================================
   HEADER
=================================== */
.site-header {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-title {
    font-size: 26px;
    font-weight: 700;
    margin: 0;
}

.site-title a {
    color: #1a1a1a;
}

.site-description {
    font-size: 14px;
    color: #666;
    margin: 5px 0 0;
}

/* ===================================
   NAVIGATION
=================================== */
.main-navigation {
    position: relative;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 30px;
    align-items: center;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    color: #333;
    font-weight: 500;
    padding: 8px 12px;
    display: block;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a {
    background: #f0f0f0;
    color: #0066cc;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: #0066cc;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

/* ===================================
   HOMEPAGE POSTS GRID
=================================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.post-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.post-thumbnail {
    position: relative;
    overflow: hidden;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #e0e0e0;
}

.post-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-card-content {
    padding: 20px;
}

.post-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-card h2 {
    font-size: 20px;
    line-height: 1.4;
    margin-bottom: 12px;
}

.post-card h2 a {
    color: #1a1a1a;
}

.post-card h2 a:hover {
    color: #0066cc;
}

.post-excerpt {
    color: #555;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.read-more {
    display: inline-block;
    color: #0066cc;
    font-weight: 600;
    padding: 8px 16px;
    border: 2px solid #0066cc;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.read-more:hover {
    background: #0066cc;
    color: white;
}

/* ===================================
   SINGLE POST
=================================== */
.single-post-header {
    background: white;
    padding: 40px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.entry-title {
    font-size: 36px;
    line-height: 1.3;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.entry-meta {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #666;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.author-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

/* Featured Image */
.post-featured-image {
    margin: 30px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ===================================
   REFERRAL CODE BOX
=================================== */
.referral-code-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.referral-code-box h3 {
    font-size: 22px;
    margin-bottom: 15px;
}

.code-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.15);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.referral-code {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    user-select: all;
}

.copy-button {
    background: white;
    color: #667eea;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.copy-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.copy-button.copied {
    background: #48bb78;
    color: white;
}

/* ===================================
   AFFILIATE LINK BOX
=================================== */
.affiliate-link-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 25px;
    margin: 30px 0;
    border-radius: 6px;
}

.affiliate-link-box h4 {
    color: #856404;
    margin-bottom: 12px;
    font-size: 18px;
}

.affiliate-button {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 14px 30px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.affiliate-button:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* ===================================
   POST CONTENT
=================================== */
.entry-content {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    line-height: 1.8;
    font-size: 17px;
}

.entry-content h2 {
    font-size: 28px;
    margin: 35px 0 20px;
    color: #1a1a1a;
    line-height: 1.3;
}

.entry-content h3 {
    font-size: 24px;
    margin: 30px 0 15px;
    color: #1a1a1a;
}

.entry-content p {
    margin-bottom: 20px;
}

.entry-content ul,
.entry-content ol {
    margin: 20px 0 20px 30px;
}

.entry-content li {
    margin-bottom: 10px;
}

.entry-content blockquote {
    border-left: 4px solid #0066cc;
    padding-left: 20px;
    margin: 25px 0;
    font-style: italic;
    color: #555;
}

/* ===================================
   FAQ SECTION (Schema Optimized)
=================================== */
.faq-section {
    background: white;
    padding: 40px;
    border-radius: 8px;
    margin: 30px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.faq-section h2 {
    font-size: 32px;
    margin-bottom: 30px;
    color: #1a1a1a;
}

.faq-item {
    border-bottom: 1px solid #e0e0e0;
    padding: 20px 0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    transition: color 0.3s ease;
}

.faq-question:hover {
    color: #0066cc;
}

.faq-toggle {
    font-size: 24px;
    font-weight: 300;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    color: #555;
    line-height: 1.7;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 15px 0;
}

/* ===================================
   SOCIAL SHARING
=================================== */
.social-share {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin: 30px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.social-share h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.share-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.share-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.share-whatsapp { background: #25D366; }
.share-telegram { background: #0088cc; }
.share-facebook { background: #1877f2; }
.share-twitter { background: #1DA1F2; }
.share-linkedin { background: #0077b5; }
.share-copy { background: #6c757d; }

/* ===================================
   SIDEBAR
=================================== */
.sidebar {
    background: transparent;
}

.widget {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.widget-title {
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #0066cc;
    color: #1a1a1a;
}

.widget ul {
    list-style: none;
}

.widget li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.widget li:last-child {
    border-bottom: none;
}

.widget a {
    color: #333;
    transition: color 0.3s ease;
}

.widget a:hover {
    color: #0066cc;
}

/* ===================================
   FOOTER
=================================== */
.site-footer {
    background: #1a1a1a;
    color: #ccc;
    padding: 50px 0 20px;
    margin-top: 60px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-widget h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 18px;
}

.footer-widget ul {
    list-style: none;
}

.footer-widget li {
    margin-bottom: 10px;
}

.footer-widget a {
    color: #ccc;
    transition: color 0.3s ease;
}

.footer-widget a:hover {
    color: white;
}

.site-info {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #333;
    font-size: 14px;
}

/* ===================================
   PAGINATION
=================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
}

.pagination a,
.pagination span {
    padding: 10px 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #333;
    transition: all 0.3s ease;
}

.pagination a:hover,
.pagination .current {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
}

/* ===================================
   FORMS (Login, Register, Contact)
=================================== */
.form-container {
    background: white;
    padding: 40px;
    border-radius: 8px;
    max-width: 500px;
    margin: 40px auto;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.form-container h2 {
    margin-bottom: 25px;
    text-align: center;
    color: #1a1a1a;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #0066cc;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.submit-button {
    width: 100%;
    background: #0066cc;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.submit-button:hover {
    background: #004499;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

/* ===================================
   RESPONSIVE DESIGN
=================================== */
@media (max-width: 968px) {
    .site-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .main-navigation ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        padding: 20px;
    }
    
    .main-navigation.toggled ul {
        display: flex;
    }
    
    .main-navigation li {
        width: 100%;
    }
    
    .entry-title {
        font-size: 28px;
    }
    
    .single-post-header,
    .entry-content,
    .faq-section {
        padding: 25px;
    }
    
    .footer-widgets {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header-inner {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .share-buttons {
        justify-content: center;
    }
    
    .code-container {
        flex-direction: column;
    }
    
    .copy-button {
        width: 100%;
    }
}

/* ===================================
   ACCESSIBILITY
=================================== */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #0066cc;
    color: white;
    padding: 8px 15px;
    z-index: 100000;
}

.skip-link:focus {
    top: 0;
}

/* ===================================
   UTILITIES
=================================== */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}
