/* Features Page Styles */
.features-page {
    min-height: 100vh;
    background-color: #fff;
    width: 100%;
    position: relative;
}

/* Hero Section */
.features-hero {
    padding-top: calc(165px + 56px + 18px);
    padding-bottom: 158px;
    padding-inline: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.features-hero-content h1 {
    font-family: var(--font-serif);
    font-size: 72px;
    color: #000;
    letter-spacing: -1.44px;
    line-height: 68px;
    font-weight: 500;
    margin-bottom: 12px;
}

.features-hero-content p {
    font-family: var(--font-ui);
    color: #484848;
    font-size: 18px;
    font-weight: 400;
    line-height: normal;
    margin-bottom: 0;
}

.features-content {
    max-width: 1240px;
    margin: 0 auto;
}

.features-page-section {
    margin-bottom: 120px;
}

.section-header {
    text-align: center;
}

.section-header h2 {
    font-family: var(--font-serif);
    font-size: 54px;
    font-weight: 500;
    color: #000;
    letter-spacing: -1.08px;
    margin-bottom: 16px;
}

.section-header p {
    font-family: var(--font-ui);
    font-size: 20px;
    font-weight: 400;
    color: #484848;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Feature Grid System */
.feature-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, 1fr);
}

/* Grid Items */
.grid-item {
    background: #f1f1f1;
    border: 1px solid #eee;
    border-radius: 24px;
    overflow: hidden;
}

.grid-item.full-width {
    grid-column: 1 / -1;
    height: 590px;
}

/* For editing section - second row (3 columns) */
#editing .feature-grid .grid-item:not(.full-width) {
    height: 520px;
}

/* For write section - second row (2 columns) */
#write .feature-grid {
    grid-template-columns: repeat(2, 1fr);
}

#write .feature-grid .grid-item:not(.full-width) {
    height: 520px;
}

/* For chapter-forge section - second row (3 columns) */
#chapter-forge .feature-grid .grid-item:not(.full-width) {
    height: 520px;
}

/* For worldbuilding section - second row (3 columns) */
#worldbuilding .feature-grid .grid-item:not(.full-width) {
    height: 520px;
}

.feature-card {
    padding: 48px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-align: left;
}

.feature-card h3 {
    font-family: var(--font-serif);
    font-size: 40px;
    font-weight: 500;
    color: #000;
    letter-spacing: -0.8px;
    margin-bottom: 4px;
}

.feature-card p {
    font-family: var(--font-ui);
    font-size: 18px;
    font-weight: 400;
    color: #484848;
    line-height: 28px;
}

/* Feature Showcase (for main editing interface) */
.feature-showcase {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Showcase Header - positioned at bottom left */
.showcase-header {
    position: absolute;
    bottom: 48px;
    left: 48px;
    max-width: 381px;
    z-index: 2;
}

.showcase-header h2 {
    font-family: var(--font-serif);
    font-size: 54px;
    font-weight: 500;
    color: #000;
    letter-spacing: -1.08px;
}

.showcase-header p {
    font-family: var(--font-ui);
    font-size: 18px;
    font-weight: 400;
    color: #484848;
    line-height: 28px;
    margin: 0;
}

@media (max-width: 1280px) {
    .features-content {
        max-width: 100%;
        padding: 0 40px;
    }
}

@media (max-width: 1024px) {
    .features-hero-content h1 {
        font-size: 52px;
        line-height: 56px;
    }

    .section-header h2 {
        font-size: 42px;
    }

    .grid-item.full-width {
        height: 480px;
    }

    #editing .feature-grid .grid-item:not(.full-width) {
        height: 400px;
    }

    #write .feature-grid .grid-item:not(.full-width) {
        height: 400px;
    }

    #chapter-forge .feature-grid .grid-item:not(.full-width) {
        height: 400px;
    }

    #worldbuilding .feature-grid .grid-item:not(.full-width) {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .features-hero {
        padding-top: 100px;
        padding-bottom: 60px;
    }

    .features-hero-content h1 {
        font-size: 42px;
        line-height: 48px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    #write .feature-grid {
        grid-template-columns: 1fr;
    }

    .showcase-header {
        bottom: 24px;
        left: 24px;
        max-width: calc(100% - 48px);
    }

    .showcase-header h2 {
        font-size: 42px;
        line-height: 48px;
    }

    .showcase-header p {
        font-size: 18px;
    }

    .grid-item.full-width {
        height: 400px;
    }

    #editing .feature-grid .grid-item:not(.full-width) {
        height: 300px;
    }

    #write .feature-grid .grid-item:not(.full-width) {
        height: 300px;
    }

    #chapter-forge .feature-grid .grid-item:not(.full-width) {
        height: 300px;
    }

    #worldbuilding .feature-grid .grid-item:not(.full-width) {
        height: 300px;
    }

    .features-page-section {
        margin-bottom: 80px;
    }
}
