/* ==========================================================================
   ABrandão 27a — widgets.css  (only loaded when a widget area is displayed)
   Works for classic widgets and block widgets alike.
   ========================================================================== */

.widget { font-size: .94em; line-height: 1.55; color: var(--a27-text-2); min-width: 0; }
.sidebar .widget + .widget { margin-top: var(--a27-widget-gap); padding-top: var(--a27-widget-gap); border-top: var(--a27-border-w) solid var(--a27-border); }
.footer-col .widget + .widget { margin-top: 28px; }

/* Titles: classic .widget-title and block-widget headings share one look */
.widget-title,
.widget_block > h2:first-child, .widget_block > h3:first-child,
.widget_block > .wp-block-group > h2:first-child, .widget_block > .wp-block-group > h3:first-child,
.widget .wp-block-heading:first-child,
.widget .wp-block-search__label {
	display: block;
	margin: 0 0 16px;
	font-family: var(--a27-font-heading);
	font-size: var(--a27-h4);
	font-weight: var(--a27-heading-weight);
	letter-spacing: var(--a27-heading-tracking);
	line-height: 1.1;
	color: var(--a27-primary);
}
.widget-title::after,
.widget .wp-block-heading:first-child::after {
	content: ""; display: block; width: 28px; height: 3px; margin-top: 8px;
	background: var(--a27-primary); border-radius: 2px;
	transition: width .3s var(--a27-ease);
}
.widget:hover .widget-title::after, .widget:hover .wp-block-heading:first-child::after { width: 44px; }
.widget-title .tt-first { color: var(--a27-secondary); }

/* Links & lists */
.widget a { color: var(--a27-text); }
.widget a:hover { color: var(--a27-link); }
.widget ul, .widget ol { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-top: 1px solid color-mix(in srgb, var(--a27-border) 70%, transparent); }
.widget li:first-child { border-top: 0; padding-top: 0; }
.widget li ul { margin-top: 7px; padding-left: 14px; }
.widget .post-date, .widget .rss-date, .widget .wp-block-latest-posts__post-date, .widget .wp-block-rss__item-publish-date {
	display: block; font-family: var(--a27-font-meta); font-size: 12px; color: var(--a27-muted); margin-top: 2px;
}
.widget p:last-child { margin-bottom: 0; }

/* RSS (classic + block): external news headlines */
.widget .wp-block-rss { margin: 0; }
.widget .wp-block-rss__item, .widget_rss li { padding: 9px 0; }
.widget .wp-block-rss__item-title a, .widget_rss .rsswidget { font-weight: 500; line-height: 1.35; }
.widget .wp-block-rss__item-excerpt, .widget_rss .rssSummary { font-size: .92em; color: var(--a27-muted); margin-top: 3px; }
.widget .wp-block-rss__item-author { font-size: 12px; color: var(--a27-muted); }
.widget_rss .widget-title img { display: none; } /* old 14px feed icon */
.widget_rss .widget-title a { color: inherit; }

/* Search (classic + block) */
.widget .wp-block-search__inside-wrapper { display: flex; position: relative; border: 0; padding: 0; }
.widget .wp-block-search__input {
	width: 100%; padding: .6em 2.8em .6em .8em; background: var(--a27-surface-alt);
	border: 1px solid color-mix(in srgb, var(--a27-border) 60%, var(--a27-muted)); border-radius: var(--a27-radius);
	font-size: max(16px, .95em);
}
.widget .wp-block-search__button {
	position: absolute; right: 3px; top: 3px; bottom: 3px; margin: 0; padding: 0 .8em;
	background: var(--a27-btn-bg); color: var(--a27-btn-text); border: 0; border-radius: calc(var(--a27-radius) - 1px);
	font-family: var(--a27-font-meta); font-size: 13px; font-weight: 600;
}
.widget .wp-block-search__button.has-icon { padding: 0 .55em; }
.widget .wp-block-search__button svg { fill: currentColor; width: 20px; height: 20px; }
.widget_search .search-form { width: 100%; }

/* Tag cloud: soft chips (keeps the weighted sizes from WordPress) */
.widget .tagcloud, .widget .wp-block-tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; line-height: 1.2; margin: 0; }
.widget .tag-cloud-link {
	display: inline-block; padding: .25em .55em;
	border-radius: var(--a27-radius);
	background: var(--a27-surface-alt);
	color: var(--a27-text-2);
	font-family: var(--a27-font-meta);
	transition: background-color .2s, color .2s;
}
.widget .tag-cloud-link:hover { background: var(--a27-btn-bg); color: var(--a27-btn-text); }
.widget .wp-block-tag-cloud.is-style-outline .tag-cloud-link { background: transparent; border: 1px solid var(--a27-border); }

/* Calendar / archive */
.widget .wp-calendar-table, .widget #wp-calendar { width: 100%; border-collapse: collapse; font-family: var(--a27-font-meta); font-size: 13px; text-align: center; }
.widget .wp-calendar-table caption, .widget #wp-calendar caption {
	caption-side: top; text-align: left; margin-bottom: 10px;
	font-family: var(--a27-font-heading); font-size: var(--a27-h5); color: var(--a27-secondary); background: none;
}
.widget .wp-calendar-table th, .widget #wp-calendar th { padding: 6px 0; color: var(--a27-muted); font-weight: 600; background: none !important; border: 0 !important; border-bottom: 1px solid var(--a27-border) !important; }
.widget .wp-calendar-table td, .widget #wp-calendar td { padding: 5px 0; border: 0 !important; color: var(--a27-text-2); }
.widget .wp-calendar-table td a, .widget #wp-calendar td a {
	display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
	background: var(--a27-primary-soft); color: var(--a27-link-hover); font-weight: 700;
}
.widget .wp-calendar-table td a:hover { background: var(--a27-btn-bg); color: var(--a27-btn-text); }
.widget #today { color: var(--a27-link); font-weight: 700; box-shadow: inset 0 -2px 0 var(--a27-primary); }
.widget .wp-calendar-nav { display: flex; justify-content: space-between; margin-top: 10px; font-family: var(--a27-font-meta); font-size: 13px; }
.widget .wp-calendar-nav a { color: var(--a27-link); font-weight: 600; }
.widget select { max-width: 100%; }

/* Categories with counts */
.widget_categories li, .widget .wp-block-categories li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; }
.widget_categories li ul, .widget .wp-block-categories li ul { flex-basis: 100%; }

/* Images, embeds, misc */
.widget img { border-radius: max(0px, calc(var(--a27-radius) - 2px)); }
.widget iframe { max-width: 100%; }
.widget .wp-block-image { margin: 0; }
.widget .wp-block-latest-posts__featured-image img { border-radius: var(--a27-radius); }

/* Footer variants */
.site-footer .widget { color: inherit; }
.site-footer .widget a { color: inherit; text-decoration: none; }
.site-footer .widget a:hover { color: var(--a27-link); }
.site-footer .widget-title { font-size: var(--a27-h5); }
