/*
 Theme Name:   PersonalitySpark
 Theme URI:    https://personalityspark.com
 Description:  GeneratePress child theme for PersonalitySpark - adds custom quiz, tools, and page styling.
 Author:       PersonalitySpark Team
 Author URI:   https://personalityspark.com
 Template:     generatepress
 Version:      1.1.0
 License:      GPL v2 or later
 License URI:  https://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  personalityspark-gp-child
*/

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

:root {
    --ps-primary: #7c3aed;
    --ps-primary-light: #a78bfa;
    --ps-primary-dark: #5b21b6;
    --ps-accent: #f43f5e;
    --ps-accent-light: #fb7185;
    --ps-success: #10b981;
    --ps-warning: #f59e0b;
    --ps-surface: #ffffff;
    --ps-surface-alt: #f8fafc;
    --ps-border: #e2e8f0;
    --ps-text: #1e293b;
    --ps-text-muted: #64748b;
    --ps-radius: 12px;
    --ps-radius-sm: 8px;
    --ps-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --ps-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --ps-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --ps-transition: 0.2s ease;
}

/* ==========================================================================
   GP Site Library Template Brand Overrides
   Transforms generic Newsroom template into PersonalitySpark brand
   SAFE: Pure CSS overrides only - no template structure changes, no ad interference
   ========================================================================== */

/* --- Navigation Bar: dark gray → purple gradient --- */
.main-navigation,
.main-navigation .navigation-search,
.navigation-search input[type="search"] {
    background-color: var(--ps-primary-dark) !important;
}

.main-navigation .main-nav ul li a,
.main-navigation .menu-toggle,
.main-navigation .menu-bar-items a {
    color: #fff !important;
    transition: color var(--ps-transition), background var(--ps-transition);
}

.main-navigation .main-nav ul li a:hover,
.main-navigation .main-nav ul li.current-menu-item > a {
    color: #fff !important;
    background-color: var(--ps-primary) !important;
}

/* Sub-menus get a slight purple tint */
.main-navigation .main-nav ul ul {
    background-color: var(--ps-primary-dark) !important;
}

.main-navigation .main-nav ul ul li a:hover {
    background-color: var(--ps-primary) !important;
}

/* Sticky nav keeps the same brand color */
.main-navigation.stuckElement {
    background-color: var(--ps-primary-dark) !important;
}

/* --- Section Headings: amber/gold → purple with left accent bar --- */
.entry-content h2.gb-headline,
main h2.gb-headline,
.site-main h2.gb-headline,
aside h2.gb-headline {
    color: var(--ps-primary-dark) !important;
    border-bottom-color: var(--ps-primary) !important;
}

/* Section heading icon squares get purple treatment */
.entry-content h2.gb-headline svg,
main h2.gb-headline svg,
aside h2.gb-headline svg {
    fill: var(--ps-primary) !important;
}

/* --- Read More / Action Buttons: dark gray → purple --- */
a.gb-button,
.gb-button {
    background-color: var(--ps-primary) !important;
    border-radius: 6px !important;
    transition: all var(--ps-transition) !important;
}

a.gb-button:hover,
.gb-button:hover {
    background-color: var(--ps-primary-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3) !important;
}

/* --- Post Cards: subtle brand hover effects --- */
.gb-query-loop-item .gb-container {
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.gb-query-loop-item:hover .gb-container.box-shadow {
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.12) !important;
    transform: translateY(-2px);
}

/* Card image overlays - softer purple gradient */
.gb-query-loop-item .gb-container img {
    transition: transform 0.3s ease;
}

.gb-query-loop-item:hover .gb-container img {
    transform: scale(1.02);
}

/* --- Category Labels on Cards: add subtle purple bg --- */
.gb-query-loop-item .gb-headline-text a[href*="category"] {
    transition: opacity var(--ps-transition);
}

.gb-query-loop-item:hover .gb-headline-text a[href*="category"] {
    opacity: 0.9;
}

