/*
Theme Name: GeneratePress Child
Theme URI: https://generatepress.com
Description: Child theme for GeneratePress. Includes custom Previous/Next pagination on single posts, related posts section, and AdSense integration.
Author: Abdo
Author URI: https://generatepress.com
Template: generatepress
Version: 1.3.0
Requires at least: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: generatepress-child
*/

/*-[ Custom single-post pagination ]------------------*/
.single .pagination {
    clear: both;
    overflow: hidden;
    float: left;
    width: 100%;
    text-align: center;
    display: block !important;
    border: 0;
    box-shadow: none;
    -moz-box-shadow: none;
    -webkit-box-shadow: none;
}
.single .pagination ul {
    list-style: none;
    margin: 0;
}
.single .pagination ul li {
    float: left;
}
.single .pagination a,
.single .pagination > .current {
    background: #373737 !important;
    margin: 0 10px 0 0;
    display: inline-block;
    float: left;
    font-size: 18px;
    line-height: 1;
    text-decoration: none;
    color: #fff !important;
    padding: 5px 5px 5px;
    transition: all 0.25s linear;
    -webkit-transition: all 0.25s linear;
    -moz-transition: all 0.25s linear;
    font-weight: 500;
    border: 1px solid #062a54;
    border-radius: 5px;
}
.single .pagination > .current > .currenttext {
    background: transparent !important;
    margin: 0;
}
.single .pagination a:hover { color: #fff; }
.single .pagination-previous-next a {
    border-radius: 5px;
    min-width: 100px;
}
.single .pagination .nav-previous { float: left; }
.single .pagination .nav-next { float: right; }
.single .pagination .nav-previous a:hover,
.single .pagination .nav-next a:hover { background-color: #87bcde; }
.single .pagination ul li:last-child a { margin-right: 0; }
.single .pagination .nav-links { display: inline-block; }
.single .pagination .nav-links a:last-child { margin-right: 0; }
.single .pagination a .currenttext,
.single .pagination a:hover .currenttext {
    padding: 0;
    background: transparent;
    margin-right: 0;
}
.single .pagination a:hover .currenttext { color: #fff; }

/*-[ Archive / home / search pagination ]------------------*/
/*  Targets the standard WP pagination emitted by the_posts_pagination()
    inside GeneratePress's .post-navigation <nav>.                         */
.post-navigation .nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
}
.post-navigation .nav-links .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    color: #373737;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}
.post-navigation .nav-links a.page-numbers:hover {
    background: #373737;
    color: #fff;
    border-color: #373737;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.post-navigation .nav-links .page-numbers.current {
    background: #373737;
    color: #fff;
    border-color: #373737;
    cursor: default;
}
.post-navigation .nav-links .page-numbers.dots {
    background: transparent;
    border-color: transparent;
    color: #999;
    cursor: default;
    padding: 0 4px;
    min-width: auto;
}
.post-navigation .nav-links .page-numbers.dots:hover {
    background: transparent;
    color: #999;
    transform: none;
    box-shadow: none;
}
.post-navigation .nav-links .prev,
.post-navigation .nav-links .next {
    padding: 0 16px;
    font-weight: 500;
}
.post-navigation .nav-links .prev .nav-prev-text,
.post-navigation .nav-links .next .nav-next-text {
    display: inline;
}
@media (max-width: 480px) {
    .post-navigation .nav-links {
        gap: 6px;
    }
    .post-navigation .nav-links .page-numbers {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 14px;
    }
    .post-navigation .nav-links .prev,
    .post-navigation .nav-links .next {
        padding: 0 12px;
    }
}

/*-[ Related posts section ]------------------*/
.related-posts-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f8f8;
    border-radius: 10px;
}

.related-posts-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    justify-content: center;
}

.related-post {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1);
}

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

.related-post a {
    text-decoration: none;
    color: #333;
    display: block;
    text-align: center;
    padding: 10px;
}

.related-post-image {
    width: 100%;
    height: auto;
    border-bottom: 3px solid #ddd;
    border-radius: 8px 8px 0 0;
}

.related-post-title {
    font-size: 16px;
    font-weight: bold;
    margin-top: 10px;
}
