/*
Theme Name: Hello Elementor Child
Theme URI: https://elementor.com
Description: Child theme for Hello Elementor
Author: Your Name
Author URI: https://yourwebsite.com
Template: hello-elementor
Version: 1.0
*/

/* ===== GLOBAL DESIGN SYSTEM ===== */
:root {
    /* Brand Colors - Consistent across all templates */
    --primary-color: #21AE34;
    --secondary-color: #111;
    --accent-color: #0056b3;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    
    /* Neutral Colors */
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --medium-gray: #e2e8f0;
    --dark-gray: #4a5568;
    --text-color: #2d3748;
    --text-light: #718096;
    --border-color: #e2e8f0;
    
    /* Typography */
    --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    
    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Layout */
    --container-max-width: 1200px;
    --content-max-width: 800px;
    --sidebar-width: 280px;
}

/* ===== GLOBAL RESET & BASE STYLES ===== */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-primary);
    color: var(--text-color);
    background-color: var(--white);
    margin: 0;
    line-height: 1.6;
    font-size: var(--text-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHY SYSTEM ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 var(--space-4) 0;
    color: var(--text-color);
}

h1 { font-size: var(--text-4xl); font-weight: 700; }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
    margin: 0 0 var(--space-4) 0;
    line-height: 1.7;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--secondary-color);
}

/* ===== COMPONENT STYLES ===== */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: var(--text-sm);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    line-height: 1;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--secondary-color);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--white);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--light-gray);
    border-color: var(--primary-color);
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all var(--transition-normal);
}

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

.card-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--border-color);
    background: var(--light-gray);
}

/* ===== LAYOUT COMPONENTS ===== */

/* Container */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-5);
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--space-8);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* Flex Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* ===== HERO SECTIONS ===== */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: var(--space-20) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: var(--text-5xl);
    font-weight: 700;
    margin-bottom: var(--space-6);
    color: var(--white);
}

.hero p {
    font-size: var(--text-xl);
    opacity: 0.9;
    margin-bottom: var(--space-8);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-10);
    margin-top: var(--space-10);
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: var(--text-4xl);
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: var(--text-sm);
    opacity: 0.8;
    margin-top: var(--space-1);
}

/* ===== POST LAYOUTS ===== */

/* Single Post Layout */
.post-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
    gap: var(--space-10);
    max-width: var(--container-max-width);
    margin: var(--space-10) auto;
    padding: 0 var(--space-5);
}

.post-content-wrapper {
    grid-column: 2;
    max-width: none;
}

/* Sticky TOC */
.sticky-toc {
    position: sticky;
    top: var(--space-6);
    background: var(--light-gray);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    height: fit-content;
    max-height: 70vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--medium-gray);
}

.sticky-toc::-webkit-scrollbar {
    width: 6px;
}

.sticky-toc::-webkit-scrollbar-track {
    background: var(--medium-gray);
    border-radius: var(--radius-sm);
}

.sticky-toc::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: var(--radius-sm);
}

.sticky-toc h5 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-4);
    color: var(--text-color);
}

.sticky-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sticky-toc li {
    margin-bottom: var(--space-2);
}

.sticky-toc a {
    display: block;
    padding: var(--space-2) 0;
    color: var(--text-light);
    font-size: var(--text-sm);
    transition: color var(--transition-fast);
}

.sticky-toc a:hover,
.sticky-toc li.active a {
    color: var(--primary-color);
    font-weight: 500;
}

/* Post Header */
.post-header {
    margin-bottom: var(--space-8);
}

.post-title {
    font-size: var(--text-4xl);
    font-weight: 700;
    margin-bottom: var(--space-4);
    line-height: 1.2;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    font-size: var(--text-sm);
    color: var(--text-light);
    margin-bottom: var(--space-6);
}

.author-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

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

/* Featured Image */
.featured-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-8);
}

/* Content */
.entry-content {
    font-size: var(--text-lg);
    line-height: 1.7;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    margin-top: var(--space-12);
    margin-bottom: var(--space-4);
}

.entry-content p {
    margin-bottom: var(--space-6);
}

.entry-content ul,
.entry-content ol {
    margin-bottom: var(--space-6);
    padding-left: var(--space-6);
}

.entry-content li {
    margin-bottom: var(--space-2);
}

/* Social Share */
.social-share {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin: var(--space-8) 0;
    padding: var(--space-6);
    background: var(--light-gray);
    border-radius: var(--radius-xl);
}

.social-share-label {
    font-weight: 500;
    color: var(--text-color);
}

.social-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--white);
    transition: transform var(--transition-fast);
}

.social-share-btn:hover {
    transform: scale(1.1);
}

.social-share-btn.facebook { background: #1877f2; }
.social-share-btn.twitter { background: #1da1f2; }
.social-share-btn.linkedin { background: #0077b5; }
.social-share-btn.whatsapp { background: #25d366; }

/* Related Posts */
.related-posts {
    background: var(--light-gray);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    height: fit-content;
}

.related-posts h4 {
    margin-bottom: var(--space-4);
    color: var(--text-color);
}

.related-posts ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-posts li {
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-color);
}

.related-posts li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.related-posts a {
    color: var(--text-color);
    font-size: var(--text-sm);
    line-height: 1.4;
    transition: color var(--transition-fast);
}

.related-posts a:hover {
    color: var(--primary-color);
}

/* ===== ARCHIVE LAYOUTS ===== */

/* Category/Archive Grid */
.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-12);
}

.archive-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.archive-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.archive-card-image {
    height: 200px;
    overflow: hidden;
    background: var(--light-gray);
}

.archive-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

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

.archive-card-content {
    padding: var(--space-6);
}

.archive-card-title {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-3);
    line-height: 1.3;
}

