/* The Temperance Room: layout fixes */

/* Never split a word or a button label across lines */
.wp-block-heading,
.wp-block-button__link {
	overflow-wrap: normal;
	word-break: normal;
	hyphens: manual;
}
.wp-block-button__link {
	white-space: nowrap;
}

/* Headings inside bordered tiles: a touch smaller so they fit */
.is-style-tile .wp-block-heading {
	font-size: clamp(24px, 2.2vw, 30px);
}

/* Rows of four tiles (the readings): two by two until the screen is wide */
@media (min-width: 782px) and (max-width: 1279px) {
	.wp-block-columns:has(> .wp-block-column:nth-child(4)) {
		flex-wrap: wrap !important;
	}
	.wp-block-columns:has(> .wp-block-column:nth-child(4)) > .wp-block-column {
		flex-basis: calc(50% - 16px) !important;
		flex-grow: 0 !important;
	}
}

/* Rows of three tiles: give each a sensible minimum width on tablets */
@media (min-width: 782px) and (max-width: 1023px) {
	.wp-block-columns:has(> .wp-block-column:nth-child(3)):not(:has(> .wp-block-column:nth-child(4))) {
		flex-wrap: wrap !important;
	}
	.wp-block-columns:has(> .wp-block-column:nth-child(3)):not(:has(> .wp-block-column:nth-child(4))) > .wp-block-column {
		flex-basis: calc(50% - 16px) !important;
		flex-grow: 1 !important;
	}
}

/* The Shuffle */
.wp-block-categories.shuffle-cats{list-style:none;display:flex;flex-wrap:wrap;justify-content:center;gap:10px 28px;padding:0;margin:24px 0 0;font-size:14px;font-weight:600;letter-spacing:.22em;text-transform:uppercase}
.wp-block-categories.shuffle-cats a,.wp-block-post-title a,.wp-block-post-terms a{text-decoration:none}
.wp-block-post-excerpt__more-link{font-size:13px;font-weight:600;letter-spacing:.22em;text-transform:uppercase}
.wp-block-post-featured-image img{box-shadow:0 12px 28px rgba(0,0,0,.35)}
.single .wp-block-post-content a{text-decoration:underline}

/* Coin seal: logo mark in the header, gentle turn on the Homepage */
.tr-logo{display:block;line-height:0}
.tr-logo img{width:52px;height:52px;display:block}
.wp-block-image.is-style-seal img{animation:tr-turn 60s linear infinite}
@keyframes tr-turn{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.wp-block-image.is-style-seal img{animation:none}}

/* Product descriptions: keep the gaps between paragraphs */
.woocommerce-product-details__short-description p,.wp-block-post-content p,.woocommerce-Tabs-panel p{margin-bottom:1em}

/* Tiles in a row: same height, pictures the same size, price and button lined up along the bottom */
.wp-block-columns:has(.is-style-tile) { align-items: stretch !important; }
.wp-block-columns:has(.is-style-tile) > .wp-block-column { display: flex; flex-direction: column; }
.wp-block-column > .is-style-tile { flex: 1 1 auto; justify-content: flex-start !important; }
.is-style-tile > .wp-block-video { width: 100%; max-width: 220px; margin-left: auto; margin-right: auto; }
.is-style-tile > .wp-block-video video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; display: block; }
.is-style-tile > .wp-block-heading { min-height: 2.3em; display: flex; align-items: center; justify-content: center; }
.is-style-tile > p.is-style-label:has(+ .wp-block-buttons) { margin-top: auto !important; }
.is-style-tile > .wp-block-buttons { margin-top: 12px; }

/* Buttons inside tiles: never wider than the tile */
.is-style-tile > .wp-block-buttons { width: 100%; justify-content: center; }
.is-style-tile .wp-block-button { max-width: 100%; }
.is-style-tile .wp-block-button__link { white-space: normal; letter-spacing: .12em; padding-left: 18px; padding-right: 18px; line-height: 1.4; }

