/*
Theme Name: ImageHub
Description: Image download theme. Sirf image, title aur description upload karo (poora post nahi). Masonry image wall, image page par download button, aur popup mein ads + countdown.
Version: 1.0.0
Requires at least: 5.5
Requires PHP: 7.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: imagehub
*/

/* ------------------------------------------------------------------
   Design notes
   Image wall: images hi design hain. Cards, shadows aur boxes nahi,
   bas tight gutters wali masonry. Title sirf hover par image ke upar.
   Ek hi accent color (Customizer se badlo) sirf actions ke liye.
------------------------------------------------------------------- */

:root {
	--idt-accent: #1f4bff;
	--idt-ink: #15171c;
	--idt-wall: #eceef1;
	--idt-paper: #ffffff;
	--idt-muted: #5d6472;
	--idt-line: #d9dce2;
	--idt-gap: 8px;
	--idt-font: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--idt-wall);
	color: var(--idt-ink);
	font: 400 16px/1.6 var(--idt-font);
	-webkit-font-smoothing: antialiased;
}

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

a {
	color: var(--idt-accent);
	text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
	outline: 3px solid var(--idt-accent);
	outline-offset: 2px;
}

h1, h2, h3 {
	margin: 0;
	line-height: 1.12;
	letter-spacing: -0.025em;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	position: fixed !important;
	top: 8px;
	left: 8px;
	z-index: 100000;
	width: auto;
	height: auto;
	margin: 0;
	padding: 10px 16px;
	clip: auto;
	background: var(--idt-paper);
	color: var(--idt-ink);
	border-radius: 6px;
}

.idt-wrap {
	width: 100%;
	max-width: 1360px;
	margin: 0 auto;
	padding: 0 20px;
}

/* ---------------- Header ---------------- */

.idt-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--idt-paper);
	border-bottom: 1px solid var(--idt-line);
}

.idt-header-in {
	display: flex;
	align-items: center;
	gap: 24px;
	min-height: 64px;
}

.idt-site-title {
	color: var(--idt-ink);
	font-size: 22px;
	font-weight: 800;
	letter-spacing: -0.03em;
	text-decoration: none;
}

.custom-logo {
	width: auto;
	max-height: 44px;
}

.idt-nav {
	display: flex;
	align-items: center;
	gap: 20px;
	margin-left: auto;
}

.idt-menu,
.idt-footer-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.idt-menu a {
	display: block;
	padding: 8px 12px;
	color: var(--idt-ink);
	font-weight: 500;
	text-decoration: none;
	border-radius: 8px;
}

.idt-menu a:hover {
	background: var(--idt-wall);
}

.idt-menu li {
	position: relative;
}

.idt-menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 10;
	display: none;
	min-width: 190px;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: var(--idt-paper);
	border: 1px solid var(--idt-line);
	border-radius: 10px;
}

.idt-menu li:hover > .sub-menu,
.idt-menu li:focus-within > .sub-menu {
	display: block;
}

.idt-nav-toggle {
	display: none;
	margin-left: auto;
	padding: 8px 14px;
	background: transparent;
	color: var(--idt-ink);
	font: 600 15px var(--idt-font);
	border: 1px solid var(--idt-line);
	border-radius: 8px;
	cursor: pointer;
}

/* ---------------- Search ---------------- */

.idt-search {
	display: flex;
	align-items: stretch;
	background: var(--idt-paper);
	border: 1px solid var(--idt-line);
	border-radius: 10px;
	overflow: hidden;
}

.idt-search input[type="search"] {
	flex: 1;
	min-width: 0;
	padding: 9px 14px;
	color: var(--idt-ink);
	font: 400 15px var(--idt-font);
	background: transparent;
	border: 0;
	outline-offset: -3px;
}

.idt-search button {
	padding: 0 16px;
	color: #fff;
	font: 600 15px var(--idt-font);
	background: var(--idt-accent);
	border: 0;
	cursor: pointer;
}

.idt-search button:hover {
	filter: brightness(1.1);
}

/* Homepage par hero ka search kaafi hai, header ka chhupao. */
.home .idt-header .idt-search {
	display: none;
}

/* ---------------- Hero ---------------- */

.idt-hero {
	padding: 56px 0 28px;
}

.idt-hero-title {
	max-width: 15ch;
	font-size: clamp(36px, 7vw, 76px);
	font-weight: 800;
	letter-spacing: -0.045em;
	line-height: 1;
}

.idt-hero-text {
	max-width: 52ch;
	margin: 16px 0 0;
	color: var(--idt-muted);
	font-size: 18px;
}

