/* ایوان معماری — main styles */

:root {
	--ink: #1a2332;
	--ink-soft: #4a5563;
	--tile: #1e4d8c;
	--tile-deep: #163a6b;
	--tile-bright: #2a6bc4;
	--bronze: #c4a35a;
	--sand: #d4c4a8;
	--paper: #f7f3eb;
	--paper-2: #efe8da;
	--white: #fffcf7;
	--line: rgba(26, 35, 50, 0.12);
	--shadow: 0 18px 50px rgba(26, 35, 50, 0.12);
	--radius: 2px;
	--font: "Vazirmatn", Tahoma, sans-serif;
	--display: "Amiri", "Vazirmatn", serif;
	--max: 1120px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: var(--font);
	color: var(--ink);
	background: var(--paper);
	line-height: 1.8;
	direction: rtl;
	text-align: right;
	-webkit-font-smoothing: antialiased;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: var(--tile-deep);
	text-decoration: none;
	transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
	color: var(--tile-bright);
}

.site-wrap {
	overflow-x: hidden;
}

.container {
	width: min(100% - 2.5rem, var(--max));
	margin-inline: auto;
}

/* ——— Header ——— */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	backdrop-filter: blur(14px);
	background: rgba(247, 243, 235, 0.88);
	border-bottom: 1px solid var(--line);
}

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	padding: 0.85rem 0;
}

.brand {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.2rem;
	color: var(--ink);
	max-width: min(540px, 70vw);
}

.brand-logo {
	width: min(280px, 58vw);
	height: auto;
	object-fit: contain;
}

.brand-name {
	font-family: var(--display);
	font-size: clamp(1.85rem, 3.6vw, 2.65rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

.brand-tag {
	font-size: clamp(0.95rem, 1.5vw, 1.15rem);
	color: var(--ink-soft);
	font-weight: 500;
	line-height: 1.45;
}

.nav-primary {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.nav-primary ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.15rem 1.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.nav-primary a {
	color: var(--ink);
	font-size: 0.95rem;
	font-weight: 500;
	position: relative;
}

.nav-primary a::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: -0.25rem;
	width: 0;
	height: 2px;
	background: var(--tile);
	transition: width 0.25s ease;
}

.nav-primary a:hover::after,
.nav-primary .current-menu-item > a::after {
	width: 100%;
}

.nav-toggle {
	display: none;
	border: 1px solid var(--line);
	background: var(--white);
	padding: 0.45rem 0.7rem;
	font-family: inherit;
	cursor: pointer;
	color: var(--ink);
}

/* ——— Hero slider ——— */
.hero-slider {
	position: relative;
	width: 100%;
	isolation: isolate;
}

.slider {
	position: relative;
	overflow: hidden;
	background: #0f1a28;
	min-height: min(72vh, 620px);
}

.slider-track {
	position: relative;
	width: 100%;
	min-height: inherit;
}

.slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.8s ease, visibility 0.8s ease;
}

.slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 1;
}

.slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	transform: scale(1.04);
	transition: transform 6.5s ease;
}

.slide.is-active img {
	transform: scale(1);
}

.slider-caption {
	position: absolute;
	z-index: 3;
	right: max(1.25rem, calc((100% - var(--max)) / 2));
	bottom: 2.5rem;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 0.95rem 1.2rem;
	background: linear-gradient(135deg, rgba(10, 110, 106, 0.88), rgba(6, 78, 75, 0.82));
	border: 1px solid rgba(180, 235, 230, 0.35);
	backdrop-filter: blur(8px);
	color: #fff;
	max-width: min(28rem, calc(100% - 2.5rem));
	box-shadow: 0 12px 36px rgba(6, 78, 75, 0.35);
	opacity: 0;
	transform: translateY(12px);
	animation: riseIn 0.8s ease 0.35s forwards;
}

.slider-caption strong {
	font-family: var(--display);
	font-size: clamp(1.45rem, 2.8vw, 2rem);
	font-weight: 700;
	line-height: 1.35;
	color: #f2fffd;
}

.slider-caption span {
	font-size: clamp(1rem, 1.6vw, 1.2rem);
	opacity: 0.95;
	font-weight: 400;
	color: #d7f5f1;
}

