/*!
Theme Name:   PlugAndRead Child
Theme URI:    http://example.com/plugandread-child/
Description:  A child theme for the PlugAndRead WordPress theme with modern AI-powered design
Author:       Your Name
Author URI:   http://example.com
Template:     plugandread
Version:      1.0.0
License:      GNU General Public License v2 or later
License URI:  LICENSE
Tags:         custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, ai, news, modern
Text Domain:  plugandread-child
*/

/*
 * This is the child theme for PlugAndRead.
 * All customizations should be made in this file or in additional files within this child theme.
 * The parent theme styles are automatically loaded before this stylesheet.
 */

/* ==========================================================================
   Child Theme Custom Styles
   ========================================================================== */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* Hide default WordPress elements that conflict with custom design */
.site-header,
.site-footer {
    display: none;
}

#primary {
    margin: 0;
    padding: 0;
}

/* Custom Tab Transitions */
.tab-content {
    transition: opacity 0.3s ease-in-out;
}

/* Source Favicon Styling */
.source-favicon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    color: white;
}

/* Custom Logo Styling */
.custom-logo-link {
    display: flex;
    align-items: center;
}

.custom-logo {
    max-height: 40px;
    width: auto;
    border-radius: 8px;
}

/* Navigation Menu Styling */
#primary-menu,
#mobile-primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

#primary-menu li,
#mobile-primary-menu li {
    display: inline-block;
    margin: 0;
}

#primary-menu a,
#mobile-primary-menu a {
    text-decoration: none;
    display: block;
}

/* Mobile Menu Specific */
#mobile-primary-menu li {
    display: block;
}

/* Skip Link */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 999999;
    padding: 1em;
    background: #fff;
    color: #000;
    text-decoration: none;
}

.skip-link:focus {
    left: 0;
}

/* Smooth Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Responsive Typography */
@media (max-width: 640px) {
    h1 {
        font-size: 2.5rem !important;
    }

    h2 {
        font-size: 1.875rem !important;
    }

    h3 {
        font-size: 1.5rem !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #1A3A54;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #FF5D28;
}

/* Accessibility Improvements */
a:focus,
button:focus {
    outline: 2px solid #FF5D28;
    outline-offset: 2px;
}

/* Print Styles */
@media print {

    nav,
    footer,
    .no-print {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }
}

/* WordPress Admin Bar Adjustment */
body.admin-bar #navbar {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar #navbar {
        top: 46px;
    }
}

/* Ensure proper spacing for fixed navbar */
body {
    padding-top: 0;
}

/* Footer Logo Styling */
.footer-logo .custom-logo {
    max-height: 32px;
    filter: brightness(0) invert(1);
}

/* Responsive Utilities */
@media (min-width: 768px) {
    .md\:hidden {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .hidden.md\:flex {
        display: flex !important;
    }
}

/* Custom Gradient Text Support for older browsers */
@supports not (background-clip: text) {
    .bg-clip-text {
        color: #1A3A54;
    }
}

/* Ensure images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* WordPress Block Editor Compatibility */
.wp-block-image {
    margin: 0;
}

/* Additional Custom Styles */
.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1;
}

/* Smooth transitions for interactive elements */
button,
a,
.tab-btn {
    transition: all 0.3s ease;
}

/* Focus visible for better accessibility */
:focus-visible {
    outline: 2px solid #FF5D28;
    outline-offset: 2px;
}

/* Remove default WordPress margins */
.site-main>* {
    margin: 0;
}

/* Page and Post Content Styling (based on blank.html) */
.entry-content {
    line-height: 1.8;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    color: #1A3A54;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.entry-content h2 {
    font-size: 2rem;
    border-bottom: 2px solid #FF5D28;
    padding-bottom: 0.5rem;
}

.entry-content h3 {
    font-size: 1.5rem;
}

.entry-content p {
    margin-bottom: 1.5rem;
    color: #4C525A;
}

.entry-content a {
    color: #FF5D28;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.entry-content a:hover {
    color: #1A3A54;
}

.entry-content ul,
.entry-content ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.entry-content li {
    margin-bottom: 0.5rem;
}

.entry-content blockquote {
    border-left: 4px solid #FF5D28;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #4C525A;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0.5rem;
}

.entry-content img {
    border-radius: 1rem;
    margin: 2rem 0;
}

.entry-content pre {
    background: #1A3A54;
    color: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 2rem 0;
}

.entry-content code {
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    color: #FF5D28;
}

