/* Persian Events Calendar - front-end styles
   Colors/fonts/sizes come from CSS custom properties printed inline by
   PEC_Render::inline_style() so admins can theme this without touching CSS. */

.pec-widget {
	font-family: var(--pec-font-family, Tahoma, sans-serif);
	font-size: var(--pec-font-size, 16px);
	background: var(--pec-bg, #1b6e63);
	color: var(--pec-text, #fff);
	border-radius: var(--pec-radius, 10px);
	padding: 16px 20px;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	box-sizing: border-box;
	max-width: 100%;
	line-height: 1.7;
}

.pec-widget * {
	box-sizing: border-box;
}

.pec-widget .pec-icon {
	font-size: 1.6em;
	line-height: 1;
	flex-shrink: 0;
}

.pec-widget-body {
	flex: 1;
	min-width: 0;
}

.pec-widget .pec-title {
	font-weight: bold;
	opacity: .85;
	font-size: .85em;
	margin-bottom: 2px;
}

.pec-widget .pec-date {
	font-weight: bold;
	font-size: 1.15em;
}

.pec-widget .pec-gregorian {
	opacity: .8;
	font-size: .85em;
	margin-top: 2px;
}

.pec-widget .pec-events {
	margin-top: 10px;
	border-top: 1px solid rgba(255, 255, 255, .25);
	padding-top: 8px;
}

.pec-widget .pec-events-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.pec-widget .pec-event {
	font-size: .9em;
}

.pec-widget .pec-event-holiday {
	color: var(--pec-holiday, #ff6b6b);
	font-weight: bold;
}

.pec-widget .pec-holiday-badge {
	display: inline-block;
	background: var(--pec-holiday, #ff6b6b);
	color: #fff;
	font-size: .75em;
	padding: 1px 6px;
	border-radius: 4px;
	margin-inline-start: 6px;
}

.pec-widget .pec-no-event {
	opacity: .75;
	font-size: .9em;
}

/* Box style: default card look, used by shortcode/widget */
.pec-style-box {
	max-width: 360px;
}

/* Inline style: compact single-line usage inside text/content */
.pec-style-inline {
	display: inline-flex;
	padding: 6px 12px;
	max-width: none;
}
.pec-style-inline .pec-events {
	display: none;
}

/* Bar style: full-width notification strip */
.pec-style-bar {
	width: 100%;
	max-width: none;
	border-radius: 0;
	flex-wrap: wrap;
	align-items: center;
}
.pec-style-bar .pec-events {
	border-top: none;
	padding-top: 0;
	margin-top: 0;
}
.pec-style-bar .pec-events-list {
	flex-direction: row;
	flex-wrap: wrap;
	gap: 14px;
}

/* Fixed top-of-site / bottom-of-site notification bar.
   The "bar" style stretches full-width flush with the edge; "box" and
   "inline" styles instead float as a corner toast so they don't stretch
   into an oddly-empty full-width strip. */
.pec-topbar {
	position: fixed;
	z-index: 99999;
	box-shadow: 0 1px 6px rgba(0, 0, 0, .2);
}
.pec-topbar.pec-style-bar {
	inset-inline: 0;
}
.pec-topbar.pec-style-box,
.pec-topbar.pec-style-inline {
	inset-inline-end: 16px;
	max-width: min(360px, calc(100% - 32px));
}
.pec-topbar.pec-style-bar.pec-topbar-top {
	top: 0;
}
.pec-topbar.pec-style-bar.pec-topbar-bottom {
	bottom: 0;
}
.pec-topbar.pec-style-box.pec-topbar-top,
.pec-topbar.pec-style-inline.pec-topbar-top {
	top: 16px;
}
.pec-topbar.pec-style-box.pec-topbar-bottom,
.pec-topbar.pec-style-inline.pec-topbar-bottom {
	bottom: 16px;
}

.pec-widget .pec-close {
	background: transparent;
	border: none;
	color: inherit;
	font-size: 1.4em;
	line-height: 1;
	cursor: pointer;
	opacity: .8;
	padding: 0 4px;
	order: 99;
	margin-inline-start: auto;
}
.pec-widget .pec-close:hover {
	opacity: 1;
}

/* Marquee (scrolling ticker) effect - used on the "bar" style */
.pec-marquee {
	overflow: hidden;
	white-space: nowrap;
	flex: 1;
	min-width: 0;
	mask-image: linear-gradient(to left, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
	-webkit-mask-image: linear-gradient(to left, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}

.pec-marquee-track {
	display: inline-flex;
	white-space: nowrap;
	animation-duration: var(--pec-marquee-speed, 25s);
	animation-timing-function: linear;
	animation-iteration-count: infinite;
}

.pec-marquee-rtl .pec-marquee-track {
	animation-name: pec-marquee-scroll-rtl;
}

.pec-marquee-ltr .pec-marquee-track {
	animation-name: pec-marquee-scroll-ltr;
}

.pec-marquee-item {
	padding-inline-end: 40px;
	font-weight: bold;
}

/* Content is duplicated (two .pec-marquee-item spans) so translating by
   exactly -50%/+50% loops seamlessly with no visible jump or gap. */
@keyframes pec-marquee-scroll-rtl {
	from { transform: translateX(0); }
	to   { transform: translateX(-50%); }
}

@keyframes pec-marquee-scroll-ltr {
	from { transform: translateX(-50%); }
	to   { transform: translateX(0); }
}

.pec-widget:hover .pec-marquee-track {
	animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
	.pec-marquee-track {
		animation: none;
	}
}

/* Typing effect - used on the "bar" style */
.pec-typing {
	flex: 1;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	font-weight: bold;
}

.pec-typing-cursor {
	display: inline-block;
	margin-inline-start: 2px;
	animation: pec-typing-blink 1s step-end infinite;
}

@keyframes pec-typing-blink {
	0%, 100% { opacity: 1; }
	50% { opacity: 0; }
}

/* Responsive */
@media (max-width: 782px) {
	.pec-widget {
		font-size: calc(var(--pec-font-size, 16px) * 0.9);
		padding: 12px 14px;
		flex-direction: row;
	}
	.pec-style-bar .pec-events-list {
		flex-direction: column;
		gap: 4px;
	}
	.pec-style-box {
		max-width: 100%;
	}
}

@media (max-width: 480px) {
	.pec-widget .pec-date {
		font-size: 1em;
	}
	.pec-widget .pec-icon {
		font-size: 1.3em;
	}
}