.slider-btn {
	position: absolute;
	top: 50%;
	z-index: 4;
	transform: translateY(-50%);
	width: 2.6rem;
	height: 2.6rem;
	border: 1px solid rgba(255, 255, 255, 0.35);
	background: rgba(15, 26, 40, 0.35);
	color: #fff;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	backdrop-filter: blur(6px);
	transition: background 0.2s ease;
}

.slider-btn:hover {
	background: rgba(15, 26, 40, 0.65);
}

.slider-prev {
	right: 1rem;
}

.slider-next {
	left: 1rem;
}

.slider-dots {
	position: absolute;
	z-index: 4;
	left: 50%;
	bottom: 1.1rem;
	transform: translateX(-50%);
	display: flex;
	gap: 0.45rem;
}

.slider-dot {
	width: 0.55rem;
	height: 0.55rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.45);
	cursor: pointer;
}

.slider-dot.is-active {
	background: #fff;
	transform: scale(1.2);
}

.slider-fallback {
	min-height: 40vh;
	display: flex;
	flex-direction: column;
	justify-content: end;
	gap: 0.35rem;
	padding: 3rem 1.5rem;
	background: linear-gradient(145deg, #163a6b, #1a2332);
	color: #fff;
}

.slider-fallback strong {
	font-family: var(--display);
	font-size: 2rem;
}

/* keep riseIn for caption */
@keyframes riseIn {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.footer-logo {
	width: min(220px, 70%);
	height: auto;
	margin-bottom: 0.75rem;
	background: #fff;
	padding: 0.5rem 0.65rem;
}

.footer-about .footer-text {
	margin-top: 0.35rem;
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.75rem 1.35rem;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	border: 1px solid transparent;
	cursor: pointer;
	transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
	transform: translateY(-2px);
}

.btn-primary {
	background: var(--tile-bright);
	color: #fff;
	border-color: var(--tile-bright);
}

.btn-primary:hover {
	background: #22b0a9;
	color: #fff;
}

.btn-ghost {
	background: transparent;
	color: #fff;
	border-color: rgba(255, 255, 255, 0.45);
}

.btn-ghost:hover {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

.btn-dark {
	background: var(--ink);
	color: #fff;
}

.btn-dark:hover {
	background: #243447;
	color: #fff;
}

/* ——— Sections ——— */
.section {
	padding: 4.5rem 0;
}

.section-head {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 2rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--line);
}

.section-title {
	margin: 0;
	font-family: var(--display);
	font-size: clamp(1.7rem, 3vw, 2.2rem);
	font-weight: 700;
	line-height: 1.2;
}

.section-desc {
	margin: 0.35rem 0 0;
	color: var(--ink-soft);
	font-size: 0.95rem;
}

.section-link {
	font-weight: 600;
	white-space: nowrap;
	color: var(--tile);
}

.section-alt {
	background: var(--paper-2);
}

/* ——— Cards ——— */
.card-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.5rem;
}

.card {
	background: transparent;
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	opacity: 0;
	transform: translateY(20px);
	transition: transform 0.35s ease;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--line);
}

.card.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.card:hover {
	transform: translateY(-4px);
}

.card-media {
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background:
		linear-gradient(145deg, #0a6e6a, #14202b),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath fill='none' stroke='rgba(255,255,255,0.15)' d='M20 0L40 20L20 40L0 20Z'/%3E%3C/svg%3E");
	background-size: cover, 40px 40px;
	position: relative;
}

.card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.card:hover .card-media img {
	transform: scale(1.05);
}

.card-badge {
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--tile-deep);
	background: rgba(10, 110, 106, 0.1);
	padding: 0.2rem 0.55rem;
	width: fit-content;
}

.card-title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.45;
}

.card-title a {
	color: var(--ink);
}

.card-excerpt {
	margin: 0;
	color: var(--ink-soft);
	font-size: 0.92rem;
	flex-grow: 1;
}

.card-meta {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
	font-size: 0.8rem;
	color: var(--ink-soft);
}

/* Book cards */
.book-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.75rem;
}

