/*
Theme Name: APK Theme Sohail
Theme URI: https://github.com/apk-theme-sohail
Author: APK Theme
Author URI: https://github.com
Description: WordPress theme for APK/MOD app listings. Normalize.css + custom CSS, clone of templates-sample design. Includes APK custom fields (metabox) for app name, publisher, size, version, MOD info, download URL, and more.
Version: 1.0.0
Requires at least: 5.9
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: apk-theme-sohail
Tags: custom-logo, custom-menu, featured-images, footer-widgets, full-width-template, sticky-post, theme-options, threaded-comments, translation-ready, block-styles, wide-blocks, blog, entertainment, one-column, two-columns, right-sidebar
*/

/* ==========================================================================
   Base (works with Normalize.css)
   ========================================================================== */

body {
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	background-color: #f3f4f6;
	color: #212529;
	line-height: 1.5;
}

a {
	color: inherit;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

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

/* ==========================================================================
   Layout
   ========================================================================== */

#page {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.site-content {
	flex: 1 1 auto;
}

.container {
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 1rem;
	padding-right: 1rem;
}

.content-area {
	flex: 1 1 auto;
}

/* ==========================================================================
   Header (templates-sample: .site-header, .bg-primary, .fixed-top)
   ========================================================================== */

.site-header {
	background-color: var(--primary, #7CBF3A);
	color: #fff;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.header-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
}

.site-logo {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
	flex-shrink: 0;
	margin-right: 1rem;
}

.site-logo a {
	color: #fff;
}

.site-logo a:hover {
	opacity: 0.9;
	text-decoration: none;
}

.site-logo-img {
	display: block;
	max-height: 2.5rem;
	width: auto;
	height: auto;
	object-fit: contain;
	vertical-align: middle;
}

/* Search – desktop: in header bar; mobile: hidden in header, shown in nav drawer */
.header-search {
	order: 2;
	width: 100%;
	max-width: 18rem;
}

@media (max-width: 1023px) {
	.header-search {
		display: none;
	}
}

.form-search {
	display: flex;
}

.form-search input {
	flex: 1;
	min-width: 0;
	padding: 0.5rem 0.75rem;
	border: 0;
	border-radius: 0.25rem 0 0 0.25rem;
	color: #111;
}

.form-search button {
	padding: 0.5rem 1rem;
	background: #fff;
	color: var(--primary, #7CBF3A);
	border: 0;
	border-radius: 0 0.25rem 0.25rem 0;
	cursor: pointer;
}

.form-search button:hover {
	background: #f3f4f6;
}

/* Nav desktop */
.site-nav {
	display: none;
	margin-left: auto;
}

.site-nav .menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 1rem 1.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-nav .menu a {
	color: #fff;
}

.site-nav .menu a,
.nav-drawer .menu a,
.nav-link {
	color: #fff;
}

.site-nav .menu a:hover,
.nav-drawer .menu a:hover,
.nav-link:hover {
	opacity: 0.9;
	text-decoration: none;
}

.post-card-icon-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.5rem;
	color: #9ca3af;
}

/* Mobile menu toggler – always visible and clickable on mobile */
.nav-toggler {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0.5rem;
	background: transparent;
	border: 0;
	border-radius: 0.25rem;
	color: #fff;
	cursor: pointer;
	position: relative;
	z-index: 1050;
	flex-shrink: 0;
	-webkit-tap-highlight-color: transparent;
}

.nav-toggler:hover,
.nav-toggler:focus {
	background: rgba(255, 255, 255, 0.15);
	outline: 0;
}

.nav-toggler .w-6.h-6 {
	width: 1.5rem;
	height: 1.5rem;
	pointer-events: none;
}

.nav-closer {
	display: none;
	margin-left: auto;
	padding: 0.25rem 0.5rem;
	background: transparent;
	border: 0;
	color: #fff;
	cursor: pointer;
}

@media (min-width: 1024px) {
	.nav-toggler { display: none; }
	.site-nav { display: flex; }
	.header-search {
		display: block;
		order: 3;
		width: 18rem;
	}
}

/* Nav drawer (mobile) – use visibility so transform can transition smoothly */
.nav-drawer {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: 16rem;
	max-width: 100%;
	background: var(--primary, #7CBF3A);
	color: #fff;
	z-index: 1040;
	padding: 4rem 1rem 1rem;
	transform: translateX(-100%);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	overflow-y: auto;
	pointer-events: none;
	visibility: hidden;
}

.nav-drawer.is-open {
	transform: translateX(0);
	pointer-events: auto;
	visibility: visible;
}

/* On mobile: keep drawer in flow so transform animates; override .site-nav display:none */
@media (max-width: 1023px) {
	.nav-drawer {
		display: block;
		visibility: hidden;
	}
	.nav-drawer.is-open {
		display: block;
		visibility: visible;
	}
}

.nav-drawer.is-open .nav-closer {
	display: block;
}

/* Search inside mobile nav drawer */
.nav-drawer-search {
	display: block;
	margin-bottom: 1rem;
	width: 100%;
}

.nav-drawer-search .form-search {
	width: 100%;
}

.nav-drawer-search .form-search input {
	background: rgba(255, 255, 255, 0.95);
	color: #111;
}

.nav-drawer-search .form-search button {
	background: #fff;
	color: var(--primary, #7CBF3A);
}

@media (min-width: 1024px) {
	.nav-drawer-search {
		display: none;
	}
}

.nav-drawer .menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.nav-drawer .menu a {
	color: #fff;
}

.nav-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.5);
	z-index: 1030;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	pointer-events: none;
}

.nav-backdrop.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* When menu is open, header (and drawer) must sit above backdrop so links are clickable */
body.nav-is-open .site-header {
	z-index: 1045;
}

@media (min-width: 1024px) {
	.nav-drawer {
		position: relative;
		width: auto;
		max-width: none;
		padding: 0;
		transform: none;
		background: transparent;
		pointer-events: auto;
		visibility: visible;
		transition: none;
	}
	.nav-drawer .menu { flex-direction: row; }
}

/* Main content offset below fixed header */
.site-content {
	padding-top: 3.5rem;
}

@media (max-width: 1023px) {
	.site-content .container {
		margin-top: 1rem;
	}
}

@media (min-width: 1024px) {
	.site-content { padding-top: 3.5rem; }
}

/* ==========================================================================
   Sections & grid (templates-sample: .row, .col-*, .mb-4)
   ========================================================================== */

.section {
	margin-bottom: 2rem;
}

.section-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.section-title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
}