.archive-card-title a {
    color: var(--text-color);
    transition: color var(--transition-fast);
}

.archive-card-title a:hover {
    color: var(--primary-color);
}

.archive-card-excerpt {
    color: var(--text-light);
    margin-bottom: var(--space-4);
    line-height: 1.6;
}

.archive-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--text-sm);
    color: var(--text-light);
    margin-bottom: var(--space-4);
}

.meta-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

/* ===== SIDEBAR COMPONENTS ===== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.sidebar-widget {
    background: var(--white);
    padding: var(--space-6);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.widget-title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-4);
    color: var(--text-color);
}

/* Newsletter Form */
.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.newsletter-form input {
    padding: var(--space-3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    transition: border-color var(--transition-fast);
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.newsletter-form button {
    padding: var(--space-3);
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.newsletter-form button:hover {
    background: var(--secondary-color);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-12);
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pagination a {
    background: var(--white);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.pagination a:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.pagination .current {
    background: var(--primary-color);
    color: var(--white);
    border: 1px solid var(--primary-color);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .post-container {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    
    .sticky-toc,
    .related-posts {
        position: static;
        max-height: none;
    }
    
    .hero h1 {
        font-size: var(--text-4xl);
    }
}

@media (max-width: 768px) {
    :root {
        --space-5: 1rem;
        --space-10: 2rem;
        --space-12: 2.5rem;
        --space-16: 3rem;
        --space-20: 4rem;
    }
    
    .hero {
        padding: var(--space-16) 0;
    }
    
    .hero h1 {
        font-size: var(--text-3xl);
    }
    
    .hero-stats {
        gap: var(--space-6);
    }
    
    .post-title {
        font-size: var(--text-3xl);
    }
    
    .archive-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-4);
    }
    
    .hero h1 {
        font-size: var(--text-2xl);
    }
    
    .post-title {
        font-size: var(--text-2xl);
    }
    
    .sidebar-widget,
    .sticky-toc,
    .related-posts {
        padding: var(--space-4);
    }
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.text-muted { color: var(--text-light); }

.bg-primary { background-color: var(--primary-color); }
.bg-light { background-color: var(--light-gray); }
.bg-white { background-color: var(--white); }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for better accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== SUBSCRIPTION FORM STYLES ===== */
.tsaaf-subscription-form {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-6);
}

.subscription-title {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 var(--space-3) 0;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: var(--space-2);
}

.subscription-description {
    font-size: var(--text-sm);
    color: var(--text-light);
    margin-bottom: var(--space-5);
    line-height: 1.5;
}

.subscription-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.form-row {
    position: relative;
    transition: all var(--transition-fast);
}

.form-row.focused {
    transform: translateY(-1px);
}

.form-row.error .form-input {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-input {
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-family: inherit;
    transition: all var(--transition-fast);
    background: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(33, 174, 52, 0.1);
}

.form-input::placeholder {
    color: var(--text-light);
}

.subscription-submit-btn {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 48px;
}

.subscription-submit-btn:hover:not(:disabled) {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.subscription-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading svg {
    animation: spin 1s linear infinite;
}

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

.form-message {
    padding: var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.form-message.success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.form-message.error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.subscription-privacy {
    font-size: var(--text-xs);
    color: var(--text-light);
    text-align: center;
    margin: var(--space-2) 0 0 0;
}

/* Form Type Variations */
.tsaaf-subscription-form[data-form-type="footer"] {
    background: transparent;
    box-shadow: none;
    padding: var(--space-4) 0;
}

.tsaaf-subscription-form[data-form-type="footer"] .subscription-title {
    color: var(--white);
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.tsaaf-subscription-form[data-form-type="footer"] .subscription-description {
    color: rgba(255, 255, 255, 0.8);
}

.tsaaf-subscription-form[data-form-type="popup"] {
    max-width: 400px;
    margin: 0 auto;
}

/* Mobile Responsive for Subscription Forms */
@media (max-width: 768px) {
    .tsaaf-subscription-form {
        padding: var(--space-4);
    }
    
    .subscription-title {
        font-size: var(--text-lg);
    }
    
    .form-input,
    .subscription-submit-btn {
        padding: var(--space-4);
    }
}

/* Accessibility for Subscription Forms */
@media (prefers-reduced-motion: reduce) {
    .form-row,
    .form-input,
    .subscription-submit-btn,
    .form-message {
        transition: none;
    }
    
    .btn-loading svg {
        animation: none;
    }
}

/* High contrast mode for Subscription Forms */
@media (prefers-contrast: high) {
    .form-input {
        border-width: 2px;
    }
    
    .subscription-submit-btn {
        border: 2px solid currentColor;
    }
}