.book-card {
	display: grid;
	grid-template-columns: 110px 1fr;
	gap: 1rem;
	align-items: start;
	padding: 1rem 0;
	border-top: 1px solid var(--line);
	opacity: 0;
	transform: translateY(16px);
}

.book-card.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.book-cover {
	aspect-ratio: 3 / 4;
	background: linear-gradient(160deg, var(--tile-deep), var(--ink));
	display: flex;
	align-items: center;
	justify-content: center;
	color: rgba(255, 255, 255, 0.7);
	font-family: var(--display);
	font-size: 1.4rem;
	overflow: hidden;
}

.book-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.book-title {
	margin: 0 0 0.35rem;
	font-size: 1.05rem;
	font-weight: 700;
}

.book-title a {
	color: var(--ink);
}

.book-meta {
	margin: 0;
	font-size: 0.85rem;
	color: var(--ink-soft);
}

.book-excerpt {
	margin: 0.5rem 0 0;
	font-size: 0.9rem;
	color: var(--ink-soft);
}

/* ——— Page / Single ——— */
.page-hero {
	padding: 3rem 0 1.5rem;
	border-bottom: 1px solid var(--line);
	background: var(--paper-2);
}

.page-hero h1 {
	margin: 0;
	font-family: var(--display);
	font-size: clamp(2rem, 4vw, 2.8rem);
}

.page-hero p {
	margin: 0.5rem 0 0;
	color: var(--ink-soft);
}

.content-area {
	padding: 2.5rem 0 4rem;
}

.entry-content {
	max-width: 42rem;
	font-size: 1.05rem;
}

.entry-content > *:first-child {
	margin-top: 0;
}

.entry-content h2,
.entry-content h3 {
	font-family: var(--display);
	margin-top: 2rem;
}

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin: 1rem 0 1.5rem;
	font-size: 0.9rem;
	color: var(--ink-soft);
}

.featured-image {
	margin: 0 0 2rem;
	aspect-ratio: 16 / 8;
	overflow: hidden;
	background: var(--ink);
}

.featured-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ——— Archive ——— */
.archive-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 2rem;
}

.pagination {
	display: flex;
	gap: 0.5rem;
	justify-content: center;
	margin-top: 3rem;
}

.pagination .page-numbers {
	padding: 0.4rem 0.75rem;
	border: 1px solid var(--line);
	color: var(--ink);
	background: var(--white);
}

.pagination .current {
	background: var(--ink);
	color: #fff;
	border-color: var(--ink);
}

/* ——— Footer ——— */
.site-footer {
	background: var(--ink);
	color: rgba(255, 252, 247, 0.78);
	padding: 3rem 0 1.5rem;
	margin-top: 2rem;
}

.footer-grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr;
	gap: 2rem;
	padding-bottom: 2rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand {
	font-family: var(--display);
	font-size: 2rem;
	color: #fff;
	margin: 0 0 0.5rem;
}

.footer-text {
	margin: 0;
	font-size: 0.95rem;
	max-width: 22rem;
}

.footer-title {
	margin: 0 0 0.75rem;
	color: #fff;
	font-size: 1rem;
}

.footer-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.footer-menu a {
	color: rgba(255, 252, 247, 0.75);
	font-size: 0.92rem;
}

.footer-menu li + li {
	margin-top: 0.35rem;
}

.footer-bottom {
	padding-top: 1.25rem;
	font-size: 0.82rem;
	opacity: 0.7;
}

.empty-state {
	padding: 2rem;
	text-align: center;
	color: var(--ink-soft);
	border: 1px dashed var(--line);
}

/* ——— Responsive ——— */
@media (max-width: 900px) {
	.card-grid,
	.book-grid,
	.archive-grid,
	.footer-grid {
		grid-template-columns: 1fr;
	}

	.nav-toggle {
		display: inline-flex;
	}

	.nav-primary {
		display: none;
		position: absolute;
		top: 100%;
		right: 0;
		left: 0;
		background: var(--paper);
		border-bottom: 1px solid var(--line);
		padding: 1rem 1.25rem 1.25rem;
	}

	.nav-primary.is-open {
		display: block;
	}

	.nav-primary ul {
		flex-direction: column;
		gap: 0.75rem;
	}

	.header-inner {
		position: relative;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}
}
