/* ============================================
   BiyeJachai - Mobile & Responsive CSS
   Version: 2.0
   ============================================ */

/* ============================================
   TABLET - max 1024px
   ============================================ */
@media (max-width: 1024px) {
    .container {
        padding: 0 18px;
    }

    /* Hero */
    .hero {
        padding: 55px 0 80px;
    }

    .hero-content {
        gap: 30px;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .hero-image img {
        height: 340px;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    /* Search */
    .search-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .btn-search-submit {
        grid-column: span 3;
        width: 100%;
    }

    /* Profile Grid */
    .profile-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Footer */
    .footer-main {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

/* ============================================
   MOBILE - max 768px
   ============================================ */
@media (max-width: 768px) {
    /* ---------- Typography ---------- */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    /* ---------- Container ---------- */
    .container {
        padding: 0 16px;
    }

    /* ---------- Topbar ---------- */
    .bjc-topbar {
        font-size: 12px;
        padding: 6px 0;
    }

    .topbar-inner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .topbar-left,
    .topbar-right {
        gap: 12px;
        justify-content: center;
    }

    .topbar-item span:not(.topbar-icon) {
        display: none;
    }

    .topbar-item .topbar-icon {
        font-size: 16px;
    }

    /* ---------- Header ---------- */
    .site-header {
        padding: 12px 0;
    }

    body.admin-bar .site-header.is-sticky {
        top: 46px;
    }

    .navbar-inner {
        gap: 12px;
    }

    /* Hide desktop nav */
    .main-navigation {
        display: none;
    }

    /* Header actions - hide some on mobile */
    .header-actions .btn-outline {
        display: none;
    }

    .header-actions .btn {
        padding: 8px 14px;
        font-size: 13px;
        min-height: 40px;
    }

    .show-mobile { display: inline; }
    .hide-mobile { display: none; }

    /* Show hamburger */
    .mobile-menu-toggle {
        display: inline-flex;
    }

    /* Logo */
    .site-logo {
        font-size: 18px;
    }

    .site-logo .logo-icon {
        font-size: 22px;
    }

    .site-description {
        display: none;
    }

    .custom-logo {
        max-width: 150px;
    }

    /* ---------- Mobile Drawer ---------- */
    .mobile-drawer {
        width: 320px;
        max-width: 88vw;
    }

    /* ---------- Hero ---------- */
    .hero {
        padding: 45px 0 75px;
        text-align: center;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .hero-text h1 {
        font-size: 1.75rem;
        line-height: 1.25;
    }

    .hero-text h1 .highlight {
        display: inline;
        margin-left: 6px;
    }

    .hero-text p {
        font-size: 0.95rem;
        margin-bottom: 24px;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .hero-buttons .btn {
        width: 100%;
        padding: 14px 24px;
    }

    .hero-image {
        order: -1;
        margin-bottom: 10px;
    }

    .hero-image img {
        height: 240px;
        max-width: 100%;
        margin: 0 auto;
    }

    /* ---------- Stats ---------- */
    .stats {
        margin-top: -50px;
        padding-bottom: 15px;
    }

    .stats-inner {
        padding: 20px 12px;
        border-radius: 16px;
        margin: 0 8px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-item {
        padding: 12px 8px;
    }

    .stat-value {
        font-size: 1.375rem;
    }

    .stat-label {
        font-size: 12px;
    }

    /* ---------- Search ---------- */
    .search-section {
        padding: 40px 0;
    }

    .search-box {
        padding: 22px 18px;
        border-radius: 16px;
    }

    .search-box h2 {
        font-size: 1.2rem;
        margin-bottom: 18px;
    }

    .keyword-input {
        padding: 14px 44px;
        font-size: 15px;
    }

    .keyword-input-wrapper .search-icon {
        left: 14px;
        font-size: 16px;
    }

    .clear-btn {
        right: 10px;
        width: 26px;
        height: 26px;
    }

    .search-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .btn-search-submit {
        grid-column: span 1;
        width: 100%;
        height: 48px;
    }

    .quick-tags {
        gap: 6px;
    }

    .quick-tag {
        padding: 7px 12px;
        font-size: 12px;
        min-height: 34px;
    }

    /* ---------- Sections ---------- */
    .section {
        padding: 40px 0;
    }

    .section-title {
        margin-bottom: 28px;
    }

    .section-title h2 {
        font-size: 1.5rem;
    }

    .section-title p {
        font-size: 0.9rem;
    }

    /* ---------- Profile Grid ---------- */
    .profile-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .profile-card-image-wrapper {
        height: 260px;
    }

    .profile-card-body {
        padding: 18px;
    }

    /* ---------- Live Results ---------- */
    .live-results {
        max-height: 320px;
    }

    .live-result-item {
        padding: 10px 12px;
    }

    .live-result-thumb {
        width: 42px;
        height: 42px;
    }

    .live-result-title {
        font-size: 13px;
    }

    .live-result-meta {
        font-size: 11px;
    }

    /* ---------- Footer ---------- */
    .site-footer {
        padding: 40px 0 0;
        margin-top: 40px;
    }

    .footer-main {
        grid-template-columns: 1fr;
        gap: 30px;
        padding-bottom: 30px;
        text-align: center;
    }

    .footer-col-about {
        text-align: center;
    }

    .footer-logo {
        justify-content: center;
    }

    .footer-socials {
        justify-content: center;
    }

    .footer-contact li {
        justify-content: center;
        text-align: left;
    }

    .footer-title {
        font-size: 1rem;
        margin-bottom: 14px;
    }

    /* ---------- Scroll to Top ---------- */
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    /* ---------- Buttons ---------- */
    .btn {
        min-height: 44px;
        padding: 12px 20px;
    }

    /* ---------- Touch feedback ---------- */
    .btn:active,
    .quick-tag:active,
    .profile-card:active {
        transform: scale(0.98);
    }
}

/* ============================================
   SMALL MOBILE - max 480px
   ============================================ */
@media (max-width: 480px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }

    .container {
        padding: 0 14px;
    }

    /* Hero */
    .hero {
        padding: 35px 0 65px;
    }

    .hero-text h1 {
        font-size: 1.5rem;
    }

    .hero-image img {
        height: 200px;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 11px;
    }

    /* Search */
    .search-box {
        padding: 18px 14px;
    }

    .keyword-input {
        font-size: 14px;
        padding: 12px 40px;
    }

    .section-title h2 {
        font-size: 1.25rem;
    }

    .quick-tags {
        justify-content: center;
    }

    /* Header */
    .header-actions .btn {
        padding: 7px 12px;
        font-size: 12px;
    }

    .site-logo {
        font-size: 16px;
    }

    .site-logo .logo-icon {
        font-size: 20px;
    }

    /* Drawer */
    .mobile-drawer {
        width: 300px;
    }

    /* Footer */
    .footer-logo {
        font-size: 1.25rem;
    }

    /* Scroll to top */
    .scroll-to-top {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
}

/* ============================================
   LANDSCAPE MOBILE
   ============================================ */
@media (max-width: 900px) and (orientation: landscape) {
    .hero {
        padding: 40px 0 60px;
    }

    .hero-image {
        display: none;
    }

    .mobile-drawer {
        max-height: 100vh;
    }
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */
@media (hover: none) {
    .profile-card:hover {
        transform: none;
    }

    .btn-primary:hover {
        transform: none;
    }

    .stat-item:hover {
        transform: none;
    }

    /* Increase tap targets */
    .main-navigation a,
    .mobile-menu a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* ============================================
   RETINA DISPLAYS
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-image img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
    .site-header,
    .site-footer,
    .mobile-drawer,
    .mobile-drawer-overlay,
    .scroll-to-top,
    .bjc-topbar {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
}