/*
 * Layout of the source design at every width: breakpoints, card grids and
 * media frames. Loaded on the page (after style.css) and in the editor canvas
 * (as an editor style, after style.css), where the media queries resolve
 * against the canvas width, so the canvas shows the layout a visitor gets at
 * that width. Page-only behaviour (fixed header, scroll states, entrance
 * animation) lives in frontend.css. A block the design hides at a width is
 * shown in the editor while it or a block inside it is selected (List View):
 * every hiding rule here excludes the editor's selection classes (in :where(),
 * so the rule keeps its specificity), which never occur on the page.
 */

.is-style-intro-mobile-rooms:where(:not(.is-selected, .has-child-selected)) {
	display: none;
}

@media (width >= 1700px) {
	.is-style-section > .is-style-container > .is-style-section-label,
	.is-style-roomgrid-section > .is-style-container > .is-style-section-label {
		position: absolute;
		top: 95px;
		left: 0;
	}
}

/*
 * Room card grids as the source's GridLayout masonry: every card spans its own
 * height plus the 30px gap in 1px rows, so grid auto-placement puts each next
 * card in the shortest column (leftmost on a tie). Spans follow the column
 * width of each container breakpoint (square = width, tall = 1.2 × width).
 * Below 768px the cards stack in order, as the source did.
 */
@media (width >= 768px) {
	.wp-block-query:is(.is-style-room-masonry, .is-style-room-masonry-home, .is-style-room-columns) > .wp-block-post-template {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		grid-auto-rows: 1px;
		column-gap: 30px;
		columns: auto;
	}

	.wp-block-query:is(.is-style-room-masonry, .is-style-room-masonry-home, .is-style-room-columns) > .wp-block-post-template > li {
		grid-row-end: span calc(380 + 70 * var(--brinkhotel-card-tall, 0));
	}
}

@media (width >= 992px) and (width <= 1199.98px) {
	.wp-block-query:is(.is-style-room-masonry, .is-style-room-masonry-home, .is-style-room-columns) > .wp-block-post-template > li {
		grid-row-end: span calc(320 + 58 * var(--brinkhotel-card-tall, 0));
	}
}

