/* ============================================================
   WritePadPro — homepage sections below the editor
   (SEO article, FAQ, Explore tools).
   Moved from plugin.css (Phase B). The editor itself is styled
   by editor-app.css.
   Rules are copied verbatim and in the original cascade order;
   loads right after style.css (via $pageCSS in index.php).
   ============================================================ */

/* ==========================================
   SEO Content Sections
   ========================================== */
.tm-seo-content {
    padding: 40px 30px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tm-seo-header {
    text-align: center;
    margin-bottom: 40px;
}

.tm-seo-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 16px 0;
    line-height: 1.2;
}

.tm-seo-tagline {
    font-size: 1.1rem;
    color: #94a3b8;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.tm-seo-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.tm-seo-feature {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tm-seo-feature:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.2);
}

.tm-seo-feature h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 12px 0;
}

.tm-seo-feature p {
    font-size: 0.95rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.6;
}

.tm-seo-feature strong {
    color: #22d3ee;
}

/* Noscript Fallback */
.tm-noscript-content {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
}

.tm-noscript-content h2 {
    color: #f1f5f9;
    margin: 0 0 16px 0;
}

.tm-noscript-content ul {
    color: #94a3b8;
    padding-left: 24px;
}

.tm-noscript-content li {
    margin-bottom: 8px;
}

.tm-noscript-content strong {
    color: #6366f1;
}

/* ==========================================
   FAQ Section
   ========================================== */
.tm-faq-section {
    padding: 50px 30px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

.tm-faq-section>h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #f1f5f9;
    text-align: center;
    margin: 0 0 40px 0;
}

.tm-faq-list {
    max-width: 900px;
    margin: 0 auto;
}

.tm-faq-item {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.tm-faq-item:hover {
    border-color: rgba(99, 102, 241, 0.4);
}

.tm-faq-item summary {
    padding: 20px 24px;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tm-faq-item summary::-webkit-details-marker {
    display: none;
}

.tm-faq-item summary::after {
    content: "+";
    font-size: 1.5rem;
    font-weight: 300;
    color: #6366f1;
    transition: transform 0.2s;
}

.tm-faq-item[open] summary::after {
    content: "−";
}

.tm-faq-item summary h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #f1f5f9;
    margin: 0;
    flex: 1;
}

.tm-faq-item>p {
    padding: 0 24px 20px;
    margin: 0;
    color: #94a3b8;
    line-height: 1.7;
    font-size: 0.95rem;
}

.tm-faq-item strong {
    color: #22d3ee;
}

/* ==========================================
   SEO Article Section
   ========================================== */
.tm-seo-article {
    padding: 50px 30px;
    background: #0f172a;
}

.tm-seo-article h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 30px 0;
    text-align: center;
}

.tm-seo-article h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #f1f5f9;
    margin: 30px 0 12px 0;
}

.tm-seo-article p {
    color: #94a3b8;
    line-height: 1.7;
    margin: 0 0 16px 0;
}

.tm-seo-article strong {
    color: #22d3ee;
}

.tm-seo-article ul {
    color: #94a3b8;
    padding-left: 24px;
    margin: 0 0 20px 0;
}

.tm-seo-article li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Platform Limits Table */
.tm-limit-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 12px;
    overflow: hidden;
}

.tm-limit-table th,
.tm-limit-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tm-limit-table th {
    background: rgba(99, 102, 241, 0.2);
    color: #f1f5f9;
    font-weight: 600;
}

.tm-limit-table td {
    color: #94a3b8;
}

.tm-limit-table tr:last-child td {
    border-bottom: none;
}

.tm-limit-table tr:hover td {
    background: rgba(99, 102, 241, 0.1);
}

/* SEO Content Responsive */
@media (max-width: 768px) {
    .tm-seo-header h1 {
        font-size: 1.8rem;
    }

    .tm-seo-tagline {
        font-size: 1rem;
    }

    .tm-seo-features {
        grid-template-columns: 1fr;
    }

    .tm-faq-section {
        padding: 30px 20px;
    }

    .tm-faq-item summary {
        padding: 16px 18px;
    }

    .tm-faq-item summary h3 {
        font-size: 0.95rem;
    }

    .tm-seo-article {
        padding: 30px 20px;
    }

    .tm-limit-table {
        font-size: 0.85rem;
    }

    .tm-limit-table th,
    .tm-limit-table td {
        padding: 10px 12px;
    }
}

/* ==========================================
   Small Phone Breakpoint (480px)
   ========================================== */
@media (max-width: 480px) {
    .tm-seo-header h1 {
        font-size: 1.4rem;
    }

    .tm-seo-tagline {
        font-size: 0.9rem;
    }

    .tm-seo-content {
        padding: 20px 15px;
    }

    .tm-faq-section {
        padding: 20px 15px;
    }

    .tm-seo-article {
        padding: 20px 15px;
    }

    .tm-faq-item summary h3 {
        font-size: 0.85rem;
    }

    .tm-limit-table {
        font-size: 0.8rem;
    }

    .tm-limit-table th,
    .tm-limit-table td {
        padding: 8px 10px;
    }
}

/* ==========================================
   WEBSITE OVERRIDES
   Make plugin work as standalone site
   (not inside WordPress page container)
   ========================================== */

/* SEO sections: constrain width, add breathing room */
.tm-seo-content {
    max-width: 1200px;
    margin: 48px auto 0;
    padding: 60px 40px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.06);
}

