/*
Theme Name: How Many Bags Fit v5
Theme URI: https://how-many-bags-fit.com/theme
Description: Conversion-focused theme for How Many Bags Fit — mobile-first, trip-planner centred.
Author: https://how-many-bags-fit.com webmaster
Author URI: https://how-many-bags-fit.com
Version: 5.1
Tags: responsive, white, bootstrap
License: GNU General Public License v2 or later
License URI: https://creativecommons.org/licenses/by-sa/3.0/
Text Domain: howmanybagsfitv5
*/

/* ===========================
   1. CSS Custom Properties
   =========================== */
:root {
    --hmbf-primary:    #0d6efd;
    --hmbf-warning:    #ffc107;
    --hmbf-success:    #198754;
    --hmbf-bg-page:    #f8f7f5;
    --hmbf-radius:     8px;
    --hmbf-font:       'Inter', system-ui, -apple-system, sans-serif;
}

/* ===========================
   2. Base
   =========================== */
body {
    background-color: var(--hmbf-bg-page);
    font-family: var(--hmbf-font);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

a {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* Lazy loading — avoid layout shift */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity .3s ease;
}
img[loading="lazy"].loaded,
img[loading="lazy"]:not([src]) {
    opacity: 1;
}

/* ===========================
   3. Logo & Brand
   =========================== */
.logo {
    border-radius: 50%;
    max-width: 100px;
}

#logo {
    max-width: 180px;
    height: auto;
}

/* ===========================
   4. Top Bar
   =========================== */
.hmbf-header {
    position: sticky;
    top: 0;
    z-index: 1030;
}

.hmbf-topbar {
    background: #1a1a2e;
    color: #fff;
    font-size: .8rem;
    padding: 6px 0;
}

.hmbf-topbar a {
    color: #fff;
    text-decoration: underline;
}

.hmbf-topbar-msg,
.hmbf-topbar-login {
    display: block;
}

@media (max-width: 575px) {
    .hmbf-topbar .d-flex {
        flex-direction: column;
        gap: 2px;
    }
    .hmbf-topbar-login {
        display: none;
    }
}

/* ===========================
   5. Navigation
   =========================== */
#mainNav {
    border-bottom: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

#mainNav .nav-link {
    font-size: .95rem;
    color: #333;
    padding: .5rem .75rem;
    border-radius: var(--hmbf-radius);
    text-decoration: none;
    transition: background .15s, color .15s;
}

#mainNav .nav-link:hover,
#mainNav .nav-link.active {
    background: #f0f4ff;
    color: var(--hmbf-primary);
}

/* Tap targets ≥ 44px on mobile */
@media (max-width: 767px) {
    #mainNav .nav-link {
        padding: .65rem 1rem;
        font-size: 1rem;
    }
    #mainNav .btn {
        padding: .6rem 1.2rem;
        font-size: 1rem;
        width: 100%;
    }
    #mainNav .d-flex.gap-2 {
        flex-direction: column;
    }
    .navbar-collapse {
        padding-bottom: 1rem;
    }
}

/* ===========================
   6. Hero / Homepage
   =========================== */
.hmbf-hero {
    background: linear-gradient(135deg, #f0f4ff 0%, #fafafa 100%);
    border-bottom: 1px solid #e8ecf4;
}

.hmbf-steps .hmbf-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--hmbf-primary);
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    margin: 0 auto;
}

.hmbf-icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===========================
   7. Stat blocks
   =========================== */
.stats h6 {
    font-size: 1.4em;
    font-weight: 700;
}

.stats p {
    font-size: 1em;
}

.stats {
    margin-top: 30px;
    padding: 10px;
}

/* ===========================
   8. Blog / Articles
   =========================== */
.blog-area {
    font-size: 1.1em;
}

.blog-area h2,
.blog-area .h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 40px;
}

.blog-area h3,
.blog-area .h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 32px;
}

.blog-area h4,
.blog-area .h4 {
    font-size: 1rem;
}

.wp-block-quote {
    text-align: center;
    margin: 36px;
    padding: 20px;
    font-size: 1.2rem;
    color: #333;
    border-left: 4px solid #333;
    border-top-left-radius: 24px;
    border-bottom-left-radius: 24px;
    border-right: 4px solid #333;
    border-top-right-radius: 24px;
    border-bottom-right-radius: 24px;
}

@media (max-width: 767px) {
    .blog-area {
        font-size: 1rem;
    }
    .wp-block-quote {
        margin: 20px 0;
        font-size: 1rem;
    }
}

/* ===========================
   9. Calculator Widgets
   =========================== */
