/* Ali Abdaal Ghost Theme - Main Stylesheet */

/* CSS Variables */
:root {
    /* Colors - can be overridden via Ghost Admin */
    --color-primary: #5DCDF1;
    --color-secondary: #FD976D;
    --color-tertiary: #FDD46B;
    --color-accent-purple: #C9B1FB;
    --color-accent-green: #79D287;
    --color-foreground: #1B1624;
    --color-background: #FFFFFF;
    --color-background-light: #F9F6F3;
    --color-background-lighter: #F3EDE9;
    --color-text-secondary: #54505B;
    --color-text-tertiary: #76737C;

    /* Typography */
    --font-heading: 'DM Serif Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 30px 40px -15px rgba(0, 0, 0, 0.2);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
}

/* Reset & Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-foreground);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary);
}

ul, ol {
    list-style: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 1.2;
    color: var(--color-foreground);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-narrow {
    max-width: 720px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-foreground);
}

.btn-primary:hover {
    background-color: #4ab8dc;
    color: var(--color-foreground);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: var(--color-foreground);
}

.btn-secondary:hover {
    background-color: #e88660;
    color: var(--color-foreground);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-foreground);
    border: 2px solid var(--color-foreground);
}

.btn-outline:hover {
    background-color: var(--color-foreground);
    color: var(--color-background);
}

/* ========================================
   HEADER & NAVIGATION
======================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--color-background);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: box-shadow var(--transition-base);
}

.site-header.scrolled {
    box-shadow: var(--shadow-sm);
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-style: italic;
    color: var(--color-foreground);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.nav-links a {
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-links a:hover,
.nav-links .nav-current a {
    color: var(--color-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--color-foreground);
    transition: all var(--transition-base);
}

.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-background);
    padding: var(--space-lg);
    box-shadow: var(--shadow-lg);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-nav.active {
    display: block;
}

.mobile-nav-links {
    margin-bottom: var(--space-lg);
}

.mobile-nav-links li {
    padding: var(--space-sm) 0;
}

.mobile-nav-links a {
    font-size: 1.125rem;
    font-weight: 500;
}

/* ========================================
   HERO SECTION
======================================== */
.hero {
    padding: var(--space-4xl) 0;
    background-color: var(--color-background-light);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
}

.hero-greeting {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-foreground);
    margin-bottom: var(--space-md);
}

.hero-headline {
    margin-bottom: var(--space-lg);
}

.hero-description {
    font-size: 1.25rem;
    margin-bottom: var(--space-xl);
}

/* Email Signup */
.email-signup {
    background: var(--color-background);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.email-signup h3 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: var(--space-md);
    color: var(--color-foreground);
}

.social-proof {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.avatars {
    display: flex;
}

.avatars img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--color-background);
    margin-left: -10px;
    object-fit: cover;
}

.avatars img:first-child {
    margin-left: 0;
}

.rating {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.stars {
    color: var(--color-tertiary);
    letter-spacing: 2px;
}

.rating-text {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
}

.signup-form,
.newsletter-form,
.course-signup {
    display: flex;
    gap: var(--space-sm);
}

.signup-form input,
.newsletter-form input,
.course-signup input {
    flex: 1;
    padding: 0.875rem var(--space-lg);
    border: 2px solid var(--color-background-lighter);
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: border-color var(--transition-fast);
}

.signup-form input:focus,
.newsletter-form input:focus,
.course-signup input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-message {
    color: #e74c3c;
    font-size: 0.875rem;
    margin-top: var(--space-sm);
}

.form-success {
    color: var(--color-accent-green);
    font-size: 0.875rem;
    margin-top: var(--space-sm);
}

/* Hero Image */
.hero-image {
    display: flex;
    justify-content: center;
}

.profile-photo {
    width: 100%;
    max-width: 450px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    object-fit: cover;
}

/* ========================================
   HELP SECTION (Tag Cards)
======================================== */
.help-section {
    padding: var(--space-4xl) 0;
}

.section-title {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
}

.section-header .section-title {
    margin-bottom: 0;
    text-align: left;
}

.view-all {
    font-weight: 600;
    color: var(--color-primary);
}

.help-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xl);
}

.help-card {
    display: block;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.help-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-xl);
    color: var(--color-foreground);
}

