/*
Theme Name: Stone Soup Child Theme
Theme URI: https://stonesoup.com
Description: ADHD/Autism accessible child theme with Albers-inspired colors and classical typography
Author: Stone Soup Team
Template: generatepress
Version: 1.0
Text Domain: stonesoup-child
*/

/* Import parent theme styles */
@import url("../generatepress/style.css");

/* ==========================================================================
   STONE SOUP GLOBAL STYLES - ADHD/AUTISM ACCESSIBLE DESIGN
   Based on Joseph Albers color theory and classical typography
   ========================================================================== */

/* ROOT VARIABLES - Albers Color Palette */
:root {
    /* Albers-Inspired Colors */
    --stonesoup-yellow-light: #f7e882;     /* Naples yellow - navigation */
    --stonesoup-orange: #d2691e;           /* Cadmium orange - stories */
    --stonesoup-blue-green: #8db4aa;       /* Blue-green - poetry */
    --stonesoup-ochre: #cd853f;            /* Golden ochre - reviews */
    --stonesoup-yellow-green: #9db09d;     /* Yellow-green gray - blogs */
    --stonesoup-beige: #f5f5dc;            /* Beige - navigation background */
    
    /* Accessibility Colors */
    --stonesoup-text-dark: #2c2c2c;        /* High contrast text */
    --stonesoup-text-light: #666666;       /* Secondary text */
    --stonesoup-white: #ffffff;
    --stonesoup-light-gray: #f8f8f8;
    --stonesoup-focus-color: #0066cc;      /* Focus indicator */
    
    /* Typography Scale */
    --stonesoup-font-base: 18px;
    --stonesoup-line-height: 1.7;
    --stonesoup-max-width: 800px;          /* 11.5 words per line at 18px */
    
    /* Spacing Scale */
    --stonesoup-space-xs: 0.5rem;
    --stonesoup-space-sm: 1rem;
    --stonesoup-space-md: 1.5rem;
    --stonesoup-space-lg: 2rem;
    --stonesoup-space-xl: 3rem;
}

/* Hide page title on Contest Winners page */
.page-id-9274 .entry-header {
    display: none;
}

/* Explore Our Community button - white text on home page */
.page-id-7 .elementor-button-text {
    color: #ffffff !important;
}

.page-id-7 .welcome-cta {
    color: #ffffff !important;
}

/* ==========================================================================
   GLOBAL TYPOGRAPHY - Classical Book Design
   ========================================================================== */

body {
    font-family: Georgia, "Times New Roman", serif;
    font-size: var(--stonesoup-font-base);
    line-height: var(--stonesoup-line-height);
    color: var(--stonesoup-text-dark);
    background-color: #ffffff;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Container for proper margins */
.stonesoup-container,
.site-main .container {
    max-width: var(--stonesoup-max-width);
    margin: 0 auto;
    padding: var(--stonesoup-space-xl) var(--stonesoup-space-lg);
}

/* Classical Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-family: Georgia, serif;
    font-weight: bold;
    margin-bottom: var(--stonesoup-space-sm);
    margin-top: var(--stonesoup-space-lg);
    line-height: 1.3;
}

h1 { 
    font-size: 2.2rem; 
    margin-top: 0;
    color: var(--stonesoup-text-dark);
}

h2 { 
    font-size: 1.4rem; 
    color: var(--stonesoup-text-dark);
}

h3 { 
    font-size: 1.2rem; 
    color: var(--stonesoup-text-dark);
}

h4 { 
    font-size: 1.1rem; 
    color: var(--stonesoup-text-dark);
}

/* Paragraph spacing for readability */
p {
    margin-bottom: var(--stonesoup-space-md);
    text-align: left;
    hyphens: none;
    word-break: normal;
}

/* ==========================================================================
   CONTENT TYPE COLOR SYSTEM
   ========================================================================== */

/* Body classes for content types */
body.single-story { --content-color: var(--stonesoup-orange); }
body.single-poem { --content-color: var(--stonesoup-blue-green); }
body.single-review { --content-color: var(--stonesoup-ochre); }
body.single-post.category-blog { --content-color: var(--stonesoup-yellow-green); }

/* Apply colors to titles and meta */
body.single-story .entry-title,
body.single-poem .entry-title,
body.single-review .entry-title,
body.single-post.category-blog .entry-title {
    color: var(--content-color);
}

/* ==========================================================================
   ARTICLE/STORY STYLING
   ========================================================================== */

/* Article header */
.entry-header {
    border-bottom: 2px solid var(--stonesoup-light-gray);
    padding-bottom: var(--stonesoup-space-lg);
    margin-bottom: var(--stonesoup-space-xl);
}

.entry-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    font-weight: normal;
}

