/*
Theme Name: A Letter Writer
Template: oceanwp
Description: Professional letter writing tools and resources with server-side first approach and minimal JavaScript. Custom child theme of OceanWP for www.aletterwriter.com
Version: 1.0.0
Author: Letter Writing Experts
*/

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

/* CSS Variables */
:root {
    --primary-color: #2C5282;
    --secondary-color: #38A169;
    --accent-color: #D69E2E;
    --text-dark: #2D3748;
    --text-light: #718096;
    --bg-light: #F7FAFC;
    --bg-white: #FFFFFF;
    --border-color: #E2E8F0;
    --shadow-light: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 8px rgba(0,0,0,0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* Responsive Logo Scaling */
.site-logo img,
.custom-logo {
    height: auto;
    max-height: 50px;
    width: auto;
    max-width: 100%;
    transition: var(--transition);
}

/* Device-specific breakpoints */
@media (max-width: 1024px) {
    .site-logo img, .custom-logo { max-height: 45px; }
}

@media (max-width: 768px) {
    .site-logo img, .custom-logo { max-height: 40px; }
}

@media (max-width: 480px) {
    .site-logo img, .custom-logo { max-height: 35px; }
}

@media (max-width: 360px) {
    .site-logo img, .custom-logo { max-height: 30px; }
}

/* High DPI Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .site-logo img, .custom-logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Mobile Menu - CSS Only */
.menu-toggle-checkbox { 
    display: none; 
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 999;
}

.hamburger {
    display: flex;
    flex-direction: column;
    width: 24px;
    height: 18px;
}

.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text-dark);
    margin-bottom: 4px;
    transition: var(--transition);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-white);
        box-shadow: var(--shadow-medium);
        z-index: 998;
    }
    
    .menu-toggle-checkbox:checked ~ .main-navigation {
        display: block;
    }
    
    .menu-toggle-checkbox:checked + .mobile-menu-toggle .hamburger span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .menu-toggle-checkbox:checked + .mobile-menu-toggle .hamburger span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle-checkbox:checked + .mobile-menu-toggle .hamburger span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
}

.back-to-top:hover {
    transform: translateY(-3px);
    background: var(--secondary-color);
}

/* Show back to top when scrolled */
body:not(.loading) .back-to-top {
    opacity: 1;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 16px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: darken(var(--primary-color), 10%);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: darken(var(--secondary-color), 10%);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Card Styles */
.card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-3px);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-section p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

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

/* Apps Grid */
.apps-section {
    padding: 80px 0;
    background: var(--bg-light);
}

.apps-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.app-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.app-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-5px);
}

.app-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.app-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.app-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.app-btn {
    background: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.app-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Recent Posts Section */
.recent-posts {
    padding: 80px 0;
    background: var(--bg-white);
}

.recent-posts h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.post-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.post-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-3px);
}

.post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-card h3 {
    padding: 1.5rem 1.5rem 0;
    margin-bottom: 1rem;
}

.post-card h3 a {
    color: var(--text-dark);
    text-decoration: none;
}

.post-card h3 a:hover {
    color: var(--primary-color);
}

.post-card p {
    padding: 0 1.5rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.read-more {
    display: inline-block;
    padding: 0 1.5rem 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.read-more:hover {
    color: var(--secondary-color);
}

.view-all {
    text-align: center;
}

/* Form Styles */
.app-form {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

/* Results Box */
.results-box {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-top: 2rem;
}

.results-box.success {
    background: #F0FFF4;
    border-color: var(--secondary-color);
    color: #22543D;
}

.results-box.error {
    background: #FED7D7;
    border-color: #E53E3E;
    color: #742A2A;
}

.result-value {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    margin: 1rem 0;
}

/* Newsletter Form */
.newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

.newsletter-form input[type="email"] {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
}

.newsletter-form button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
}

.newsletter-form button:hover {
    background: var(--secondary-color);
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 999999;
}

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

/* Focus states */
a:focus, button:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Screen reader text */
.screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    word-wrap: normal !important;
    border: 0;
    overflow: hidden;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0000FF;
        --secondary-color: #00AA00;
        --text-dark: #000000;
        --bg-white: #FFFFFF;
        --border-color: #000000;
    }
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .apps-section,
    .recent-posts {
        padding: 60px 0;
    }
    
    .apps-grid,
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .newsletter-form {
        flex-direction: column;
        max-width: 100%;
    }
}