.help-card.card-0 { background-color: var(--color-primary); }
.help-card.card-1 { background-color: var(--color-secondary); }
.help-card.card-2 { background-color: var(--color-tertiary); }
.help-card.card-3 { background-color: var(--color-accent-purple); }

.card-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.card-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.help-card h3 {
    font-family: var(--font-body);
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--color-foreground);
}

.help-card p {
    font-size: 0.9rem;
    color: var(--color-foreground);
    opacity: 0.8;
    margin-bottom: var(--space-md);
}

.card-link {
    font-weight: 600;
    color: var(--color-foreground);
}

/* ========================================
   POSTS GRID & CARDS
======================================== */
.posts-section,
.featured-section,
.related-posts {
    padding: var(--space-4xl) 0;
}

.featured-section {
    background-color: var(--color-background-light);
}

.posts-grid,
.post-carousel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xl);
}

.posts-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.post-card {
    background: var(--color-background);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.post-card-image-link {
    display: block;
    position: relative;
    overflow: hidden;
}

.post-card-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.post-card:hover .post-card-image {
    transform: scale(1.05);
}

.post-duration {
    position: absolute;
    bottom: var(--space-sm);
    right: var(--space-sm);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.post-card-content {
    padding: var(--space-lg);
}

.post-card-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
}

.post-card-content h4 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: var(--space-sm);
    line-height: 1.4;
}

.post-card-content h4 a:hover {
    color: var(--color-primary);
}

.post-excerpt {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
}

.post-author {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.post-author img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-lg);
    margin-top: var(--space-3xl);
}

.page-number {
    color: var(--color-text-tertiary);
}

/* ========================================
   NEWSLETTER SECTION
======================================== */
.newsletter-section {
    padding: var(--space-4xl) 0;
    background-color: var(--color-foreground);
    text-align: center;
}

.newsletter-content {
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-content h2 {
    color: var(--color-background);
    margin-bottom: var(--space-md);
}

.newsletter-content > p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: var(--space-xl);
}

.newsletter-form {
    margin-bottom: var(--space-md);
}

.newsletter-form input {
    background: var(--color-background);
}

.newsletter-note {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Post Newsletter Box */
.post-newsletter {
    padding: var(--space-3xl) 0;
}

.newsletter-box {
    background: var(--color-background-light);
    padding: var(--space-2xl);
    border-radius: var(--radius-lg);
    text-align: center;
}

.newsletter-box h3 {
    margin-bottom: var(--space-sm);
}

.newsletter-box p {
    margin-bottom: var(--space-lg);
}

.newsletter-box .newsletter-form {
    max-width: 400px;
    margin: 0 auto;
}

/* ========================================
   ARTICLE STYLES
======================================== */
.article-header {
    padding: var(--space-4xl) 0 var(--space-2xl);
    text-align: center;
}

.article-tag {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-primary);
    margin-bottom: var(--space-md);
}

.article-title {
    margin-bottom: var(--space-lg);
}

.article-excerpt {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
}

.article-meta {
    display: flex;
    justify-content: center;
}

.article-author {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.author-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.author-info {
    text-align: left;
}

.author-name {
    font-weight: 600;
    color: var(--color-foreground);
}

.article-date {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
}

/* Article Image */
.article-image {
    margin-bottom: var(--space-3xl);
}

.article-image img {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
}

.article-image figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
    margin-top: var(--space-sm);
    padding: 0 var(--space-lg);
}

/* Article Content */
.article-content {
    padding-bottom: var(--space-3xl);
}

.article-content h2,
.article-content h3,
.article-content h4 {
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-md);
}

.article-content p {
    margin-bottom: var(--space-lg);
    font-size: 1.125rem;
    line-height: 1.8;
}

.article-content ul,
.article-content ol {
    margin-bottom: var(--space-lg);
    padding-left: var(--space-xl);
}

.article-content li {
    margin-bottom: var(--space-sm);
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--color-text-secondary);
}

.article-content ul li {
    list-style: disc;
}

.article-content ol li {
    list-style: decimal;
}

.article-content blockquote {
    border-left: 4px solid var(--color-primary);
    padding-left: var(--space-lg);
    margin: var(--space-xl) 0;
    font-style: italic;
}

.article-content blockquote p {
    font-size: 1.25rem;
}

.article-content pre {
    background: var(--color-foreground);
    color: var(--color-background);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: var(--space-lg);
}

.article-content code {
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
}

