/**
 * Evesta widgets + sidebar styles. Loaded when a widget area is active.
 * Covers the primary sidebar (incl. optional sticky), common core widgets and
 * the block widgets, for both the sidebar and the footer widget columns.
 */

/* ===================== SIDEBAR ===================== */
.evesta-sidebar { font-size: 0.95rem; }
.evesta-sidebar .widget,
.evesta-sidebar .evesta-widget { margin-bottom: calc(var(--evesta-spacing) * 2); }
.evesta-sidebar .widget:last-child { margin-bottom: 0; }

/* Optional sticky sidebar (desktop only, when enabled). */
@media screen and (min-width: 1025px) {
	.evesta-sticky-sidebar .evesta-sidebar {
		position: sticky;
		top: calc(var(--evesta-spacing) * 1.5);
		align-self: flex-start;
	}
}

/* ===================== WIDGET TITLES ===================== */
.widget-title,
.evesta-widget-title,
.wp-block-heading.widget-title {
	font-size: var(--evesta-h5, 1.25rem);
	margin: 0 0 var(--evesta-spacing);
	line-height: 1.25;
}

/* ===================== LIST-STYLE WIDGETS ===================== */
.widget ul,
.widget ol { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 0.4rem 0; }
/* Dividers between list items are shown in the sidebar by default. Footer widget
   dividers are off by default and toggled by the footer "Widget item dividers"
   setting (emitted by the dynamic CSS). */
.evesta-sidebar .widget li { border-bottom: var(--evesta-border-width) solid var(--evesta-color-border); }
.evesta-sidebar .widget li:last-child { border-bottom: 0; }
.widget li a { text-decoration: none; }
.widget li a:hover { text-decoration: underline; }
.widget .children,
.widget .sub-menu { margin-left: 1rem; }

/* Counts / dates alongside list items */
.widget li .post-date,
.widget .rss-date,
.widget li span.count { opacity: 0.7; font-size: 0.85em; }

/* ===================== SEARCH + TAG CLOUD ===================== */
.widget .search-form,
.widget .wp-block-search__inside-wrapper { display: flex; gap: 0.5rem; }
.widget input[type="search"],
.widget input[type="text"] {
	flex: 1; min-width: 0;
	padding: 0.5rem 0.75rem;
	border: var(--evesta-border-width) solid var(--evesta-color-border);
	border-radius: var(--evesta-radius);
	background: var(--evesta-color-bg);
	color: inherit;
}
.widget .tagcloud,
.widget .wp-block-tag-cloud { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.widget .tagcloud a,
.widget .wp-block-tag-cloud a {
	display: inline-block;
	font-size: 0.8rem !important;
	padding: 0.25rem 0.6rem;
	border-radius: 999px;
	text-decoration: none;
	background: var(--evesta-palette8, #f1f5f9);
	color: inherit;
}

/* ===================== CALENDAR ===================== */
.widget .wp-calendar-table { width: 100%; border-collapse: collapse; }
.widget .wp-calendar-table th,
.widget .wp-calendar-table td { text-align: center; padding: 0.3rem; }
.widget .wp-calendar-table caption { padding-bottom: 0.5rem; font-weight: 600; }

/* ===================== IMAGE / GALLERY WIDGETS ===================== */
.widget img { height: auto; max-width: 100%; }

/* ===================== FOOTER WIDGET AREA ===================== */
.evesta-footer__widgets .widget-title,
.evesta-footer__widgets .evesta-widget-title { color: inherit; }
/* Footer widget item dividers (when enabled) are emitted by the dynamic CSS. */
