/*
Theme Name: Avenue Child
Description: Child theme for SofreyeInterneti.com — use together with the PHP 8.2–patched Avenue parent theme from this repository.
Author: SofreyeInterneti
Template: Avenue
Version: 1.0.0
*/

@import url("../Avenue/style.css");

/* Add site-specific overrides below. */

/*
 * Typography — Vazirmatn (enqueued in functions.php): modern, highly readable Persian.
 * Tahoma/Nasim fall back if the webfont is blocked or slow.
 */
body,
button,
input,
select,
textarea {
	font-family: "Vazirmatn", Tahoma, "Arial Unicode MS", sans-serif;
	font-size: 15px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6,
.nivo-caption h1,
#navigation,
#navigation li > ul li a,
.topNav li a,
.social-count,
ul.tabs li a,
.comment-submit,
.button,
.pagination,
.arrows,
.wp-block-heading {
	font-family: "Vazirmatn", Tahoma, "Arial Unicode MS", sans-serif;
}

h1,
h2,
h3 {
	font-weight: 700;
	letter-spacing: 0;
}

h4,
h5,
h6 {
	font-weight: 600;
}

#navigation {
	font-weight: 600;
	font-size: 19px;
}

.topNav li a {
	font-weight: 500;
}

/* Post & page body: Persian typography — override legacy inline XB Zar / align / sizes */
#main .post-entry,
#fullwidth .post-entry {
	text-align: right;
}

#main .post-entry h1,
#main .post-entry h2,
#main .post-entry h3,
#main .post-entry h4,
#main .post-entry h5,
#main .post-entry h6,
#main .post-entry p,
#main .post-entry li,
#main .post-entry blockquote,
#main .post-entry td,
#main .post-entry th,
#main .post-entry span,
#main .post-entry div,
#fullwidth .post-entry h1,
#fullwidth .post-entry h2,
#fullwidth .post-entry h3,
#fullwidth .post-entry h4,
#fullwidth .post-entry h5,
#fullwidth .post-entry h6,
#fullwidth .post-entry p,
#fullwidth .post-entry li,
#fullwidth .post-entry blockquote,
#fullwidth .post-entry td,
#fullwidth .post-entry th,
#fullwidth .post-entry span,
#fullwidth .post-entry div {
	font-family: "Vazirmatn", Tahoma, "Arial Unicode MS", sans-serif !important;
}

#main .post-entry p,
#fullwidth .post-entry p {
	text-align: right !important;
	direction: rtl !important;
	unicode-bidi: plaintext;
	font-size: 1rem !important;
	line-height: 1.75 !important;
	font-weight: 400 !important;
}

/* Block editor paragraph block (sometimes no classic <p> wrapper quirks). */
#main .post-entry .wp-block-paragraph,
#fullwidth .post-entry .wp-block-paragraph {
	text-align: right !important;
	direction: rtl !important;
	unicode-bidi: plaintext;
}

/* Legacy/editor spans inside body text — often carry align or LTR embedding. */
#main .post-entry p span,
#main .post-entry h3:not(.jp-relatedposts-headline) span,
#fullwidth .post-entry p span,
#fullwidth .post-entry h3:not(.jp-relatedposts-headline) span {
	direction: rtl !important;
	text-align: right !important;
}

/* Body-like headings (legacy posts used h3 for whole articles) */
#main .post-entry h1,
#fullwidth .post-entry h1 {
	text-align: right !important;
	direction: rtl !important;
	font-size: 1.85rem !important;
	font-weight: 700 !important;
	line-height: 1.4 !important;
}

#main .post-entry h2,
#fullwidth .post-entry h2 {
	text-align: right !important;
	direction: rtl !important;
	font-size: 1.55rem !important;
	font-weight: 700 !important;
	line-height: 1.45 !important;
}

#main .post-entry h3:not(.jp-relatedposts-headline),
#main .post-entry h3:not(.jp-relatedposts-headline) span,
#fullwidth .post-entry h3:not(.jp-relatedposts-headline),
#fullwidth .post-entry h3:not(.jp-relatedposts-headline) span {
	text-align: right !important;
	direction: rtl !important;
	font-size: 1.15rem !important;
	font-weight: 600 !important;
	line-height: 1.75 !important;
}

#main .post-entry h4,
#fullwidth .post-entry h4 {
	text-align: right !important;
	direction: rtl !important;
	font-size: 1.1rem !important;
	font-weight: 600 !important;
	line-height: 1.6 !important;
}