.article-content a {
    color: var(--color-primary);
    text-decoration: underline;
}

.article-content img {
    border-radius: var(--radius-md);
    margin: var(--space-xl) auto;
}

.article-content figure {
    margin: var(--space-xl) 0;
}

.article-content figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
    margin-top: var(--space-sm);
}

/* Ghost-specific content cards */
.kg-card {
    margin: var(--space-xl) 0;
}

.kg-image-card img {
    width: 100%;
}

.kg-width-wide {
    max-width: 1000px;
    margin-left: calc(50% - 500px);
    margin-right: calc(50% - 500px);
}

.kg-width-full {
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.kg-bookmark-card {
    border: 1px solid var(--color-background-lighter);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.kg-bookmark-container {
    display: flex;
    text-decoration: none;
}

.kg-bookmark-content {
    flex: 1;
    padding: var(--space-lg);
}

.kg-bookmark-title {
    font-weight: 600;
    color: var(--color-foreground);
}

.kg-bookmark-description {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-top: var(--space-sm);
}

.kg-bookmark-thumbnail {
    width: 200px;
}

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Article Footer */
.article-footer {
    padding: var(--space-xl) 0;
    border-top: 1px solid var(--color-background-lighter);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.tag-pill {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: var(--color-background-light);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background var(--transition-fast);
}

.tag-pill:hover {
    background: var(--color-primary);
    color: var(--color-foreground);
}

/* Author Box */
.author-box {
    padding: var(--space-3xl) 0;
    background: var(--color-background-light);
}

.author-box-content {
    display: flex;
    gap: var(--space-xl);
    align-items: center;
}

.author-box-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.author-box-info h4 {
    font-family: var(--font-body);
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.author-box-info p {
    margin-bottom: var(--space-sm);
}

.author-location {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
}

/* ========================================
   TAG & AUTHOR PAGES
======================================== */
.tag-header,
.author-header {
    padding: var(--space-4xl) 0 var(--space-2xl);
    background: var(--color-background-light);
    text-align: center;
}

.tag-image {
    max-width: 200px;
    margin: 0 auto var(--space-xl);
}

.tag-image img {
    border-radius: var(--radius-lg);
}

.tag-title,
.author-name {
    margin-bottom: var(--space-md);
}

.tag-description,
.author-bio {
    max-width: 600px;
    margin: 0 auto var(--space-md);
    font-size: 1.125rem;
}

.tag-meta,
.author-post-count {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
}

.author-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
}

.author-avatar-large img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-lg);
}

.author-details {
    text-align: center;
}

.author-meta-info {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
}

.author-social {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
}

.author-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-background);
    transition: all var(--transition-fast);
}

.author-social a:hover {
    background: var(--color-primary);
    transform: translateY(-2px);
}

/* ========================================
   PAGE TEMPLATE
======================================== */
.page-header {
    padding: var(--space-4xl) 0 var(--space-2xl);
    text-align: center;
}

.page-title {
    margin-bottom: var(--space-md);
}

.page-excerpt {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
}

.page-image {
    margin-bottom: var(--space-3xl);
}

.page-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

.page-content {
    padding-bottom: var(--space-4xl);
}

/* ========================================
   ERROR PAGE
======================================== */
.error-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-4xl) 0;
}

.error-code {
    font-size: 8rem;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: var(--space-md);
}

.error-message {
    margin-bottom: var(--space-md);
}

.error-description {
    margin-bottom: var(--space-xl);
    font-size: 1.125rem;
}

/* ========================================
   FOOTER
======================================== */
.site-footer {
    padding: var(--space-4xl) 0 var(--space-xl);
    background-color: var(--color-background-light);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: var(--space-3xl);
    margin-bottom: var(--space-3xl);
}

.footer-brand .logo-text {
    display: block;
    margin-bottom: var(--space-md);
}

.footer-logo {
    height: 40px;
    margin-bottom: var(--space-md);
}

.footer-brand > p {
    font-size: 0.9rem;
    margin-bottom: var(--space-lg);
}

.social-links {
    display: flex;
    gap: var(--space-md);
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--color-background);
    color: var(--color-foreground);
    transition: all var(--transition-fast);
}

.social-links a:hover {
    background-color: var(--color-primary);
    transform: translateY(-2px);
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
}

.footer-column h4 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.footer-column ul li {
    margin-bottom: var(--space-sm);
}

