/* ====================================
   Shared Styles - Nitesh Singhal Website
   Used across all pages for consistency
   ==================================== */

/* CSS Variables - Design Tokens */
:root {
    /* Primary Colors */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --accent-color: #06b6d4;
    --purple-accent: #6f42c1;
    
    /* Neutral Colors */
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --background-light: #f8f9fa;
    --background-white: #ffffff;
    --border-color: #e2e8f0;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Transitions */
    --transition-base: all 0.3s ease;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    font-weight: 700;
    color: var(--text-primary);
}

p {
    margin-bottom: 1.5em;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
}

strong {
    color: var(--text-primary);
    font-weight: 600;
}

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

a:hover {
    text-decoration: underline;
}

/* Lists */
ul, ol {
    margin-bottom: 1.5em;
    padding-left: 30px;
}

li {
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Code */
code {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    padding: 3px 8px;
    border-radius: 6px;
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    font-size: 0.9em;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

/* ====================================
   Shared Button Styles
   ==================================== */

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    margin-bottom: 30px;
    font-weight: 500;
    padding: 12px 20px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 12px;
    transition: var(--transition-base);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.back-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.back-link::before {
    content: "←";
    font-size: 1.2rem;
}

/* Email Link Button */
.email-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    color: white;
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    padding: 15px 30px;
    border-radius: 50px;
    transition: var(--transition-base);
    box-shadow: var(--shadow-md);
    border: none;
}

.email-link:hover,
.email-link:focus {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.email-link::before {
    content: "✉️";
    font-size: 1.2rem;
}

/* Substack Link Button */
.substack-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color);
    text-decoration: none;
    background: rgba(37, 99, 235, 0.1);
    padding: 15px 30px;
    border-radius: 50px;
    transition: var(--transition-base);
    border: 2px solid var(--primary-color);
    margin-top: 20px;
}

.substack-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.substack-link::before {
    content: "📬";
    font-size: 1.2rem;
}

/* Read More Link */
.read-more-link {
    display: inline-block;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    margin-top: 15px;
    padding: 8px 16px;
    border: 2px solid var(--primary-color);
    border-radius: 5px;
    transition: var(--transition-base);
}

.read-more-link:hover,
.read-more-link:focus {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

/* Event Link (for speaking engagements) */
.event-link {
    display: inline-block;
    font-weight: 600;
    color: var(--purple-accent);
    text-decoration: none;
    margin-top: 10px;
    padding: 8px 16px;
    border: 2px solid var(--purple-accent);
    border-radius: 5px;
    transition: var(--transition-base);
}

.event-link:hover,
.event-link:focus {
    background-color: var(--purple-accent);
    color: white;
    text-decoration: none;
}

/* ====================================
   Card Components
   ==================================== */

/* Article Card (used in homepage and articles page) */
.article-card {
    margin-bottom: 25px;
    padding: 30px;
    background-color: var(--background-light);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    transition: var(--transition-base);
}

.article-card:last-child {
    margin-bottom: 0;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    background: rgba(255, 255, 255, 0.95);
}

.article-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.article-card p {
    margin-bottom: 15px;
}

/* Speaking Card */
.speaking-card {
    margin-bottom: 25px;
    padding: 30px;
    background-color: var(--background-light);
    border-radius: 8px;
    border-left: 4px solid var(--purple-accent);
    transition: var(--transition-base);
}

.speaking-card:last-child {
    margin-bottom: 0;
}

.speaking-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.speaking-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--purple-accent);
}

.speaking-card .event-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.speaking-card .event-date {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.speaking-card p {
    margin-bottom: 15px;
    color: #495057;
}

/* Stats / Badges */
.article-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

.stat {
    background-color: #e3f2fd;
    color: #1976d2;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid #bbdefb;
}

/* Stat Cards (for metrics display in articles) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.15);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    transition: var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    background: rgba(37, 99, 235, 0.08);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
}

/* ====================================
   Layout Components
   ==================================== */

/* Highlight Box (for callouts and important notes) */
.highlight-box {
    background: rgba(6, 182, 212, 0.1);
    border-left: 4px solid var(--accent-color);
    padding: 25px 30px;
    margin: 30px 0;
    border-radius: 12px;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.highlight-box p:last-child {
    margin-bottom: 0;
}

/* CTA Section */
.cta-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid var(--border-color);
    text-align: center;
    position: relative;
}

.cta-section::before {
    content: "";
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 1px;
}

.cta-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

/* Image Container */
.image-container {
    text-align: center;
    margin: 40px 0;
    padding: 30px;
    background: rgba(37, 99, 235, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(37, 99, 235, 0.1);
}

.image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

/* ====================================
   Section Layouts
   ==================================== */

.speaking-section {
    margin-top: 40px;
}

.speaking-section h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--text-primary);
}