/* --- Post Title Links: brand color on hover --- */
.gb-query-loop-item h3 a:hover,
.gb-query-loop-item h4 a:hover,
main article h3 a:hover,
main article h4 a:hover {
    color: var(--ps-primary) !important;
}

/* --- Sidebar: section heading accent --- */
.right-sidebar .widget-title,
aside .widget-title,
.sidebar .gb-headline {
    color: var(--ps-primary-dark) !important;
}

/* --- Back to Top Button: brand purple --- */
.generate-back-to-top,
a.generate-back-to-top {
    background-color: var(--ps-primary) !important;
    transition: background var(--ps-transition);
}

.generate-back-to-top:hover,
a.generate-back-to-top:hover {
    background-color: var(--ps-primary-dark) !important;
}

/* --- Footer: subtle brand accent --- */
.site-footer a:hover {
    color: var(--ps-primary) !important;
}

/* Footer social icons get purple hover */
.site-footer a[href*="facebook"]:hover,
.site-footer a[href*="twitter"]:hover,
.site-footer a[href*="instagram"]:hover,
.site-footer a[href*="linkedin"]:hover {
    opacity: 0.85;
}

/* --- General Link Accents --- */
.entry-content a:not(.gb-button):not([class*="ps-"]):hover {
    color: var(--ps-primary);
}

/* --- Selection Color: brand purple --- */
::selection {
    background: rgba(124, 58, 237, 0.2);
    color: var(--ps-text);
}

/* --- Search Button: brand purple --- */
.navigation-search input[type="search"]:focus {
    border-color: var(--ps-primary-light) !important;
}

/* --- GP Customizer Accent Override --- */
:root {
    --accent: var(--ps-primary);
}

/* --- Blog Post Meta Links --- */
.entry-meta a:hover {
    color: var(--ps-primary) !important;
}

/* --- Pagination: brand styled --- */
.nav-links .page-numbers {
    transition: all var(--ps-transition);
}

.nav-links .page-numbers.current,
.nav-links a.page-numbers:hover {
    background-color: var(--ps-primary) !important;
    border-color: var(--ps-primary) !important;
    color: #fff !important;
}

/* --- Header Logo Area: subtle bottom border accent --- */
.site-header {
    border-bottom: 3px solid var(--ps-primary) !important;
}

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

/* ==========================================================================
   Quiz Archive Page (/quiz/)
   ========================================================================== */

.ps-quiz-archive-header {
    text-align: center;
    padding: 2.5rem 0 1.5rem;
}

.ps-quiz-archive-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--ps-text);
    margin-bottom: 0.5rem;
}

.ps-quiz-archive-header p {
    font-size: 1.1rem;
    color: var(--ps-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Category Filter Tabs */
.ps-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    padding: 1rem 0 2rem;
}

.ps-category-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border: 1.5px solid var(--ps-border);
    border-radius: 100px;
    background: var(--ps-surface);
    color: var(--ps-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--ps-transition);
    text-decoration: none;
}

.ps-category-tab:hover,
.ps-category-tab.active {
    border-color: var(--ps-primary);
    background: var(--ps-primary);
    color: #fff;
    text-decoration: none;
}

/* Quiz Cards Grid */
.ps-quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding-bottom: 2rem;
}

.ps-quiz-card {
    background: var(--ps-surface);
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius);
    overflow: hidden;
    transition: all var(--ps-transition);
    display: flex;
    flex-direction: column;
}

.ps-quiz-card:hover {
    box-shadow: var(--ps-shadow-lg);
    transform: translateY(-2px);
    border-color: var(--ps-primary-light);
}

.ps-quiz-card a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ps-quiz-card-body {
    padding: 1.25rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ps-quiz-card-category {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ps-primary);
    margin-bottom: 0.5rem;
}

.ps-quiz-card h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ps-text);
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

.ps-quiz-card-excerpt {
    font-size: 0.875rem;
    color: var(--ps-text-muted);
    line-height: 1.5;
    flex: 1;
    margin-bottom: 1rem;
}

.ps-quiz-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--ps-text-muted);
    padding-top: 0.75rem;
    border-top: 1px solid var(--ps-border);
}