.entry-content pre code {
    background: transparent;
    padding: 0;
    color: white;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.entry-content table th,
.entry-content table td {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.entry-content table th {
    background: #1A3A54;
    color: white;
    font-weight: 600;
}

.entry-content table tr:nth-child(even) {
    background: #f8f9fa;
}

/* WordPress Blocks Styling */
.wp-block-image {
    margin: 2rem 0;
}

.wp-block-quote {
    border-left: 4px solid #FF5D28;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
}

.wp-block-button__link {
    background: #FF5D28;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.wp-block-button__link:hover {
    background: #1A3A54;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Post Meta Styling */
.entry-header .fa-regular,
.entry-header .fa-solid {
    font-size: 0.875rem;
}

.entry-footer .fa-solid,
.entry-footer .fa-tags {
    font-size: 1rem;
}

/* Category and Tag Links */
.entry-header a,
.entry-footer a {
    text-decoration: none;
}

.entry-header a:hover,
.entry-footer a:hover {
    text-decoration: underline;
}

/* Post Navigation */
.post-navigation a {
    text-decoration: none;
}

/* Comments Styling */
.comment-list {
    list-style: none;
    padding: 0;
}

.comment-body {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
}

.comment-author {
    font-weight: 600;
    color: #1A3A54;
    margin-bottom: 0.5rem;
}

.comment-meta {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.comment-content p {
    margin-bottom: 0.5rem;
}

.reply {
    margin-top: 1rem;
}

.reply a {
    color: #FF5D28;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
}

.reply a:hover {
    text-decoration: underline;
}

/* Comment Form */
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #FF5D28;
    box-shadow: 0 0 0 3px rgba(255, 93, 40, 0.1);
}

.comment-form input[type="submit"] {
    background: #FF5D28;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.comment-form input[type="submit"]:hover {
    background: #1A3A54;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Ensure flex-grow works for main content */
body {
    display: flex;
    flex-direction: column;
}

main.flex-grow {
    flex: 1;
}

/* Blog Listing Styles */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Archive Title Styling */
.archive-title {
    font-family: 'Outfit', sans-serif;
}

/* Pagination Styling */
.page-numbers {
    text-decoration: none;
}

.page-numbers.current {
    pointer-events: none;
}

/* Featured Post Hover Effects */
.featured-post-image {
    transition: transform 0.5s ease;
}

.group:hover .featured-post-image {
    transform: scale(1.05);
}

/* Post Card Hover Effects */
.post-card-image {
    transition: transform 0.3s ease;
}

.group:hover .post-card-image {
    transform: scale(1.05);
}

/* Reading Time Badge */
.reading-time {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Category Badge */
.category-badge {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Post Meta Icons */
.post-meta i {
    font-size: 0.875rem;
}

/* Archive Description */
.archive-description {
    color: #6b7280;
}

.archive-description p {
    margin-bottom: 0;
}

/* Empty State */
.empty-state {
    padding: 5rem 0;
}

.empty-state i {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1.5rem;
}

/* Responsive adjustments for blog grid */
@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Single Post Styles (based on post.html) */
.single .entry-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

.single .entry-content p:first-of-type {
    font-size: 1.25rem;
    font-weight: 500;
    color: #1f2937;
    line-height: 1.6;
}

.single .entry-content h2 {
    font-size: 1.875rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

.single .entry-content h3 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.single .entry-content ul li {
    display: flex;
    align-items: start;
    gap: 0.75rem;
}

.single .entry-content ul li i {
    margin-top: 0.5rem;
    flex-shrink: 0;
}

.single .entry-content blockquote {
    font-size: 1.25rem;
    margin: 2.5rem 0;
    padding: 1.5rem;
}

/* Breadcrumbs */
.breadcrumbs a {
    transition: color 0.3s ease;
}

/* Share Buttons Sidebar */
.share-sidebar {
    position: sticky;
    top: 8rem;
}

.share-sidebar button,
.share-sidebar a {
    transition: all 0.3s ease;
}

.share-sidebar button:hover,
.share-sidebar a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Author Box */
.author-box {
    background: rgba(26, 58, 84, 0.05);
}

.author-box:hover {
    background: rgba(26, 58, 84, 0.08);
    transition: background 0.3s ease;
}

/* Related Posts Section */
.related-posts-section {
    background: #f9fafb;
}

.related-post-card {
    transition: all 0.3s ease;
}

.related-post-card:hover {
    transform: translateY(-4px);
}

/* Line Clamp for Related Posts */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Aspect Ratio for Featured Image */
.aspect-video {
    aspect-ratio: 16 / 9;
}

/* Print Styles */
@media print {

    .share-sidebar,
    nav,
    footer,
    .related-posts-section {
        display: none !important;
    }

    .entry-content {
        max-width: 100% !important;
    }
}

/* Mobile Adjustments for Single Post */
@media (max-width: 1024px) {
    .single .entry-content {
        font-size: 1rem;
    }

    .single .entry-content p:first-of-type {
        font-size: 1.125rem;
    }

    .single .entry-content h2 {
        font-size: 1.5rem;
    }

    .single .entry-content blockquote {
        font-size: 1.125rem;
    }
}

/* ==========================================================================
   Visited Links Styling - Keep Original Colors
   ========================================================================== */

/* All visited links maintain their original color */
a:visited {
    color: inherit;
}