@media (width >= 768px) and (width <= 991.98px) {
	.wp-block-query:is(.is-style-room-masonry, .is-style-room-masonry-home, .is-style-room-columns) > .wp-block-post-template {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wp-block-query:is(.is-style-room-masonry, .is-style-room-masonry-home, .is-style-room-columns) > .wp-block-post-template > li {
		grid-row-end: span calc(360 + 66 * var(--brinkhotel-card-tall, 0));
	}
}

@media (width <= 1199.98px) {
	.wp-block-group.is-style-container,
	.is-style-plain-hero .is-style-container,
	.is-style-home-hero .is-style-container,
	.is-style-image-hero .is-style-container {
		max-width: 960px;
	}

	.is-style-hero-prev span,
	.is-style-hero-next span {
		width: 60px;
	}

	.wp-block-group.is-style-pageintro-body,
	.wp-block-heading.is-style-pageintro-title {
		max-width: 610px;
	}

	.is-style-shell-footer-menu-inner {
		flex-direction: column;
		gap: 0;
	}

	.is-style-shell-footer-menu-inner::after {
		display: none;
	}

	.is-style-shell-footer-logo,
	.is-style-shell-footer-menu-inner > .wp-block-brinkhotel-menu.is-location-footer {
		flex: auto;
	}
}

@media (width >= 992px) and (width <= 1199.98px) {
	.is-style-shell-footer-menu-inner {
		max-width: 930px;
	}

	/* Legal navigation includes the source row's column gutters. */
	.is-style-shell-footer-bottom-inner {
		max-width: 960px;
	}

	.is-style-shell-footer-contact-inner {
		max-width: 915px;
	}
}

@media (width <= 991.98px) {
	/* Header: menu button, centred logo, phone. */
	.is-style-shell-header {
		min-height: 70px;
		height: 70px;
		padding: 10px 15px;
		justify-content: space-between;
	}

	.is-style-shell-header > .wp-block-brinkhotel-menu.is-location-primary:where(:not(.is-selected, .has-child-selected)),
	.is-style-shell-header > .is-style-shell-booking:where(:not(.is-selected, .has-child-selected)),
	.is-style-shell-header > .wp-block-brinkhotel-language-switcher:where(:not(.is-selected, .has-child-selected)) {
		display: none;
	}

	.is-style-shell-header .is-style-shell-logo {
		position: absolute;
		left: 50%;
		margin: 0;
		transform: translateX(-50%);
	}

	/* Core image dimensions are inline; the mobile logo must override both axes. */
	.is-style-shell-header .is-style-shell-logo img {
		width: 65px !important;
		height: 50px !important;
	}

	.is-style-shell-header > .wp-block-brinkhotel-menu.is-location-mobile,
	.is-style-shell-header > .is-style-shell-phone {
		display: block;
		margin: 0;
	}

	.is-style-shell-footer-menu-inner {
		max-width: 690px;
	}

	.is-style-shell-footer-contact-inner {
		left: 0;
		max-width: 660px;
		padding-top: 30px;
	}

	.is-style-shell-footer-bottom-inner {
		flex-direction: column;
		gap: 0;
		max-width: 720px;
	}

	.is-style-shell-footer-credits {
		margin-top: 5px;
		padding-top: 15px;
		border: 0;
	}

	/* Sections. */
	.wp-block-group.is-style-container,
	.is-style-plain-hero .is-style-container,
	.is-style-home-hero .is-style-container,
	.is-style-image-hero .is-style-container {
		max-width: 720px;
	}

	.wp-block-group.is-style-section {
		padding-top: 60px;
		padding-bottom: 60px;
	}

	.is-style-roomgrid-section:where(:not(.is-selected, .has-child-selected)) {
		display: none;
	}

	:is(.wp-block-heading, .wp-block-post-title).is-style-hero-title {
		font-size: 58px;
	}

	.is-style-plain-hero .is-style-hero-title,
	.is-style-blog-hero .is-style-blog-hero-title {
		font-size: 45px;
	}

	.is-style-hero-prev,
	.is-style-hero-next {
		font-size: 36px;
	}

	.is-style-hero-prev span,
	.is-style-hero-next span {
		display: none;
	}

	.wp-block-cover.is-style-home-hero {
		align-items: center;
	}

	.is-style-home-hero .is-style-container > .wp-block-brinkhotel-booking {
		display: block;
		margin-top: 30px;
		margin-bottom: 30px;
	}

	.is-style-breadcrumbs:where(:not(.is-selected, .has-child-selected)),
	.is-style-crumbs-section:where(:not(.is-selected, .has-child-selected)) {
		display: none;
	}

	.is-style-article-columns,
	.is-style-intro-columns {
		flex-wrap: wrap !important;
	}

	/* Column widths are fixed by the design; the sidebar width is not used here. */
	.is-style-article-columns > .wp-block-column,
	.is-style-intro-columns > .wp-block-column {
		flex-basis: 100% !important;
	}

	/* Images first, text below. */
	.is-style-article-columns > .wp-block-column {
		order: 2;
	}

	.is-style-article-columns > .wp-block-column:has(> :is(.is-style-article-media, .is-style-article-media-alt)) {
		order: 1;
	}

	.wp-block-group.is-style-article-media,
	.wp-block-group.is-style-article-media-alt {
		height: 0;
		margin-right: 0;
		margin-left: 0;
		padding-top: 56.25%;
		aspect-ratio: auto;
	}

	.is-style-article-content {
		padding-top: 30px;
	}

	.wp-block-columns.is-style-article-columns {
		gap: 0;
	}

	.wp-block-group.is-style-article-narrow {
		width: auto;
	}

	.is-style-article-content > .is-style-article-buttons {
		justify-content: center;
	}

	/* The source's centred article button row, for the record cards' read-more. */
	.is-style-article-content > .wp-block-read-more.is-style-text-link {
		margin-inline: auto;
	}

	.wp-block-column.is-style-intro-copy-column {
		order: 1;
	}

	.wp-block-column.is-style-intro-media-column {
		position: static;
		order: 3;
		aspect-ratio: auto;
	}

	.wp-block-column.is-style-intro-mobile-rooms {
		display: block;
		order: 2;
	}

	.wp-block-column.is-style-intro-media-column > .wp-block-group.is-style-intro-media {
		position: relative;
		inset: auto;
		height: 0;
		min-height: 0;
		margin: 30px 0;
		padding-top: calc(100% + 75px);
		border: 0;
		aspect-ratio: auto;
	}

	.wp-block-columns.is-style-intro-columns {
		gap: 0;
	}

	/* Room carousel: full-bleed, one card per container width. */
	.is-style-intro-mobile-rooms > .wp-block-brinkhotel-carousel {
		width: 100vw;
		margin-right: -30px;
		margin-left: -30px;
	}

	.is-style-intro-mobile-rooms .wp-block-brinkhotel-carousel.is-mode-rooms .brinkhotel-carousel__track {
		grid-auto-columns: 720px;
		padding-inline: calc((100vw - 720px) / 2);
		scroll-padding-inline: calc((100vw - 720px) / 2);
	}

	.is-style-intro-mobile-rooms .wp-block-brinkhotel-carousel.is-mode-rooms .brinkhotel-carousel__track > :is(.wp-block-brinkhotel-carousel-item, .wp-block-post) {
		padding: 0;
	}

	.wp-block-group.is-style-pageintro-body,
	.wp-block-heading.is-style-pageintro-title {
		max-width: 570px;
	}

	.wp-block-columns.is-style-gallery-columns > .wp-block-column {
		/* stylelint-disable-next-line number-max-precision -- Preserve captured column geometry. */
		flex-basis: calc(33.333333333333336% - 20px) !important;
	}

	.is-style-gallery-columns > .wp-block-column:nth-child(n + 4):where(:not(.is-selected, .has-child-selected)) {
		display: none;
	}

	.is-style-brands-grid > .is-style-brand-card,
	.wp-block-query.is-style-brand-cards > .wp-block-post-template > li {
		/* stylelint-disable-next-line number-max-precision -- Preserve captured column geometry. */
		flex-basis: calc(33.333333333333336% - 20px);
	}

	.is-style-full-image {
		aspect-ratio: 4/3;
	}

	.wp-block-heading.is-style-pageintro-title {
		font-size: 36px;
	}

	/* Contact: form above, map below. */
	.wp-block-group.is-style-contact-section {
		padding-block: var(--wp--preset--spacing--60);
	}

	.is-style-contact-section .wp-block-heading.is-style-contact-heading {
		margin-bottom: 1em;
		font-size: calc(var(--wp--preset--font-size--large) * 2);
	}

	.wp-block-group.is-style-contact-layout {
		grid-template-columns: minmax(0, 1fr);
		margin-bottom: calc(var(--wp--preset--spacing--30) + var(--wp--preset--spacing--15));
		padding-top: calc(var(--wp--preset--spacing--30) + var(--wp--preset--spacing--15));
	}

	.is-style-contact-layout > .is-style-contact-enquiry,
	.is-style-contact-layout > .is-style-contact-enquiry:only-child {
		grid-column: 1;
		width: auto;
		margin-left: 0;
	}

	.wp-block-group.is-style-contact-layout > .is-style-contact-location {
		grid-row: 2;
		grid-column: 1;
		aspect-ratio: 1;
		margin-top: calc(var(--wp--preset--spacing--30) + var(--wp--preset--spacing--15));
	}

	.is-style-contact-links > :is(.is-style-contact-address, .is-style-contact-telephone, .is-style-contact-email) {
		flex-basis: calc(100% / 3);
	}

	:is(.is-style-contact-address, .is-style-contact-telephone, .is-style-contact-email) a::before {
		font-size: var(--wp--preset--spacing--60);
	}
}

@media (width <= 767.98px) {
	.is-style-intro-mobile-rooms .wp-block-brinkhotel-carousel.is-mode-rooms .brinkhotel-carousel__track {
		grid-auto-columns: 540px;
		padding-inline: calc((100vw - 540px) / 2);
		scroll-padding-inline: calc((100vw - 540px) / 2);
	}

	.is-style-shell-footer-credits::after {
		content: "";
		position: absolute;
		top: 0;
		left: calc(50% - 25px);
		width: 50px;
		height: 2px;
		background: currentcolor;
	}

	.is-style-shell-footer-menu-inner,
	.is-style-shell-footer-bottom-inner {
		max-width: 510px;
		padding-inline: 15px;
	}

	.is-style-shell-footer-logo:where(:not(.is-selected, .has-child-selected)) {
		display: none;
	}

	.is-style-shell-footer-contact-inner {
		max-width: none;
		margin: 0 15px;
		padding: 30px 30px 0;
	}

	.is-style-shell-footer-contact-inner > p {
		flex: 0 1 auto;
		min-width: auto;
	}

	.is-style-shell-footer-credits {
		padding-inline: 15px;
	}

	.wp-block-group.is-style-container,
	.is-style-plain-hero .is-style-container,
	.is-style-home-hero .is-style-container,
	.is-style-image-hero .is-style-container {
		max-width: 540px;
	}

	.wp-block-group.is-style-section {
		padding-top: 30px;
		padding-bottom: 30px;
	}

	:is(.wp-block-heading, .wp-block-post-title).is-style-hero-title {
		font-size: 48px;
	}

	.is-style-plain-hero .is-style-hero-title,
	.is-style-blog-hero .is-style-blog-hero-title {
		font-size: 30px;
	}

	.is-style-hero-title-row > .is-style-hero-prev,
	.is-style-hero-title-row > .is-style-hero-next {
		position: absolute;
		bottom: 15px;
		left: 0;
		flex-basis: auto;
		font-size: 24px;
	}

	.is-style-hero-title-row > .is-style-hero-next {
		right: 0;
		left: auto;
	}

	.wp-block-group.is-style-article-media,
	.wp-block-group.is-style-article-media-alt {
		padding-top: 75%;
	}

	.wp-block-query:is(.is-style-room-masonry, .is-style-room-masonry-home, .is-style-room-columns) > .wp-block-post-template {
		columns: 1;
	}

	.wp-block-columns.is-style-gallery-columns > .wp-block-column {
		flex-basis: calc(50% - 15px) !important;
	}

	.is-style-gallery-columns > .wp-block-column:nth-child(n + 3):where(:not(.is-selected, .has-child-selected)) {
		display: none;
	}

	.is-style-brands-grid > .is-style-brand-card,
	.wp-block-query.is-style-brand-cards > .wp-block-post-template > li {
		flex-basis: calc(50% - 15px);
		margin-top: 30px;
		margin-bottom: 30px;
	}

	.wp-block-heading.is-style-pageintro-title {
		font-size: 30px;
	}

	.wp-block-group.is-style-pageintro-body,
	.wp-block-heading.is-style-pageintro-title {
		max-width: none;
	}

	.is-style-full-image {
		aspect-ratio: 16/9;
	}

	.wp-block-group.is-style-contact-section {
		padding-block: var(--wp--preset--spacing--30);
	}

	.is-style-contact-section .wp-block-heading.is-style-contact-heading {
		margin-bottom: 1em;
		font-size: var(--wp--preset--font-size--xx-large);
	}

	.wp-block-group.is-style-contact-layout {
		margin-bottom: var(--wp--preset--spacing--30);
		padding-top: var(--wp--preset--spacing--30);
	}

	/* The source hides the map on phones. */
	.wp-block-group.is-style-contact-layout > .is-style-contact-location:where(:not(.is-selected, .has-child-selected)) {
		display: none;
	}

	.is-style-contact-links > :is(.is-style-contact-address, .is-style-contact-telephone, .is-style-contact-email) {
		flex-basis: 50%;
		padding-block: var(--wp--preset--spacing--30);
	}

	:is(.is-style-contact-address, .is-style-contact-telephone, .is-style-contact-email) a::before {
		font-size: var(--wp--preset--spacing--50);
	}
}

@media (width <= 575.98px) {
	.wp-block-group.is-style-container,
	.is-style-plain-hero .is-style-container,
	.is-style-home-hero .is-style-container,
	.is-style-image-hero .is-style-container {
		max-width: 100%;
		padding-right: 30px;
		padding-left: 30px;
	}

	.wp-block-column.is-style-intro-media-column > .wp-block-group.is-style-intro-media {
		width: 100vw;
		height: calc(100vw + 15px);
		margin: 30px -30px 0;
		padding-top: 0;
	}

	.is-style-intro-media img {
		object-position: left center;
	}

	.is-style-intro-mobile-rooms .wp-block-brinkhotel-carousel.is-mode-rooms .brinkhotel-carousel__track {
		grid-auto-columns: calc(100vw - 60px);
		padding-inline: 30px;
		scroll-padding-inline: 30px;
	}
}