/* Custom date format - "Published" + year only */
.entry-meta .posted-on {
    font-size: 1rem;
    color: var(--stonesoup-text-light);
}

/* Hide default date format, show only year */
.entry-meta .posted-on time:not(.entry-year) {
    display: none;
}

.entry-meta .posted-on .entry-year::before {
    content: "Published ";
}

/* Author and age styling */
.entry-meta .author {
    color: var(--content-color, var(--stonesoup-text-dark));
    font-weight: 500;
}

.author-age {
    background-color: var(--content-color, var(--stonesoup-light-gray));
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: bold;
    display: inline-block;
    margin-left: 0.5rem;
}

/* Drop caps for stories */
body.single-story .entry-content > p:first-child::first-letter {
    float: left;
    font-size: 4rem;
    line-height: 3.5rem;
    margin: 0.1rem 0.2rem 0 0;
    font-weight: bold;
    color: var(--stonesoup-orange);
}

/* ==========================================================================
   PRINT FUNCTIONALITY
   ========================================================================== */

/* Print button */
.print-button {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: var(--content-color, var(--stonesoup-orange));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* CSS PDF Icon - Document shape */
.print-button::before {
    content: '';
    width: 14px;
    height: 18px;
    background: white;
    position: absolute;
    clip-path: polygon(0 0, 70% 0, 100% 30%, 100% 100%, 0 100%);
}

.print-button::after {
    content: 'PDF';
    position: absolute;
    font-size: 7px;
    font-weight: bold;
    color: var(--content-color, var(--stonesoup-orange));
    bottom: 12px;
    font-family: Arial, sans-serif;
}

.print-button:hover {
    transform: translateY(-50%) scale(1.1);
}

.print-button:focus {
    outline: 3px solid var(--stonesoup-focus-color);
    outline-offset: 2px;
}

/* Loading state for PDF button */
.print-button.loading {
    pointer-events: none;
    background-color: #999;
}

.print-button.loading::before,
.print-button.loading::after {
    display: none;
}

.print-button.loading {
    position: fixed;
}

.print-button.loading::before {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: pdf-button-spin 1s linear infinite;
    background: transparent;
    clip-path: none;
}

@keyframes pdf-button-spin {
    to { transform: rotate(360deg); }
}

/* Print Styles */
@media print {
    /* Hide non-print elements */
    .site-header,
    .navigation,
    .sidebar,
    .site-footer,
    .print-button,
    .comments-area,
    .nav-links,
    #wpadminbar {
        display: none !important;
    }
    
    /* Add print header */
    body::before {
        content: "Stone Soup Magazine • stonesoup.com • 100% written and illustrated by kids ages 6-13";
        display: block;
        text-align: center;
        font-size: 10pt;
        margin-bottom: 20pt;
        padding-bottom: 10pt;
        border-bottom: 1px solid #ccc;
    }
    
    /* Add print footer */
    body::after {
        content: "This story originally appeared in Stone Soup Magazine • Visit stonesoup.com for more stories by young writers";
        display: block;
        text-align: center;
        font-size: 9pt;
        margin-top: 20pt;
        padding-top: 10pt;
        border-top: 1px solid #ccc;
    }
    
    /* Typography optimization for print */
    body {
        font-size: 12pt;
        line-height: 1.6;
        color: black !important;
        background: white !important;
    }
    
    .entry-title { font-size: 18pt; }
    h2 { font-size: 14pt; }
    h3 { font-size: 13pt; }
    
    /* Remove drop caps in print */
    .entry-content > p:first-child::first-letter {
        float: none !important;
        font-size: inherit !important;
        line-height: inherit !important;
        margin: 0 !important;
        font-weight: normal !important;
        color: inherit !important;
    }
    
    /* Page break control */
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    p {
        page-break-inside: avoid;
        orphans: 3;
        widows: 3;
    }
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

/* Hero container */
.stonesoup-hero {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    height: 60vh;
    min-height: 400px;
    max-height: 600px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--stonesoup-ochre), var(--stonesoup-orange));
}

/* Hero background image */
.stonesoup-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../../../uploads/2025/07/P1040361_1.jpeg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0.8;
    z-index: 1;
}

/* Hero overlay removed - now controlled via Elementor widget settings */

/* Hero content container */
.stonesoup-hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: white;
    max-width: 800px;
    padding: var(--stonesoup-space-xl);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