.section-title a {
	color: #212529;
}

.section-title a:hover {
	color: var(--primary, #7CBF3A);
	text-decoration: none;
}

.row {
	display: flex;
	flex-wrap: wrap;
	margin: -0.5rem;
}

.row > * {
	padding: 0.5rem;
}

.col-12 { width: 100%; }
.col-6 { width: 50%; }

@media (min-width: 768px) {
	.col-md-6 { width: 50%; }
	.col-md-4 { width: 33.333%; }
}

@media (min-width: 1200px) {
	.col-xl-4 { width: 33.333%; }
	.col-xl-3 { width: 25%; }
}

/* Category grid (2–6 cols) */
.cat-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.75rem;
}

@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .cat-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) { .cat-grid { grid-template-columns: repeat(6, 1fr); } }

.cat-grid a {
	display: block;
	text-align: center;
	font-weight: 600;
	color: #212529;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 0.5rem;
	box-shadow: 0 1px 2px rgba(0,0,0,0.05);
	padding: 0.75rem;
}

.cat-grid a:hover {
	box-shadow: 0 4px 6px rgba(0,0,0,0.1);
	border-color: var(--primary, #7CBF3A);
	text-decoration: none;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
	display: inline-block;
	padding: 0.5rem 1rem;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.5;
	text-align: center;
	border-radius: 0.5rem;
	border: 0;
	cursor: pointer;
	text-decoration: none;
}

.btn-primary {
	background: var(--primary, #7CBF3A);
	color: #fff;
}

.btn-primary:hover {
	background: var(--primary-dark, #4d8619);
	text-decoration: none;
}

/* ==========================================================================
   Archive post card (templates-sample: .archive-post)
   ========================================================================== */

.archive-post {
	display: block;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 0.5rem;
	box-shadow: 0 1px 2px rgba(0,0,0,0.05);
	overflow: hidden;
	color: #212529;
	height: 100%;
}

.archive-post:hover {
	box-shadow: 0 4px 6px rgba(0,0,0,0.1);
	text-decoration: none;
	color: #212529;
}

.post-card-inner {
	display: flex;
	padding: 0.75rem;
	gap: 0.75rem;
}

.post-card-icon {
	flex-shrink: 0;
	width: 4rem;
	height: 4rem;
	border-radius: 0.5rem;
	overflow: hidden;
	background: #f3f4f6;
}

.post-card-icon img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.post-card-body {
	min-width: 0;
	flex: 1;
}

.post-card-title {
	margin: 0 0 0.25rem;
	font-size: 1rem;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.post-card-meta {
	font-size: 0.875rem;
	color: #6b7280;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ==========================================================================
   Footer (templates-sample: .site-footer, .bg-primary)
   ========================================================================== */

.site-footer {
	background: var(--primary, #7CBF3A);
	color: #fff;
	padding-top: 1.5rem;
	margin-top: 2rem;
}

.footer-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
	margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
	.footer-grid { grid-template-columns: 1fr 1fr; }
}

.footer-section h4 {
	margin: 0 0 0.75rem;
	font-size: 1.125rem;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.footer-section ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.footer-section a {
	color: #fff;
}

.footer-section a:hover {
	opacity: 0.9;
	text-decoration: none;
}

.footer-section .widget {
	margin-bottom: 0;
}

.footer-section .widget-title {
	margin: 0 0 0.75rem;
	font-size: 1.125rem;
	font-weight: 600;
}

.footer-socials {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem 1rem;
	padding: 1rem 0;
	border-top: 1px solid rgba(255,255,255,0.2);
}

.footer-socials a {
	color: #fff;
}

.footer-socials a:hover {
	opacity: 0.9;
	text-decoration: none;
}

.footer-socials svg {
	width: 1.25rem;
	height: 1.25rem;
}

.footer-copyright {
	background: var(--primary-dark, #4d8619);
	padding: 0.75rem 1rem;
	text-align: center;
	font-size: 0.875rem;
}

.footer-copyright p {
	margin: 0;
	font-weight: 600;
}

/* ==========================================================================
   Breadcrumb
   ========================================================================== */

.breadcrumb {
	font-size: 0.875rem;
}

.breadcrumb-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
	color: #6b7280;
}

.breadcrumb-list li + li::before {
	content: "/";
	margin-right: 0.25rem;
}

.breadcrumb-list a {
	color: var(--primary, #7CBF3A);
}

.breadcrumb-list a:hover { text-decoration: underline; }

/* ==========================================================================
   Single post / article
   ========================================================================== */

.article-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 0.5rem;
	box-shadow: 0 1px 2px rgba(0,0,0,0.05);
	padding: 1rem;
	margin-bottom: 1rem;
}

.article-hero {
	position: relative;
	border-radius: 0.5rem;
	margin-bottom: 1rem;
	min-height: 200px;
	overflow: hidden;
}

.article-hero img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	min-height: 200px;
}

.article-hero-placeholder {
	width: 100%;
	min-height: 200px;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #e5e7eb;
	color: #6b7280;
}

.article-hero-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.6);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 1rem;
	gap: 0.5rem;
}

.article-hero h1 {
	margin: 0;
	font-size: 1.25rem;
	color: #fff;
	order: 1;
}

.article-hero-overlay time {
	margin: 0;
	color: rgba(255,255,255,0.9);
	font-size: 0.875rem;
	order: 2;
}

@media (min-width: 768px) {
	.article-hero h1 { font-size: 1.5rem; }
}

.layout-single {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

@media (min-width: 1024px) {
	.layout-single { flex-direction: row; }
	.layout-single .main-content { flex: 1 1 auto; max-width: 72%; }
	.layout-single .sidebar { width: 28%; flex-shrink: 0; }
}

.info-table {
	width: 100%;
	font-size: 0.875rem;
	border-collapse: collapse;
}

.info-table th,
.info-table td {
	padding: 0.5rem 0.5rem 0.5rem 0;
	text-align: left;
	border-bottom: 1px solid #f3f4f6;
}

.info-table th {
	width: 45%;
	color: #6b7280;
	font-weight: 500;
}

.info-table tr:nth-child(even) { background: #f9fafb; }

.info-table a {
	color: var(--primary, #7CBF3A);
}

.info-table a:hover { text-decoration: underline; }

.download-section h2 {
	margin: 0 0 0.75rem;
	font-size: 1.125rem;
	font-weight: 700;
}

.download-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.download-buttons a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.75rem 1.25rem;
	font-weight: 500;
	border-radius: 0.5rem;
	text-decoration: none;
	transition: background 0.15s;
}

.download-buttons a:hover { text-decoration: none; }

.download-buttons .btn-download {
	background: var(--primary, #7CBF3A);
	color: #fff;
}

.download-buttons .btn-download:hover {
	background: var(--primary-dark, #4d8619);
}

.download-buttons .btn-play {
	background: #111;
	color: #fff;
}

.download-buttons .btn-play:hover { background: #333; }

.download-buttons .btn-telegram {
	background: #0088cc;
	color: #fff;
}

.download-buttons .btn-telegram:hover { background: #0077b5; }

.download-buttons svg {
	width: 1.25rem;
	height: 1.25rem;
	flex-shrink: 0;
}

/* ==========================================================================
   Sidebar / widgets
   ========================================================================== */

.widget-area {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.widget {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 0.5rem;
	box-shadow: 0 1px 2px rgba(0,0,0,0.05);
	padding: 1rem;
}

.widget-title {
	margin: 0 0 0.75rem;
	font-size: 1.125rem;
	font-weight: 600;
}

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

.widget .archive-post { margin-bottom: 0.75rem; }
.widget .archive-post:last-child { margin-bottom: 0; }

/* ==========================================================================
   Utilities
   ========================================================================== */

.sr-only,
.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
}

.screen-reader-text:focus {
	clip: auto !important;
	display: block;
	height: auto;
	width: auto;
	z-index: 100000;
	padding: 0.5rem;
	background: #fff;
	border-radius: 0.25rem;
}

.text-muted { color: #6b7280; }
.text-small { font-size: 0.875rem; }
.font-normal { font-weight: normal; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }

.article-featured-img {
	max-width: 48rem;
	width: 100%;
	height: auto;
	border-radius: 0.5rem;
	display: block;
	margin-left: auto;
	margin-right: auto;
}

/* Entry content */
.entry-content > * + * {
	margin-top: 1em;
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.5rem;
}

/* Pagination (WordPress .navigation.pagination .nav-links) */
.navigation.pagination {
	margin: 1.5rem 0;
}

.navigation.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
}

.navigation.pagination .nav-links a,
.navigation.pagination .nav-links span {
	display: inline-block;
	padding: 0.5rem 0.75rem;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 0.25rem;
	color: #212529;
}

.navigation.pagination .nav-links a:hover {
	background: var(--primary, #7CBF3A);
	color: #fff;
	border-color: var(--primary, #7CBF3A);
	text-decoration: none;
}

.navigation.pagination .nav-links .current {
	background: var(--primary, #7CBF3A);
	color: #fff;
	border-color: var(--primary, #7CBF3A);
}

/* Share buttons */
.share-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style: none;
	margin: 0.75rem 0 0;
	padding: 0;
}

.share-links a {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.25rem 0.5rem;
	font-size: 0.75rem;
	border-radius: 0.25rem;
	color: #fff;
}

.share-links a:hover { text-decoration: none; opacity: 0.9; }

/* News archive card (16:9 image + overlay) */
.news-card {
	display: block;
	position: relative;
	border-radius: 0.5rem;
	overflow: hidden;
	background: #e5e7eb;
	background-size: cover;
	background-position: center;
	aspect-ratio: 16 / 9;
}

.news-card-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.5);
	display: flex;
	align-items: flex-end;
	padding: 0.75rem;
}

.news-card:hover .news-card-overlay {
	background: rgba(0,0,0,0.6);
}

.news-card-title {
	font-size: 1rem;
	font-weight: 700;
	color: #fff;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.news-card:hover {
	text-decoration: none;
}

/* Tag list (e.g. News archive) */
.news-tags-heading {
	border-bottom: 2px solid var(--primary, #7CBF3A);
	padding-bottom: 0.25rem;
	display: inline-block;
}

.tag-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.tag-link {
	display: inline-block;
	padding: 0.375rem 0.75rem;
	background: #f3f4f6;
	border-radius: 0.25rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: #212529;
}

.tag-link:hover {
	background: #e5e7eb;
	text-decoration: none;
}
