@font-face {
    font-family: "Product Sans";
    src: url("/wp-content/themes/twentytwentytwo/fonts/ProductSans-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: "Product Sans", Arial, Helvetica, sans-serif;
}

#searchBox form.wait::after {
    background: url(/assets/mirror/images/loading.svg) center/contain no-repeat !important;
}

#searchBox ul li a {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Search modal must stay hidden until opened (home-inline.css provides full modal UI) */
#searchModalOverlay.searchModalOverlay:not(.show) {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
}

#searchModalOverlay.searchModalOverlay.show {
    display: block;
    visibility: visible;
    pointer-events: auto;
}

.aboutus-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 40px;
}

.aboutus-left {
    width: 50%;
}

.aboutus-right {
    width: 50%;
    margin-top: 20px;
}

.aboutus-pages-all a {
    display: block;
    margin-bottom: 12px;
}

.legal_footer {
    font-weight: 700;
    font-size: 15px;
    color: #666;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .aboutus-wrapper {
        flex-direction: column;
    }

    .aboutus-left,
    .aboutus-right {
        width: 100%;
    }
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

#header-menu-btn {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html,
body {
    overflow-x: clip;
    max-width: 100%;
}

main {
    overflow-x: clip;
    max-width: 100%;
}

@media (max-width: 768px) {
    #featured_posts {
        width: 100% !important;
        max-width: 100%;
    }

    .fp_box,
    .fp_box a {
        width: 85% !important;
        flex: 0 0 85% !important;
        max-width: 100%;
    }

    .layout-maxbox,
    .layout-detailmaxbox,
    .layout-middlebox,
    .layout-ratmaxbox,
    .layout-banner-main {
        max-width: 100%;
        overflow-x: clip;
    }

    .header-all.layout-minbox {
        width: 100%;
        max-width: 100%;
    }

    label.mobpart {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        flex-shrink: 0;
        margin-left: auto;
        cursor: pointer;
        position: relative;
        z-index: 12;
        -webkit-tap-highlight-color: transparent;
    }

    label.mobpart .icon-search {
        width: 24px;
        height: 24px;
        pointer-events: none;
    }

    .header-tool.header-topics {
        display: none !important;
    }
}

@media (min-width: 601px) and (max-width: 768px) {
    label.mobpart {
        display: flex !important;
        align-items: center;
    }

    .header-tool.header-topics {
        display: none !important;
    }
}

.header-tool-list {
    display: none;
}

.header-tool.is-open .header-tool-list,
.header-tool:hover .header-tool-list,
.header-tool:focus-within .header-tool-list {
    display: block;
}

body.menu-open {
    overflow: hidden;
}

body.menu-open .header-menu {
    width: 100%;
    max-width: 300px;
    height: 100vh;
    z-index: 999999;
    background-color: #fff;
    box-shadow: 0 5px 5px rgba(155, 153, 153, 0.2);
    overflow: auto;
    padding: 14px 24px 30px;
    display: flex;
    flex-direction: column;
}

.layout-page {
    padding: 24px 0 48px;
}

.layout-maxtit {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 24px;
    line-height: 1.3;
    color: #222;
}

/* Static/legal pages — undo app-detail flex reversal from style.css */
.layout-article.static-page,
.static-page.layout-article {
    display: block;
}

.static-page .layout-art {
    display: block;
}

.layout-article.prose,
.layout-art.prose {
    line-height: 1.7;
    color: #333;
    font-size: 16px;
}

.layout-article.prose h2,
.layout-art.prose h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 28px 0 12px;
    color: #222;
}

.layout-article.prose h3,
.layout-art.prose h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 24px 0 10px;
    color: #222;
}

.layout-article.prose p,
.layout-art.prose p {
    margin: 0 0 16px;
}

.layout-article.prose ul,
.layout-art.prose ul,
.layout-article.prose ol,
.layout-art.prose ol {
    margin: 0 0 16px 20px;
    padding: 0;
}

.layout-article.prose li,
.layout-art.prose li {
    margin-bottom: 8px;
}

.layout-article.prose a,
.layout-art.prose a {
    color: #f70000;
    text-decoration: none;
}

.layout-article.prose a:hover,
.layout-art.prose a:hover {
    text-decoration: underline;
}

.layout-article.prose strong,
.layout-art.prose strong {
    font-weight: 700;
    color: #222;
}

.layout-article.prose hr,
.layout-art.prose hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 28px 0;
}

.layout-article.prose table,
.layout-art.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.layout-article.prose th,
.layout-article.prose td,
.layout-art.prose th,
.layout-art.prose td {
    border: 1px solid #eee;
    padding: 8px 12px;
    text-align: left;
}

.static-page {
    max-width: 860px;
}

.ranking {
    list-style: none;
    margin: 0 0 32px;
    padding: 0;
}

.ranking-item {
    margin-bottom: 12px;
}

.ranking-con {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #eee;
}

.ranking-img img,
.ranking-img .wp-post-image {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
}

.ranking-info-tit {
    font-size: 16px;
    margin: 0 0 4px;
    font-weight: 600;
}

.ranking-info-sort {
    font-size: 13px;
    color: #888;
}

.ranking-info-score {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    margin-top: 4px;
}

.category-group {
    margin-bottom: 36px;
}

.search-page-empty {
    margin-bottom: 28px;
}

.search-page-empty ul {
    margin: 8px 0 0 20px;
}

.search-top-apps {
    margin-top: 40px;
}

.error-page {
    text-align: center;
    padding: 40px 0 24px;
}

.error-page-message {
    font-size: 18px;
    margin-bottom: 8px;
}

.error-page-home {
    display: inline-flex;
    margin-top: 20px;
    text-decoration: none;
}

.author-page .author-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
}

.author-page .author-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-page .author-name {
    margin: 0 0 8px;
}

.author-page .author-bio {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

@media (max-width: 600px) {
    .layout-maxtit {
        font-size: 24px;
    }

    .author-page .author-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
}

/* Homepage top-free lists — 3 columns side by side (match apkmodjoy.net) */
.home .home-topfree .topfree {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
    width: 100%;
    height: auto !important;
    margin-left: 0 !important;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.home .home-topfree .topfree-item {
    width: auto !important;
    max-width: none;
    position: static !important;
    list-style: none;
}

@media screen and (min-width: 601px) {
    .home .home-topfree .topfree {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (min-width: 900px) {
    .home .home-topfree .topfree {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Category / archive app grids — 3 columns (match apkmodjoy.net) */
.category-archive section.apps .all-apps,
.layout-page section.apps .all-apps,
.appDetail-similar .all-apps {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
    width: 100%;
    height: auto !important;
    margin-left: 0 !important;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.category-archive section.apps .app-item,
.layout-page section.apps .app-item,
.appDetail-similar .app-item {
    width: auto !important;
    max-width: none;
    position: static !important;
    list-style: none;
}

@media screen and (min-width: 601px) {
    .category-archive section.apps .all-apps,
    .layout-page section.apps .all-apps,
    .appDetail-similar .all-apps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (min-width: 900px) {
    .category-archive section.apps .all-apps,
    .layout-page section.apps .all-apps,
    .appDetail-similar .all-apps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