/* Hero title styling */
.stonesoup-hero h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: bold;
    margin-bottom: var(--stonesoup-space-md);
    line-height: 1.1;
    color: white;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
}

/* Hero subtitle */
.stonesoup-hero .hero-subtitle {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: normal;
    margin-bottom: var(--stonesoup-space-lg);
    opacity: 0.95;
    font-style: italic;
}

/* Hero description */
.stonesoup-hero .hero-description {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    line-height: 1.6;
    margin-bottom: var(--stonesoup-space-lg);
    opacity: 0.9;
}

/* Hero call-to-action button */
.stonesoup-hero .hero-cta {
    display: inline-block;
    background-color: var(--stonesoup-yellow-light);
    color: var(--stonesoup-text-dark);
    padding: var(--stonesoup-space-sm) var(--stonesoup-space-lg);
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    text-shadow: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid transparent;
}

.stonesoup-hero .hero-cta:hover {
    background-color: white;
    color: var(--stonesoup-orange);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border-color: var(--stonesoup-orange);
}

.stonesoup-hero .hero-cta:focus {
    outline: 3px solid white;
    outline-offset: 3px;
}

/* Responsive hero adjustments */
@media (max-width: 768px) {
    .stonesoup-hero {
        height: 50vh;
        min-height: 350px;
    }
    
    .stonesoup-hero-content {
        padding: var(--stonesoup-space-lg);
    }
    
    .stonesoup-hero h1 {
        margin-bottom: var(--stonesoup-space-sm);
    }
    
    .stonesoup-hero .hero-subtitle {
        margin-bottom: var(--stonesoup-space-md);
    }
    
    .stonesoup-hero .hero-description {
        margin-bottom: var(--stonesoup-space-md);
    }
}

@media (max-width: 480px) {
    .stonesoup-hero {
        height: 45vh;
        min-height: 300px;
    }
    
    .stonesoup-hero .hero-cta {
        padding: var(--stonesoup-space-xs) var(--stonesoup-space-md);
        font-size: 1rem;
    }
}

/* Reduced motion support for hero */
@media (prefers-reduced-motion: reduce) {
    .stonesoup-hero .hero-cta {
        transition: none;
    }
    
    .stonesoup-hero .hero-cta:hover {
        transform: none;
    }
}

/* ==========================================================================
   NAVIGATION SYSTEM
   ========================================================================== */

/* Main navigation grid for homepage */
.stonesoup-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.nav-section {
    background-color: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    border: 3px solid transparent;
}

