/*
Theme Name: GeneratePress Child - Premium News & Magazine
Theme URI: https://generatepress.com
Description: Premium Editorial & News Magazine Child Theme for GeneratePress. Includes modern card grids, reading time, reading progress bar, related posts, author bio box, ad slots, and ultra-fast SEO performance.
Author: Antigravity AI
Author URI: https://generatepress.com
Template: generatepress
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: generatepress-child
*/

/* ==========================================================================
   1. ROOT VARIABLES & COLOR PALETTE
   ========================================================================== */
:root {
    --gp-primary: #1d4ed8;         /* Vibrant Royal Blue */
    --gp-primary-hover: #1e40af;
    --gp-accent: #e11d48;          /* Editorial Rose / Breaking Red */
    --gp-accent-subtle: #ffe4e6;
    --gp-dark: #0f172a;            /* Slate 900 for Headings */
    --gp-text: #334155;            /* Slate 700 for Body text */
    --gp-muted: #64748b;           /* Slate 500 for Meta/Subtitles */
    --gp-bg-light: #f8fafc;        /* Slate 50 for Page background */
    --gp-card-bg: #ffffff;
    --gp-border: #e2e8f0;
    --gp-radius-sm: 6px;
    --gp-radius-md: 12px;
    --gp-radius-lg: 16px;
    --gp-shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --gp-shadow-md: 0 4px 20px -2px rgba(15, 23, 42, 0.08);
    --gp-shadow-hover: 0 12px 28px -4px rgba(15, 23, 42, 0.12);
    --gp-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Body Adjustments */
body {
    background-color: var(--gp-bg-light);
    color: var(--gp-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   2. READING PROGRESS BAR (TOP OF PAGE)
   ========================================================================== */
#gp-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--gp-primary), #38bdf8, var(--gp-accent));
    z-index: 99999;
    transition: width 0.1s ease-out;
}

/* ==========================================================================
   3. MODERN ARCHIVE & BLOG POST CARDS
   ========================================================================== */
.blog .site-main,
.archive .site-main {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 30px;
}

/* Single Post Card */
.blog article.post,
.archive article.post {
    display: flex;
    flex-direction: column;
    background: var(--gp-card-bg);
    border-radius: var(--gp-radius-md);
    border: 1px solid var(--gp-border);
    box-shadow: var(--gp-shadow-sm);
    overflow: hidden;
    transition: var(--gp-transition);
    margin-bottom: 0 !important;
    padding: 0 !important;
}

.blog article.post:hover,
.archive article.post:hover {
    transform: translateY(-4px);
    box-shadow: var(--gp-shadow-hover);
    border-color: #cbd5e1;
}

/* Card Image / Thumbnail */
.blog .post-image,
.archive .post-image {
    position: relative;
    margin: 0 !important;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background-color: #f1f5f9;
}

.blog .post-image img,
.archive .post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.blog article.post:hover .post-image img,
.archive article.post:hover .post-image img {
    transform: scale(1.04);
}

/* Card Content Area */
.blog .inside-article,
.archive .inside-article {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 24px;
}

/* Category Badge (Pill) */
.gp-category-pill {
    display: inline-block;
    align-self: flex-start;
    background: var(--gp-accent-subtle);
    color: var(--gp-accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 9999px;
    margin-bottom: 12px;
    text-decoration: none;
    transition: var(--gp-transition);
}

.gp-category-pill:hover {
    background: var(--gp-accent);
    color: #ffffff;
}

/* Card Title */
.blog .entry-title,
.archive .entry-title {
    font-size: 1.35rem;
    line-height: 1.35;
    font-weight: 700;
    margin-bottom: 12px;
}

.blog .entry-title a,
.archive .entry-title a {
    color: var(--gp-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog .entry-title a:hover,
.archive .entry-title a:hover {
    color: var(--gp-primary);
}

/* Card Excerpt */
.blog .entry-summary,
.archive .entry-summary {
    color: var(--gp-text);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

/* Card Footer Meta (Author, Date, Reading Time) */
.gp-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--gp-border);
    font-size: 0.825rem;
    color: var(--gp-muted);
}

.gp-card-meta img.avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
}

.gp-card-meta .gp-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.gp-card-meta .gp-reading-badge {
    margin-left: auto;
    font-weight: 600;
    color: var(--gp-primary);
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 4px;
}

/* ==========================================================================
   4. SINGLE POST EDITORIAL STYLING
   ========================================================================== */
.single .inside-article {
    background: var(--gp-card-bg);
    border-radius: var(--gp-radius-md);
    box-shadow: var(--gp-shadow-sm);
    padding: 40px 48px;
    border: 1px solid var(--gp-border);
}

@media (max-width: 768px) {
    .single .inside-article {
        padding: 24px 18px;
    }
}

.single .entry-header {
    margin-bottom: 30px;
}

.single .entry-title {
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    font-weight: 800;
    line-height: 1.25;
    color: var(--gp-dark);
    margin-top: 10px;
    margin-bottom: 18px;
}

/* Single Post Meta Bar */
.gp-single-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-top: 1px solid var(--gp-border);
    border-bottom: 1px solid var(--gp-border);
    font-size: 0.875rem;
    color: var(--gp-muted);
}

.gp-single-meta .gp-author-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
}

.gp-single-meta .gp-meta-name {
    font-weight: 600;
    color: var(--gp-dark);
}

.gp-updated-badge {
    background: #ecfdf5;
    color: #059669;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.775rem;
}

/* Rich Typography for Content */
.single .entry-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #1e293b;
}