.idt-hero .idt-search {
	max-width: 680px;
	margin-top: 26px;
	border-radius: 12px;
	border-color: var(--idt-ink);
}

.idt-hero .idt-search input[type="search"] {
	padding: 15px 18px;
	font-size: 17px;
}

.idt-hero .idt-search button {
	padding: 0 26px;
	font-size: 16px;
}

.idt-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 20px 0 0;
	padding: 0;
	list-style: none;
}

.idt-chips a {
	display: block;
	padding: 6px 14px;
	color: var(--idt-ink);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	background: var(--idt-paper);
	border: 1px solid var(--idt-line);
	border-radius: 999px;
}

.idt-chips a:hover {
	color: #fff;
	background: var(--idt-ink);
	border-color: var(--idt-ink);
}

/* ---------------- Image wall ---------------- */

.idt-listing {
	padding-top: 20px;
	padding-bottom: 8px;
}

.idt-page-head {
	padding: 24px 0 18px;
}

.idt-page-head h1 {
	font-size: clamp(28px, 4vw, 44px);
	font-weight: 800;
}

.idt-page-desc {
	max-width: 60ch;
	margin-top: 8px;
	color: var(--idt-muted);
}

.idt-masonry {
	column-width: 250px;
	column-gap: var(--idt-gap);
}

.idt-card {
	position: relative;
	margin: 0 0 var(--idt-gap);
	overflow: hidden;
	background: #d3d7de;
	border-radius: 6px;
	break-inside: avoid;
}

.idt-card-link {
	display: block;
	color: #fff;
	text-decoration: none;
}

.idt-card img {
	width: 100%;
	transition: transform 0.4s ease;
}

.idt-card:hover img {
	transform: scale(1.03);
}

.idt-noimg {
	display: block;
	min-height: 180px;
}

.idt-card-cap {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 36px 12px 11px;
	background: linear-gradient(to top, rgba(8, 10, 16, 0.78), rgba(8, 10, 16, 0));
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.idt-card:hover .idt-card-cap,
.idt-card:focus-within .idt-card-cap {
	opacity: 1;
	transform: none;
}

.idt-card-title {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.25;
}

.idt-card-dl {
	font-size: 12px;
	opacity: 0.85;
}

/* Touch screens par hover nahi hota: title hamesha dikhao. */
@media (hover: none) {
	.idt-card-cap {
		opacity: 1;
		transform: none;
	}
}

/* Pagination */
.navigation.pagination {
	padding: 22px 0 40px;
}

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

.page-numbers {
	padding: 8px 15px;
	color: var(--idt-ink);
	font-weight: 600;
	text-decoration: none;
	background: var(--idt-paper);
	border: 1px solid var(--idt-line);
	border-radius: 8px;
}

a.page-numbers:hover {
	border-color: var(--idt-ink);
}

.page-numbers.current {
	color: #fff;
	background: var(--idt-ink);
	border-color: var(--idt-ink);
}

.idt-empty {
	max-width: 520px;
	padding: 80px 0;
}

.idt-empty h1,
.idt-empty h2 {
	font-size: 30px;
	font-weight: 800;
}

.idt-empty p {
	color: var(--idt-muted);
}

.idt-empty .idt-search {
	margin-top: 18px;
}

/* ---------------- Single image ---------------- */

.idt-single {
	padding-top: 24px;
}

.idt-single-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 28px;
	align-items: start;
}

.idt-stage {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 320px;
	padding: 24px;
	background: #d3d7de;
	border-radius: 10px;
}

.idt-main-img {
	width: auto;
	max-width: 100%;
	max-height: 78vh;
	object-fit: contain;
	border-radius: 4px;
}

.idt-info {
	position: sticky;
	top: 88px;
	padding: 4px 0;
}

.idt-single-title {
	font-size: clamp(28px, 3.4vw, 40px);
	font-weight: 800;
}

.idt-desc {
	margin: 14px 0 0;
	color: var(--idt-muted);
}

.idt-desc p {
	margin: 0 0 0.8em;
}

.idt-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 15px 22px;
	color: #fff;
	font: 700 17px/1.2 var(--idt-font);
	background: var(--idt-accent);
	border: 0;
	border-radius: 10px;
	cursor: pointer;
}

.idt-btn:hover {
	filter: brightness(1.1);
}

.idt-btn:disabled {
	cursor: not-allowed;
	opacity: 0.45;
	filter: none;
}

