/**
 * Custom CSS - Modern UI Enhancements for Prowebtips.com
 * Child Theme for GeneratePress
 */

/* ==========================================================================
   1. Typography & Global Polish
   ========================================================================== */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-size: 17px;
    line-height: 1.7;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.015em;
    margin-top: 1.5em;
    margin-bottom: 0.6em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

/* Smooth Anchor Links */
.entry-content p a,
.entry-content li a {
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    text-decoration-color: rgba(37, 99, 235, 0.4);
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.entry-content p a:hover,
.entry-content li a:hover {
    text-decoration-color: var(--pwt-primary);
}

/* ==========================================================================
   2. Header & Navigation Modernization
   ========================================================================== */
.site-header,
.main-navigation {
    position: relative;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.navigation-branding .site-logo img {
    height: 48px;
    width: auto;
    transition: opacity 0.2s ease;
}

.navigation-branding .site-logo img:hover {
    opacity: 0.9;
}

/* Nav Menu Items */
.main-navigation .main-nav ul li a {
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.01em;
    padding: 0 16px;
    position: relative;
}

/* Enforce Hiding Mobile Bar Items on Desktop (prevents mobile search leaking to desktop) */
.main-navigation .mobile-bar-items {
    display: none !important;
}


/* ==========================================================================
   3. Blog Listing & Article Cards
   ========================================================================== */
.generate-columns-container {
    row-gap: 24px;
}

.generate-columns .inside-article {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding: 0 !important;
    transform: translateY(0);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.generate-columns .inside-article:hover {
    transform: translateY(-4px);
}

/* Card Image Wrapper */
.generate-columns .inside-article .post-image {
    margin: 0 !important;
    overflow: hidden;
    position: relative;
    background-color: var(--pwt-surface-subtle);
    aspect-ratio: 16 / 9;
}

.generate-columns .inside-article .post-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.generate-columns .inside-article .post-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.generate-columns .inside-article:hover .post-image img {
    transform: scale(1.04);
}

/* Card Content Area */
.generate-columns .inside-article .entry-header {
    padding: 20px 22px 10px 22px;
    flex-grow: 1;
}

.generate-columns .inside-article h2.entry-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 10px 0;
    text-align: left;
    padding: 0;
}

.generate-columns .inside-article .entry-meta {
    padding: 0 22px 20px 22px;
    margin-top: auto;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    text-align: left;
}

.generate-columns .inside-article .entry-summary {
    padding: 0 22px 14px 22px;
    font-size: 0.95rem;
    line-height: 1.55;
    margin: 0;
}

/* ==========================================================================
   4. Single Post Enhancements
   ========================================================================== */
.single .inside-article {
    padding: 40px 48px !important;
}

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

.single h1.entry-title {
    font-size: 2.35rem;
    line-height: 1.25;
    margin-bottom: 16px;
}

.single .entry-meta {
    font-size: 0.95rem;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--pwt-border-subtle);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* Author & Metadata Typography / Spacing Refinements */
.entry-meta .posted-on,
.entry-meta .byline {
    display: inline-flex;
    align-items: center;
}

.entry-meta .byline {
    margin-left: 8px;
}

.single .entry-meta .byline,
.generate-columns .inside-article .entry-meta .byline {
    margin-left: 0; /* Handled cleanly by flex container gap */
}

.author-name,
.entry-meta .author-name {
    display: inline-block;
    margin: 0 4px;
    font-weight: 600;
}

.entry-meta .byline a.url.fn.n {
    color: var(--pwt-text);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.entry-meta .byline a.url.fn.n:hover,
.entry-meta .byline a.url.fn.n:focus {
    color: var(--pwt-primary);
    text-decoration: underline;
}

/* Post Content Formatting */
.single .entry-content > p {
    margin-bottom: 1.6em;
}

.single .entry-content h2 {
    position: relative;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--pwt-border-subtle);
}

.single .entry-content h2::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 48px;
    height: 2px;
    background-color: var(--pwt-primary);
    border-radius: 2px;
}

/* Featured Images inside single posts */
.single .featured-image img,
.single .wp-block-image img {
    border-radius: 8px;
    box-shadow: var(--pwt-card-shadow);
}

/* ==========================================================================
   5. Code Blocks & Syntax Polish
   ========================================================================== */
pre.wp-block-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
    font-size: 0.92rem !important;
    line-height: 1.65 !important;
    border-radius: 10px !important;
    overflow-x: auto;
    margin: 28px 0 !important;
}

/* Custom Scrollbar for Code Blocks */
pre.wp-block-code::-webkit-scrollbar {
    height: 8px;
}

pre.wp-block-code::-webkit-scrollbar-track {
    background: transparent;
}

pre.wp-block-code::-webkit-scrollbar-thumb {
    background: var(--pwt-border);
    border-radius: 4px;
}

/* Clipboard Copy Button Tooltip */
.codecopy_tooltip {
    background: var(--pwt-surface-elevated) !important;
    color: var(--pwt-text) !important;
    border: 1px solid var(--pwt-border) !important;
    box-shadow: var(--pwt-card-shadow) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    padding: 4px 10px !important;
    border-radius: 4px !important;
    z-index: 1000;
}

/* ==========================================================================
   6. Blockquotes, Tables, and Lists
   ========================================================================== */
