/*
 * استایل فرانت‌اند ویجت‌های مدرسه
 * این فایل فقط در صفحاتی بارگذاری می‌شود که یکی از ویجت‌های افزونه استفاده شده باشد
 * (از طریق get_style_depends() هر ویجت در المنتور).
 */

.hew-announcements,
.hew-students {
	--hew-primary: #1F3A5F;
	--hew-accent: #C9974A;
	--hew-surface: #FFFFFF;
	--hew-bg-soft: #F7F5F0;
	--hew-text: #232B38;
	--hew-text-muted: #6B7280;
	--hew-border: #E7E2D8;
	--hew-radius: 14px;
	--hew-shadow: 0 2px 10px rgba(31, 58, 95, .08);
	--hew-shadow-hover: 0 10px 24px rgba(31, 58, 95, .14);
	--hew-cols: 3;

	box-sizing: border-box;
	font-family: var(--hew-font-family, inherit);
	color: var(--hew-text);
}

.hew-announcements *,
.hew-students *,
.hew-announcements *::before,
.hew-students *::before,
.hew-announcements *::after,
.hew-students *::after {
	box-sizing: border-box;
}

.hew-notice {
	background: var(--hew-bg-soft, #F7F5F0);
	border: 1px dashed var(--hew-border, #E7E2D8);
	border-radius: 10px;
	padding: 16px 18px;
	color: var(--hew-text-muted, #6B7280);
	font-size: 14px;
	text-align: center;
}

/* ---------------------------------- */
/* اطلاعیه‌ها - حالت کارتی (grid)     */
/* ---------------------------------- */

.hew-announcements--grid {
	display: grid;
	grid-template-columns: repeat(var(--hew-cols), 1fr);
	gap: 20px;
	align-items: stretch;
}

@media (max-width: 767px) {
	.hew-announcements--grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.hew-announcements--grid {
		grid-template-columns: 1fr;
	}
}

.hew-card {
	display: flex;
	flex-direction: column;
	background: var(--hew-surface);
	border: 1px solid var(--hew-border);
	border-radius: var(--hew-radius);
	box-shadow: var(--hew-shadow);
	overflow: hidden;
	transition: box-shadow .25s ease, transform .25s ease;
}

.hew-card:hover {
	box-shadow: var(--hew-shadow-hover);
	transform: translateY(-3px);
}

.hew-card-image {
	position: relative;
	display: block;
	height: 190px;
	overflow: hidden;
	background: var(--hew-bg-soft);
}

.hew-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .5s ease;
}

.hew-img-hover-zoom .hew-card-image:hover img {
	transform: scale(1.06);
}

.hew-card-body {
	padding: 18px 20px 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1 1 auto;
}

.hew-card-title {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.6;
}

.hew-card-title a {
	color: var(--hew-primary);
	text-decoration: none;
	transition: color .2s ease;
}

.hew-card:hover .hew-card-title a {
	color: var(--hew-accent);
}

.hew-card-excerpt {
	margin: 0;
	font-size: 14px;
	line-height: 1.9;
	color: var(--hew-text-muted);
	flex: 1 1 auto;
}

/* ---------------------------------- */
/* اطلاعیه‌ها - حالت لیستی           */
/* ---------------------------------- */

.hew-announcements--list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.hew-announcement-item {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	background: var(--hew-surface);
	border: 1px solid var(--hew-border);
	border-radius: var(--hew-radius);
	box-shadow: var(--hew-shadow);
	padding: 18px 20px;
	transition: box-shadow .25s ease, border-color .25s ease;
}

.hew-announcement-item:hover {
	box-shadow: var(--hew-shadow-hover);
	border-color: var(--hew-accent);
}

.hew-item-icon {
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--hew-bg-soft);
	color: var(--hew-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 17px;
}

.hew-item-thumb {
	flex: 0 0 auto;
	display: block;
	width: 60px;
	height: 60px;
	overflow: hidden;
	background: var(--hew-bg-soft);
	border-radius: 10px;
}

.hew-item-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.hew-thumb-circle .hew-item-thumb {
	border-radius: 50%;
}

.hew-item-body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.hew-item-title {
	display: block;
	font-size: 16px;
	font-weight: 700;
	color: var(--hew-primary);
	text-decoration: none;
	line-height: 1.7;
	transition: color .2s ease;
}

.hew-announcement-item:hover .hew-item-title {
	color: var(--hew-accent);
}

.hew-item-excerpt {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.9;
	color: var(--hew-text-muted);
}

.hew-item-more {
	flex: 0 0 auto;
	align-self: center;
	white-space: nowrap;
	font-size: 13px;
	font-weight: 600;
	color: var(--hew-primary);
	text-decoration: none;
	border: 1px solid currentColor;
	border-radius: 30px;
	padding: 7px 16px;
	transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.hew-item-more:hover {
	background-color: var(--hew-accent);
	border-color: var(--hew-accent);
	color: #fff;
}

@media (max-width: 600px) {
	.hew-announcement-item {
		flex-wrap: wrap;
	}
	.hew-item-more {
		align-self: flex-start;
		margin-inline-start: 58px;
	}
}

/* ---------------------------------- */
/* عناصر مشترک                       */
/* ---------------------------------- */

.hew-item-meta {
	font-size: 12.5px;
	color: var(--hew-text-muted);
	opacity: .85;
}

.hew-badge-new {
	display: inline-flex;
	align-items: center;
	font-size: 11px;
	font-weight: 700;
	background: var(--hew-accent);
	color: #fff;
	border-radius: 20px;
	padding: 3px 10px;
	margin-inline-start: 6px;
	line-height: 1.6;
	vertical-align: middle;
}

.hew-badge-new--onimage {
	position: absolute;
	top: 12px;
	inset-inline-end: 12px;
	margin: 0;
}

.hew-btn-more {
	display: inline-flex;
	align-self: flex-start;
	margin-top: auto;
	font-size: 13px;
	font-weight: 600;
	color: var(--hew-primary);
	text-decoration: none;
	border: 1px solid currentColor;
	border-radius: 30px;
	padding: 8px 18px;
	transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.hew-btn-more:hover {
	background-color: var(--hew-accent);
	border-color: var(--hew-accent);
	color: #fff;
}

.hew-view-all-wrap {
	text-align: center;
	margin-top: 24px;
}

.hew-btn-view-all {
	display: inline-block;
	font-size: 14px;
	font-weight: 700;
	color: var(--hew-primary);
	text-decoration: none;
	border: 1px solid currentColor;
	border-radius: 30px;
	padding: 10px 26px;
	transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.hew-btn-view-all:hover {
	background-color: var(--hew-accent);
	border-color: var(--hew-accent);
	color: #fff;
}

/* ---------------------------------- */
/* کارت فشرده موبایل + مودال خلاصه    */
/* ---------------------------------- */

.hew-card-slot {
	display: flex;
	height: 100%;
}

.hew-card--mobile-compact {
	display: none;
	align-items: center;
	gap: 12px;
	width: 100%;
}

@media (max-width: 767px) {
	.hew-mstyle-compact .hew-card--desktop {
		display: none;
	}

	.hew-mstyle-compact .hew-card--mobile-compact {
		display: flex;
	}
}

.hew-compact-thumb {
	flex: 0 0 auto;
	display: block;
	width: 64px;
	height: 64px;
	overflow: hidden;
	background: var(--hew-bg-soft);
	border-radius: 10px;
}

.hew-compact-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.hew-compact-thumb-circle .hew-compact-thumb {
	border-radius: 50%;
}

.hew-compact-title {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 14.5px;
	font-weight: 700;
	color: var(--hew-primary);
	text-decoration: none;
	line-height: 1.6;
	display: -webkit-box;
	overflow: hidden;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.hew-summary-trigger {
	flex: 0 0 auto;
	appearance: none;
	-webkit-appearance: none;
	background: var(--hew-bg-soft);
	border: 1px solid var(--hew-border);
	color: var(--hew-primary);
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 700;
	border-radius: 30px;
	padding: 7px 14px;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.hew-summary-trigger:hover,
.hew-summary-trigger:focus-visible {
	background: var(--hew-accent);
	border-color: var(--hew-accent);
	color: #fff;
}

.hew-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s ease, visibility .2s ease;
}

.hew-modal.is-open {
	opacity: 1;
	visibility: visible;
}

.hew-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(35, 43, 56, .55);
}

.hew-modal-dialog {
	position: relative;
	background: var(--hew-surface, #fff);
	border-radius: 16px;
	max-width: 420px;
	width: 100%;
	max-height: 80vh;
	overflow-y: auto;
	padding: 28px 24px 24px;
	box-shadow: 0 20px 45px rgba(0, 0, 0, .25);
	transform: translateY(10px) scale(.98);
	transition: transform .2s ease;
	font-family: var(--hew-font-family, inherit);
}

.hew-modal.is-open .hew-modal-dialog {
	transform: translateY(0) scale(1);
}

.hew-modal-close {
	position: absolute;
	top: 12px;
	inset-inline-end: 12px;
	width: 32px;
	height: 32px;
	border: none;
	background: var(--hew-bg-soft, #F7F5F0);
	color: var(--hew-text, #232B38);
	border-radius: 50%;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hew-modal-title {
	margin: 0 0 12px;
	padding-inline-end: 30px;
	font-size: 17px;
	font-weight: 700;
	color: var(--hew-primary, #1F3A5F);
	line-height: 1.7;
}

.hew-modal-excerpt {
	margin: 0 0 20px;
	font-size: 14px;
	line-height: 1.9;
	color: var(--hew-text-muted, #6B7280);
}

.hew-modal-more {
	display: inline-block;
	font-size: 13.5px;
	font-weight: 700;
	color: #fff;
	background: var(--hew-primary, #1F3A5F);
	text-decoration: none;
	border-radius: 30px;
	padding: 10px 22px;
	transition: background-color .2s ease;
}

.hew-modal-more:hover {
	background: var(--hew-accent, #C9974A);
}

body.hew-modal-open {
	overflow: hidden;
}

/* ---------------------------------- */
/* دانش‌آموزان نمونه                  */
/* ---------------------------------- */

.hew-students {
	display: grid;
	grid-template-columns: repeat(var(--hew-cols), 1fr);
	gap: 24px;
}

@media (max-width: 991px) {
	.hew-students {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 600px) {
	.hew-students {
		grid-template-columns: repeat(2, 1fr);
	}
}

.hew-student-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 12px;
	background: var(--hew-surface);
	border: 1px solid var(--hew-border);
	border-radius: 16px;
	box-shadow: var(--hew-shadow);
	padding: 20px 16px;
	transition: box-shadow .25s ease, transform .25s ease;
}

.hew-hover-lift .hew-student-card:hover {
	box-shadow: var(--hew-shadow-hover);
	transform: translateY(-4px);
}

.hew-student-photo {
	width: 130px;
	height: 130px;
	overflow: hidden;
	background: var(--hew-bg-soft);
	border: 3px solid var(--hew-bg-soft);
	flex: 0 0 auto;
}

.hew-student-photo img,
.hew-student-photo svg {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .4s ease;
}

.hew-hover-zoom .hew-student-photo:hover img {
	transform: scale(1.08);
}

.hew-shape-circle .hew-student-photo {
	border-radius: 50%;
}

.hew-shape-rounded .hew-student-photo {
	border-radius: 18px;
}

.hew-shape-square .hew-student-photo {
	border-radius: 4px;
}

.hew-student-name {
	margin: 0;
	font-size: 15.5px;
	font-weight: 700;
	color: var(--hew-primary);
	line-height: 1.6;
}

.hew-student-grade {
	display: inline-block;
	font-size: 12px;
	font-weight: 600;
	background: #F3EDE0;
	color: #B08535;
	border-radius: 20px;
	padding: 4px 14px;
}

/* ---------------------------------- */
/* برنامه هفتگی کلاسی                 */
/* ---------------------------------- */

.hew-schedule-wrap {
	--hew-primary: #1F3A5F;
	--hew-accent: #C9974A;
	--hew-surface: #FFFFFF;
	--hew-bg-soft: #F7F5F0;
	--hew-text: #232B38;
	--hew-border: #E7E2D8;

	box-sizing: border-box;
	font-family: var(--hew-font-family, inherit);
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	background: var(--hew-surface);
	border: 1px solid var(--hew-border);
	border-radius: 14px;
	box-shadow: 0 2px 10px rgba(31, 58, 95, .08);
}

.hew-schedule-wrap * {
	box-sizing: border-box;
}

.hew-schedule {
	width: 100%;
	min-width: 640px;
	border-collapse: collapse;
}

.hew-schedule thead th {
	background: var(--hew-primary);
	color: #fff;
	font-weight: 700;
	font-size: 14px;
	text-align: center;
	white-space: nowrap;
	padding: 14px 10px;
}

.hew-schedule thead th.hew-schedule-today {
	background: var(--hew-accent);
}

.hew-schedule-corner {
	background: var(--hew-primary);
}

.hew-schedule-period {
	background: var(--hew-bg-soft);
	color: var(--hew-primary);
	font-weight: 700;
	font-size: 13.5px;
	text-align: center;
	white-space: nowrap;
	padding: 12px 16px;
	border-top: 1px solid var(--hew-border);
}

.hew-schedule td {
	padding: 12px 10px;
	text-align: center;
	font-size: 13.5px;
	color: var(--hew-text);
	border-top: 1px solid var(--hew-border);
}

.hew-schedule tbody tr:nth-child(even) td:not(.hew-schedule-today) {
	background: var(--hew-bg-soft);
}

.hew-schedule td.hew-schedule-today {
	background: rgba(201, 151, 74, .12);
	font-weight: 600;
}

.hew-schedule-empty {
	color: var(--hew-text-muted, #6B7280);
	opacity: .6;
}

@media (max-width: 600px) {
	.hew-schedule thead th,
	.hew-schedule-period,
	.hew-schedule td {
		font-size: 12.5px;
		padding: 10px 8px;
	}
}
