/**
 * shadcn theme: page styles for "feed" (loaded after css/core/shadcn.php).
 * Scope every rule to this page's own wrapper so it cannot affect other pages.
 * Wrapper: .newsfeed-middle (composer + posts). Body-level popovers opened from the
 * composer (emoji picker, tag-friends suggestions) are scoped by their own classes.
 */

/* ------------------------------------------------------------------ composer: hidden panels
 * one vertical rhythm: each panel sits --sc-field-gap under the text area, no negative margins */
body.sc .newsfeed-middle .ossn-wall-container-data > #ossn-wall-friend,
body.sc .newsfeed-middle .ossn-wall-container-data > #ossn-wall-location,
body.sc .newsfeed-middle .ossn-wall-container-data > #ossn-wall-photo,
body.sc .newsfeed-middle .ossn-wall-container-data > #ossn-wall-postbg { margin: var(--sc-field-gap) 0 0 !important; }

/* photo: file input as a kit Input (32px, 1px input border, 6px) with a ghost "Choose file" */
body.sc .newsfeed-middle #ossn-wall-photo input[type="file"] {
	display: block; width: 100%; height: var(--sc-control-h); margin: 0 !important; padding: 3px var(--sc-control-px) 3px 3px !important;
	border: 1px solid var(--input) !important; border-radius: var(--sc-control-radius) !important; background: transparent !important;
	font-size: 0.875rem; line-height: 1.5rem; color: var(--muted-foreground); box-shadow: var(--sc-shadow-xs);
}
body.sc .newsfeed-middle #ossn-wall-photo input[type="file"]::file-selector-button {
	height: 1.5rem; margin: 0 0.5rem 0 0; padding: 0 0.5rem; vertical-align: top; line-height: 1.5rem;
	border: 0; border-radius: var(--sc-tag-radius); background: transparent; color: var(--foreground);
	font: inherit; font-size: 0.875rem; font-weight: 500; cursor: pointer;
}
body.sc .newsfeed-middle #ossn-wall-photo input[type="file"]::file-selector-button:hover { background: var(--accent); }

/* tag friends: the token list is the input (one border), the inner text field is borderless */
body.sc .newsfeed-middle #ossn-wall-friend .token-input-list {
	display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; min-height: var(--sc-control-h); width: 100%;
	margin: 0 !important; padding: 0 0.25rem !important; list-style: none;
	border: 1px solid var(--input) !important; border-radius: var(--sc-control-radius) !important;
	background: transparent !important; color: var(--foreground) !important; font-size: 0.875rem; box-shadow: var(--sc-shadow-xs);
}
body.sc .newsfeed-middle #ossn-wall-friend .token-input-list:focus-within {
	border-color: var(--ring) !important; box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent) !important;
}
body.sc .newsfeed-middle #ossn-wall-friend .token-input-input-token { flex: 1 1 4rem; margin: 0 !important; padding: 0 !important; background: transparent !important; }
body.sc .newsfeed-middle #ossn-wall-friend .token-input-input-token input {
	width: 100% !important; height: calc(var(--sc-control-h) - 2px) !important; margin: 0 !important; padding: 0 0.375rem !important;
	border: 0 !important; box-shadow: none !important; background: transparent !important; font-size: 0.875rem !important; color: var(--foreground) !important;
}
body.sc .newsfeed-middle #ossn-wall-friend .token-input-token {
	display: inline-flex; align-items: center; gap: 0.25rem; height: 1.5rem; margin: 0 !important; padding: 0 0.25rem 0 0.5rem !important;
	border: 0 !important; border-radius: var(--sc-tag-radius) !important; background: var(--secondary) !important; color: var(--secondary-foreground) !important;
	font-size: 0.75rem; font-weight: 500; overflow: visible;
}
body.sc .newsfeed-middle #ossn-wall-friend .token-input-token p { margin: 0 !important; padding: 0 !important; font-size: 0.75rem; color: inherit !important; }
body.sc .newsfeed-middle #ossn-wall-friend .token-input-delete-token { margin: 0 !important; color: var(--muted-foreground) !important; cursor: pointer; }

/* tag-friends suggestions dropdown: styled once in css/core/shadcn.php (shared popover) */