.footer-column a {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.footer-column a:hover {
    color: var(--color-primary);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-xl);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.footer-bottom p {
    font-size: 0.875rem;
    margin: 0;
}

.footer-legal {
    display: flex;
    gap: var(--space-lg);
}

.footer-legal a {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
}

.footer-legal a:hover {
    color: var(--color-foreground);
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */
@media (max-width: 1024px) {
    .help-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .posts-grid,
    .post-carousel {
        grid-template-columns: repeat(2, 1fr);
    }

    .posts-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .kg-width-wide {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .nav-links,
    .nav-actions {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-image {
        order: -1;
    }

    .profile-photo {
        max-width: 300px;
    }

    .social-proof {
        justify-content: center;
    }

    .signup-form,
    .newsletter-form,
    .course-signup {
        flex-direction: column;
    }

    .help-cards {
        grid-template-columns: 1fr;
    }

    .posts-grid,
    .post-carousel,
    .posts-grid-3 {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    .author-box-content {
        flex-direction: column;
        text-align: center;
    }

    .article-content p,
    .article-content li {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-md);
    }

    .social-proof {
        flex-direction: column;
        align-items: center;
    }

    .footer-links {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    .pagination {
        flex-direction: column;
    }
}

/* ========================================
   CUSTOM HOMEPAGE STYLES
======================================== */
.hero-home .hero-stats {
    display: flex;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.hero-stats .stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--color-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
}

.signup-subtitle {
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
}

.signup-note {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    margin-top: var(--space-sm);
}

/* Social Proof Section */
.social-proof-section {
    padding: var(--space-2xl) 0;
    background: var(--color-background);
    border-bottom: 1px solid var(--color-background-lighter);
}

.proof-label {
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.proof-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-3xl);
    flex-wrap: wrap;
}

.proof-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-text-tertiary);
    opacity: 0.6;
}

/* Section Intro */
.section-intro {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-subtitle {
    color: var(--color-text-secondary);
    font-size: 1.125rem;
    margin-top: var(--space-sm);
}

/* About Section */
.about-section {
    padding: var(--space-4xl) 0;
    background: var(--color-background-light);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--space-3xl);
    align-items: center;
}

.about-image img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.about-label {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-primary);
    margin-bottom: var(--space-md);
}

.about-text h2 {
    margin-bottom: var(--space-lg);
}

.about-body {
    margin-bottom: var(--space-xl);
}

.about-body p {
    margin-bottom: var(--space-md);
}

/* Featured Grid */
.featured-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}

.featured-card {
    background: var(--color-background);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.featured-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.featured-card-large {
    grid-column: 1 / -1;
}

.featured-card-large .featured-card-image img {
    height: 400px;
}

.featured-card-image {
    position: relative;
    display: block;
}

.featured-card-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.featured-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-lg);
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
}

