/*
 * The feed on the phone.
 *
 * The feed is the start page of the site. On the phone it is an app:
 * a post takes the whole width of the screen, a picture or a video
 * fills the width of the screen, and the buttons of a post are the
 * buttons of an app. The computer keeps the card.
 *
 * A single post is the feed with one post in it, so the page of a
 * single post has the same look.
 *
 * Every rule about a post starts with the two names of the frame of
 * the feed. BuddyBoss writes its own rules with two names too, and a
 * rule with one name loses against a rule with two.
 */

@media only screen and (max-width: 991px) {

	/* The feed takes the whole width of the phone. The frame of the
	   site keeps its room at the top and at the bottom. */
	body.directory.activity #section-2-4407 > .ct-section-inner-wrap {
		padding-left: 0;
		padding-right: 0;
	}

	body.directory.activity #activity-stream {
		padding-top: 0;
	}

	/* A single post is the feed with one post in it. The frame of the
	   page gives the post the room of a page, the app gives it the
	   whole width of the screen. */
	body.bostad-single-activity #inner_content-51-9 {
		padding-left: 0;
		padding-right: 0;
	}

	body.bostad-single-activity #buddypress {
		padding-top: 0;
		padding-bottom: 0;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list {
		--bostad-feed-avatar: 52px;

		padding: 0;
		margin-bottom: 0;
	}

	/* A post is a piece of the feed and not a card. A band of grey
	   between two posts tells them apart. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list.bp-list .activity-item {
		display: flex;
		flex-wrap: wrap;
		align-items: flex-start;
		background: var(--bostad-paper);
		border: 0;
		border-bottom: 10px solid var(--bostad-line);
		border-radius: 0 !important;
		box-shadow: none;
		margin: 0;
		padding: 0;
	}

	/* The grey cards that BuddyBoss shows while the feed loads look
	   like the cards of BuddyBoss. The feed is an app, so they look
	   like the posts of the feed. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .bb-activity-placeholder {
		background: var(--bostad-paper);
		border: 0;
		border-bottom: 10px solid var(--bostad-line);
		border-radius: 0;
		box-shadow: none;
		margin: 0;
		padding: 0;
	}

	/* The picture of the member and the name stand in the same row,
	   the same as in a post. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .bb-activity-placeholder .bb-activity-placeholder_avatar {
		width: 40px;
		height: 40px;
		margin: 10px 10px 0 12px;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .bb-activity-placeholder .bb-activity-placeholder_head {
		align-items: flex-start;
		margin-bottom: 0;
		padding: 10px 12px 0 0;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .bb-activity-placeholder .bb-activity-placeholder_details {
		width: auto;
		padding-top: 4px;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .bb-activity-placeholder .bb-activity-placeholder_content {
		margin: 12px 0 0;
		padding: 0 12px;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .bb-activity-placeholder .bb-activity-placeholder_actions {
		padding: 12px;
	}

	/* A shared post keeps the line about the share, and the post it
	   shares stands in the row below it. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list.bp-list .activity-item.inlined {
		display: block;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list.bp-list .activity-item.inlined .nested-activity {
		display: flex;
		flex-wrap: wrap;
		align-items: flex-start;
	}

	/* The boxes around the text and around the pictures are not needed.
	   Their pieces stand in the row of the post themselves, so a picture
	   can fill the whole width of the screen. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .activity-content,
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .activity-inner {
		display: contents;
	}

	/* The picture of the member and the name stand in the same row. The
	   name takes the rest of the row, so the buttons of the post get a
	   row of their own. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .activity-feature-image {
		flex: 1 1 100%;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .activity-avatar.item-avatar {
		float: none;
		flex: 0 0 var(--bostad-feed-avatar);
		margin: 0;
		padding: 10px 0 0 12px;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .activity-avatar.item-avatar img {
		width: 40px;
		height: 40px;
		max-width: 100%;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .activity-header {
		flex: 1 1 calc(100% - var(--bostad-feed-avatar));
		min-width: 0;
		margin: 0;
		width: auto;
		padding: 10px 12px 0 8px;
		font-size: 15px;
	}

	/* The name of the member stands in the middle of the picture next
	   to it, so the room above it is not needed. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .activity-header:not(.activity-header--group) {
		padding-top: 10px;
	}

	/* The group and the member who wrote in it stand in the same row. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .bp-activity-head-group {
		flex: 1 1 100%;
		align-items: center;
		padding: 10px 12px 0;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .activity-group-avatar {
		margin: 0 10px 0 0;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .activity-header.activity-header--group {
		margin: 0;
		padding: 0;
	}

	/* The three dots of the post stand in the corner of the row of the
	   name, so the name keeps away from them. */
	body.logged-in #buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .activity-header {
		padding-right: 60px;
	}

	/* The text of the post stands in the row of the post, with the room
	   the app keeps at the side. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .activity-inner > * {
		flex: 1 1 100%;
		min-width: 0;
		margin: 0;
		padding: 0 12px 10px;
	}

	/* A picture or a video fills the whole width of the screen. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .activity-inner > .bb-activity-media-wrap,
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .activity-inner > .bb-activity-video-wrap {
		padding: 0;
	}

	/* Two pictures stand next to each other with a small gap between
	   them. The gap is a white border on the picture, so the pictures
	   still touch the edge of the screen. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .bb-activity-media-elem:not(:first-child) .entry-img {
		border-left: 6px solid var(--bostad-paper);
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .bb-activity-media-elem {
		padding: 3px;
	}

	/* One picture takes the whole width of the screen. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .bb-media-length-1 .bb-activity-media-elem {
		padding: 0;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .bb-activity-media-elem .entry-img {
		border-radius: 0;
	}

	/* The video takes the whole width of the screen too. BuddyBoss
	   sets the width of it in the markup, so the rule needs an
	   important. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .bb-activity-video-elem {
		padding: 0;
		max-width: 100% !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .bb-activity-video-elem .video-js {
		width: 100%;
		max-width: 100%;
		border-radius: 0;
	}

	/* The buttons of the post stand in one row under the text: the
	   like, the field for a comment and the button that shares the
	   post. The number of the comments stands under them. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .wpulike {
		order: 1;
		flex: 0 0 auto;
		margin: 10px 0 0 0;
		padding: 0 0 8px 12px;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .activity-content .activity-state {
		order: 3;
		flex: 1 1 100%;
		justify-content: flex-start;
		margin: 0;
		padding: 0 12px 10px;
	}

	/* The field for a comment and the button that shares the post
	   stand at the other end of the same row. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .bp-generic-meta.action {
		order: 2;
		flex: 0 0 auto;
		align-self: flex-start;
		justify-content: flex-end;
		gap: 8px;
		margin: 10px 12px 0 auto;
		padding: 0 0 8px 0;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .bp-generic-meta.action .generic-button {
		display: inline-flex;
		flex: 0 0 auto;
		justify-content: flex-start;
		margin: 0;
	}

	/* The button of the like is a soft pill with the icon in it, and
	   the number stands in the same pill. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .wpulike .wp_ulike_general_class {
		align-items: center;
		gap: 2px;
		padding: 3px 10px 3px 3px;
		border-radius: 999px;
		background: var(--bostad-brand-soft);
		box-shadow: none;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .wpulike .wp_ulike_btn {
		background: none;
		box-shadow: none;
		border-radius: 999px;
		width: 28px;
		height: 28px;
		min-width: 28px;
		min-height: 28px;
		padding: 0;
	}

	/* The icon of the plugin is grey. The filter gives it the colour
	   of the site. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .wpulike .wp_ulike_btn:after {
		width: 18px;
		height: 18px;
		filter: grayscale(1) sepia(1) hue-rotate(216deg) saturate(6) brightness(0.85);
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .wpulike .count-box {
		background: none;
		box-shadow: none;
		padding: 0;
		margin: 0;
		color: var(--bostad-brand);
		font-size: var(--bostad-size-small);
		font-weight: 700;
		line-height: 1;
	}

	/* The little arrow of the number is not needed in the pill. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .wpulike .count-box:before {
		display: none;
	}

	/* The number of the comments is a quiet text under the buttons. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .activity-state-comments {
		display: inline-block;
		margin: 0;
		padding: 0;
		border-radius: 0;
		background: none;
		color: var(--bostad-text-soft);
		font-size: var(--bostad-size-small);
		font-weight: 600;
		text-decoration: none;
	}

	/* The button that opens the field for a comment is a quiet pill
	   with the icon of a comment in it. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .bp-generic-meta.action .acomment-reply {
		display: inline-flex;
		align-items: center;
		justify-content: flex-start;
		gap: 6px;
		width: auto;
		margin: 0;
		padding: 8px 14px;
		border: 1px solid var(--bostad-line);
		border-radius: 999px;
		background: var(--bostad-ground);
		color: var(--bostad-text-soft);
		font-size: var(--bostad-size-small);
		font-weight: 600;
		text-align: left;
	}

	/* The button that shares the post is a quiet pill too. The plugin
	   holds the colour of it with an important rule, so the colour
	   stays. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .bp-generic-meta.action .bostad-share {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		padding: 8px 14px;
		border: 1px solid var(--bostad-line);
		border-radius: 999px;
		background: var(--bostad-ground);
		font-size: var(--bostad-size-small);
		font-weight: 600;
	}

	/* The lines around the buttons of the post are not needed on the
	   phone. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .bp-generic-meta.action {
		border-top: 0;
		border-bottom: 0;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-comments > ul {
		border-top: 0;
	}

	/* The field for a comment follows the style guide: a white field
	   with a soft line around it, and the colour of the site when it
	   has the focus. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) :is(.ac-form, .ac-form-placeholder) .ac-reply-content {
		background: var(--bostad-paper);
		border: 1px solid var(--bostad-line-soft);
		border-radius: var(--bostad-radius);
		box-shadow: none;
		padding: 10px 12px;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) :is(.ac-form, .ac-form-placeholder) .ac-reply-content:focus-within {
		border-color: var(--bostad-brand);
		box-shadow: 0 0 0 3px var(--bostad-brand-soft);
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) :is(.ac-form, .ac-form-placeholder) .ac-textarea {
		margin-bottom: 0;
		padding: 0;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) :is(.ac-form, .ac-form-placeholder) .ac-input {
		min-height: 26px;
		line-height: 26px;
		font-size: var(--bostad-size-body);
		color: var(--bostad-text);
	}

	/* The button that sends the comment has the colour of the site. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) :is(.ac-form, .ac-form-placeholder) .ac-submit-wrap {
		background: var(--bostad-brand);
	}

	/* The buttons of the field are quiet, the field is the thing. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) :is(.ac-form, .ac-form-placeholder) .ac-reply-toolbar .toolbar-button {
		color: var(--bostad-text-soft);
	}

	/* The comments of the post. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .activity-comments {
		order: 4;
		flex: 1 1 100%;
		margin: 0;
		padding: 0 12px 12px;
		background: var(--bostad-paper);
	}

	/* A comment is plain text on the white of the post, not a box. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-comments .acomment_inner .acomment-content_block {
		background: none;
		padding: 0;
		border-radius: 0;
		margin-bottom: 0;
		min-width: 0;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-comments .acomment-content p {
		margin: 2px 0 0;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-comments .acomment-foot-actions {
		padding-left: 0;
	}

	/* The link that shows the other comments is quiet. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-comments .view-more-comments {
		color: var(--bostad-text-soft);
		font-size: var(--bostad-size-small);
		font-weight: 600;
	}

	/* A reply to a reply is one step in, not a whole step. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-comments ul {
		padding: 0;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-comments ul ul {
		padding-left: 32px;
	}

	/* The picture of a comment is smaller than the picture of a post. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-comments .acomment-avatar img {
		width: 32px;
		height: 32px;
	}

	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-comments ul li div.acomment-avatar {
		margin: 0 8px 0 0;
	}

	/* The line about a share is quiet, it is not the post itself. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list .activity-item .inlined-activity-banner {
		padding: 10px 12px 0;
		font-size: var(--bostad-size-small);
		color: var(--bostad-text-soft);
	}

	/* The button that loads more posts is a bar across the feed. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) .activity-list li.load-more > a {
		display: block;
		width: 100%;
		max-width: none;
		padding: 14px;
		border: 0;
		border-radius: 0;
		background: var(--bostad-ground);
		color: var(--bostad-brand);
	}

	/* The tooltips of BuddyBoss are a long line of text that sticks out
	   to the side. They push the page to the side on a small phone,
	   and a finger has no mouse to hover with. */
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) [data-bp-tooltip]:after,
	#buddypress :is(#activity-stream, .bb-modal-activity-body, .bb-modal-activity-footer) [data-bp-tooltip]:before {
		display: none;
	}

	/* The popup with a post and its comments is an app on the phone:
	   it fills the screen and the bar on top of it is small. */
	#buddypress .bb-activity-model-wrapper .activity-modal {
		width: 100%;
		max-width: 100%;
		height: 100%;
		max-height: 100%;
		padding-top: 70px;
		padding-bottom: env(safe-area-inset-bottom, 0px);
		border: 0;
		border-radius: 0;
		box-shadow: none;
	}

	#buddypress .bb-activity-model-wrapper .bb-modal-activity-header {
		height: 48px;
		min-height: 48px;
		padding: 0 12px;
	}

	#buddypress .bb-activity-model-wrapper .bb-modal-activity-header h2 {
		font-size: 16px;
	}

	#buddypress .bb-activity-model-wrapper .bb-modal-activity-body {
		padding: 0;
	}

	#buddypress .bb-activity-model-wrapper .bb-modal-activity-footer {
		padding: 10px 12px;
	}
}