.calc_groups,
.calc_group {
    background-color: #3763f4;
    box-shadow: 0 4px 8px rgba(0,0,0,.2), 0 6px 20px rgba(0,0,0,.19);
}

.calc_groups .text-success,
.calc_groups .text-danger,
.calc_group .text-success,
.calc_group .text-danger {
    color: #fff !important;
}

.calc_groups .border,
.calc_group .border {
    background: #f6f6f6;
}

.calc_group-text {
    padding: 10px 30px;
    margin-top: 20px;
    color: #fff;
}

.cal_style {
    background-color: #fff;
    padding: 36px;
    border-radius: 16px;
    margin-top: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,.2), 0 6px 20px rgba(0,0,0,.19);
}

.cal_style_warning {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    border: 5px solid red;
    margin-top: 10px;
}

@media (max-width: 575px) {
    .cal_style {
        padding: 20px;
        border-radius: 12px;
    }
}

/* ===========================
   10. Sidebar
   =========================== */
.sidebar li {
    border-bottom: 1px dashed #ccc;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.sidebar h4 {
    font-size: 1.3rem;
    margin: 0 0 16px;
    font-weight: 600;
}

.sidebar li p {
    font-size: .8rem;
}

.sidebar li p a {
    display: inline;
    font-size: 1.1em;
}

.sidebar .thumbnail_size {
    width: 60px;
    border: 4px solid #f0f0f0;
    border-radius: 50%;
    float: left;
    margin-right: 8px;
}

.sidebar .latest_posts,
.sidebar .latest_posts li {
    list-style: none;
    margin-left: 0;
    padding-left: 0;
}

/* ===========================
   11. Car Model Cards (by-make page)
   =========================== */
.car-model-card {
    transition: transform .15s, box-shadow .15s;
}

.car-model-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,.12) !important;
}

/* ===========================
   12. Compare page — mobile cards
   =========================== */
@media (max-width: 575px) {
    .compare-cards .col-sm-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ===========================
   13. Comparison table (legacy)
   =========================== */
.table-responsive {
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 100%;
}

/* ===========================
   14. Sticky sidebar nav
   =========================== */
.sticky-top {
    top: 70px !important; /* clear fixed header */
}

/* ===========================
   15. Fit-check CTA widget
   =========================== */
#fit-check {
    scroll-margin-top: 80px;
}

/* ===========================
   16. Pagination
   =========================== */
.page-numbers {
    position: relative;
    display: block;
    padding: var(--bs-pagination-padding-y) var(--bs-pagination-padding-x);
    font-size: var(--bs-pagination-font-size);
    color: var(--bs-pagination-color);
    text-decoration: none;
    background-color: var(--bs-pagination-bg);
    border: var(--bs-pagination-border-width) solid var(--bs-pagination-border-color);
    transition: color .15s, background-color .15s, border-color .15s, box-shadow .15s;
}

/* ===========================
   17. Footer
   =========================== */
footer.bg-primary-gradient {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #ccc;
}

footer a {
    color: #ccc;
    text-decoration: none;
}

footer a:hover {
    color: #fff;
    text-decoration: underline;
}

footer .item h3 {
    color: #fff;
}

/* ===========================
   18. Breadcrumb
   =========================== */
.breadcrumb-item a {
    text-decoration: none;
    color: var(--hmbf-primary);
}

/* ===========================
   19. Mobile global fixes
   =========================== */
@media (max-width: 767px) {
    section {
        padding-left: 0;
        padding-right: 0;
    }

    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.2rem; }

    .display-5 { font-size: 1.7rem; }
    .display-6 { font-size: 1.4rem; }
    .lead      { font-size: 1rem; }

    .btn-lg {
        font-size: 1rem;
        padding: .65rem 1.2rem;
    }

    /* Prevent horizontal overflow site-wide */
    body, html {
        overflow-x: hidden;
    }

    .table-responsive {
        font-size: .82rem;
    }
}

/* ===========================
   20. Misc utilities
   =========================== */
.letter-spacing-1 {
    letter-spacing: .06em;
}

.bg-success-light {
    background-color: #d1e7dd;
}

.bg-primary-subtle {
    background-color: #e0ecff;
}

.bg-success-subtle {
    background-color: #d1fae5;
}

.bg-warning-subtle {
    background-color: #fff3cd;
}

.fit-cover {
    object-fit: cover;
}

.fs-7 {
    font-size: .8rem;
}

/* ===========================
   21. WP Roadmap plugin
   =========================== */
.wp-roadmap .container {
    max-width: 100% !important;
}