.articles-section {
    margin-top: 40px;
}

.articles-section h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--text-primary);
}

/* ====================================
   Utility Classes
   ==================================== */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Text selection styling */
::selection {
    background: rgba(37, 99, 235, 0.2);
    color: var(--text-primary);
}

/* Focus styles for accessibility */
.back-link:focus,
.email-link:focus,
.substack-link:focus,
.read-more-link:focus,
.event-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ====================================
   Responsive Design
   ==================================== */

@media (max-width: 768px) {
    p, li {
        font-size: 1rem;
    }
    
    .article-card,
    .speaking-card {
        padding: 25px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .back-link {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .article-card,
    .speaking-card {
        padding: 20px;
    }
    
    .article-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .email-link,
    .substack-link {
        font-size: 1rem;
        padding: 12px 24px;
    }
}

/* ====================================
   Page Layout Styles
   ==================================== */

/* Article Page Layout (for individual article pages) */
body.article-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

body.article-page .container {
    max-width: 900px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    padding: 60px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Article Header with Decorative Line */
.article-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.article-header::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 1px;
}

.article-header h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.article-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.5;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.meta-icon {
    font-size: 1.1rem;
}

.article-content {
    max-width: 800px;
    margin: 0 auto;
}

body.article-page article {
    margin-top: 40px;
}

body.article-page h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-top: 50px;
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.3;
}

body.article-page h3 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-top: 35px;
    margin-bottom: 15px;
    font-weight: 600;
}

/* Articles Listing Page Layout */
body.articles-listing {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

body.articles-listing .container {
    max-width: 1000px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    padding: 60px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Header with Decorative Line (for listing pages) */
body.articles-listing header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

body.articles-listing header::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 1px;
}

body.articles-listing h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.articles-listing .subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 500;
}

.articles-container {
    margin-top: 40px;
}

.article-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
    line-height: 1.3;
}

.article-excerpt {
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.6;
    font-size: 1.05rem;
}

/* Footer with Decorative Line (for listing pages) */
body.articles-listing footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
    position: relative;
}

body.articles-listing footer::before {
    content: "";
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 1px;
}

/* Homepage Layout */
body.homepage {
    background-color: var(--background-light);
    color: #343a40;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

body.homepage .container {
    max-width: 800px;
    width: 100%;
    background-color: var(--background-white);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 40px;
}

body.homepage header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 20px;
}

body.homepage h1 {
    font-size: 2.2rem;
    margin-bottom: 5px;
    color: #212529;
}

body.homepage .tagline {
    font-size: 1.1rem;
    color: #6c757d;
    margin: 0;
}

body.homepage main {
    font-size: 1rem;
}

body.homepage p {
    margin-bottom: 1.2em;
}

body.homepage footer {
    text-align: center;
    margin-top: 40px;
    border-top: 1px solid #e9ecef;
    padding-top: 20px;
}

/* ====================================
   Responsive Design for Page Layouts
   ==================================== */

@media (max-width: 768px) {
    body.article-page .container,
    body.articles-listing .container {
        padding: 30px 25px;
        border-radius: 16px;
    }

    .article-header h1,
    body.articles-listing h1 {
        font-size: 2rem;
    }

    .article-subtitle,
    body.articles-listing .subtitle {
        font-size: 1.1rem;
    }

    body.article-page h2 {
        font-size: 1.5rem;
    }

    body.article-page h3 {
        font-size: 1.3rem;
    }

    .article-title {
        font-size: 1.2rem;
    }
    
    body.homepage .container {
        padding: 25px;
    }

    body.homepage h1 {
        font-size: 1.8rem;
    }

    body.homepage .tagline {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    body.article-page .container,
    body.articles-listing .container {
        padding: 20px 15px;
    }

    .article-header h1,
    body.articles-listing h1 {
        font-size: 1.7rem;
    }

    .article-subtitle,
    body.articles-listing .subtitle {
        font-size: 1rem;
    }

    .article-title {
        font-size: 1.1rem;
    }
}

