/* ==========================================================================
   Prakad - main stylesheet
   ========================================================================== */

/* --- Reset / base --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.6;
	color: var(--text-main);
	background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; line-height: 1.3; margin: 0 0 .5em; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.skip-link:focus {
	position: fixed; top: 10px; left: 10px; z-index: 999;
	background: var(--primary); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
}

/* --- Buttons --- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	padding: 10px 20px; border-radius: var(--radius-sm); font-weight: 600;
	border: 2px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
	cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 24px; font-size: 1.05rem; }

/* --- Badges --- */
.badge {
	display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600;
	color: #fff; background: var(--primary);
}
.badge-type { background: var(--primary); }
.badge-sold { background: var(--danger); }
.badge-large { font-size: 1rem; padding: 6px 16px; position: absolute; top: 16px; left: 16px; }

/* --- Header --- */
.site-header { background: var(--surface); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; gap: 20px; padding: 14px 20px; flex-wrap: wrap; }
.site-title { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.header-search { flex: 1 1 320px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.mobile-menu-toggle {
	display: none; flex-direction: column; gap: 4px; background: none; border: 0; padding: 8px;
}
.mobile-menu-toggle span { width: 22px; height: 2px; background: var(--text-main); border-radius: 2px; }

.primary-nav { background: var(--primary); }
.nav-menu, .footer-menu { display: flex; flex-wrap: wrap; gap: 4px; }
.nav-menu li a {
	display: block; padding: 12px 16px; color: #fff; font-weight: 500; font-size: .95rem;
}
.nav-menu li a:hover { background: rgba(255,255,255,.15); color: #fff; }

/* --- Search form --- */
.prakad-search-form { display: flex; gap: 8px; flex-wrap: wrap; background: var(--surface); }
.prakad-search-form.is-hero {
	background: var(--surface); padding: 14px; border-radius: var(--radius); box-shadow: var(--shadow-hover);
}
.search-field { flex: 1 1 160px; }
.search-field-keyword { flex: 2 1 260px; }
.prakad-search-form input[type="text"],
.prakad-search-form select {
	width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff;
}
.search-submit { flex: 0 0 auto; }

/* --- Hero --- */
.hero {
	background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
	color: #fff; padding: 60px 0 70px; text-align: center;
}
.hero-title { font-size: 2.2rem; color: #fff; margin-bottom: .3em; }
.hero-subtitle { color: rgba(255,255,255,.85); margin-bottom: 1.5em; font-size: 1.05rem; }
.hero .prakad-search-form { max-width: 900px; margin: 0 auto; text-align: left; }

/* --- Category shortcuts --- */
.category-shortcuts { padding: 24px 0; }
.category-chip-list { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.category-chip {
	background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
	padding: 8px 18px; font-size: .9rem; font-weight: 500; color: var(--text-main);
	transition: all .15s ease;
}
.category-chip:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* --- Sections / titles --- */
.section-title { font-size: 1.4rem; margin-bottom: 20px; }
.latest-listings, .related-listings { padding: 30px 0; }
.see-more-wrap { text-align: center; margin-top: 30px; }
.empty-state { text-align: center; color: var(--text-muted); padding: 40px 0; }

/* --- Listing grid / card --- */
.listing-grid {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px;
}
.listing-card {
	background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
	transition: transform .2s ease, box-shadow .2s ease; display: flex; flex-direction: column;
}
.listing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.listing-card-media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--bg); overflow: hidden; }
.listing-card-media img { width: 100%; height: 100%; object-fit: cover; }
.listing-card-noimage { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--border); }
.listing-card-media .badge { position: absolute; top: 10px; left: 10px; }
.listing-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.listing-card-title {
	font-weight: 600; color: var(--text-main); font-size: .98rem;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.listing-card-title:hover { color: var(--primary); }
.listing-card-price { color: var(--accent-dark); font-weight: 700; font-size: 1.05rem; margin: 0; }
.listing-card-meta { display: flex; justify-content: space-between; color: var(--text-muted); font-size: .8rem; margin: 0; }
.listing-card.is-sold .listing-card-media img { filter: grayscale(60%); opacity: .7; }

/* --- Page layout with sidebar --- */
.page-layout { display: grid; grid-template-columns: 1fr 280px; gap: 30px; padding: 30px 20px; align-items: start; }
.page-layout-narrow { max-width: 760px; margin: 0 auto; padding: 30px 20px; }
.site-main.with-sidebar { min-width: 0; }
.archive-title { margin-bottom: 20px; }

/* --- Breadcrumbs --- */
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; color: var(--text-muted); font-size: .85rem; margin-bottom: 16px; }
.breadcrumbs li:not(:last-child)::after { content: '›'; margin-left: 6px; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary); }

/* --- Sidebar / filters --- */
.site-sidebar { display: flex; flex-direction: column; gap: 20px; }
.widget { background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.widget-title { font-size: 1.05rem; margin-bottom: 12px; }
.filter-list li { margin-bottom: 4px; }
.filter-list a { display: flex; justify-content: space-between; padding: 6px 8px; border-radius: var(--radius-sm); color: var(--text-main); font-size: .92rem; }
.filter-list a:hover, .filter-list li.is-active a { background: var(--primary-light); color: var(--primary-dark); }
.filter-list .count { color: var(--text-muted); font-size: .8rem; }
.filter-list-scroll { max-height: 260px; overflow-y: auto; }
.cta-widget { text-align: center; background: var(--primary-light); }
.cta-widget p { margin: 0 0 10px; font-weight: 600; }

/* --- Single listing --- */
.listing-single { min-width: 0; }
.listing-gallery { margin-bottom: 20px; }
.gallery-main { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.gallery-main-image { width: 100%; max-height: 480px; object-fit: cover; aspect-ratio: 4 / 3; }
.gallery-placeholder { aspect-ratio: 4/3; background: var(--border); }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery-thumb { border: 2px solid transparent; border-radius: var(--radius-sm); overflow: hidden; padding: 0; background: none; width: 70px; height: 52px; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.is-active { border-color: var(--primary); }

.listing-header { margin-bottom: 20px; }
.listing-title { font-size: 1.6rem; }
.listing-price { font-size: 1.4rem; font-weight: 700; color: var(--accent-dark); margin: 4px 0; }
.listing-meta { display: flex; gap: 14px; align-items: center; color: var(--text-muted); flex-wrap: wrap; }

.listing-description { background: var(--surface); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.listing-contact-card { background: var(--surface); border-radius: var(--radius); padding: 20px; margin-bottom: 30px; box-shadow: var(--shadow); }
.listing-contact-card .contact-name { font-weight: 600; margin-bottom: 10px; }
.reveal-phone { margin-bottom: 12px; font-size: 1.1rem; }
.contact-safety-note { font-size: .82rem; color: var(--text-muted); margin: 0; }

/* --- Forms (submit listing) --- */
.notice { padding: 16px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; }
.notice-success { background: #DCFCE7; border: 1px solid var(--success); color: #166534; }
.notice-error { background: #FEE2E2; border: 1px solid var(--danger); color: #991B1B; }
.notice-error ul { margin: 6px 0 0 18px; list-style: disc; }

.listing-submit-form { background: var(--surface); padding: 24px; border-radius: var(--radius); box-shadow: var(--shadow); }
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; }
.required { color: var(--danger); }
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
	width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
	outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.form-note { text-align: center; color: var(--text-muted); font-size: .85rem; margin-top: 10px; }
.image-preview-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.image-preview-thumb { width: 80px; height: 60px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* --- Footer --- */
.site-footer { background: var(--text-main); color: #cbd5e1; margin-top: 40px; }
.footer-widgets-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 40px 20px; }
.footer-logo { color: #fff; font-size: 1.3rem; }
.footer-tagline { color: #94a3b8; font-size: .9rem; }
.site-footer .widget-title { color: #fff; font-size: 1rem; }
.footer-cat-list li, .footer-menu li { margin-bottom: 6px; }
.footer-cat-list a, .footer-menu a { color: #cbd5e1; font-size: .9rem; }
.footer-cat-list a:hover, .footer-menu a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 16px 20px; text-align: center; font-size: .85rem; color: #94a3b8; }

/* --- Basic page / post fallback --- */
.basic-page, .basic-post { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.page-title { margin-bottom: 16px; }
.not-found-page { text-align: center; padding: 60px 20px; }
.not-found-page .prakad-search-form { max-width: 500px; margin: 20px auto; }

/* --- Comments (basic pages only) --- */
.comments-area { margin-top: 30px; }
.comment-list { margin-top: 16px; }
.comment-list li { background: var(--surface); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
	.page-layout { grid-template-columns: 1fr; }
	.footer-widgets-row { grid-template-columns: repeat(2, 1fr); }
	.form-row { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
	.header-inner { justify-content: space-between; }
	.header-search { order: 3; flex-basis: 100%; }
	.mobile-menu-toggle { display: flex; }
	.primary-nav .nav-menu { display: none; flex-direction: column; }
	.primary-nav .nav-menu.is-open { display: flex; }
	.hero-title { font-size: 1.6rem; }
	.hero .prakad-search-form { flex-direction: column; }
	.listing-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
	.footer-widgets-row { grid-template-columns: 1fr; text-align: center; }
}
