/*
Theme Name: Rishta Grid
Theme URI: https://example.com/rishta-grid
Author: Rishta Grid
Author URI: https://example.com
Description: A lightweight, fully responsive theme built to work with the Matrimonial Profiles plugin. The front page opens straight into a pink, glowing grid of profiles with Next/Previous paging; single profiles, widgets, menus, the Customizer, Additional CSS, Gutenberg and Elementor all work normally.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.7
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rishta-grid
Tags: custom-background, custom-logo, custom-menu, featured-images, full-width-template, threaded-comments, translation-ready, wide-blocks, block-styles, editor-style

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/

/* =========================================================================
   1. Reset & base
   ========================================================================= */

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

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

body {
	margin: 0;
	background: var( --wp--preset--color--background, #ffffff );
	color: var( --wp--preset--color--foreground, #2b2b2b );
	font-family: var( --rishta-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Nastaliq Urdu', 'Noto Sans', sans-serif );
	line-height: 1.6;
	font-size: clamp( 1rem, 0.94rem + 0.3vw, 1.1rem );
}

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

a {
	color: inherit;
}

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

button,
input,
select,
textarea {
	font: inherit;
}

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

.screen-reader-text:focus {
	position: fixed;
	top: 8px;
	inset-inline-start: 8px;
	width: auto;
	height: auto;
	padding: 10px 16px;
	background: #fff;
	color: #000;
	z-index: 100000;
	border-radius: 6px;
	box-shadow: 0 2px 10px rgba( 0, 0, 0, 0.2 );
}

/* =========================================================================
   2. Layout helpers
   ========================================================================= */

.rishta-container {
	width: 100%;
	max-width: var( --wp--style--global--wide-size, 1200px );
	margin-inline: auto;
	padding-inline: clamp( 1rem, 3vw, 2.5rem );
}

/* =========================================================================
   3. Header & footer (used everywhere except the front-page landing view)
   ========================================================================= */

.rishta-site-header {
	background: #ffffff;
	border-block-end: 1px solid rgba( 0, 0, 0, 0.06 );
	padding-block: clamp( 0.9rem, 2vw, 1.4rem );
	position: sticky;
	top: 0;
	z-index: 50;
}

.rishta-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.rishta-branding {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	text-decoration: none;
}

.rishta-logo-image {
	max-height: 46px;
	width: auto;
}

.rishta-site-title {
	margin: 0;
	font-size: clamp( 1.15rem, 1rem + 0.8vw, 1.5rem );
	font-weight: 800;
	color: var( --wp--preset--color--primary, #e0177d );
}

.rishta-site-description {
	margin: 0;
	font-size: 0.85rem;
	color: var( --wp--preset--color--muted, #6b6b6b );
}

.rishta-primary-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.4rem;
}

.rishta-primary-nav a {
	text-decoration: none;
	font-weight: 600;
	padding: 0.3rem 0.1rem;
	border-block-end: 2px solid transparent;
	transition: border-color 150ms ease, color 150ms ease;
}

.rishta-primary-nav a:hover,
.rishta-primary-nav a:focus-visible {
	border-block-end-color: var( --wp--preset--color--primary, #e0177d );
	color: var( --wp--preset--color--primary, #e0177d );
}

.rishta-site-footer {
	margin-top: clamp( 2rem, 6vw, 4rem );
	background: var( --wp--preset--color--foreground, #2b2b2b );
	color: #f4e9f0;
	padding-block: clamp( 2rem, 5vw, 3.5rem ) 1.5rem;
}

.rishta-footer-widgets {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 200px, 1fr ) );
	gap: 2rem;
	margin-bottom: 2rem;
}

.rishta-footer-widgets .widget-title {
	color: #ffffff;
	font-size: 1rem;
	margin-bottom: 0.75rem;
}

.rishta-footer-widgets a {
	color: #e8c9dc;
	text-decoration: none;
}

.rishta-footer-widgets a:hover {
	color: #ffffff;
}

.rishta-footer-bottom {
	border-block-start: 1px solid rgba( 255, 255, 255, 0.12 );
	padding-top: 1.25rem;
	font-size: 0.85rem;
	color: #cfa9bf;
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.5rem;
}

/* =========================================================================
   4. Ad slots
   ========================================================================= */

.rishta-ad {
	max-width: var( --wp--style--global--wide-size, 1200px );
	margin: clamp( 1rem, 3vw, 1.75rem ) auto;
	padding-inline: clamp( 1rem, 3vw, 2.5rem );
	text-align: center;
	overflow-x: auto;
}

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

/* =========================================================================
   5. The profile grid — fluid, no fixed breakpoints needed for column count.
   Card width is itself fluid (clamp), so the number of columns that fit the
   viewport adjusts continuously: one on a narrow phone, several on a
   desktop, without extra media queries.
   ========================================================================= */

.rishta-landing-main,
.rishta-archive-main {
	padding-block: clamp( 1.25rem, 4vw, 2.5rem ) clamp( 2rem, 6vw, 4rem );
}

.rishta-grid-wrap {
	max-width: var( --wp--style--global--wide-size, 1200px );
	margin-inline: auto;
	padding-inline: clamp( 1rem, 3vw, 2.5rem );
}

.rishta-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( clamp( 150px, 24vw, 230px ), 1fr ) );
	gap: clamp( 0.9rem, 2.4vw, 1.6rem );
}

.rishta-card {
	background: #ffffff;
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 2px 14px rgba( 173, 20, 87, 0.1 );
	display: flex;
	flex-direction: column;
	transition: transform 180ms ease, box-shadow 180ms ease;
}

.rishta-card:hover {
	transform: translateY( -4px );
	box-shadow: 0 10px 26px rgba( 173, 20, 87, 0.22 );
}

.rishta-card-media {
	display: block;
	aspect-ratio: 1 / 1;
	background: linear-gradient( 145deg, #ffe0ef, #ffc3e0 );
	overflow: hidden;
}

.rishta-card-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 300ms ease;
}

.rishta-card:hover .rishta-card-image {
	transform: scale( 1.05 );
}

.rishta-card-placeholder {
	display: block;
	width: 100%;
	height: 100%;
}

.rishta-card-body {
	padding: clamp( 0.85rem, 2vw, 1.1rem );
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	flex-grow: 1;
}

.rishta-card-name {
	margin: 0;
	font-size: clamp( 0.98rem, 0.9rem + 0.3vw, 1.1rem );
	font-weight: 700;
	color: var( --wp--preset--color--foreground, #2b2b2b );
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rishta-card-meta {
	margin: 0;
	font-size: 0.86rem;
	color: var( --wp--preset--color--muted, #6b6b6b );
	flex-grow: 1;
}

.rishta-card-button {
	margin-top: auto;
	align-self: flex-start;
}

/* =========================================================================
   6. Buttons — clean, rounded and glowing, as requested.
   ========================================================================= */

.rishta-button,
.rishta-card-button,
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4em;
	padding: 0.65em 1.5em;
	border-radius: 999px;
	background: linear-gradient( 135deg, var( --wp--preset--color--primary, #e0177d ), var( --wp--preset--color--primary-dark, #a10f5c ) );
	color: #ffffff;
	font-weight: 700;
	font-size: 0.92em;
	text-decoration: none;
	border: none;
	cursor: pointer;
	box-shadow: 0 0 0 rgba( 224, 23, 125, 0 ), 0 4px 14px rgba( 224, 23, 125, 0.35 );
	transition: box-shadow 200ms ease, transform 150ms ease, filter 150ms ease;
}

.rishta-button:hover,
.rishta-card-button:hover,
.wp-block-button__link:hover {
	box-shadow: 0 0 22px rgba( 224, 23, 125, 0.55 ), 0 6px 18px rgba( 224, 23, 125, 0.4 );
	transform: translateY( -1px );
	filter: brightness( 1.04 );
	color: #ffffff;
}

.rishta-button:active,
.rishta-card-button:active {
	transform: translateY( 0 );
}

.rishta-button:focus-visible,
.rishta-card-button:focus-visible,
.wp-block-button__link:focus-visible {
	outline: 3px solid var( --wp--preset--color--secondary, #ffe0ef );
	outline-offset: 2px;
}

@media ( prefers-reduced-motion: reduce ) {
	.rishta-card,
	.rishta-card-image,
	.rishta-button,
	.rishta-card-button {
		transition: none;
	}
}

/* =========================================================================
   7. Pagination
   ========================================================================= */

.rishta-pagination {
	max-width: var( --wp--style--global--wide-size, 1200px );
	margin: clamp( 1.5rem, 4vw, 2.5rem ) auto 0;
	padding-inline: clamp( 1rem, 3vw, 2.5rem );
	display: flex;
	justify-content: space-between;
	gap: 1rem;
}

.rishta-pagination a,
.rishta-pagination span {
	padding: 0.6em 1.4em;
	border-radius: 999px;
	font-weight: 600;
	text-decoration: none;
}

.rishta-pagination a {
	background: #ffffff;
	color: var( --wp--preset--color--primary, #e0177d );
	box-shadow: 0 2px 10px rgba( 173, 20, 87, 0.15 );
	transition: box-shadow 180ms ease, transform 180ms ease;
}

.rishta-pagination a:hover {
	box-shadow: 0 4px 16px rgba( 173, 20, 87, 0.28 );
	transform: translateY( -1px );
}

.rishta-pagination .is-disabled {
	background: transparent;
	color: var( --wp--preset--color--muted, #6b6b6b );
	opacity: 0.5;
	cursor: default;
}

/* =========================================================================
   8. Empty / notice states
   ========================================================================= */

.rishta-grid-empty,
.rishta-grid-notice {
	text-align: center;
	padding: 3rem 1rem;
	color: var( --wp--preset--color--muted, #6b6b6b );
}

/* =========================================================================
   9. Single profile page
   ========================================================================= */

.rishta-single-main {
	padding-block: clamp( 1.25rem, 4vw, 2.5rem ) clamp( 2rem, 6vw, 4rem );
}

.rishta-single-profile {
	max-width: 760px;
	margin-inline: auto;
	padding-inline: clamp( 1rem, 3vw, 2.5rem );
}

.rishta-back-link {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	text-decoration: none;
	font-weight: 600;
	color: var( --wp--preset--color--primary, #e0177d );
	margin-bottom: 1rem;
}

.rishta-single-photo {
	border-radius: 20px;
	overflow: hidden;
	margin-bottom: 1.25rem;
	box-shadow: 0 10px 30px rgba( 173, 20, 87, 0.18 );
}

.rishta-single-photo img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.rishta-single-name {
	font-size: clamp( 1.5rem, 1.2rem + 1.6vw, 2.1rem );
	margin: 0 0 1.25rem;
	color: var( --wp--preset--color--foreground, #2b2b2b );
}

/* Re-skin the plugin's own markup with our palette, instead of overriding
   its templates — the plugin exposes these CSS custom properties and class
   names precisely so a theme can do this safely. */
.rishta-single-content,
.rishta-grid-wrap {
	--mpro-accent: var( --wp--preset--color--primary, #e0177d );
	--mpro-accent-hover: var( --wp--preset--color--primary-dark, #a10f5c );
	--mpro-accent-text: #ffffff;
	--mpro-radius: 16px;
	--mpro-border: 1px solid rgba( 173, 20, 87, 0.15 );
	--mpro-field-bg: #fff8fb;
}

.rishta-single-content .mpro-profile {
	background: #fff8fb;
	border-radius: 18px;
	padding: clamp( 1rem, 3vw, 1.6rem );
	margin-block: 1.5rem;
}

.rishta-single-content .mpro-form-wrap {
	background: #ffffff;
	border: 1px solid rgba( 173, 20, 87, 0.12 );
	border-radius: 18px;
	padding: clamp( 1.1rem, 3vw, 1.75rem );
	box-shadow: 0 4px 20px rgba( 173, 20, 87, 0.08 );
}

/* =========================================================================
   10. 404 & generic pages
   ========================================================================= */

.rishta-page-main {
	padding-block: clamp( 1.5rem, 5vw, 3rem ) clamp( 2rem, 6vw, 4rem );
}

.rishta-page-content {
	max-width: 760px;
	margin-inline: auto;
	padding-inline: clamp( 1rem, 3vw, 2.5rem );
}

.rishta-404 {
	text-align: center;
	padding: clamp( 3rem, 8vw, 6rem ) 1rem;
}

.rishta-404 h1 {
	font-size: clamp( 2rem, 1.6rem + 2vw, 3rem );
	color: var( --wp--preset--color--primary, #e0177d );
}
