/* Final responsive layer. Loaded after the theme, plugins and parish styles. */

@media (max-width: 767px) {
	html,
	body,
	#page {
		max-width: 100%;
		overflow-x: clip;
	}

	*,
	*::before,
	*::after {
		box-sizing: border-box;
	}

	img,
	svg,
	video,
	iframe {
		max-width: 100%;
	}

	.ast-container,
	.site-content > .ast-container,
	#primary,
	.site-main,
	.entry-content {
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		margin-right: 0 !important;
		margin-left: 0 !important;
	}

	.entry-content > :is(.wp-block-group, .wp-block-columns, .wp-block-media-text):not(.alignfull),
	.entry-content .alignwide,
	.church-hierarchy-section,
	.church-faith-today {
		width: calc(100% - 2rem) !important;
		max-width: calc(100% - 2rem) !important;
		margin-right: auto !important;
		margin-left: auto !important;
	}

	.entry-content :is(h1, h2, h3, h4, h5, h6, p, li, a),
	.site-title a {
		overflow-wrap: anywhere;
	}

	/* Mobile header: reserve a fixed column for the menu trigger. */
	#ast-mobile-header .ast-primary-header-bar,
	#ast-mobile-header .ast-builder-grid-row {
		width: 100% !important;
		max-width: 100% !important;
	}

	#ast-mobile-header .ast-builder-grid-row {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) 46px !important;
		align-items: center;
		padding: 0.55rem 1rem !important;
	}

	#ast-mobile-header .site-header-primary-section-left,
	#ast-mobile-header .ast-builder-layout-element[data-section="title_tagline"],
	#ast-mobile-header .site-branding,
	#ast-mobile-header .ast-site-title-wrap {
		min-width: 0 !important;
		max-width: 100% !important;
	}

	#ast-mobile-header .site-header-primary-section-right {
		display: flex !important;
		width: 46px !important;
		min-width: 46px !important;
		justify-content: flex-end !important;
	}

	#ast-mobile-header .church-emblem-link {
		width: 46px;
		height: 43px;
	}

	#ast-mobile-header .church-emblem-crop img {
		width: 96px;
		transform: translate(-25px, -3px);
	}

	#ast-mobile-header .ast-site-identity {
		width: 100%;
		gap: 0.45rem;
	}

	#ast-mobile-header .site-title,
	#ast-mobile-header .site-title a {
		display: block !important;
		font-size: clamp(0.78rem, 3.7vw, 0.95rem) !important;
		line-height: 1.2 !important;
	}

	#ast-mobile-header .menu-toggle.main-header-menu-toggle {
		display: grid !important;
		width: 42px !important;
		height: 42px !important;
		min-height: 42px !important;
		padding: 0 !important;
		place-items: center;
		border-radius: 8px !important;
	}

	#ast-mobile-header .ast-mobile-header-content {
		width: 100%;
		border-top: 1px solid var(--church-border);
		background: var(--church-white);
	}

	#ast-mobile-header .main-header-menu .menu-link {
		min-height: 46px;
		padding: 0.65rem 1.1rem !important;
	}

	/* Page banners and homepage hero. */
	body:not(.home) .entry-content > .wp-block-cover:first-child {
		min-height: 255px !important;
		margin-bottom: 0 !important;
		padding: 2.5rem 1rem !important;
		border-radius: 0 0 22px 22px;
	}

	body:not(.home) .entry-content > .wp-block-cover:first-child h1 {
		font-size: clamp(1.75rem, 8vw, 2.25rem) !important;
		line-height: 1.12 !important;
	}

	body:not(.home) .entry-content > .wp-block-cover:first-child p {
		max-width: 34rem;
		font-size: 0.95rem !important;
		line-height: 1.55 !important;
	}

	.home .entry-content > .wp-block-cover:first-child {
		min-height: 480px !important;
		padding: 3rem 1rem !important;
		border-radius: 0 0 24px 24px;
	}

	.home .entry-content > .wp-block-cover:first-child h1 {
		font-size: clamp(1.8rem, 8.4vw, 2.35rem) !important;
		line-height: 1.12 !important;
	}

	.home .church-hero-address {
		font-size: 0.92rem !important;
		line-height: 1.5 !important;
	}

	.home .entry-content > .wp-block-cover:first-child .wp-block-buttons {
		width: min(100%, 310px);
		flex-direction: column;
		align-items: stretch;
		gap: 0.65rem;
		margin-right: auto;
		margin-left: auto;
	}

	.home .entry-content > .wp-block-cover:first-child .wp-block-button,
	.home .entry-content > .wp-block-cover:first-child .wp-block-button__link {
		width: 100%;
	}

	body.home .entry-content > .wp-block-group.alignwide.church-service-card {
		padding-top: 1.5rem !important;
		padding-right: 1.25rem !important;
		padding-bottom: 1.5rem !important;
		padding-left: 1.25rem !important;
	}

	.home .church-service-card > .wp-block-group {
		display: block !important;
		width: 100%;
		margin: 0 !important;
		padding: 0 !important;
	}

	.home .church-service-card > .wp-block-group > .wp-block-group {
		width: 100%;
		margin: 0 !important;
		padding: 0 !important;
	}

	.home .church-service-card .church-service-location {
		margin-top: 1.5rem !important;
		padding: 1.5rem 0 0 !important;
	}

	.home .church-service-card .wp-block-buttons {
		margin: 1.1rem 0 0 !important;
	}

	/* Announcement card and notice. */
	.church-announcement-card {
		display: block;
		width: calc(100% - 2rem);
		margin-top: 1rem;
		padding: 1.2rem;
	}

	.church-announcement-card__mark {
		width: 42px;
		height: 42px;
		margin-bottom: 0.85rem;
	}

	.church-announcement-card__button {
		width: 100%;
		margin-top: 1rem;
	}

	.church-announcement-notice {
		width: calc(100% - 2rem);
		padding: 0.65rem;
	}

	/* Common content components. */
	.wp-block-columns,
	.wp-block-columns:not(.is-not-stacked-on-mobile) {
		flex-direction: column !important;
	}

	.wp-block-columns > .wp-block-column {
		width: 100% !important;
		min-width: 0 !important;
		flex-basis: auto !important;
	}

	.wp-block-media-text,
	.wp-block-media-text.alignwide {
		display: block !important;
		padding: 1rem !important;
	}

	.wp-block-media-text .wp-block-media-text__media,
	.wp-block-media-text .wp-block-media-text__content {
		width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	.wp-block-media-text .wp-block-media-text__content {
		padding-top: 1.25rem !important;
	}

	.wp-block-table {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	/* About page. */
	.page-id-94 .church-about-parish,
	.page-id-94 .church-history-section,
	.page-id-94 .church-about-invite {
		width: calc(100% - 2rem) !important;
		padding: 1.35rem !important;
	}

	.page-id-94 .church-history-timeline::before {
		left: 17px;
	}

	.page-id-94 .church-history-item {
		grid-template-columns: 36px minmax(0, 1fr);
		column-gap: 0.85rem;
	}

	.page-id-94 .church-history-marker {
		width: 36px;
		height: 36px;
		font-size: 0.62rem;
		line-height: 34px !important;
	}

	/* Events archive: neutralise the global pill button on day cells. */
	.post-type-archive-tribe_events .tribe-events,
	.post-type-archive-tribe_events .tribe-events .tribe-events-l-container {
		width: 100% !important;
		max-width: 100% !important;
	}

	.post-type-archive-tribe_events .tribe-events .tribe-events-l-container {
		padding: 1.25rem 1rem 2rem !important;
	}

	.post-type-archive-tribe_events .tribe-events .tribe-events-calendar-month__day-cell--mobile {
		display: flex !important;
		width: 100% !important;
		height: 58px !important;
		min-height: 58px !important;
		align-items: flex-start;
		justify-content: flex-start;
		margin: 0 !important;
		padding: 0.45rem !important;
		border: 0 !important;
		border-radius: 0 !important;
		background: transparent !important;
		background-image: none !important;
		box-shadow: none !important;
		color: var(--church-heading) !important;
		line-height: 1 !important;
		transform: none !important;
	}

	.post-type-archive-tribe_events .tribe-events .tribe-events-calendar-month__day-cell--selected,
	.post-type-archive-tribe_events .tribe-events .tribe-events-calendar-month__day-cell--mobile:focus,
	.post-type-archive-tribe_events .tribe-events .tribe-events-calendar-month__day-cell--mobile:hover {
		background: var(--church-cream) !important;
	}

	.post-type-archive-tribe_events .tribe-events .tribe-events-calendar-month__day-date-daynum {
		font-size: 0.85rem !important;
		line-height: 1.2 !important;
	}

	.post-type-archive-tribe_events .tribe-events .tribe-events-c-top-bar {
		flex-wrap: wrap;
	}

	.post-type-archive-tribe_events .tribe-events .tribe-events-c-subscribe-dropdown__button {
		width: 100% !important;
		min-width: 0;
	}

	.datepicker.dropdown-menu {
		width: calc(100vw - 1.5rem) !important;
		max-width: 340px;
	}

	/* Gallery landing page and album timeline. */
	.page-id-146 .church-gallery-albums-section {
		width: calc(100% - 2rem) !important;
		padding: 2.25rem 0;
	}

	.church-album-highlights__grid,
	.church-album-highlights__grid--1 {
		grid-template-columns: 1fr;
	}

	.church-album-timeline::before {
		left: 21px;
	}

	.church-album-timeline__item {
		grid-template-columns: 44px minmax(0, 1fr);
	}

	.church-album-timeline__item > time {
		width: 42px;
		height: 42px;
	}

	.church-album-timeline__item .church-album-card__link {
		grid-template-columns: 1fr;
	}

	.church-album-timeline__item .church-album-card__cover {
		min-height: 0;
		aspect-ratio: 16 / 9;
	}

	/* Contact page. */
	.page-id-122 .church-contact-main {
		width: calc(100% - 2rem) !important;
		padding: 2.5rem 0;
	}

	.page-id-122 .church-contact-cards {
		grid-template-columns: 1fr;
	}

	.page-id-122 .church-contact-directions__heading {
		display: block;
	}

	.page-id-122 .church-contact-directions__heading p {
		margin-top: 0.5rem !important;
		text-align: left !important;
	}

	.page-id-122 .church-contact-map iframe {
		height: 290px;
	}

	/* Single album and single event pages. */
	.single-church_album .entry-header,
	.single-church_album .entry-content,
	.single-tribe_events .tribe-events-pg-template,
	.single-tribe_events .tribe-events-single {
		width: calc(100% - 2rem) !important;
		max-width: calc(100% - 2rem) !important;
		margin-right: auto !important;
		margin-left: auto !important;
	}

	.single-church_album .entry-header {
		padding-top: 2rem;
	}

	.single-church_album .entry-title,
	.single-tribe_events .tribe-events-single-event-title {
		font-size: clamp(1.65rem, 7vw, 2rem) !important;
		line-height: 1.2 !important;
	}

	.single-church_album .entry-meta {
		display: none;
	}

	.single-church_album .modula-gallery,
	.single-church_album .modula-items {
		width: 100% !important;
		max-width: 100% !important;
	}

	.single-tribe_events .tribe-events-single-event-description,
	.single-tribe_events .tribe-events-event-meta,
	.single-tribe_events .tribe-events-event-meta > div {
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
	}

	.single-tribe_events .tribe-events-event-meta {
		display: block !important;
	}

	.single-tribe_events .tribe-events .tribe-events-c-subscribe-dropdown__button {
		width: 100% !important;
		min-width: 0;
	}

	/* Footer. */
	.site-footer .ast-builder-grid-row {
		display: block !important;
	}

	.site-footer .site-footer-section {
		width: 100%;
		text-align: center;
	}
}

@media (max-width: 420px) {
	#ast-mobile-header .ast-builder-grid-row {
		padding-right: 0.65rem !important;
		padding-left: 0.65rem !important;
	}

	#ast-mobile-header .site-title,
	#ast-mobile-header .site-title a {
		font-size: 0.75rem !important;
	}

	.church-announcement-bar__inner {
		padding-right: 2.25rem;
	}

	.church-announcement-card h2 {
		font-size: 1.25rem;
	}

	.post-type-archive-tribe_events .tribe-events .tribe-events-calendar-month__day-cell--mobile {
		height: 52px !important;
		min-height: 52px !important;
		padding: 0.35rem !important;
	}
}