#main .post-entry h5,
#fullwidth .post-entry h5 {
	text-align: right !important;
	direction: rtl !important;
	font-size: 1.05rem !important;
	font-weight: 600 !important;
}

#main .post-entry h6,
#fullwidth .post-entry h6 {
	text-align: right !important;
	direction: rtl !important;
	font-size: 1rem !important;
	font-weight: 600 !important;
}

#main .post-entry li,
#fullwidth .post-entry li,
#main .post-entry blockquote,
#fullwidth .post-entry blockquote {
	direction: rtl !important;
	text-align: right !important;
}

/* Jetpack Related — keep a modest section title, still Vazirmatn */
#main .post-entry h3.jp-relatedposts-headline,
#fullwidth .post-entry h3.jp-relatedposts-headline {
	font-size: 1rem !important;
	font-weight: 600 !important;
	margin-top: 1.5em !important;
	direction: ltr !important;
	text-align: left !important;
}

#main .post-entry #jp-relatedposts .jp-relatedposts-post-a,
#fullwidth .post-entry #jp-relatedposts .jp-relatedposts-post-a {
	direction: rtl !important;
	text-align: right !important;
}

#main .post-entry #jp-relatedposts,
#fullwidth .post-entry #jp-relatedposts {
	font-family: "Vazirmatn", Tahoma, "Arial Unicode MS", sans-serif !important;
}

#main .post-entry #jp-relatedposts a,
#fullwidth .post-entry #jp-relatedposts a {
	font-family: "Vazirmatn", Tahoma, "Arial Unicode MS", sans-serif !important;
	font-size: 0.95rem !important;
}

/* Read More links on archive / blog listings — slightly larger hit area & type. */
.block.archive .block-item-big .readmore {
	font-size: 13px;
	width: 100px;
	height: 30px;
	padding-top: 6px;
	line-height: 1.25;
	box-sizing: border-box;
	background-size: 100% 100%;
}

.block.archive .block-item-big .readmore .block-arrows {
	font-size: 17px;
}

/* Listing / block thumbnails: clean card look (no border, soft corners, light shadow). */
.block-item-big .block-image img,
.block-item-small .block-image img {
	border: none;
	padding: 0;
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
	vertical-align: middle;
}

.block-item-big .block-image img:hover,
.block-item-small .block-image img:hover {
	border: none;
	background: transparent;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

/* Single post featured image — full main column width, fluid, lightbox link matches image. */
#main .post-thumb {
	width: 100%;
	max-width: 100%;
	margin-bottom: 20px;
	box-sizing: border-box;
}

#main .post-thumb > a,
#main .post-thumb a.lightbox {
	display: block;
	width: 100%;
	max-width: 100%;
	border-radius: 8px;
	overflow: hidden;
	line-height: 0;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
	transition: box-shadow 0.2s ease;
}

#main .post-thumb > a:hover,
#main .post-thumb a.lightbox:hover {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

#main .post-thumb img {
	border: none !important;
	padding: 0 !important;
	border-radius: 0;
	box-shadow: none;
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
}

/*
 * Main navigation: always right-aligned (no dependency on WP site language / html dir).
 * Menu order in Appearance → Menus still controls order; first item sits on the right.
 */
#wrapper-navigation {
	direction: rtl;
}

#navigation ul.menu,
#navigation ul#menu-main {
	float: right;
}

#navigation li {
	float: right;
	background-position: left center;
	padding: 0 0 0 2px;
}

#navigation li:hover > ul,
#navigation li.hover > ul {
	left: auto;
	right: 0;
}

#navigation li ul li:hover > ul,
#navigation li ul li.hover > ul {
	left: auto;
	right: 100%;
}

#navigation li > ul li a {
	text-align: right;
}

/*
 * Wide layout (large screens) — ~1240px content band, fluid side padding (common on modern themes).
 * Scoped to min-width: 960px so Avenue’s responsive.css (loaded after this file) still controls tablets/phones.
 */