/* Section color coding */
.reading-section { border-color: var(--stonesoup-blue-green); }
.submit-section { border-color: var(--stonesoup-orange); }
.contests-section { border-color: #e8a317; }
.learn-section { border-color: var(--stonesoup-yellow-green); }
.community-section { border-color: var(--stonesoup-ochre); }
.support-section { border-color: #a8a8a8; }

.nav-section h2 {
    font-size: 1.6rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-section .emoji {
    font-size: 1.8rem;
}

.nav-section p {
    font-size: 1rem;
    color: var(--stonesoup-text-light);
    margin-bottom: 20px;
    font-style: italic;
}

.content-list {
    list-style: none;
    padding: 0;
}

.content-list li {
    margin-bottom: 8px;
    padding: 8px 12px;
    background-color: var(--stonesoup-light-gray);
    border-radius: 6px;
    border-left: 4px solid;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.content-list a {
    color: var(--stonesoup-text-dark);
    text-decoration: none;
    display: block;
}

.content-list a:hover {
    color: #1a1a1a;
}

.reading-section .content-list li { border-left-color: var(--stonesoup-blue-green); }
.submit-section .content-list li { border-left-color: var(--stonesoup-orange); }
.contests-section .content-list li { border-left-color: #e8a317; }
.learn-section .content-list li { border-left-color: var(--stonesoup-yellow-green); }
.community-section .content-list li { border-left-color: var(--stonesoup-ochre); }
.support-section .content-list li { border-left-color: #a8a8a8; }

.content-list li:hover {
    background-color: #e8e6dc;
    transform: translateX(5px);
}

/* ==========================================================================
   ACCESSIBILITY ENHANCEMENTS
   ========================================================================== */

/* Focus management */
*:focus {
    outline: 3px solid var(--stonesoup-focus-color);
    outline-offset: 2px;
}

/* Skip links */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--stonesoup-focus-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 6px;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --stonesoup-text-dark: #000000;
        --stonesoup-text-light: #333333;
    }
    
    .nav-section {
        border-width: 2px;
        border-color: var(--stonesoup-text-dark) !important;
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

/* Tablet styles */
@media (max-width: 768px) {
    .stonesoup-container {
        padding: var(--stonesoup-space-md);
    }
    
    .stonesoup-nav-grid {
        grid-template-columns: 1fr;
    }
    
    .entry-title {
        font-size: 2rem;
    }
    
    .print-button {
        top: auto;
        bottom: 20px;
        right: 20px;
        transform: none;
    }
    
    .print-button:hover {
        transform: scale(1.1);
    }
}

/* Mobile styles */
@media (max-width: 480px) {
    :root {
        --stonesoup-font-base: 16px;
        --stonesoup-space-lg: 1rem;
        --stonesoup-space-xl: 1.5rem;
    }
    
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.3rem; }
    
    .entry-content > p:first-child::first-letter {
        font-size: 3rem;
        line-height: 2.5rem;
    }
}

/* ==========================================================================
   BLOG PAGE SPECIFIC STYLES
   ========================================================================== */

.site-content {
    max-width: 1140px;
    margin:auto;
}

/* ==========================================================================
   WORDPRESS SPECIFIC OVERRIDES
   ========================================================================== */

/* Override GeneratePress defaults */
.site-content {
    padding: 0;
}

.separate-containers .inside-article {
    padding: var(--stonesoup-space-xl) var(--stonesoup-space-lg);
}

/* Ensure our typography applies to all content */
.entry-content p,
.entry-content li,
.entry-content blockquote {
    font-family: Georgia, "Times New Roman", serif;
    font-size: var(--stonesoup-font-base);
    line-height: var(--stonesoup-line-height);
}

/* Override default link colors in content */
.entry-content a {
    color: var(--stonesoup-focus-color);
    text-decoration: underline;
}

.entry-content a:hover {
    color: var(--content-color, var(--stonesoup-orange));
}

/* Breadcrumb styling */
.stonesoup-breadcrumb {
    font-size: 0.9rem;
    margin-bottom: var(--stonesoup-space-md);
    color: var(--stonesoup-text-light);
}

.stonesoup-breadcrumb a {
    color: var(--stonesoup-focus-color);
    text-decoration: none;
}

.stonesoup-breadcrumb a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   BLOG PAGE SPECIFIC STYLES
   ========================================================================== */

/* Target the content area specifically when showing the blog posts page */
.blog-page {
    /* Add any blog-specific styling here */
    position: relative;
}

/* Example: Add a subtle indicator that this is the blog page */
.blog-page::before {
    content: "";
    /* Uncomment to add visual indicator:
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--stonesoup-focus-color);
    */
}

/* ==========================================================================
   ART ARCHIVE GRID LAYOUT
   ========================================================================== */

/* Art archive header */
.post-type-archive-art .page-header {
    text-align: center;
    margin-bottom: var(--stonesoup-space-xl);
    padding-bottom: var(--stonesoup-space-lg);
    border-bottom: 2px solid var(--stonesoup-light-gray);
}

.post-type-archive-art .page-title {
    font-size: 2.5rem;
    color: var(--stonesoup-text-dark);
    margin-bottom: 0.5rem;
}

.post-type-archive-art .archive-description {
    font-size: 1.2rem;
    color: var(--stonesoup-text-light);
    font-style: italic;
}

/* Art grid container */
.stonesoup-art-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: var(--stonesoup-space-xl);
}

/* Individual art item */
.stonesoup-art-grid-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e8e8e8;
}

.stonesoup-art-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

/* Art thumbnail container */
.stonesoup-art-thumbnail {
    position: relative;
    padding-top: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
    background-color: var(--stonesoup-light-gray);
}

.stonesoup-art-thumbnail a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.stonesoup-art-thumbnail img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Art content section */
.stonesoup-art-content {
    padding: 20px;
}

.stonesoup-art-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
    line-height: 1.3;
}

.stonesoup-art-title a {
    color: var(--stonesoup-text-dark);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stonesoup-art-title a:hover {
    color: var(--stonesoup-orange);
}

/* Art meta information */
.stonesoup-art-meta {
    font-size: 0.85rem;
    color: var(--stonesoup-text-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stonesoup-art-author {
    font-weight: 500;
}

.stonesoup-art-date {
    font-style: italic;
}

/* Pagination styling for art archive */
.post-type-archive-art .paging-navigation {
    margin-top: var(--stonesoup-space-xl);
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stonesoup-art-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .post-type-archive-art .page-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .stonesoup-art-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stonesoup-art-content {
        padding: 15px;
    }
}

