/* Budayantara 1.2 layout system: widgets, footer, comments, archives, post/page. */

/* Structural safety */
.site-main > *,
.content-with-sidebar > *,
.content-full > *,
.site-sidebar > *,
.footer-widgets > *,
.widget > *,
.budayantara-widget > * { min-width: 0; }

.site-sidebar { gap: var(--budayantara-widget-gap, 16px); }
.widget {
	max-width: 100%;
	overflow: hidden;
	border-radius: var(--budayantara-widget-radius, 14px);
}
.widget img,
.widget iframe,
.widget video { max-width: 100%; }
.widget ul,
.widget ol { max-width: 100%; }

/* Global widget surfaces */
body.widget-style-card .widget {
	padding: 1.15rem;
	border: 1px solid rgba(18, 18, 18, .10);
	background: #fff;
	box-shadow: 0 8px 26px rgba(18, 18, 18, .035);
}
body.widget-style-bordered .widget {
	padding: 1.1rem;
	border: 1px solid rgba(18, 18, 18, .16);
	background: transparent;
	box-shadow: none;
}
body.widget-style-flat .widget {
	padding: .35rem 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}
body.widget-style-soft .widget {
	padding: 1.15rem;
	border: 0;
	background: color-mix(in srgb, var(--budayantara-primary) 7%, #fff);
	box-shadow: none;
}

.widget__title {
	margin: 0 0 .9rem;
	padding: 0 0 .55rem;
	font-size: clamp(1.05rem, 2vw, 1.3rem);
	line-height: 1.25;
}
body.widget-title-underline .widget__title { border: 0; border-bottom: 2px solid var(--widget-accent, var(--budayantara-gold)); }
body.widget-title-bar .widget__title { border: 0; border-left: 4px solid var(--widget-accent, var(--budayantara-gold)); padding: .2rem 0 .2rem .7rem; }
body.widget-title-plain .widget__title { border: 0; padding-bottom: 0; }

/* Widget list internals: prevent title/date/thumb collisions. */
.widget-post-list li,
.widget-term-list li {
	min-width: 0;
}
.widget-post-list li {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	align-items: start;
	gap: .25rem .75rem;
	padding: .75rem 0;
}
.widget-post-list li > a {
	min-width: 0;
	font-weight: 700;
	line-height: 1.35;
	text-decoration: none;
	overflow-wrap: anywhere;
}
.widget-post-list li > small {
	display: block;
	font-size: .76rem;
	line-height: 1.35;
	opacity: .72;
}
.widget-post-list--thumbnail li,
.widget-post-list--carousel li {
	grid-template-columns: 92px minmax(0, 1fr);
}
.widget-post-list--thumbnail li > img,
.widget-post-list--thumbnail li > .widget-thumb-placeholder,
.widget-post-list--carousel li > img,
.widget-post-list--carousel li > .widget-thumb-placeholder {
	grid-column: 1;
	grid-row: 1 / span 2;
	width: 92px;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}
.widget-post-list--thumbnail li > a,
.widget-post-list--thumbnail li > small,
.widget-post-list--carousel li > a,
.widget-post-list--carousel li > small { grid-column: 2; }
.widget-skin--numbered .widget-post-list li {
	grid-template-columns: 2.2rem minmax(0, 1fr);
}
.widget-skin--numbered .widget-post-list li::before {
	grid-column: 1;
	grid-row: 1 / span 2;
	align-self: start;
	padding-top: .05rem;
}
.widget-skin--numbered .widget-post-list li > a,
.widget-skin--numbered .widget-post-list li > small { grid-column: 2; }
.widget-post-list--compact li { display: block; padding: .5rem 0; }
.widget-post-list--compact li > a { display: block; }

.widget-card-list article {
	min-width: 0;
	padding-bottom: .75rem;
	border-bottom: 1px solid rgba(18, 18, 18, .09);
}
.widget-card-list article:last-child { padding-bottom: 0; border-bottom: 0; }
.widget-card-list article > a { display: block; margin-top: .45rem; font-weight: 700; line-height: 1.35; text-decoration: none; }
.widget-card-list article > small { display: block; margin-top: .25rem; opacity: .72; }
.widget-card-list--magazine { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.widget-card-list--magazine article { border: 0; padding: 0; }
.widget-card-list--carousel,
.widget-post-list--carousel {
	grid-auto-columns: min(82%, 280px);
	gap: .8rem;
	padding-bottom: .45rem;
}
.widget-card-list--carousel article {
	padding: .65rem;
	border: 1px solid rgba(18, 18, 18, .1);
	border-radius: calc(var(--budayantara-widget-radius, 14px) * .7);
}
.widget-term-list li { gap: .65rem; }
.widget-term-list li > a { min-width: 0; overflow-wrap: anywhere; }
.widget-term-list li > span { flex: none; }
.widget-video-list article,
.widget-location-list a { min-width: 0; align-items: flex-start; }
.widget-video-list article > a,
.widget-location-list a { min-width: 0; overflow-wrap: anywhere; }

/* Social links from Customizer or menu fallback. */
.social-links ul {
	display: flex;
	flex-wrap: wrap;
	gap: .55rem;
	margin: 0;
	padding: 0;
	list-style: none;
}
.social-links li { margin: 0; padding: 0; }
.social-links a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .42rem;
	min-height: 40px;
	max-width: 100%;
	padding: .45rem .7rem;
	border: 1px solid currentColor;
	border-radius: 999px;
	color: inherit;
	text-decoration: none;
	line-height: 1.2;
}
.social-icon { display: inline-grid; place-items: center; flex: 0 0 auto; }
.social-icon svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.social-icon svg rect,
.social-icon svg circle { fill: none; stroke: currentColor; stroke-width: 2; }
.social-display--icon a { width: 42px; padding-inline: 0; }
.social-skin--minimal a { width: 42px; padding-inline: 0; }
.social-skin--minimal .social-label { display: none; }
.social-skin--card ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.social-skin--card a { width: 100%; border-radius: 10px; }

/* Footer: widgets no longer become white-on-white. */
.site-footer { padding-top: 0; }
.site-footer.footer-skin--dark { background: #092d1d; color: #fff; }
.site-footer.footer-skin--brand { background: var(--budayantara-primary); color: #fff; }
.site-footer.footer-skin--light { background: #fff; color: var(--budayantara-ink); border-top: 1px solid rgba(18, 18, 18, .1); }
.site-footer.footer-skin--custom { background: var(--budayantara-footer-bg, #092d1d); color: var(--budayantara-footer-text, #fff); }
.site-footer a { color: inherit; }
.site-footer a:hover { color: var(--budayantara-gold-soft); }
.site-footer.footer-skin--light a:hover { color: var(--budayantara-primary); }
.footer-widgets {
	gap: var(--budayantara-widget-gap, 16px);
	padding-block: clamp(1.5rem, 4vw, 3rem);
}
.footer-widget-column { display: grid; align-content: start; gap: var(--budayantara-widget-gap, 16px); min-width: 0; }
.site-footer .widget {
	color: inherit;
	background: transparent;
	border-color: color-mix(in srgb, currentColor 22%, transparent);
	box-shadow: none;
}
body.widget-style-card .site-footer .widget,
body.widget-style-soft .site-footer .widget {
	background: color-mix(in srgb, currentColor 7%, transparent);
}
.site-footer.footer-skin--light .widget {
	background: color-mix(in srgb, var(--budayantara-primary) 4%, #fff);
	border-color: rgba(18, 18, 18, .1);
}
.site-footer .widget__title { color: inherit; }
.site-footer .widget-post-list li,
.site-footer .widget-term-list li,
.site-footer .widget-card-list article { border-color: color-mix(in srgb, currentColor 18%, transparent); }
.site-footer__bottom {
	align-items: center;
	gap: .8rem 1.25rem;
	padding-block: 1.1rem;
}
.site-footer__bottom > * { min-width: 0; }
.footer-menu { min-width: 0; }
.footer-menu ul { align-items: center; }
.footer-credit { line-height: 1.5; }
.footer-layout--centered .footer-menu ul,
.footer-layout--centered .social-links ul,
.footer-layout--stacked .footer-menu ul,
.footer-layout--stacked .social-links ul { justify-content: center; }
.footer-layout--cards.site-footer__bottom { border: 1px solid color-mix(in srgb, currentColor 20%, transparent); }

/* Archive/blog layouts. */
.archive-header { max-width: 880px; }
.archive-header h1 { margin-bottom: .45rem; font-size: clamp(2rem, 6vw, 3.5rem); }
.archive-description > :first-child { margin-top: 0; }
.archive-toolbar { flex-wrap: wrap; }
.archive-toolbar button[aria-pressed="true"] { background: var(--budayantara-gold); color: #12281d; }
.archive-posts { min-width: 0; }
.archive-posts > .navigation,
.archive-posts > .pagination,
.archive-posts > .js-load-more { grid-column: 1 / -1; }
.archive-posts.view-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.archive-posts--grid-2.view-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.archive-posts--grid-3.view-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.archive-posts.view-grid .content-card--list { display: block; margin: 0; }
.archive-posts.view-list .content-card--list { display: grid; grid-template-columns: minmax(180px, 32%) minmax(0, 1fr); }
.archive-posts.view-list .content-card--list.content-card--no-media { grid-template-columns: minmax(0, 1fr); }
.archive-layout--compact .archive-posts.view-list .content-card--list { grid-template-columns: 150px minmax(0, 1fr); }
.archive-layout--compact .content-card__body { padding: .8rem .95rem; }
.archive-layout--compact .content-card__title { font-size: 1.05rem; }
.archive-layout--compact .content-card__body p { font-size: .9rem; line-height: 1.5; }
.content-card--no-media .content-card__body { width: 100%; }
.content-card__terms { display: flex; flex-wrap: wrap; gap: .3rem; }
.content-card__terms .post-categories { flex-wrap: wrap; }

/* Post and Page surfaces. */
.article-column,
.page-article { min-width: 0; }
.single-article {
	width: min(100%, var(--budayantara-post-width, 760px));
	max-width: none;
}
.page-layout--standard .page-article {
	width: min(100%, var(--budayantara-page-width, 860px));
	max-width: none;
}
.post-layout--wide .single-article { width: min(100%, 1040px); max-width: none; }
.post-layout--full .single-article { width: 100%; max-width: none; }
.page-layout--wide .page-article { width: min(100%, 1100px); max-width: none; }
.page-layout--full .page-article { width: 100%; max-width: none; }
.single-article .entry-content > *,
.page-article .entry-content > * { max-width: 100%; }
.single-article .entry-content > .alignwide,
.page-article .entry-content > .alignwide { width: 100%; max-width: 100%; }
.single-article .entry-content > .alignfull,
.page-article .entry-content > .alignfull { width: 100%; max-width: 100%; margin-inline: 0; }
.content-surface--card,
.content-surface--soft {
	padding: clamp(1rem, 3vw, 2rem);
	border-radius: var(--radius);
}
.content-surface--card { background: #fff; border: 1px solid rgba(18, 18, 18, .09); box-shadow: var(--shadow); }
.content-surface--soft { background: color-mix(in srgb, var(--budayantara-primary) 6%, #fff); }
.title-align--center .single-article__header,
.title-align--center .page-article__header { text-align: center; }
.title-align--center .single-article__meta,
.title-align--center .content-card__terms { justify-content: center; }
.single-article__featured,
.page-article__featured { margin-inline: 0; }
.single-article__featured img,
.page-article__featured img { width: 100%; }
.entry-content > :first-child { margin-top: 0; }
.entry-content > :last-child { margin-bottom: 0; }
.entry-content blockquote { margin-inline: 0; padding: .8rem 1rem; border-left: 4px solid var(--budayantara-gold); }
.entry-content figure { margin-inline: 0; }
.entry-content .wp-block-image img { height: auto; }

/* Comments */
.comments-area {
	width: min(100%, var(--budayantara-post-width, 760px));
	max-width: none;
	margin-top: clamp(2rem, 6vw, 4rem);
}
.comments-header { margin-bottom: 1rem; }
.comments-title { margin: 0; font-size: clamp(1.35rem, 3vw, 2rem); }
.comment-list,
.comment-list .children { margin: 0; padding: 0; list-style: none; }
.comment-list .children { margin-top: .8rem; margin-left: clamp(.55rem, 3vw, 2rem); }
.comment-item { margin: 0 0 .85rem; }
.comment-body {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: .8rem;
	min-width: 0;
}
.comment-avatar img { display: block; border-radius: 50%; }
.comment-main { min-width: 0; }
.comment-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .7rem; }
.comment-author { min-width: 0; }
.comment-author a { color: inherit; text-decoration: none; }
.comment-permalink { font-size: .76rem; opacity: .65; text-decoration: none; }
.comment-content { margin-top: .55rem; overflow-wrap: anywhere; }
.comment-content > :first-child { margin-top: 0; }
.comment-content > :last-child { margin-bottom: 0; }
.comment-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: .55rem; font-size: .8rem; }
.comment-actions a { font-weight: 700; text-decoration: none; }
.comments-layout--cards > .comment-list > .comment,
.comments-layout--cards .children > .comment {
	padding: 1rem;
	border: 1px solid rgba(18, 18, 18, .09);
	border-radius: var(--budayantara-widget-radius, 14px);
	background: #fff;
}
.comments-layout--clean .comment-item { padding-bottom: .9rem; border-bottom: 1px solid rgba(18, 18, 18, .1); }
.comments-layout--compact .comment-body { grid-template-columns: minmax(0, 1fr); gap: .25rem; }
.comments-layout--compact .comment-avatar { display: none; }
.comments-layout--compact .comment-content { margin-top: .3rem; font-size: .94rem; }
.comment-respond {
	margin-top: 1.25rem;
	padding: clamp(1rem, 3vw, 1.5rem);
	border: 1px solid rgba(18, 18, 18, .09);
	border-radius: var(--budayantara-widget-radius, 14px);
	background: color-mix(in srgb, var(--budayantara-primary) 4%, #fff);
}
.comment-reply-title { margin-top: 0; }
.comment-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.comment-form > p { margin: 0; min-width: 0; }
.comment-form-comment,
.comment-notes,
.comment-form-cookies-consent,
.form-submit,
.logged-in-as { grid-column: 1 / -1; }
.comment-form label { display: block; margin-bottom: .25rem; font-weight: 700; }
.comment-form input:not([type="checkbox"]),
.comment-form textarea {
	width: 100%;
	max-width: 100%;
	border: 1px solid rgba(18, 18, 18, .22);
	border-radius: 10px;
	padding: .7rem .8rem;
	background: var(--budayantara-paper);
	color: var(--budayantara-ink);
}
.comment-form textarea { min-height: 150px; resize: vertical; }
.comment-form-cookies-consent { display: flex; align-items: flex-start; gap: .55rem; }
.comment-form-cookies-consent label { margin: 0; font-weight: 400; }

/* Dark mode compatibility for new surfaces. */
html.is-dark body.widget-style-card .widget,
html.is-dark .content-surface--card,
html.is-dark .comments-layout--cards > .comment-list > .comment,
html.is-dark .comments-layout--cards .children > .comment { background: #1a1a1a; border-color: rgba(255,255,255,.14); }
html.is-dark body.widget-style-soft .widget,
html.is-dark .content-surface--soft,
html.is-dark .comment-respond { background: #181f1b; }
html.is-dark .comment-form input:not([type="checkbox"]),
html.is-dark .comment-form textarea { background: #121212; color: #f5f2e8; border-color: rgba(255,255,255,.2); }
html.is-dark .widget-post-list li,
html.is-dark .widget-term-list li,
html.is-dark .widget-card-list article,
html.is-dark .comments-layout--clean .comment-item { border-color: rgba(255,255,255,.12); }

@media (max-width: 767px) {
	.archive-posts.view-grid,
	.archive-posts--grid-2.view-grid,
	.archive-posts--grid-3.view-grid { grid-template-columns: 1fr; }
	.archive-posts.view-list .content-card--list,
	.archive-layout--compact .archive-posts.view-list .content-card--list { grid-template-columns: 1fr; }
	.content-card--list .content-card__media { aspect-ratio: 16 / 9; }
	.widget-card-list--magazine { grid-template-columns: 1fr; }
	.social-skin--card ul { grid-template-columns: 1fr; }
	.comment-form { grid-template-columns: 1fr; }
	.comment-form > p { grid-column: 1; }
	.comment-list .children { margin-left: .45rem; padding-left: .55rem; border-left: 2px solid color-mix(in srgb, var(--budayantara-gold) 55%, transparent); }
	.comment-body { grid-template-columns: 36px minmax(0, 1fr); gap: .65rem; }
	.comment-avatar img { width: 36px; height: 36px; }
	.footer-widgets { grid-template-columns: 1fr !important; }
	.site-footer__bottom { flex-direction: column; align-items: flex-start; }
	.footer-layout--centered.site-footer__bottom,
	.footer-layout--stacked.site-footer__bottom,
	.footer-layout--cards.site-footer__bottom { align-items: center; text-align: center; }
	.footer-layout--centered .footer-menu ul,
	.footer-layout--centered .social-links ul,
	.footer-layout--stacked .footer-menu ul,
	.footer-layout--stacked .social-links ul,
	.footer-layout--cards .footer-menu ul,
	.footer-layout--cards .social-links ul { justify-content: center; }
	.content-surface--card,
	.content-surface--soft { padding: .9rem; }
}

@media (min-width: 768px) {
	.footer-columns--1 { grid-template-columns: minmax(0, 1fr); }
	.footer-columns--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.footer-columns--3,
	.footer-columns--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
	.footer-columns--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.footer-columns--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.archive-posts--grid-3.view-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.comments-area { width: min(100%, var(--budayantara-post-width, 760px)); }
}
