/*
 * Theme Name:   GeneratePress Child with Bootstrap 4
 * Theme URI:    https://yoursite.com/generatepress-child/
 * Description:  GeneratePress Child Theme tích hợp Bootstrap 4
 * Author:       Your Name
 * Author URI:   https://yoursite.com
 * Template:     generatepress
 * Version:      1.0.0
 * License:      GNU General Public License v2 or later
 * License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:  generatepress-child
 */

/* ================================================
   BOOTSTRAP 4 INTEGRATION & OVERRIDE
   ================================================ */

/* Reset một số xung đột giữa Bootstrap và GeneratePress */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ================================================
   TYPOGRAPHY
   ================================================ */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #343a40;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    color: #212529;
}

a {
    color: #007bff;
    transition: color 0.2s ease;
}

a:hover {
    color: #0056b3;
    text-decoration: none;
}

/* ================================================
   LAYOUT - SỬ DỤNG BOOTSTRAP CONTAINER
   ================================================ */

.site-main {
    padding: 2rem 0;
}

/* GeneratePress site-container override để dùng Bootstrap container */
.site-content .inside-site-inner,
.site-header .inside-header {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ================================================
   HEADER
   ================================================ */

.site-header {
    background-color: #ffffff;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.inside-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    padding-bottom: 1rem;
    flex-wrap: wrap;
}

/* Site Logo / Title */
.site-branding {
    display: flex;
    align-items: center;
}

.site-title a {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    text-decoration: none;
}

.site-title a:hover {
    color: #007bff;
}

.site-description {
    font-size: 0.875rem;
    color: #6c757d;
    margin: 0;
}

/* ================================================
   NAVIGATION - BOOTSTRAP NAVBAR STYLE
   ================================================ */

.main-navigation {
    background: transparent;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.main-navigation ul li {
    position: relative;
}

.main-navigation ul li a {
    display: block;
    padding: 0.5rem 1rem;
    color: #495057;
    font-weight: 500;
    text-decoration: none;
    border-radius: 0.25rem;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.main-navigation ul li a:hover,
.main-navigation ul li.current-menu-item > a {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.08);
}

/* Dropdown menu */
.main-navigation ul ul {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 200px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    padding: 0.5rem 0;
}

.main-navigation ul li:hover > ul {
    display: flex;
}

.main-navigation ul ul li a {
    padding: 0.4rem 1.25rem;
    white-space: nowrap;
    border-radius: 0;
}

/* Mobile toggle button */
.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
    color: #495057;
    font-size: 1.25rem;
    line-height: 1;
}

.menu-toggle:hover {
    background: #f8f9fa;
}

/* ================================================
   BOOTSTRAP CARD - POSTS
   ================================================ */

.post,
.page {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

.post:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-header {
    margin-bottom: 1.5rem;
}

.entry-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.entry-title a {
    color: #212529;
    text-decoration: none;
}

.entry-title a:hover {
    color: #007bff;
}

/* Post meta */
.entry-meta {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.entry-meta a {
    color: #6c757d;
}

.entry-meta a:hover {
    color: #007bff;
}

/* Post thumbnail */
.post-image {
    margin-bottom: 1.5rem;
    border-radius: 0.375rem;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.post:hover .post-image img {
    transform: scale(1.02);
}

/* ================================================
   BADGE - CATEGORIES / TAGS
   ================================================ */

.cat-links a,
.tags-links a {
    display: inline-block;
    padding: 0.2em 0.6em;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.25rem;
    text-decoration: none;
    background-color: #e9ecef;
    color: #495057;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.cat-links a:hover,
.tags-links a:hover {
    background-color: #007bff;
    color: #ffffff;
}

/* ================================================
   READ MORE BUTTON
   ================================================ */

.read-more a,
.more-link {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #007bff;
    background: transparent;
    border: 1px solid #007bff;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.read-more a:hover,
.more-link:hover {
    background-color: #007bff;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.35);
}

/* ================================================
   SIDEBAR WIDGETS - BOOTSTRAP CARD STYLE
   ================================================ */

.widget {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.widget-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #495057;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

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

.widget ul li {
    padding: 0.35rem 0;
    border-bottom: 1px solid #f1f3f5;
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    color: #495057;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget ul li a:hover {
    color: #007bff;
}

/* ================================================
   FORMS - BOOTSTRAP STYLE
   ================================================ */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
textarea,
select {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    margin-bottom: 1rem;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

input[type="submit"],
button[type="submit"],
.button,
.wp-block-button__link {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    color: #ffffff;
    background-color: #007bff;
    border: 1px solid #007bff;
    border-radius: 0.375rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

input[type="submit"]:hover,
button[type="submit"]:hover,
.button:hover {
    background-color: #0069d9;
    border-color: #0062cc;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.35);
}

/* ================================================
   COMMENTS
   ================================================ */

#comments {
    margin-top: 2rem;
}

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

.comment-list .comment {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.comment-author .fn {
    font-weight: 600;
    color: #212529;
}

.comment-metadata {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
}

.reply a {
    font-size: 0.875rem;
    color: #007bff;
    border: 1px solid #007bff;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    text-decoration: none;
}

.reply a:hover {
    background: #007bff;
    color: #fff;
}

/* ================================================
   PAGINATION - BOOTSTRAP STYLE
   ================================================ */

.pagination,
.page-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: center;
    margin: 2rem 0;
    list-style: none;
    padding: 0;
}

.page-numbers a,
.page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    color: #007bff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.page-numbers a:hover {
    background-color: #007bff;
    border-color: #007bff;
    color: #ffffff;
}

.page-numbers.current {
    background-color: #007bff;
    border-color: #007bff;
    color: #ffffff;
}

/* ================================================
   FOOTER
   ================================================ */

.site-footer {
    background-color: #343a40;
    color: #adb5bd;
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}

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

.footer-widgets .widget {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.footer-widgets .widget-title {
    color: #ffffff;
    border-bottom-color: #007bff;
}

.footer-widgets .widget a {
    color: #adb5bd;
}

.footer-widgets .widget a:hover {
    color: #ffffff;
}

.site-info {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #495057;
    font-size: 0.875rem;
}

.site-info a {
    color: #007bff;
}

/* ================================================
   UTILITIES - BOOTSTRAP KẾT HỢP
   ================================================ */

/* Alert boxes */
.alert {
    padding: 1rem 1.25rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* ================================================
   RESPONSIVE - MOBILE FIRST
   ================================================ */

@media (max-width: 991.98px) {
    .menu-toggle {
        display: block;
    }

    .main-navigation ul {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 0.5rem 0;
    }

    .main-navigation.toggled ul {
        display: flex;
    }

    .main-navigation ul li a {
        padding: 0.6rem 1rem;
    }

    .main-navigation ul ul {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 1rem;
        background: #f8f9fa;
    }

    .inside-header {
        flex-wrap: wrap;
    }
}

@media (max-width: 767.98px) {
    .site-content .inside-site-inner,
    .site-header .inside-header {
        padding: 0 12px;
    }

    .post,
    .page {
        padding: 1.25rem;
    }

    .entry-title {
        font-size: 1.4rem;
    }

    .footer-widgets {
        grid-template-columns: 1fr;
    }
}

/* ================================================
   PRINT
   ================================================ */

@media print {
    .site-header,
    .site-footer,
    .main-navigation,
    .sidebar,
    .widget-area {
        display: none;
    }

    body {
        font-size: 12pt;
        color: #000;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}
