/* ========================================
   CSS Variables & Reset
   ======================================== */
/* :root variables moved to variables.css */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.2;
    overflow-x: hidden;
}

/* ========================================
   Hero Section
   ======================================== */
.home-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hero-section {
    min-height: 90vh;
    /* Reduced from 100vh for better fold visibility */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg);
    padding: 4rem 2rem;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1200px;
    width: 100%;
    align-items: center;
}

.hero-text {
    text-align: left;
    order: 1;
    /* Text first on desktop */
}

.hero-visual {
    order: 2;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-profile-image {
    width: 100%;
    max-width: 480px;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: center 20%;
    /* Shift view slightly down */
    transform: scale(1.05);
    /* Zoom in to crop edges */
    border-radius: 0;
    box-shadow: 20px 20px 0px rgba(0, 0, 0, 0.05);
}

.hero-title {
    font-size: 5rem;
    font-weight: 500;
    color: var(--color-text-primary);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--color-text-secondary);
    line-height: 1.6;
    max-width: 90%;
}

.hero-subtitle p {
    margin-bottom: 1rem;
}

.hero-subtitle p:last-child {
    margin-bottom: 0;
}

/* CTA Button */
.hero-cta-wrapper {
    display: flex;
    justify-content: flex-start;
    /* Align left */
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    font-size: 1.125rem;
    font-weight: 500;
    color: #ffffff;
    background-color: #000000;
    text-decoration: none;
    border-radius: 999px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 900px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .hero-text {
        order: 2;
        text-align: center;
    }

    .hero-visual {
        order: 1;
        /* Image on top for mobile */
    }

    .hero-cta-wrapper {
        justify-content: center;
    }

    .hero-profile-image {
        max-width: 300px;
    }

    .hero-title {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-section {
        padding: 3rem 1.5rem;
    }
}

/* ========================================
   Calculators Section
   ======================================== */
.calculators-section {
    position: relative;
    z-index: 20;
    background: var(--color-bg);
    padding: 6rem 2rem;
}

.section-container {
    max-width: 1000px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 400;
    letter-spacing: -0.03em;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    margin-bottom: 3rem;
}

.calculators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.calculator-card {
    display: flex;
    flex-direction: column;
    padding: 2rem;
    background: #fafafa;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.calculator-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    background: #f5f5f5;
}

.calculator-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-button-bg);
    color: var(--color-button-text);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.calculator-title {
    font-size: 1.375rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.calculator-description {
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.calculator-cta {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-primary);
    transition: transform 0.2s ease;
}

.calculator-card:hover .calculator-cta {
    transform: translateX(4px);
}

/* Responsive */
@media (max-width: 768px) {
    .calculators-section {
        padding: 4rem 1.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .calculators-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Articles Section
   ======================================== */
.articles-section {
    background: #fafafa;
    padding: 6rem 2rem;
}

.articles-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 3rem;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.view-all-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.view-all-link:hover {
    color: var(--color-text-primary);
}

.article-card {
    display: flex;
    flex-direction: column;
    background: transparent;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.article-card:hover {
    transform: scale(1.02);
    filter: brightness(1.05);
}

.article-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f0f0f0;
}

.article-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.article-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 400;
    /* Matching blog-item weight */
    color: var(--color-text-primary);
    line-height: 1.4;
    margin: 0;
}

.article-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    letter-spacing: 0.02em;
}

.meta-dot {
    opacity: 0.5;
}

.article-category {
    color: var(--color-text-secondary);
}

.article-date {
    opacity: 0.8;
}

/* Removed articles-more as it is replaced by header link */

/* ========================================
   Instagram Section
   ======================================== */
.instagram-section {
    background: var(--color-bg-subtle);
    padding: 6rem 2rem;
}

.reels-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.reel-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.reel-card:hover {
    transform: translateY(-8px);
}

.reel-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 9/16;
    border-radius: 16px;
    overflow: hidden;
    background: #f0f0f0;
    margin-bottom: 1rem;
}

.reel-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reel-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0.8;
    transition: transform 0.3s ease, background 0.3s ease;
}

.reel-card:hover .reel-play-icon {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(255, 255, 255, 0.4);
}

.reel-play-icon svg {
    width: 24px;
    height: 24px;
}

.reel-content {
    padding: 0 0.5rem;
}

.reel-caption {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--color-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Instagram Responsive */
@media (max-width: 768px) {
    .reels-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        grid-template-columns: none !important;
        /* Safety measure */
        gap: 1rem;
        overflow-x: auto !important;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        padding-bottom: 2rem;
        /* Hide scrollbar */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .reels-grid::-webkit-scrollbar {
        display: none;
    }

    .reel-card {
        flex: 0 0 85% !important;
        width: 85% !important;
        scroll-snap-align: center;
        margin-bottom: 0 !important;
        /* Prevent bottom margin usage */
    }
}

/* ========================================
   NRI Mutual Funds Section
   ======================================== */
.nri-mf-section {
    background: var(--color-white);
    padding: 8rem 2rem;
    overflow: hidden;
}

.nri-mf-container {
    display: flex;
    align-items: center;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nri-mf-content {
    flex: 1;
}

.meta-tag {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-text-primary);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
}

.section-description {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 3rem;
    max-width: 600px;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.benefit-item {
    padding: 1.5rem;
    background: #fafafa;
    border-radius: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.benefit-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.benefit-icon {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.benefit-item h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text-primary);
}

.benefit-item p {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

.nri-cta {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.nri-cta .btn-primary {
    background-color: #000000;
    color: #ffffff;
    padding: 18px 40px;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-transform: none;
    letter-spacing: normal;
}

.nri-cta .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.nri-mf-image {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: flex-end;
}

.premium-image {
    width: 100%;
    max-width: 500px;
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
}

/* Responsive NRI MF */
@media (max-width: 1024px) {
    .nri-mf-container {
        flex-direction: column;
        text-align: center;
    }

    .nri-mf-content {
        order: 2;
    }

    .nri-mf-image {
        order: 1;
        justify-content: center;
    }

    .section-description {
        margin-inline: auto;
    }

    .nri-cta {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .benefit-item {
        text-align: left;
    }
}

/* ========================================
   Articles & Generic
   ======================================== */
.loading-placeholder,
.no-articles,
.error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--color-text-secondary);
}

@media (max-width: 768px) {
    .articles-section {
        padding: 4rem 1.5rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

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

/* ========================================
   Footer
   ======================================== */
.site-footer {
    background: #f8f8f8;
    padding: 0;
    position: relative;
    overflow: hidden;
    min-height: 300px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.footer-bg-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.footer-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
}

.footer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.3) 100%);
}

.footer-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
    width: 100%;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.footer-content p {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin: 0;
}