/*
Theme Name: AppHub
Theme URI: https://example.com/apphub
Author: Your Name
Description: Mobile-first, SEO-optimized WordPress theme for app & game directories and download sites. Everything is editable from Appearance > Customize, Menus, Widgets and the block editor.
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: apphub
Tags: custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, blog, one-column, two-columns, grid-layout
*/

:root{--ah-primary:#15803d;--ah-link:var(--ah-primary);--ah-accent:#f59e0b;--ah-bg:#f4f6f9;--ah-card:#fff;--ah-text:#111827;--ah-muted:#6b7280;--ah-border:#e5e7eb;--ah-w:1100px;--ah-r:14px;--ah-hh:56px}
[data-theme=dark]{--ah-bg:#0e1116;--ah-card:#171b22;--ah-text:#e8eaed;--ah-muted:#9aa4b2;--ah-border:#2a303a;--ah-link:color-mix(in srgb,var(--ah-primary) 55%,#fff)}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{margin:0;background:var(--ah-bg);color:var(--ah-text);font:16px/1.6 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;-webkit-font-smoothing:antialiased}
body.has-bottom-nav{padding-bottom:62px}
img{max-width:100%;height:auto;display:block}
a{color:var(--ah-link);text-decoration:none}
:focus-visible{outline:2px solid var(--ah-link);outline-offset:2px}
a:hover{text-decoration:underline}
h1,h2,h3,h4{line-height:1.25;margin:0 0 .6em}
h1{font-size:1.6rem}h2{font-size:1.25rem}h3{font-size:1.1rem}
.screen-reader-text{position:absolute!important;clip:rect(1px,1px,1px,1px);width:1px;height:1px;overflow:hidden}
.skip-link:focus{clip:auto;width:auto;height:auto;background:#fff;color:#000;padding:8px 14px;z-index:9999;top:6px;left:6px}
.ah-wrap{width:100%;max-width:var(--ah-w);margin:0 auto;padding:0 14px}
.ah-main{padding:14px 0 28px;min-height:60vh}
button,input,select,textarea{font:inherit}

/* Header */
.ah-header{background:var(--ah-card);border-bottom:1px solid var(--ah-border);z-index:50}
.ah-sticky .ah-header{position:sticky;top:0}
.ah-header__in{display:flex;align-items:center;gap:10px;height:var(--ah-hh)}
.ah-brand{flex:1;min-width:0;font-weight:800;font-size:1.05rem;letter-spacing:.3px}
.ah-brand a{color:var(--ah-text);text-decoration:none}
.ah-brand img{max-height:36px;width:auto}
.ah-nav{display:none}
.ah-nav ul,.ah-drawer ul{list-style:none;margin:0;padding:0}
.ah-actions{display:flex;align-items:center;gap:6px}
.ah-icon-btn{background:none;border:0;color:var(--ah-text);width:40px;height:40px;border-radius:10px;display:grid;place-items:center;cursor:pointer;font-size:20px}
.ah-icon-btn:hover{background:var(--ah-bg)}
.ah-i{display:block}
.ah-burger span,.ah-burger span::before,.ah-burger span::after{display:block;width:20px;height:2px;background:currentColor;position:relative;content:""}
.ah-burger span::before{position:absolute;top:-6px}.ah-burger span::after{position:absolute;top:6px}
.ah-cta{display:none;background:var(--ah-primary);color:#fff;padding:8px 14px;border-radius:999px;font-weight:600;font-size:.9rem}
.ah-cta:hover{text-decoration:none;opacity:.9}
.ah-searchbar{padding:8px 0 12px;border-top:1px solid var(--ah-border)}
.ah-searchform{display:flex;gap:8px}
.ah-searchform input[type=search]{flex:1;min-width:0;padding:11px 14px;border:1px solid var(--ah-border);border-radius:999px;background:var(--ah-bg);color:var(--ah-text)}
.ah-searchform button{background:var(--ah-primary);color:#fff;border:0;border-radius:999px;padding:0 18px;cursor:pointer;font-weight:600}
.ah-drawer{position:fixed;inset:0;z-index:100;display:flex}
.ah-drawer[hidden]{display:none}
.ah-drawer__panel{width:80%;max-width:300px;background:var(--ah-card);padding:16px;overflow:auto;animation:ahslide .2s ease}
.ah-drawer__bg{flex:1;background:rgba(0,0,0,.5)}
.ah-drawer a{display:block;padding:12px 6px;color:var(--ah-text);border-bottom:1px solid var(--ah-border);font-weight:600}
@keyframes ahslide{from{transform:translateX(-100%)}to{transform:none}}

/* Hero slider */
.ah-hero{display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x mandatory;padding:2px 0 8px;-webkit-overflow-scrolling:touch;scrollbar-width:none}
.ah-hero::-webkit-scrollbar{display:none}
.ah-hero a{flex:0 0 86%;scroll-snap-align:center;border-radius:var(--ah-r);overflow:hidden;position:relative;aspect-ratio:16/9;background:var(--ah-border)}
.ah-hero img{width:100%;height:100%;object-fit:cover}
.ah-hero span{position:absolute;left:0;right:0;bottom:0;padding:22px 12px 10px;color:#fff;font-weight:700;background:linear-gradient(transparent,rgba(0,0,0,.75))}

/* Tools + promo */
.ah-tools{display:flex;gap:10px;overflow-x:auto;padding:4px 0 10px;scrollbar-width:none}
.ah-tools::-webkit-scrollbar{display:none}
.ah-tool{flex:0 0 78px;text-align:center;font-size:.78rem;color:var(--ah-text);font-weight:600}
.ah-tool img{width:52px;height:52px;margin:0 auto 4px;border-radius:14px;object-fit:cover;background:var(--ah-card)}
.ah-tool i{display:grid;place-items:center;width:52px;height:52px;margin:0 auto 4px;border-radius:14px;background:var(--ah-card);font-style:normal;font-size:22px;border:1px solid var(--ah-border)}
.ah-promo{display:flex;align-items:center;gap:12px;background:var(--ah-card);border:1px solid var(--ah-border);border-radius:var(--ah-r);padding:12px;margin:6px 0 14px}
.ah-promo img{width:56px;height:56px;border-radius:14px;object-fit:cover}
.ah-promo div{flex:1;min-width:0}.ah-promo strong{display:block}.ah-promo small{color:var(--ah-muted)}

/* Buttons */
.ah-btn{display:inline-block;background:var(--ah-primary);color:#fff!important;border:0;padding:10px 18px;border-radius:999px;font-weight:700;cursor:pointer;text-align:center}
.ah-btn:hover{text-decoration:none;filter:brightness(1.07)}
.ah-btn--big{display:block;width:100%;padding:14px;font-size:1.05rem;border-radius:14px}
.ah-btn--ghost{background:transparent;border:1px solid var(--ah-primary);color:var(--ah-link)!important}

/* Sections & cards */
.ah-sec{margin:0 0 22px}
.ah-sec__head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
.ah-sec__head h2{margin:0;font-size:1.2rem}
.ah-more{font-size:.85rem;font-weight:600}
.ah-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.ah-card{display:block;background:var(--ah-card);border:1px solid var(--ah-border);border-radius:var(--ah-r);overflow:hidden;color:var(--ah-text);transition:transform .15s}
.ah-card:hover{text-decoration:none;transform:translateY(-2px)}
.ah-card__img{display:block;aspect-ratio:1/1;background:var(--ah-border)}
.ah-card__img img{width:100%;height:100%;object-fit:cover}
.ah-card__body{display:block;padding:8px}
.ah-card__title{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:.82rem;line-height:1.3;min-height:2.6em}
.ah-card__meta,.ah-card__mod{display:block;font-size:.7rem;color:var(--ah-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}
.ah-card__mod{color:var(--ah-link);font-weight:600}

/* Chips */
.ah-chips{display:flex;flex-wrap:wrap;gap:8px}
.ah-chip{background:var(--ah-card);border:1px solid var(--ah-border);color:var(--ah-text);padding:6px 12px;border-radius:999px;font-size:.82rem}
.ah-chip:hover{border-color:var(--ah-primary);color:var(--ah-link);text-decoration:none}
.ah-tabs{display:flex;gap:8px;margin:0 0 12px;overflow-x:auto}
.ah-tabs a{background:var(--ah-card);border:1px solid var(--ah-border);padding:6px 14px;border-radius:999px;font-weight:600;font-size:.85rem;color:var(--ah-text);white-space:nowrap}
.ah-tabs a.on{background:var(--ah-primary);border-color:var(--ah-primary);color:#fff}

/* Single */
.ah-crumbs{font-size:.8rem;color:var(--ah-muted);margin:0 0 10px}
.ah-crumbs a{color:var(--ah-muted)}
.ah-box{background:var(--ah-card);border:1px solid var(--ah-border);border-radius:var(--ah-r);padding:16px;margin:0 0 14px}
.ah-app-head{display:flex;gap:14px;align-items:center}
.ah-app-head img{width:92px;height:92px;border-radius:20px;object-fit:cover;flex:none}
.ah-app-head h1{margin:0 0 4px;font-size:1.3rem}
.ah-stars{color:var(--ah-accent);letter-spacing:1px}
.ah-badge{display:inline-block;background:color-mix(in srgb,var(--ah-primary) 14%,transparent);color:var(--ah-link);font-weight:700;font-size:.78rem;padding:3px 10px;border-radius:999px}
.ah-info{width:100%;border-collapse:collapse;font-size:.92rem}
.ah-info th,.ah-info td{text-align:left;padding:9px 4px;border-bottom:1px solid var(--ah-border)}
.ah-info th{color:var(--ah-muted);font-weight:600;width:42%}
.ah-shots{display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x mandatory}
.ah-shots img{height:300px;width:auto;border-radius:12px;scroll-snap-align:start;flex:none}
.ah-content{overflow-wrap:break-word}
.ah-content img{border-radius:10px}
.ah-content table{width:100%;border-collapse:collapse;display:block;overflow-x:auto}
.ah-content th,.ah-content td{border:1px solid var(--ah-border);padding:8px}
.ah-faq details{border-bottom:1px solid var(--ah-border);padding:10px 0}
.ah-faq summary{font-weight:700;cursor:pointer}
.ah-note{font-size:.8rem;color:var(--ah-muted)}
.ah-ad{text-align:center;margin:10px 0;overflow:hidden;min-height:90px}

/* Blog list */
.ah-post{display:flex;gap:12px;background:var(--ah-card);border:1px solid var(--ah-border);border-radius:var(--ah-r);padding:10px;margin-bottom:10px;color:var(--ah-text)}
.ah-post img{width:96px;height:96px;object-fit:cover;border-radius:10px;flex:none}
.ah-post h2{font-size:1rem;margin:0 0 4px}
.ah-post p{margin:0;font-size:.85rem;color:var(--ah-muted)}
.navigation.pagination{margin:18px 0}
.nav-links{display:flex;flex-wrap:wrap;gap:6px;justify-content:center}
.page-numbers{background:var(--ah-card);border:1px solid var(--ah-border);padding:7px 13px;border-radius:10px;color:var(--ah-text)}
.page-numbers.current{background:var(--ah-primary);border-color:var(--ah-primary);color:#fff}

/* Comments */
.comment-list{list-style:none;padding:0}.comment-body{background:var(--ah-card);border:1px solid var(--ah-border);border-radius:12px;padding:12px;margin-bottom:10px}
.comment-form input[type=text],.comment-form input[type=email],.comment-form input[type=url],.comment-form textarea{width:100%;padding:10px;border:1px solid var(--ah-border);border-radius:10px;background:var(--ah-card);color:var(--ah-text)}
.comment-form input[type=submit]{background:var(--ah-primary);color:#fff;border:0;padding:10px 20px;border-radius:999px;cursor:pointer;font-weight:700}

/* Footer */
.ah-footer{background:var(--ah-card);border-top:1px solid var(--ah-border);padding:22px 0 14px;margin-top:10px}
.ah-fcols{display:grid;gap:18px}
.ah-footer ul{list-style:none;padding:0;margin:0}.ah-footer li{padding:3px 0}
.ah-footer .widget-title{font-size:1rem}
.ah-social{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}
.ah-copy{font-size:.8rem;color:var(--ah-muted);text-align:center;border-top:1px solid var(--ah-border);padding-top:12px;margin-top:10px}
.ah-totop{display:grid;place-items:center;position:fixed;right:14px;bottom:76px;width:42px;height:42px;border-radius:50%;background:var(--ah-primary);color:#fff;border:0;font-size:18px;cursor:pointer;opacity:0;pointer-events:none;transition:.2s;z-index:40}
.ah-totop.show{opacity:1;pointer-events:auto}
.ah-bnav{position:fixed;left:0;right:0;bottom:0;background:var(--ah-card);border-top:1px solid var(--ah-border);display:flex;z-index:60;padding-bottom:env(safe-area-inset-bottom)}
.ah-bnav a{flex:1;text-align:center;padding:8px 0;font-size:.7rem;color:var(--ah-muted);font-weight:600}
.ah-bnav a b{display:block;line-height:1.2}
.ah-bnav a b svg{margin:0 auto 2px}
.ah-bnav a:hover{text-decoration:none;color:var(--ah-primary)}

/* v1.1 additions */
.ah-dls{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}
.ah-dls .ah-btn{flex:1 1 140px}
.ah-badge--safe{background:color-mix(in srgb,var(--ah-accent) 18%,transparent);color:var(--ah-text)}
.ah-news{margin:0;padding-inline-start:1.2em}
.ah-report{font-size:.8rem;color:var(--ah-muted);text-decoration:underline}
.ah-cookie{position:fixed;left:10px;right:10px;bottom:72px;z-index:70;background:var(--ah-card);color:var(--ah-text);border:1px solid var(--ah-border);border-radius:var(--ah-r);padding:12px;display:flex;gap:10px;align-items:center;font-size:.85rem;box-shadow:0 6px 24px rgba(0,0,0,.18)}
.ah-cookie[hidden]{display:none}
.ah-cookie span{flex:1}
.ah-cookie .ah-btn{padding:8px 16px}

@media(min-width:768px){
 .ah-cookie{bottom:16px;max-width:560px;margin:0 auto}
 h1{font-size:2rem}
 body.has-bottom-nav{padding-bottom:0}.ah-bnav{display:none}.ah-totop{bottom:20px}
 .ah-burger{display:none}
 .ah-nav{display:block;flex:1}
 .ah-nav ul{display:flex;gap:4px}
 .ah-nav a{display:block;padding:8px 12px;color:var(--ah-text);font-weight:600;border-radius:8px}
 .ah-nav a:hover{background:var(--ah-bg);text-decoration:none}
 .ah-brand{flex:none}
 .ah-cta{display:inline-block}
 .ah-grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:14px}
 .ah-card__title{font-size:.9rem}
 .ah-hero a{flex-basis:48%}
 .ah-fcols{grid-template-columns:repeat(3,1fr)}
}
@media(min-width:1024px){.ah-hero a{flex-basis:32%}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

.ah-dlpage{position:fixed;inset:0;z-index:200;background:rgba(0,0,0,.82);display:flex;align-items:center;justify-content:center;padding:16px}
.ah-dlbox{background:var(--ah-card);color:var(--ah-text);border-radius:var(--ah-r);padding:28px 22px;max-width:420px;width:100%;text-align:center;box-shadow:0 10px 40px rgba(0,0,0,.4)}
.ah-dlbox h2{margin:0 0 14px;font-size:1.15rem}
.ah-dlnum{font-size:3rem;font-weight:800;color:var(--ah-primary);line-height:1}
.ah-dlbar{height:8px;background:rgba(128,128,128,.25);border-radius:99px;margin:16px 0;overflow:hidden}
.ah-dlbar i{display:block;height:100%;width:0;background:var(--ah-primary);transition:width 1s linear}
.ah-dlmsg{margin:0;font-size:.85rem;opacity:.85}