@media only screen and (min-width: 960px) {
	#wrapper {
		max-width: 1320px;
		width: 100%;
		padding-left: clamp(16px, 3vw, 40px);
		padding-right: clamp(16px, 3vw, 40px);
		box-sizing: border-box;
		background-size: 100% auto;
	}

	#wrapper-content {
		max-width: 1240px;
		width: 100%;
		margin-left: auto;
		margin-right: auto;
		box-sizing: border-box;
	}

	.topNav {
		width: 100% !important;
		max-width: 1240px;
		margin-left: auto;
		margin-right: auto;
		box-sizing: border-box;
	}

	#wrapper-navigation {
		background-size: cover;
		background-position: center top;
	}

	/* Header: logo row uses full content width (matches widened wrapper). */
	#header-middle {
		width: 100%;
		box-sizing: border-box;
	}

	#logo {
		float: none;
		width: 100%;
		text-align: center;
		box-sizing: border-box;
	}

	#logo a {
		display: inline-block;
		max-width: 100%;
	}

	#logo img {
		display: block;
		width: auto;
		max-width: 100%;
		height: auto;
		margin-left: auto;
		margin-right: auto;
	}

	#header-banner {
		float: none;
		width: 100%;
		clear: both;
		text-align: center;
		padding-top: 14px;
		box-sizing: border-box;
	}

	#main {
		width: calc(100% - 340px) !important;
		margin-right: 20px;
		box-sizing: border-box;
	}

	#sidebar {
		width: 320px;
		box-sizing: border-box;
	}

	#wrapper-footer {
		max-width: 1320px;
		width: 100%;
		padding-left: clamp(16px, 3vw, 40px);
		padding-right: clamp(16px, 3vw, 40px);
		box-sizing: border-box;
	}

	#footer {
		max-width: 1240px;
		width: 100%;
		margin-left: auto;
		margin-right: auto;
		box-sizing: border-box;
	}

	#footer .widget {
		width: calc((100% - 40px) / 3) !important;
		margin-right: 20px !important;
		box-sizing: border-box;
	}

	#footer .widget.last {
		margin-right: 0 !important;
	}

	#fullwidth {
		width: 100% !important;
		max-width: 1240px !important;
		margin-left: auto;
		margin-right: auto;
		float: none;
	}

	#fullwidth .post-entry {
		width: 100% !important;
		max-width: none;
	}

	.block.archive .block-item-big {
		width: 100% !important;
		max-width: 100%;
		box-sizing: border-box;
	}

	/* Magazine / homepage: two column tiles inside main */
	#main .block.full .block-item-big,
	#main .homepage-widget .block-item-big {
		width: calc((100% - 20px) / 2) !important;
		max-width: none;
		box-sizing: border-box;
	}

	#main .block.half {
		width: calc((100% - 18px) / 2) !important;
		max-width: none;
		box-sizing: border-box;
	}

	#main .block.full .block-item-small,
	#main .homepage-widget .block-item-small {
		width: calc((100% - 20px) / 2) !important;
		max-width: none;
		box-sizing: border-box;
	}

	#main .block-item-big img,
	#main .block-item-small img {
		max-width: 100%;
		height: auto;
	}

	#wrapper-featured {
		max-width: 100%;
		box-sizing: border-box;
	}
}

/*
 * Section titles (e.g. “Recent Posts »”) — parent uses heading-box.png no-repeat, so the
 * bar didn’t span full width on widened layouts. Tile horizontally + fill block width.
 */
.block h3 {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	display: block;
	background-repeat: repeat-x;
	background-position: left center;
	background-size: auto 51px;
	min-height: 51px;
	line-height: 51px;
	padding-right: 12px;
}

/* Comment form — full-width fluid textarea (parent used fixed 308px + bitmap). */
#respond #comment-input,
#respond #comment-textarea {
	float: none;
	width: 100%;
	max-width: 100%;
	margin-right: 0;
	box-sizing: border-box;
}

#respond #comment-textarea {
	margin-bottom: 12px;
}

#respond .textarea-comment {
	display: block;
	width: 100% !important;
	max-width: 100%;
	min-height: 168px;
	height: auto !important;
	box-sizing: border-box;
	padding: 14px 16px;
	background: #fafafa !important;
	background-image: none !important;
	border: 1px solid #d0d0d0 !important;
	border-radius: 8px;
	font-family: "Vazirmatn", Tahoma, "Arial Unicode MS", sans-serif;
	font-size: 15px;
	line-height: 1.55;
	resize: vertical;
}

#respond .textarea-comment:focus {
	outline: none;
	border-color: #b0b0b0;
	box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
}

#respond #comment-submit,
#respond #comment-submit-admin {
	float: none;
	clear: both;
	width: auto;
	margin-top: 8px;
}

/* Header logo strip */
#header #logo {
	background-color: #e9dcea;
}

/* Footer credit / fine print — smaller type */
#footer-bottom {
	font-size: 12px;
	line-height: 1.5;
}

#footer-bottom p {
	font-size: inherit;
}

#footer-bottom a {
	font-size: inherit;
}