.idt-btn svg {
	flex: none;
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.idt-download {
	width: 100%;
	margin-top: 22px;
}

.idt-meta {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 8px 18px;
	margin: 22px 0 0;
	padding-top: 18px;
	font-size: 14px;
	border-top: 1px solid var(--idt-line);
}

.idt-meta dt {
	color: var(--idt-muted);
}

.idt-meta dd {
	margin: 0;
	font-weight: 600;
}

.idt-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 16px;
}

.idt-tags a {
	padding: 4px 12px;
	color: var(--idt-ink);
	font-size: 13px;
	text-decoration: none;
	background: var(--idt-paper);
	border: 1px solid var(--idt-line);
	border-radius: 999px;
}

.idt-tags a:hover {
	border-color: var(--idt-ink);
}

.idt-related {
	padding: 44px 0 12px;
}

.idt-related h2 {
	margin-bottom: 16px;
	font-size: 26px;
	font-weight: 800;
}

/* Ads */
.idt-ad {
	margin: 18px 0;
	max-width: 100%;
	overflow: hidden;
	text-align: center;
}

.idt-ad:empty {
	display: none;
}

/* ---------------- Pages ---------------- */

.idt-page {
	max-width: 780px;
	margin: 32px 0;
	padding: 32px;
	background: var(--idt-paper);
	border-radius: 10px;
}

.idt-page-title {
	margin-bottom: 18px;
	font-size: clamp(28px, 4vw, 40px);
	font-weight: 800;
}

.idt-prose > :first-child {
	margin-top: 0;
}

/* ---------------- Footer ---------------- */

.idt-footer {
	margin-top: 48px;
	padding: 26px 0;
	color: #b9bfcc;
	font-size: 14px;
	background: var(--idt-ink);
}

.idt-footer-in {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.idt-copy {
	margin: 0;
}

.idt-footer a {
	color: #fff;
	text-decoration: none;
}

.idt-footer a:hover {
	text-decoration: underline;
}

.idt-footer-menu {
	gap: 18px;
}

/* ---------------- Download popup ---------------- */

.idt-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	overflow-y: auto;
	background: rgba(12, 14, 20, 0.72);
}

.idt-modal.is-open {
	display: flex;
}

.idt-dialog {
	position: relative;
	width: 100%;
	max-width: 560px;
	max-height: 100%;
	padding: 30px 26px 24px;
	overflow-y: auto;
	text-align: center;
	background: var(--idt-paper);
	border-radius: 14px;
}

.idt-modal.is-open .idt-dialog {
	animation: idt-open 0.18s ease-out;
}

@keyframes idt-open {
	from { opacity: 0; transform: translateY(8px) scale(0.98); }
	to   { opacity: 1; transform: none; }
}

.idt-close {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 36px;
	height: 36px;
	color: var(--idt-muted);
	font-size: 26px;
	line-height: 1;
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.idt-close:hover {
	color: var(--idt-ink);
	background: var(--idt-wall);
}

.idt-dialog-title {
	margin: 0 30px 12px;
	font-size: 22px;
	font-weight: 800;
}

.idt-status {
	margin: 16px 0 10px;
	font-weight: 600;
}

.idt-progress {
	max-width: 320px;
	height: 6px;
	margin: 0 auto 18px;
	overflow: hidden;
	background: var(--idt-wall);
	border-radius: 999px;
}

.idt-progress span {
	display: block;
	width: 0;
	height: 100%;
	background: var(--idt-accent);
	transition: width 1s linear;
}

.idt-go {
	min-width: 220px;
}

.idt-lock {
	overflow: hidden !important;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 980px) {
	.idt-single-grid {
		grid-template-columns: minmax(0, 1fr);
	}
	.idt-info {
		position: static;
	}
}

@media (max-width: 860px) {
	.idt-header {
		position: relative;
	}
	.idt-nav-toggle {
		display: inline-flex;
	}
	.idt-nav {
		position: absolute;
		top: 100%;
		right: 0;
		left: 0;
		z-index: 60;
		display: none;
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
		padding: 14px 20px 18px;
		background: var(--idt-paper);
		border-bottom: 1px solid var(--idt-line);
	}
	.idt-nav.is-open {
		display: flex;
	}
	.idt-menu {
		flex-direction: column;
	}
	.idt-menu .sub-menu {
		position: static;
		display: block;
		border: 0;
	}
	.home .idt-header .idt-search {
		display: flex;
	}
}

@media (max-width: 480px) {
	.idt-wrap {
		padding: 0 14px;
	}
	.idt-masonry {
		column-width: 150px;
	}
	.idt-hero {
		padding-top: 36px;
	}
	.idt-dialog {
		padding: 26px 16px 18px;
	}
	.idt-go {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}
}