.featured-tag {
    display: inline-block;
    background: var(--color-primary);
    color: var(--color-foreground);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.featured-card-content {
    padding: var(--space-xl);
}

.featured-card-content h3 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

.featured-card-content p {
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
}

.featured-meta {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
}

/* Video Section */
.video-section {
    padding: var(--space-4xl) 0;
    background: var(--color-background-light);
}

.video-embed-grid {
    display: grid;
    gap: var(--space-xl);
}

.video-embed-placeholder {
    background: var(--color-foreground);
    border-radius: var(--radius-lg);
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-placeholder-content {
    text-align: center;
    color: var(--color-background);
}

.video-placeholder-content svg {
    margin-bottom: var(--space-lg);
}

.video-placeholder-content p {
    color: rgba(255,255,255,0.7);
    margin-bottom: var(--space-lg);
}

/* Testimonials */
.testimonials-section {
    padding: var(--space-4xl) 0;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
}

.testimonial-card {
    background: var(--color-background);
    border: 1px solid var(--color-background-lighter);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.testimonial-stars {
    color: var(--color-tertiary);
    margin-bottom: var(--space-md);
    letter-spacing: 2px;
}

.testimonial-text {
    font-size: 1rem;
    font-style: italic;
    margin-bottom: var(--space-lg);
    color: var(--color-foreground);
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--color-foreground);
}

.testimonial-info {
    display: flex;
    flex-direction: column;
}

.testimonial-name {
    font-weight: 600;
    color: var(--color-foreground);
}

.testimonial-role {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
}

.testimonial-mini {
    margin-top: var(--space-2xl);
    padding: var(--space-lg);
    background: var(--color-background);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-primary);
}

.testimonial-mini p {
    font-style: italic;
    margin-bottom: var(--space-sm);
    color: var(--color-foreground);
}

.testimonial-mini .testimonial-author {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
}

/* Products Section */
.products-section {
    padding: var(--space-4xl) 0;
    background: var(--color-background-light);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
}

.product-card {
    background: var(--color-background);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.product-card-featured {
    border: 2px solid var(--color-primary);
}

.product-badge {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: var(--color-secondary);
    color: var(--color-foreground);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 1;
}

.product-image {
    aspect-ratio: 4/3;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-content {
    padding: var(--space-xl);
}

.product-content h3 {
    font-family: var(--font-body);
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.product-content p {
    font-size: 0.9rem;
    margin-bottom: var(--space-lg);
}

/* Newsletter Large */
.newsletter-section-large {
    padding: var(--space-4xl) 0;
}

.newsletter-form-large {
    max-width: 500px;
    margin: 0 auto var(--space-lg);
}

.newsletter-form-large input {
    padding: 1rem var(--space-xl);
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

.newsletter-features {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
}

/* ========================================
   AUTH PAGES (SIGNUP/SIGNIN)
======================================== */
.auth-page {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    padding: var(--space-3xl) 0;
}

.auth-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4xl);
    align-items: center;
}

.auth-benefits {
    padding: var(--space-3xl);
    background: var(--color-background-light);
    border-radius: var(--radius-lg);
}

.auth-logo {
    display: block;
    margin-bottom: var(--space-2xl);
}

.auth-logo img {
    height: 40px;
}

.auth-benefits h2 {
    margin-bottom: var(--space-sm);
}

.benefits-intro {
    font-size: 1.125rem;
    margin-bottom: var(--space-2xl);
}

.benefits-list {
    margin-bottom: var(--space-2xl);
}

.benefits-list li {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.benefit-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.benefit-content strong {
    display: block;
    color: var(--color-foreground);
    margin-bottom: var(--space-xs);
}

.benefit-content p {
    font-size: 0.875rem;
    margin: 0;
}

.auth-form-container {
    max-width: 400px;
}

.auth-form-header {
    margin-bottom: var(--space-xl);
}

.auth-form-header h1 {
    margin-bottom: var(--space-sm);
}

.auth-form-header p {
    color: var(--color-text-secondary);
}

.auth-form-header a {
    color: var(--color-primary);
    font-weight: 500;
}

.auth-form .form-group {
    margin-bottom: var(--space-lg);
}

.auth-form label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--space-sm);
    color: var(--color-foreground);
}

.auth-form input {
    width: 100%;
    padding: 0.875rem var(--space-lg);
    border: 2px solid var(--color-background-lighter);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.btn-block {
    width: 100%;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: var(--space-xl) 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-background-lighter);
}

.auth-divider span {
    padding: 0 var(--space-md);
    color: var(--color-text-tertiary);
    font-size: 0.875rem;
}

.social-auth {
    margin-bottom: var(--space-xl);
}

.btn-social {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.875rem var(--space-lg);
    background: var(--color-background);
    border: 2px solid var(--color-background-lighter);
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-social:hover {
    border-color: var(--color-foreground);
    background: var(--color-background-light);
}

.auth-terms {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    text-align: center;
}

.auth-terms a {
    color: var(--color-text-secondary);
}

.auth-terms a:hover {
    color: var(--color-primary);
}

/* Signin Page */
.signin-page .container {
    display: flex;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: var(--space-3xl);
    background: var(--color-background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.auth-logo-centered {
    display: block;
    margin-bottom: var(--space-2xl);
}

.auth-logo-centered img {
    height: 40px;
    margin: 0 auto;
}

.auth-card .auth-form-header {
    text-align: center;
}

.auth-info {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-xl);
}

.auth-alternatives {
    margin-bottom: var(--space-xl);
}

.auth-footer {
    padding-top: var(--space-xl);
    border-top: 1px solid var(--color-background-lighter);
}

.auth-footer p {
    font-size: 0.875rem;
    margin: 0;
}

.auth-footer a {
    color: var(--color-primary);
    font-weight: 500;
}

/* Already logged in states */
.auth-already {
    text-align: center;
}

.auth-success-icon {
    width: 64px;
    height: 64px;
    background: var(--color-accent-green);
    color: var(--color-background);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto var(--space-lg);
}

.auth-already h2 {
    margin-bottom: var(--space-sm);
}

.auth-already p {
    margin-bottom: var(--space-xl);
}

.auth-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

/* ========================================
   ACCOUNT PAGE
======================================== */
.account-page {
    padding: var(--space-4xl) 0;
}

.account-header {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    margin-bottom: var(--space-3xl);
    padding-bottom: var(--space-2xl);
    border-bottom: 1px solid var(--color-background-lighter);
}

.account-avatar img,
.avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-foreground);
    text-transform: uppercase;
}

.account-info h1 {
    margin-bottom: var(--space-xs);
}

.account-email {
    color: var(--color-text-tertiary);
    margin: 0;
}

.account-sections {
    display: grid;
    gap: var(--space-xl);
}

.account-card {
    background: var(--color-background);
    border: 1px solid var(--color-background-lighter);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.account-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg) var(--space-xl);
    background: var(--color-background-light);
    border-bottom: 1px solid var(--color-background-lighter);
}

.account-card-header h3 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
}