/* location: pin sits inside the input, so the text starts after it */
body.sc .newsfeed-middle #ossn-wall-location #ossn-wall-location-input {
	height: var(--sc-control-h); margin: 0 !important; padding: 0 var(--sc-control-px) 0 2rem !important;
}
body.sc .newsfeed-middle #ossn-wall-location .ossn-location-icon {
	top: 50% !important; left: var(--sc-control-px) !important; margin: 0 !important; transform: translateY(-50%);
	width: 1rem; height: 1rem; color: var(--muted-foreground) !important; line-height: 1;
}
body.sc .newsfeed-middle #ossn-wall-location .ossn-location-icon svg { width: 1rem; height: 1rem; display: block; }
body.sc .newsfeed-middle #ossn-wall-location .ossn-location-dropdown {
	background: var(--popover) !important; color: var(--popover-foreground) !important; border: 1px solid var(--border) !important;
	border-radius: var(--radius) !important; box-shadow: var(--sc-shadow-lg) !important; padding: 0.25rem !important; margin-top: 0.25rem !important;
}
body.sc .newsfeed-middle #ossn-wall-location .ossn-location-dropdown li {
	padding: 0.375rem 0.5rem !important; border-radius: var(--sc-tag-radius); font-size: 0.875rem; color: var(--popover-foreground) !important; background: transparent !important;
}
body.sc .newsfeed-middle #ossn-wall-location .ossn-location-dropdown li:hover { background: var(--accent) !important; color: var(--accent-foreground) !important; }

/* background picker: an outlined group of 32px swatches, 6px corners, token gaps */
body.sc .newsfeed-middle #ossn-wall-postbg {
	display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.25rem !important;
	border: 1px solid var(--input) !important; border-radius: var(--sc-control-radius) !important; background: transparent !important;
}
body.sc .newsfeed-middle #ossn-wall-postbg[style*="none"] { display: none !important; }
body.sc .newsfeed-middle #ossn-wall-postbg > span {
	width: var(--sc-control-h) !important; height: var(--sc-control-h) !important; margin: 0 !important;
	border-radius: var(--sc-control-radius) !important; border: 1px solid var(--border); cursor: pointer;
}

/* text area with a chosen background: 6px corners and OSSN's vertical centring back
 * (the core composer padding override pinned the text to the top-left of the 320px canvas) */
body.sc .newsfeed-middle .ossn-wall-container-data > .ossn-wall-textarea.postbg-container {
	border-radius: var(--sc-container-radius) !important; padding: 110px var(--sc-card-pad) 0 !important;
}


/* emoji picker: styled once in css/core/shadcn.php (shared popover) */

/* phones: the toolbar does not fit one row and Post wrapped alone onto a short, broken band.
 * Keep the same footer band: icons on the first row, Privacy + Post on the second, right aligned. */
@media (max-width: 575.98px) {
	/* same layout in the Create post pop-up (.sc-post-body), where the composer is moved out of the feed */
	body.sc .newsfeed-middle .ossn-wall-container-data > .controls,
	body.sc .sc-post-body .ossn-wall-container-data > .controls {
		/* 100% plus the two negative side margins, so the row is full and Privacy + Post always start a new row */
		flex: 1 1 calc(100% + var(--sc-card-pad) * 2); margin-right: calc(var(--sc-card-pad) * -1) !important; padding-bottom: 0.5rem !important; border-bottom-left-radius: 0 !important;
	}
	/* Privacy and Post fill the second row, half each */
	body.sc .newsfeed-middle .ossn-wall-container-data > .ossn-wall-privacy,
	body.sc .sc-post-body .ossn-wall-container-data > .ossn-wall-privacy {
		flex: 1 1 0; min-width: 0; margin: 0 0 0 calc(var(--sc-card-pad) * -1) !important;
		padding: 0 0.25rem 0.75rem var(--sc-card-pad) !important; border-top: 0 !important;
		border-bottom-left-radius: calc(var(--sc-container-radius) - 1px) !important;
	}
	body.sc .newsfeed-middle .ossn-wall-container-data > .ossn-wall-post-button-container,
	body.sc .sc-post-body .ossn-wall-container-data > .ossn-wall-post-button-container {
		flex: 1 1 0; min-width: 0; margin-top: 0 !important; padding-top: 0 !important; padding-left: 0.25rem !important; border-top: 0 !important;
	}
	body.sc .newsfeed-middle .ossn-wall-container-data > .ossn-wall-privacy > span,
	body.sc .sc-post-body .ossn-wall-container-data > .ossn-wall-privacy > span { flex: 1 1 auto; justify-content: center; }
	body.sc .newsfeed-middle .ossn-wall-container-data > .ossn-wall-post-button-container .ossn-wall-post,
	body.sc .sc-post-body .ossn-wall-container-data > .ossn-wall-post-button-container .ossn-wall-post { flex: 1 1 auto; width: 100%; }
}