blockquote p {
    margin-bottom: 0 !important;
    font-style: italic;
    font-size: 1.05rem;
}

/* Table Responsive Container */
.wp-block-table {
    margin: 28px 0;
    border-radius: 8px;
    overflow-x: auto;
}

/* Unordered & Ordered Lists */
.entry-content ul,
.entry-content ol {
    margin-left: 1.5em;
    margin-bottom: 1.6em;
}

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

/* ==========================================================================
   7. Social Share & Author Box Modernization
   ========================================================================== */
.social-share {
    padding: 16px 20px;
    margin: 32px 0 !important;
}

.social-share-list {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.social-share-list li {
    margin: 0;
}

.social-share-list a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--pwt-surface);
    border: 1px solid var(--pwt-border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.social-share-list a:hover {
    transform: translateY(-2px);
    box-shadow: var(--pwt-card-shadow);
}

/* Author Box */
.author-box {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    margin: 40px 0 20px 0;
    border-radius: 12px;
}

.author-box .avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0;
    border: 2px solid var(--pwt-border);
}

.author-title {
    margin: 0 0 8px 0;
    font-size: 1.15rem;
}

.author-description {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* ==========================================================================
   8. Comments Section Polish
   ========================================================================== */
.comments-area {
    margin-top: 40px;
    padding: 32px 36px;
}

@media (max-width: 768px) {
    .comments-area {
        padding: 24px 18px;
    }
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-list .comment {
    margin-bottom: 24px;
}

.comment-body {
    margin-bottom: 12px;
}

.comment-author .avatar {
    border-radius: 50%;
    margin-right: 12px;
}

.comment-meta {
    font-size: 0.85rem;
    color: var(--pwt-text-muted);
    margin-bottom: 8px;
}

.comment-content {
    padding: 16px 20px !important;
}

/* ==========================================================================
   9. Footer Layout & Theme Toggle
   ========================================================================== */
footer.site-info {
    padding: 24px 0;
    font-size: 0.9rem;
    border-top: 1px solid var(--pwt-border);
}

.inside-site-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 0 20px;
}

.copyright-bar {
    margin: 0;
    font-size: 0.85rem;
    color: var(--pwt-text-muted);
}

.copyright-bar a {
    color: inherit;
    font-weight: 500;
}

.footer-bar {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: flex-end;
}

.footer-bar .widget {
    margin: 0;
    padding: 0;
}

.footer-bar .textwidget {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.5;
}

.footer-bar a {
    padding: 0 4px;
    color: var(--pwt-text-muted);
    transition: color 0.2s ease;
}

.footer-bar a:hover {
    color: var(--pwt-text);
}

/* Footer Theme Toggle Wrapper & Divider */
.pwt-footer-toggle-wrap {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding-left: 16px;
    border-left: 1px solid var(--pwt-border);
}

.pwt-toggle-footer {
    display: inline-flex;
    align-items: center;
    background-color: var(--pwt-surface-subtle);
    border: 1px solid var(--pwt-border);
    border-radius: 9999px;
    padding: 2px;
    gap: 2px;
}

.pwt-toggle-footer .pwt-toggle-btn {
    width: 28px;
    height: 28px;
}

.pwt-toggle-footer .pwt-toggle-btn svg {
    width: 14px;
    height: 14px;
}

/* ==========================================================================
   10. Responsive Navigation & Mobile Layout (320px - 768px)
   ========================================================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .main-navigation .main-nav ul li a {
        padding: 0 10px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    /* Mobile Bar Items (Search in Header Bar) */
    .main-navigation .mobile-bar-items {
        display: inline-flex !important;
        align-items: center;
        height: 55px;
        position: absolute;
        right: 50px;
        top: 0;
        z-index: 20;
    }

    .main-navigation .mobile-bar-items .search-item a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        padding: 0 6px;
    }

    .main-navigation .menu-toggle {
        line-height: 55px;
        padding: 0 16px;
    }

    /* Mobile Branding Sizing */
    .navigation-branding .site-logo img {
        height: 38px;
        max-width: 160px;
        width: auto;
    }

    /* Mobile Card Layout */
    .generate-columns .inside-article {
        border-radius: 10px;
    }

    .generate-columns .inside-article .entry-header {
        padding: 16px 18px 8px 18px;
    }

    .generate-columns .inside-article h2.entry-title {
        font-size: 1.05rem;
    }

    .generate-columns .inside-article .entry-meta {
        padding: 0 18px 16px 18px;
    }

    /* Mobile Footer Layout */
    .inside-site-info {
        flex-direction: column;
        text-align: center;
        gap: 14px;
        padding: 0 16px;
    }

    .footer-bar {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 12px;
        text-align: center;
    }

    .footer-bar .textwidget {
        justify-content: center;
    }

    .pwt-footer-toggle-wrap {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        margin-top: 2px;
    }

    .copyright-bar {
        order: 10;
        margin-top: 4px;
    }

    /* Prevent Horizontal Overflow */
    html, body {
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    .navigation-branding .site-logo img {
        height: 32px;
        max-width: 135px;
    }

    .main-navigation .mobile-bar-items .search-item a {
        padding: 0 4px;
    }

    .single h1.entry-title {
        font-size: 1.85rem;
    }

    .pwt-toggle-btn {
        width: 26px;
        height: 26px;
    }
}