.badge {
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: var(--color-accent-green);
    color: var(--color-foreground);
}

.badge-neutral {
    background: var(--color-background-lighter);
    color: var(--color-text-secondary);
}

.account-card-body {
    padding: var(--space-xl);
}

.account-card-body p {
    margin-bottom: var(--space-lg);
}

.subscription-details {
    margin-bottom: var(--space-lg);
}

.subscription-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-md);
    background: var(--color-background-light);
    border-radius: var(--radius-md);
}

.subscription-plan {
    font-weight: 600;
}

.subscription-price {
    color: var(--color-text-secondary);
}

.email-preferences {
    margin-bottom: var(--space-lg);
}

.preference-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--color-background-light);
    border-radius: var(--radius-md);
}

.toggle-status {
    color: var(--color-primary);
    font-weight: 500;
}

.account-actions {
    display: flex;
    gap: var(--space-md);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-tertiary);
    padding: 0.875rem 2rem;
    border-radius: var(--radius-full);
    font-weight: 500;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.btn-ghost:hover {
    color: var(--color-foreground);
}

/* Account Section */
.account-section {
    margin-top: var(--space-3xl);
    padding-top: var(--space-2xl);
    border-top: 1px solid var(--color-background-lighter);
}

.account-section h3 {
    margin-bottom: var(--space-lg);
}

.reading-list {
    display: grid;
    gap: var(--space-md);
}

.reading-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-background-light);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.reading-item:hover {
    background: var(--color-background-lighter);
}

.reading-item img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.reading-item-content h4 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: var(--space-xs);
}

.reading-tag {
    font-size: 0.75rem;
    color: var(--color-primary);
}

/* Logged out state */
.account-logged-out {
    text-align: center;
    padding: var(--space-4xl) 0;
}

.logged-out-icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
}

.account-logged-out h1 {
    margin-bottom: var(--space-md);
}

.account-logged-out p {
    margin-bottom: var(--space-xl);
    font-size: 1.125rem;
}

.logged-out-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

/* ========================================
   RESPONSIVE - NEW SECTIONS
======================================== */
@media (max-width: 1024px) {
    .testimonials-grid,
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .featured-grid {
        grid-template-columns: 1fr;
    }

    .featured-card-large .featured-card-image img {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .hero-stats {
        flex-wrap: wrap;
        justify-content: center;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .about-image {
        order: -1;
        max-width: 300px;
        margin: 0 auto;
    }

    .testimonials-grid,
    .products-grid {
        grid-template-columns: 1fr;
    }

    .newsletter-features {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .auth-wrapper {
        grid-template-columns: 1fr;
    }

    .auth-benefits {
        display: none;
    }

    .auth-form-container {
        max-width: 100%;
    }

    .account-header {
        flex-direction: column;
        text-align: center;
    }

    .account-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .proof-logos {
        gap: var(--space-lg);
    }

    .proof-logo {
        font-size: 1rem;
    }

    .auth-card {
        padding: var(--space-xl);
    }
}

/* ========================================
   GHOST PORTAL OVERRIDES
======================================== */
.gh-portal-triggerbtn-iframe {
    display: none !important;
}