.single .entry-content > p:first-of-type {
    font-size: 1.25rem;
    line-height: 1.75;
    color: #0f172a;
    font-weight: 400;
}

.single .entry-content h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gp-dark);
    margin-top: 40px;
    margin-bottom: 18px;
    position: relative;
    padding-left: 14px;
}

.single .entry-content h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    background: var(--gp-primary);
    border-radius: 2px;
}

.single .entry-content h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gp-dark);
    margin-top: 30px;
    margin-bottom: 14px;
}

.single .entry-content blockquote {
    border-left: 4px solid var(--gp-primary);
    background: #f8fafc;
    margin: 30px 0;
    padding: 20px 24px;
    border-radius: 0 var(--gp-radius-sm) var(--gp-radius-sm) 0;
    font-style: italic;
    color: #334155;
    font-size: 1.15rem;
}

/* ==========================================================================
   5. SOCIAL SHARE BAR (LIGHTWEIGHT PURE SVG)
   ========================================================================== */
.gp-social-share-box {
    margin: 35px 0 25px;
    padding: 16px 20px;
    background: #f8fafc;
    border-radius: var(--gp-radius-md);
    border: 1px solid var(--gp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.gp-share-label {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--gp-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gp-share-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.gp-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: #ffffff !important;
    text-decoration: none !important;
    transition: var(--gp-transition);
}

.gp-share-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.gp-share-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.gp-share-whatsapp { background: #25d366; }
.gp-share-x { background: #000000; }
.gp-share-facebook { background: #1877f2; }
.gp-share-linkedin { background: #0a66c2; }
.gp-share-telegram { background: #229ed9; }
.gp-share-copy {
    background: #475569;
    cursor: pointer;
    border: none;
}

/* ==========================================================================
   6. AUTHOR BIO BOX
   ========================================================================== */
.gp-author-bio-box {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 28px;
    margin: 40px 0;
    background: #ffffff;
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius-md);
    box-shadow: var(--gp-shadow-sm);
}

@media (max-width: 600px) {
    .gp-author-bio-box {
        flex-direction: column;
        text-align: center;
    }
}

.gp-author-bio-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e2e8f0;
}

.gp-author-bio-content h4 {
    margin: 0 0 6px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gp-dark);
}

.gp-author-bio-content p {
    margin: 0 0 10px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--gp-text);
}

.gp-author-bio-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gp-primary);
    text-decoration: none;
}

.gp-author-bio-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   7. RELATED POSTS GRID
   ========================================================================== */
.gp-related-posts-section {
    margin: 50px 0 20px;
    padding-top: 30px;
    border-top: 2px solid var(--gp-border);
}

.gp-related-posts-heading {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--gp-dark);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gp-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.gp-related-card {
    background: #ffffff;
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius-md);
    overflow: hidden;
    transition: var(--gp-transition);
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
}