/* Product options (Colour, Design) and other shop drop-downs: cream on navy */
.woocommerce select, .wc-block-components-select select, table.variations select, .woocommerce-ordering select {
	background-color: #1C2A44 !important; color: #F2E8D5 !important; border: 1px solid #F2E8D5 !important;
	border-radius: 0; padding: 10px 36px 10px 14px; font-family: inherit; font-size: 17px;
	-webkit-appearance: none; appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, #F2E8D5 50%), linear-gradient(135deg, #F2E8D5 50%, transparent 50%) !important;
	background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50% !important;
	background-size: 6px 6px, 6px 6px !important; background-repeat: no-repeat !important;
}
.woocommerce select option { background: #1C2A44; color: #F2E8D5; }
table.variations th.label, table.variations label { color: #F2E8D5; }
table.variations .reset_variations { color: #F2E8D5; }
.tr-receipt-note { font-style: italic; opacity: .9; margin-top: .6em; }

/* Homepage sign-up: the section already has the heading, so hide the form's own */
.tr-signup .ml-form-embedContent:first-child{display:none!important}
.tr-signup{margin:18px 0 8px;max-width:460px}
.tr-signup .ml-form-embedWrapper{margin:0!important;border-radius:0!important}

/* Full-width sections: every coloured band runs edge to edge, whatever the page's content width */
.wp-block-post-content > .alignfull,
.entry-content > .alignfull{width:100vw!important;max-width:100vw!important;margin-left:calc(50% - 50vw)!important;margin-right:calc(50% - 50vw)!important;box-sizing:border-box}
.wp-block-post-content > .alignfull > .alignwide{max-width:min(1180px,100%)!important;width:100%;margin-left:auto!important;margin-right:auto!important}
html,body{overflow-x:hidden}

/* Homepage Shuffle cards: all the same height */
.wp-block-post-template.is-layout-grid > li{display:flex}
.wp-block-post-template.is-layout-grid > li > .is-style-tile{flex:1 1 auto;width:100%}

/* Shop: greeting cards listed automatically from the Cards category, styled as tiles */
.woocommerce ul.products{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:24px;margin:24px 0 0!important;padding:0;list-style:none}
.woocommerce ul.products::before,.woocommerce ul.products::after{display:none!important}
.woocommerce ul.products li.product{width:auto!important;margin:0!important;float:none!important;border:1px solid rgba(242,232,213,.5);padding:28px 24px 32px;text-align:center;display:flex;flex-direction:column;align-items:center}
.woocommerce ul.products li.product img{max-width:260px;margin:0 auto 18px}
.woocommerce ul.products li.product .woocommerce-loop-product__title{font-family:"Cormorant Garamond",Georgia,serif;font-size:28px;font-weight:500;color:#F2E8D5;padding:0}
.woocommerce ul.products li.product .price{color:#F2E8D5;font-size:13px;font-weight:600;letter-spacing:.24em;margin:10px 0 0}
.woocommerce ul.products li.product .button{margin-top:auto!important;background:#F2E8D5;color:#1C2A44;border-radius:0;font-size:13px;font-weight:600;letter-spacing:.2em;text-transform:uppercase;padding:14px 22px}
.woocommerce ul.products li.product a{text-decoration:none;color:inherit}
.woocommerce ul.products li.product .onsale{display:none}

/* 1.2.8 phones: less empty space between the menu and each page's opening */
@media (max-width: 781px) {
  header > .wp-block-group.alignfull { padding: 20px 24px !important; }
  main .wp-block-post-content > .alignfull:first-child { padding-top: 40px !important; }
}

/* 1.2.10 Keep me posted box (Shop + Books coming soon) */
.tr-keep{margin:56px auto 0;max-width:460px;scroll-margin-top:96px}
.tr-keep .tr-signup{margin:18px auto 0}