/* privacy icon: 16px like the other toolbar icons */
body.sc .newsfeed-middle .ossn-wall-container-data > .ossn-wall-privacy > span svg { width: 1rem; height: 1rem; }

/* ------------------------------------------------------------------ post cards */
/* header: name link uses the same 600 weight as its row; inline icons match the 16px set */
body.sc .newsfeed-middle .ossn-wall-item .meta .user a.ossn-output-user-url { font-weight: 600 !important; }
body.sc .newsfeed-middle .ossn-wall-item .meta .user i.fa-angle-right { display: inline-flex; vertical-align: middle; }
body.sc .newsfeed-middle .ossn-wall-item .meta .user i.fa-angle-right svg { width: 1rem; height: 1rem; color: var(--muted-foreground); }

/* "..." post menu trigger: ghost icon button (32px, 6px, 16px icon), pulled out so the icon lines up with the card edge */
body.sc .newsfeed-middle .ossn-wall-item .post-menu { margin: -0.375rem -0.5rem 0 0 !important; }
body.sc .newsfeed-middle .ossn-wall-item .post-menu .dropdown > a {
	display: inline-flex !important; align-items: center; justify-content: center;
	width: var(--sc-control-h); height: var(--sc-control-h); border-radius: var(--sc-control-radius);
	color: var(--muted-foreground) !important; background: transparent;
}
body.sc .newsfeed-middle .ossn-wall-item .post-menu .dropdown > a:hover,
body.sc .newsfeed-middle .ossn-wall-item .post-menu .dropdown > a[aria-expanded="true"] { background: var(--accent); color: var(--accent-foreground) !important; }
body.sc .newsfeed-middle .ossn-wall-item .post-menu .dropdown > a i { display: inline-flex; line-height: 1; }
body.sc .newsfeed-middle .ossn-wall-item .post-menu .dropdown > a svg { width: 1rem; height: 1rem; }

/* photo post: no grey band under the image (old #f8f8f8 + 10px image margin) */
body.sc .newsfeed-middle .ossn-wall-item .ossn-wall-image-container { background: transparent !important; margin-top: var(--sc-field-gap); }
body.sc .newsfeed-middle .ossn-wall-item .post-contents > .ossn-wall-image-container:first-child { margin-top: 0; }
body.sc .newsfeed-middle .ossn-wall-item .ossn-wall-image-container img { display: block; margin: 0 !important; }

/* album post: muted panel in theme colours, even 10px padding/gaps, thumbnails without Bootstrap's white frame */
body.sc .newsfeed-middle .ossn-wall-item .post-contents.ossn-photos-wall {
	display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sc-field-gap);
	background: var(--muted) !important; border: 1px solid var(--border) !important; border-radius: var(--sc-container-radius) !important;
	padding: var(--sc-field-gap) !important; margin: 0.75rem 0 0 !important;
}
body.sc .newsfeed-middle .ossn-wall-item .post-contents.ossn-photos-wall > a { display: block; line-height: 0; }
body.sc .newsfeed-middle .ossn-wall-item .ossn-photos-wall .img-thumbnail {
	margin: 0 !important; padding: 0 !important; background: transparent !important;
	border: 1px solid var(--border) !important; border-radius: var(--radius) !important; box-shadow: none !important;
}

/* reactions popover: same 4px inner padding as other menus */
body.sc .newsfeed-middle .ossn-like-reactions-panel { padding: 0.25rem !important; }