.ps-quiz-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.ps-quiz-card-cta {
    margin-left: auto;
    color: var(--ps-primary);
    font-weight: 600;
    font-size: 0.8rem;
}

/* ==========================================================================
   Tools Page Styling
   ========================================================================== */

.ps-tools-header {
    text-align: center;
    padding: 2.5rem 0 1.5rem;
}

.ps-tools-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--ps-text);
    margin-bottom: 0.5rem;
}

.ps-tools-header p {
    font-size: 1.1rem;
    color: var(--ps-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.ps-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding-bottom: 2rem;
}

.ps-tool-card-link {
    display: block;
    background: var(--ps-surface);
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius);
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all var(--ps-transition);
}

.ps-tool-card-link:hover {
    box-shadow: var(--ps-shadow-lg);
    transform: translateY(-2px);
    border-color: var(--ps-primary-light);
    text-decoration: none;
}

.ps-tool-card-link .ps-tool-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
}

.ps-tool-card-link h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ps-text);
    margin: 0 0 0.5rem;
}

.ps-tool-card-link p {
    font-size: 0.875rem;
    color: var(--ps-text-muted);
    line-height: 1.5;
    margin: 0 0 0.75rem;
}

.ps-tool-card-link .ps-tool-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ps-primary);
    background: rgba(124, 58, 237, 0.08);
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
}

/* ==========================================================================
   Quiz & Tool Container Enhancements (works with plugin CSS)
   ========================================================================== */

/* Ensure plugin tool containers look good inside GP's content area */
.ps-tool-container,
.psq-quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Make quiz/tool buttons match the site's design */
.ps-tool-container .ps-btn,
.psq-quiz-container .psq-btn {
    border-radius: var(--ps-radius-sm);
    font-weight: 600;
    transition: all var(--ps-transition);
}

/* ==========================================================================
   Homepage Customization (optional - for front-page)
   ========================================================================== */

.ps-hero {
    text-align: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.05) 0%, rgba(244, 63, 94, 0.05) 100%);
    border-radius: var(--ps-radius);
    margin-bottom: 2rem;
}

.ps-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--ps-text);
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.ps-hero h1 span {
    background: linear-gradient(135deg, var(--ps-primary), var(--ps-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ps-hero p {
    font-size: 1.15rem;
    color: var(--ps-text-muted);
    max-width: 550px;
    margin: 0 auto 1.5rem;
}

.ps-hero-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.ps-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--ps-primary);
    color: #fff;
    border: none;
    border-radius: var(--ps-radius-sm);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all var(--ps-transition);
    cursor: pointer;
}

.ps-btn-primary:hover {
    background: var(--ps-primary-dark);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--ps-shadow-md);
}

.ps-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--ps-surface);
    color: var(--ps-primary);
    border: 1.5px solid var(--ps-primary);
    border-radius: var(--ps-radius-sm);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all var(--ps-transition);
    cursor: pointer;
}

.ps-btn-outline:hover {
    background: var(--ps-primary);
    color: #fff;
    text-decoration: none;
}

/* ==========================================================================
   Section Headers
   ========================================================================== */

.ps-section {
    padding: 2rem 0;
}

.ps-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.ps-section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ps-text);
    margin: 0;
}

.ps-section-header a {
    color: var(--ps-primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
}

.ps-section-header a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Ad Slot Containers
   ========================================================================== */

.ps-ad-slot {
    text-align: center;
    padding: 1rem 0;
    min-height: 90px;
}

.ps-ad-slot-sidebar {
    margin-bottom: 1.5rem;
}

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

@media (max-width: 768px) {
    .ps-quiz-grid {
        grid-template-columns: 1fr;
    }

    .ps-tools-grid {
        grid-template-columns: 1fr;
    }

    .ps-hero h1 {
        font-size: 1.75rem;
    }

    .ps-hero p {
        font-size: 1rem;
    }

    .ps-quiz-archive-header h1,
    .ps-tools-header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .ps-category-tabs {
        gap: 0.35rem;
    }

    .ps-category-tab {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
}