.tm-faq-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 40px;
    background: linear-gradient(180deg, var(--bg1, #0f172a) 0%, var(--bg2, #1e293b) 100%);
    border-radius: 16px;
}

.tm-seo-article {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 40px;
}

/* Feature cards: 3-column grid, no empty slots */
.tm-seo-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.tm-seo-feature {
    padding: 28px;
    border-radius: 14px;
    background: rgba(30,41,59,0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.tm-seo-feature:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(99,102,241,0.2);
    border-color: rgba(99,102,241,0.3);
}

/* FAQ items: softer look */
.tm-faq-item {
    border-radius: 14px;
    background: rgba(30,41,59,0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Header: bigger for site context */
.tm-seo-header h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
}

/* Table: rounder corners */
.tm-limit-table {
    border-radius: 14px;
}

/* Light theme overrides for website */
[data-theme="light"] .tm-seo-content {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-color: rgba(0,0,0,0.06);
}
[data-theme="light"] .tm-seo-feature {
    background: rgba(255,255,255,0.7);
    border-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .tm-seo-feature h2 {
    color: #1e293b;
}
[data-theme="light"] .tm-seo-feature p {
    color: #64748b;
}
[data-theme="light"] .tm-faq-section {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
[data-theme="light"] .tm-faq-item {
    background: rgba(255,255,255,0.7);
    border-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .tm-faq-item summary h3 {
    color: #1e293b;
}
[data-theme="light"] .tm-faq-item > p {
    color: #64748b;
}
[data-theme="light"] .tm-seo-article {
    background: #f8fafc;
}
[data-theme="light"] .tm-seo-article h2,
[data-theme="light"] .tm-seo-article h3 {
    color: #1e293b;
}
[data-theme="light"] .tm-seo-article p,
[data-theme="light"] .tm-seo-article li {
    color: #64748b;
}

/* Responsive: tighter on mobile */
@media (max-width: 768px) {
    .tm-seo-features {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .tm-seo-content,
    .tm-faq-section,
    .tm-seo-article {
        margin-left: 12px;
        margin-right: 12px;
        padding: 32px 20px;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .tm-seo-features {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .tm-seo-content,
    .tm-faq-section,
    .tm-seo-article {
        margin-left: 8px;
        margin-right: 8px;
        padding: 24px 16px;
        border-radius: 8px;
    }
    .tm-seo-header h1 {
        font-size: 1.5rem;
    }
}

/* ==========================================
   HOMEPAGE — EXPLORE ALL TOOLS SECTION
   ========================================== */

.hp-tools-section {
    padding: 64px 0 80px;
    background: var(--bg1, #0f172a);
}

.hp-tools-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.hp-tools-header {
    text-align: center;
    margin-bottom: 48px;
}

.hp-tools-header h2 {
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: 800;
    color: var(--text, #f1f5f9);
    margin-bottom: 10px;
}

.hp-tools-header p {
    font-size: 16px;
    color: var(--text2, #94a3b8);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Category group */
.hp-tools-category {
    margin-bottom: 36px;
}

.hp-tools-cat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text, #f1f5f9);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
}

.hp-tools-cat-icon {
    font-size: 20px;
    line-height: 1;
}

.hp-tools-cat-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--text3, #64748b);
    background: var(--bg2, #1e293b);
    padding: 2px 8px;
    border-radius: 99px;
    margin-left: auto;
}

/* Tool grid within category */
.hp-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

/* Individual tool card */
.hp-tool-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg2, #1e293b);
    border: 1px solid var(--border, rgba(255,255,255,0.06));
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.hp-tool-card:hover {
    border-color: var(--primary, #6366f1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99,102,241,0.15);
}

.hp-tool-card:hover .hp-tool-name {
    color: var(--primary, #6366f1);
}

.hp-tool-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99,102,241,0.1);
    border-radius: 9px;
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1;
}

.hp-tool-name {
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text, #f1f5f9);
    transition: color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* CTA button */
.hp-tools-cta {
    text-align: center;
    margin-top: 40px;
}

.hp-tools-cta-btn {
    display: inline-block;
    padding: 14px 36px;
    background: linear-gradient(135deg, var(--primary, #6366f1), #4f46e5);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(99,102,241,0.25);
}

.hp-tools-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99,102,241,0.35);
}

/* Light theme */
[data-theme="light"] .hp-tools-section {
    background: var(--bg1, #f8fafc);
}

[data-theme="light"] .hp-tool-card {
    background: #fff;
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

[data-theme="light"] .hp-tool-card:hover {
    box-shadow: 0 6px 20px rgba(99,102,241,0.12);
}

[data-theme="light"] .hp-tool-icon {
    background: rgba(99,102,241,0.08);
}

[data-theme="light"] .hp-tools-cat-count {
    background: rgba(0,0,0,0.05);
}

/* Responsive */
@media (max-width: 768px) {
    .hp-tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 8px;
    }
    .hp-tool-card {
        padding: 12px 14px;
    }
    .hp-tool-icon {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }
    .hp-tool-name {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .hp-tools-grid {
        /* minmax(0, 1fr): long tool names must never widen the page on phones */
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .hp-tool-card {
        min-width: 0;
    }
    .hp-tool-name {
        min-width: 0;
        white-space: normal;
        line-height: 1.25;
    }
    .hp-tools-header h2 {
        font-size: 1.4rem;
    }
    .hp-tool-card {
        padding: 10px 12px;
        gap: 8px;
    }
    .hp-tool-name {
        font-size: 12px;
    }
}