/* ------------------------------------------------------------------ comments */
body.sc .newsfeed-middle .comments-list .comment-contents p,
body.sc .newsfeed-middle .comments-list .comment-contents .comment-text { font-size: 0.875rem !important; line-height: 1.25rem !important; }
body.sc .newsfeed-middle .comments-list .comment-contents .comment-text { display: block; padding: 0 !important; }
body.sc .newsfeed-middle .comments-list .comment-contents .owner-link { font-weight: 600 !important; }
body.sc .newsfeed-middle .comments-list .comment-contents { margin-top: 0 !important; }
/* meta row: 12px, items on one baseline with token gaps */
body.sc .newsfeed-middle .comments-list .comment-metadata {
	display: flex; align-items: center; gap: 0.5rem; margin: 0.25rem 0 0 0.75rem !important; font-size: 0.75rem;
}
body.sc .newsfeed-middle .comments-list .comment-metadata .ossn-like-comment,
body.sc .newsfeed-middle .comments-list .comment-metadata .ossn-unlike-comment { margin: 0 !important; font-size: 0.75rem; font-weight: 500; line-height: 1.125rem; }
body.sc .newsfeed-middle .comments-list .ossn-comment-menu a { display: inline-flex; align-items: center; color: var(--muted-foreground) !important; }
body.sc .newsfeed-middle .comments-list .ossn-comment-menu a svg { width: 1rem; height: 1rem; }
/* like / comment buttons (32px, 16px icons), comment box (32px) and its icons: now in css/core/shadcn.php for every page */

/* One centred feed column (no right-hand ads column, owner request): a readable width, centred in the space */
body.sc .ossn-layout-newsfeed .sc-feed-centered { max-width: 42rem; margin-left: auto; margin-right: auto; flex: 0 0 100%; }

/* ================================================================== approvals and roles (pages/approvals.php, pages/roles.php) */
body.sc .sc-membership .widget-contents { display: flex; flex-direction: column; gap: 1rem; }
body.sc .sc-membership h3 { font-size: 0.9375rem; font-weight: 600; margin: 0 0 0.5rem; }
body.sc .sc-membership h3 span { color: var(--muted-foreground); font-weight: 400; }
body.sc .sc-membership .is-muted, body.sc .sc-membership-lead { color: var(--muted-foreground); font-size: 0.875rem; margin: 0; }
body.sc .sc-membership-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0; border-top: 1px solid var(--border); }
body.sc .sc-membership-row img { width: 2.5rem; height: 2.5rem; border-radius: 999px; object-fit: cover; flex: none; }
body.sc .sc-membership-text { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: 0.875rem; }
body.sc .sc-membership-text strong span { font-weight: 400; color: var(--muted-foreground); }
body.sc .sc-membership-text > span { color: var(--muted-foreground); overflow-wrap: anywhere; }
body.sc .sc-membership-actions { display: flex; gap: 0.5rem; flex: none; }
body.sc .sc-membership-empty { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 2rem 1rem; color: var(--muted-foreground); font-size: 0.875rem; }
body.sc .sc-membership-empty p { margin: 0; }
body.sc .sc-membership-alert { display: flex; gap: 0.75rem; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: color-mix(in oklch, var(--muted) 60%, transparent); font-size: 0.875rem; }
body.sc .sc-membership-alert ul { margin: 0.25rem 0 0; padding-left: 1.125rem; }
body.sc .sc-membership-form { display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); }
body.sc .sc-membership-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.75rem; }
body.sc .sc-membership-fields label { display: flex; flex-direction: column; gap: 0.375rem; font-size: 0.8125rem; font-weight: 500; margin: 0; }
body.sc .sc-membership-fields input, body.sc .sc-membership-fields select { height: var(--sc-control-h); padding: 0 var(--sc-control-px); border: 1px solid var(--input, var(--border)); border-radius: var(--sc-control-radius); background: var(--background); color: var(--foreground); font-size: 0.875rem; }
body.sc .sc-membership-form .btn { align-self: flex-start; }
@media (max-width: 575px) {
	body.sc .sc-membership-row { flex-wrap: wrap; }
	body.sc .sc-membership-actions { width: 100%; justify-content: flex-end; }
}
/* the Role dropdown's options use the theme's popover colours (the browser default was white on white in dark mode) */
body.sc .sc-membership-fields select option { background-color: var(--popover); color: var(--popover-foreground); }
:root.dark body.sc .sc-membership-fields select { color-scheme: dark; color: var(--foreground); }
 