.gp-related-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--gp-shadow-md);
    border-color: #cbd5e1;
}

.gp-related-thumb {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f1f5f9;
}

.gp-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gp-related-body {
    padding: 16px;
}

.gp-related-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gp-dark);
    line-height: 1.4;
    margin: 0 0 8px;
}

.gp-related-card:hover .gp-related-title {
    color: var(--gp-primary);
}

.gp-related-date {
    font-size: 0.775rem;
    color: var(--gp-muted);
}

/* ==========================================================================
   8. ADVERTISEMENT & MONETIZATION SLOTS
   ========================================================================== */
.gp-ad-slot-container {
    margin: 25px auto;
    text-align: center;
    clear: both;
}

.gp-ad-label {
    display: block;
    font-size: 0.675rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin-bottom: 6px;
    font-weight: 600;
}

.gp-ad-wrapper {
    display: inline-block;
    max-width: 100%;
    min-height: 90px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: var(--gp-radius-sm);
    padding: 8px;
}

/* ==========================================================================
   9. SIDEBAR, NEWSLETTER & STICKY ELEMENTS
   ========================================================================== */
.is-right-sidebar .sidebar,
.is-left-sidebar .sidebar {
    padding-left: 20px;
}

.sidebar .widget {
    background: #ffffff;
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius-md);
    padding: 24px;
    margin-bottom: 25px;
    box-shadow: var(--gp-shadow-sm);
}

.sidebar .widget-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--gp-dark);
    position: relative;
    padding-bottom: 12px;
    margin-bottom: 18px;
    border-bottom: 2px solid var(--gp-border);
}

.sidebar .widget-title::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--gp-primary);
}

/* Sticky Sidebar Widget */
.gp-sticky-widget {
    position: sticky;
    top: 25px;
}

/* Newsletter Box Widget */
.gp-newsletter-box {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #ffffff;
    padding: 28px 24px;
    border-radius: var(--gp-radius-md);
    text-align: center;
}

.gp-newsletter-box h3 {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.gp-newsletter-box p {
    color: #94a3b8;
    font-size: 0.875rem;
    margin-bottom: 18px;
    line-height: 1.5;
}

.gp-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gp-newsletter-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--gp-radius-sm);
    border: 1px solid #334155;
    background: #1e293b;
    color: #ffffff;
    font-size: 0.9rem;
    outline: none;
    box-sizing: border-box;
}

.gp-newsletter-input::placeholder {
    color: #64748b;
}

.gp-newsletter-input:focus {
    border-color: var(--gp-primary);
}

.gp-newsletter-submit {
    width: 100%;
    padding: 12px 16px;
    background: var(--gp-primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    border-radius: var(--gp-radius-sm);
    cursor: pointer;
    transition: var(--gp-transition);
}

.gp-newsletter-submit:hover {
    background: var(--gp-primary-hover);
}

/* ==========================================================================
   10. HEADER & NAVIGATION ENHANCEMENTS
   ========================================================================== */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--gp-border);
}

.main-navigation {
    background: #ffffff;
    border-bottom: 1px solid var(--gp-border);
}

.main-navigation .main-nav ul li a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gp-dark);
}

.main-navigation .main-nav ul li a:hover,
.main-navigation .main-nav ul li[class*="current-menu-item"] > a {
    color: var(--gp-primary);
    background-color: transparent;
}

/* Toast Copy Link Notification */
#gp-toast {
    visibility: hidden;
    min-width: 200px;
    background-color: var(--gp-dark);
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 10px 16px;
    position: fixed;
    z-index: 99999;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#gp-toast.show {
    visibility: visible;
    animation: gpFadeInOut 2.5s;
}

@keyframes gpFadeInOut {
    0% { opacity: 0; bottom: 20px; }
    15% { opacity: 1; bottom: 30px; }
    85% { opacity: 1; bottom: 30px; }
    100% { opacity: 0; bottom: 20px; }
}
