/*
Theme Name: The Radiance Room
Author: Henry Bailey
Description: Custom block theme for The Radiance Room specialist skin clinic.
Version: 2.2.1
Requires at least: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: radiance-room
*/

/* Eyebrow label (Paragraph > Styles > Eyebrow) */
.is-style-eyebrow { font-size: 13px; letter-spacing: 0.28em; text-transform: uppercase; font-weight: 500; color: var(--wp--preset--color--berry); }
.has-ink-background-color .is-style-eyebrow, .has-berry-background-color .is-style-eyebrow { color: var(--wp--preset--color--rose-light); }

/* Card (Group > Styles > Card) */
.is-style-card { background: var(--wp--preset--color--white); border: 1px solid var(--wp--preset--color--line); border-radius: 20px; padding: 32px; }
.is-style-card > * + * { margin-block-start: 10px; }
.has-ink-background-color .is-style-card { background: transparent; border-color: #4A403A; }
.has-blush-background-color .is-style-card { background: var(--wp--preset--color--cream); border-color: transparent; }

/* Headings: italic words pick up the brand colour */
.wp-block-heading em { color: var(--wp--preset--color--berry); font-weight: 400; }
.has-ink-background-color .wp-block-heading em, .has-berry-background-color .wp-block-heading em { color: var(--wp--preset--color--rose-light); }

/* Small text helpers */
.radiance-more a, .radiance-price a { text-decoration: none; font-weight: 500; }
.radiance-price { color: var(--wp--preset--color--berry); font-weight: 500; }
.radiance-num { font-family: var(--wp--preset--font-family--serif); font-size: 44px; line-height: 1; color: var(--wp--preset--color--berry); }
.radiance-footer-brand { font-family: var(--wp--preset--font-family--serif); font-size: 28px; color: var(--wp--preset--color--white); }
.radiance-brand { gap: 6px; }
.radiance-brand > * { margin: 0; }

/* Dark sections: readable links and prices */
.has-ink-background-color a:not(.wp-element-button), .has-ink-background-color .radiance-price { color: var(--wp--preset--color--rose-light); }
.has-ink-background-color .has-muted-color { color: #D6CCC2 !important; }

/* Outline buttons */
.wp-block-button.is-style-outline > .wp-block-button__link { background: transparent; color: var(--wp--preset--color--berry); border: 1px solid currentColor; padding: 15px 31px; }
.has-ink-background-color .wp-block-button.is-style-outline > .wp-block-button__link { color: var(--wp--preset--color--white); }
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--berry); color: var(--wp--preset--color--white); border-color: var(--wp--preset--color--berry); }

/* Sticky header */
header.wp-block-template-part { position: sticky; top: 0; z-index: 100; background: rgba(246, 242, 236, 0.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--wp--preset--color--line); }
.admin-bar header.wp-block-template-part { top: 32px; }
@media (max-width: 782px) { .admin-bar header.wp-block-template-part { top: 46px; } }

/* Floating Book now (mobile only) */
.rr-float { display: none !important; }
@media (max-width: 860px) {
	.rr-head-book { display: none !important; }
	.rr-float { display: flex !important; position: fixed; right: 16px; bottom: 16px; z-index: 110; margin: 0 !important; }
	.rr-float .wp-block-button__link { box-shadow: 0 8px 24px rgba(42, 36, 32, 0.25); padding: 14px 24px; }
}

/* Mobile tidy-ups */
@media (max-width: 560px) { .wp-block-buttons > .wp-block-button { flex: 1 1 100%; } .wp-block-buttons > .wp-block-button .wp-block-button__link { width: 100%; box-sizing: border-box; } .wp-block-site-tagline { display: none; } }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { font-family: var(--wp--preset--font-family--serif); font-size: 28px; }
.radiance-signature { font-family: var(--wp--preset--font-family--serif); font-style: italic; font-size: 24px; margin-bottom: 0; }
.radiance-signature-sub { font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: #6A5E56; margin-top: 0 !important; }

/* Shop (WooCommerce) */
.radiance-product-name a { color: inherit; text-decoration: none; font-weight: 400; }
.wp-block-post-title a, .wc-block-components-product-name { font-family: var(--wp--preset--font-family--serif); text-decoration: none; }
.wc-block-components-product-price, .wp-block-woocommerce-product-price, .woocommerce-Price-amount { color: var(--wp--preset--color--berry); font-weight: 500; }
.wc-block-components-product-image img, .wp-block-woocommerce-product-image img { border-radius: 16px; aspect-ratio: 1 / 1; object-fit: cover; background: var(--wp--preset--color--white); }

/* No gap between the last section and the footer */
footer.wp-block-template-part { margin-top: 0 !important; }
main + footer, .wp-site-blocks > footer { margin-block-start: 0 !important; }

/* ---------- Phones only (desktop untouched) ---------- */
@media (max-width: 781px) {
	:root, body { --wp--style--root--padding-left: 20px !important; --wp--style--root--padding-right: 20px !important; }
	.wp-block-group.alignfull[style*="padding-top:96px"] { padding-top: 56px !important; }
	.wp-block-group.alignfull[style*="padding-bottom:96px"] { padding-bottom: 56px !important; }
	.wp-block-group.alignfull[style*="padding-top:80px"] { padding-top: 32px !important; }
	.wp-block-group.alignfull[style*="padding-top:88px"] { padding-top: 56px !important; padding-bottom: 56px !important; }
	.wp-block-columns { gap: 32px !important; }
	.wp-block-post-content > .alignfull + .alignfull { margin-block-start: 0 !important; }

	/* Concern boxes: tighter */
	.is-style-card { padding: 22px; border-radius: 16px; }
	.is-style-card h3, .is-style-card .wp-block-heading { font-size: 24px; }
	.rr-match-height .wp-block-group.is-layout-grid, .is-layout-grid:has(> .is-style-card) { gap: 12px !important; }

	/* Treatment cards: swipe sideways instead of stacking */
	main .has-ink-background-color .wp-block-group.is-layout-grid { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px !important; margin-right: calc(-1 * var(--wp--style--root--padding-right)) !important; padding-right: var(--wp--style--root--padding-right); padding-bottom: 6px; scrollbar-width: none; }
	main .has-ink-background-color .wp-block-group.is-layout-grid::-webkit-scrollbar { display: none; }
	main .has-ink-background-color .wp-block-group.is-layout-grid > * { flex: 0 0 82%; scroll-snap-align: start; margin: 0 !important; }

	/* Keep the floating Book now off the footer links */
	footer.wp-block-template-part > .wp-block-group { padding-bottom: 104px !important; }
}

/* ---------- Phones: section order and photos ---------- */
@media (max-width: 781px) {
	/* Photo first when a section has its photo in the right-hand column (e.g. Shop) */
	.wp-block-columns > .wp-block-column:last-child:has(> :is(.wp-block-image, .wp-block-cover):only-child) { order: -1; }
	/* Consultation: Grace's photo above the text */
	.wp-block-columns.rr-reverse-mobile { flex-direction: row !important; }

	/* Hero: eyebrow, then photo, then heading, text and buttons */
	main .wp-block-post-content > .alignfull:first-child .wp-block-columns { gap: 0 !important; }
	main .wp-block-post-content > .alignfull:first-child .wp-block-columns > .wp-block-column { display: contents; }
	main .wp-block-post-content > .alignfull:first-child .wp-block-columns > .wp-block-column > * { order: 3; flex: 0 0 100%; max-width: 100%; margin-top: 20px !important; margin-bottom: 0 !important; }
	main .wp-block-post-content > .alignfull:first-child .wp-block-columns > .wp-block-column > .is-style-eyebrow { order: 1; margin-top: 0 !important; }
	main .wp-block-post-content > .alignfull:first-child .wp-block-columns > .wp-block-column > :is(.wp-block-image, .wp-block-cover) { order: 2; margin-top: 16px !important; margin-bottom: 8px !important; }
	main .wp-block-post-content > .alignfull:first-child .wp-block-columns .wp-block-image img { max-height: 46vh !important; }
	main .wp-block-post-content > .alignfull:first-child .wp-block-columns .wp-block-image img { aspect-ratio: 1 / 1; height: auto !important; object-fit: cover; border-radius: 24px !important; }

	/* Skin concerns: no photo on phones */
	.rr-match-height > .wp-block-column:last-child { display: none !important; }

	/* Treatments: one full card at a time, with a swipe hint */
	main .has-ink-background-color .wp-block-group.is-layout-grid { margin-right: 0 !important; padding-right: 0 !important; }
	main .has-ink-background-color .wp-block-group.is-layout-grid > * { flex: 0 0 100% !important; }
	main .has-ink-background-color .wp-block-group.is-layout-grid + .wp-block-buttons::before { content: "Swipe to see more  →"; flex-basis: 100%; text-align: center; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--wp--preset--color--rose-light); margin-bottom: 8px; }
}

/* ---------- Shop ---------- */
.rr-pills { gap: 10px !important; margin: 8px 0 40px !important; }
.rr-pills .wp-block-button__link { padding: 10px 20px !important; font-size: 14px !important; border-color: var(--wp--preset--color--line) !important; color: var(--wp--preset--color--ink) !important; background: var(--wp--preset--color--white) !important; }
.post-type-archive-product .rr-pill-all .wp-block-button__link,
.term-cleansers .rr-pill-cleansers .wp-block-button__link, .term-serums .rr-pill-serums .wp-block-button__link,
.term-moisturisers .rr-pill-moisturisers .wp-block-button__link, .term-spf .rr-pill-spf .wp-block-button__link,
.term-eye-care .rr-pill-eye-care .wp-block-button__link, .term-treatments .rr-pill-treatments .wp-block-button__link,
.term-hair .rr-pill-hair .wp-block-button__link { background: var(--wp--preset--color--ink) !important; color: var(--wp--preset--color--white) !important; border-color: var(--wp--preset--color--ink) !important; }
@media (max-width: 781px) { .rr-pills { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; } .rr-pills .wp-block-button { flex: 0 0 auto !important; } .rr-pills .wp-block-button__link { width: auto !important; white-space: nowrap; } }
.wp-block-woocommerce-product-template { gap: 28px 20px !important; }
.wp-block-woocommerce-product-template > li { margin: 0 !important; }
.rr-product-card { height: 100%; gap: 0 !important; background: var(--wp--preset--color--white); border: 1px solid var(--wp--preset--color--line); border-radius: 20px; overflow: hidden; }
.rr-product-card .wc-block-components-product-image, .rr-product-card .wp-block-woocommerce-product-image { margin: 0 !important; width: 100%; background: #EEE7DD; }
.rr-product-card .wc-block-components-product-image img, .rr-product-card .wp-block-woocommerce-product-image img { aspect-ratio: 1 / 1; object-fit: contain !important; border-radius: 0 !important; background: #FFFFFF; }
.rr-product-body { padding: 22px; gap: 8px !important; flex: 1 1 auto; width: 100%; box-sizing: border-box; }
.rr-product-meta { gap: 6px !important; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 500; color: #6A5E56; }
.rr-product-meta a { color: inherit !important; text-decoration: none; pointer-events: none; }
.rr-product-body .wp-block-post-title { font-size: 24px !important; line-height: 1.15; margin: 0; }
.rr-product-body .wp-block-post-title a { color: var(--wp--preset--color--ink); text-decoration: none; }
.rr-product-body .wp-block-post-excerpt { font-size: 15px; line-height: 1.55; color: var(--wp--preset--color--muted); flex: 1 1 auto; margin: 0; }
.rr-product-body .wp-block-post-excerpt__more-text { display: none; }
.rr-product-buy { width: 100%; align-items: center !important; margin-top: 8px; }
.rr-product-buy .wc-block-components-product-price, .rr-product-buy .wp-block-woocommerce-product-price { font-size: 18px !important; margin: 0 !important; text-align: left !important; }
.rr-product-buy .wp-block-woocommerce-product-button { margin: 0 !important; width: auto !important; }
.rr-product-buy .wp-block-button__link, .rr-product-buy .wc-block-components-product-button__button { padding: 11px 18px !important; font-size: 14px !important; margin: 0 !important; white-space: nowrap; }
.single-product .woocommerce-Tabs-panel h3, .single-product .wp-block-woocommerce-product-details h3 { font-family: var(--wp--preset--font-family--serif); font-size: 24px; margin-top: 32px; }
.single-product .woocommerce-Tabs-panel p { color: var(--wp--preset--color--muted); }

/* ---------- Treatments ---------- */
.rr-item-head { gap: 16px !important; align-items: baseline !important; }
.rr-item-head > * { margin: 0 !important; }
.rr-price-tag { font-family: var(--wp--preset--font-family--serif); font-size: 26px; color: var(--wp--preset--color--berry); white-space: nowrap; margin-top: 0; }
.rr-item-head .rr-price-tag { font-size: 24px; }
.rr-duration { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: #6A5E56; font-weight: 500; margin-top: 4px !important; }
.rr-result { color: var(--wp--preset--color--ink); }
.rr-note { display: inline-block; background: var(--wp--preset--color--cream); border-radius: 999px; padding: 6px 14px; font-weight: 500; color: var(--wp--preset--color--berry); }
.has-blush-background-color .rr-note { background: var(--wp--preset--color--white); }
.rr-badge { display: inline-block; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 500; background: var(--wp--preset--color--berry); color: #fff; border-radius: 999px; padding: 5px 12px; margin: 0 0 6px !important; }
[id] { scroll-margin-top: 110px; }
html { scroll-behavior: smooth; }
.wp-block-post-content > .alignfull:first-child .rr-pills { margin: 28px 0 0 !important; }

/* ---------- Contact ---------- */
.rr-contact-cols { align-items: stretch !important; }
.rr-contact-cols > .wp-block-column:first-child { display: flex; flex-direction: column; gap: 14px; }
.rr-contact-cols .is-style-card { padding: 22px 26px; margin: 0 !important; }
.rr-contact-cols .is-style-eyebrow { margin: 0 0 6px !important; }
.rr-contact-line { margin: 0 !important; font-size: 17px; }
.rr-contact-line a { color: var(--wp--preset--color--ink); }
.rr-map { height: 100%; min-height: 420px; border-radius: 24px; overflow: hidden; border: 1px solid var(--wp--preset--color--line); }
.rr-map iframe { width: 100%; height: 100%; min-height: 420px; border: 0; display: block; }

/* ---------- Mobile header + menu ---------- */
@media (max-width: 781px) {
	header.wp-block-template-part { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: #F6F2EC !important; }
	header.wp-block-template-part > .alignfull { padding-top: 12px !important; padding-bottom: 12px !important; }
	header .wp-block-group.is-content-justification-space-between { flex-wrap: nowrap !important; gap: 12px !important; }
	header .radiance-brand { min-width: 0; flex: 0 1 auto; }
	header .wp-block-site-logo img { width: auto !important; max-width: 168px; height: auto !important; }
	header .wp-block-group.is-nowrap { gap: 2px !important; flex-shrink: 0; }
	header .wp-block-navigation { order: 3; }
	header .wp-block-navigation__responsive-container-open, header .wc-block-mini-cart__button, header .wc-block-customer-account__link { width: 44px; height: 44px; display: inline-flex !important; align-items: center; justify-content: center; padding: 0 !important; }
	header .wp-block-navigation__responsive-container-open svg { width: 28px; height: 28px; }
}
/* The open menu: full-screen panel */
.wp-block-navigation__responsive-container.is-menu-open { background: #F6F2EC !important; color: var(--wp--preset--color--ink) !important; padding: 20px 24px 40px !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 64px !important; align-items: stretch !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { gap: 0 !important; width: 100%; align-items: stretch !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { width: 100%; border-bottom: 1px solid var(--wp--preset--color--line); }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { display: block; width: 100%; padding: 18px 0 !important; font-family: var(--wp--preset--font-family--serif); font-size: 32px !important; line-height: 1.1; color: var(--wp--preset--color--ink) !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close { top: 22px !important; right: 22px !important; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close svg { width: 30px; height: 30px; }

/* ---------- Footer ---------- */
footer .rr-footer-cols { gap: 40px !important; align-items: flex-start !important; }
footer .rr-footer-cols p { text-align: left; }
footer .rr-footer-logo { margin: 0 0 20px !important; }
footer .rr-footer-logo img { width: 240px !important; max-width: 100%; height: auto; }
footer .is-style-eyebrow { margin: 4px 0 18px !important; font-size: 12px; }
footer .rr-footer-text { line-height: 2 !important; margin: 0 !important; color: #D6CCC2; max-width: 300px; }
footer .rr-footer-text a { white-space: nowrap; }
footer .rr-footer-text a, footer .rr-footer-small a { color: #F6F2EC !important; text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .2s; }
footer .rr-footer-text a:hover, footer .rr-footer-small a:hover { border-bottom-color: currentColor; }
footer .rr-footer-line { border: 0 !important; border-top: 1px solid rgba(216, 195, 165, 0.22) !important; margin: 56px 0 24px !important; max-width: none !important; width: 100%; opacity: 1; }
footer .rr-footer-small { margin: 0 !important; font-size: 13px !important; color: #BFB3A8; }
@media (max-width: 781px) { footer .rr-footer-cols { gap: 36px !important; } footer .rr-footer-line { margin: 40px 0 20px !important; } }


/* Shop on phones: one product per row - photo left, details right */
@media (max-width: 781px) {
	.wp-block-woocommerce-product-template { grid-template-columns: 1fr !important; gap: 14px !important; }
	.rr-product-card { flex-direction: row !important; flex-wrap: nowrap !important; align-items: stretch !important; border-radius: 16px !important; }
	.rr-product-card .wc-block-components-product-image, .rr-product-card .wp-block-woocommerce-product-image { flex: 0 0 38% !important; width: 38% !important; max-width: 38% !important; align-self: center !important; height: auto !important; }
	.rr-product-card .wc-block-components-product-image a { display: block; }
	.rr-product-card .wc-block-components-product-image img, .rr-product-card .wp-block-woocommerce-product-image img { width: 100% !important; height: auto !important; aspect-ratio: 1 / 1 !important; object-fit: contain !important; }
	.rr-product-body { flex: 1 1 0 !important; width: auto !important; min-width: 0; padding: 16px !important; gap: 6px !important; justify-content: center; }
	.rr-product-body .wp-block-post-title { font-size: 20px !important; hyphens: none !important; overflow-wrap: normal !important; word-break: normal !important; }
	.rr-product-body .wp-block-post-excerpt { display: none !important; }
	.rr-product-meta { font-size: 10px !important; letter-spacing: 0.12em !important; }
	.rr-product-buy { flex-direction: row !important; align-items: center !important; justify-content: space-between !important; gap: 10px !important; margin-top: 6px !important; }
	.rr-product-buy .wp-block-woocommerce-product-button { width: auto !important; }
	.rr-product-buy .wp-block-button__link, .rr-product-buy .wc-block-components-product-button__button { width: auto !important; padding: 9px 14px !important; font-size: 13px !important; border-radius: 999px !important; white-space: nowrap; }
	.rr-product-buy .wc-block-components-product-price { font-size: 17px !important; }
}

/* Images fill their column */
.wp-block-image img { width: 100%; height: auto; display: block; }
/* Wide photo under the welcome text: a little narrower than the page */
.rr-wide-photo { max-width: 960px !important; margin-left: auto !important; margin-right: auto !important; margin-top: 48px !important; }
.rr-wide-photo img { aspect-ratio: 21 / 9; object-fit: cover; max-height: none; }
@media (max-width: 781px) { .rr-wide-photo img { aspect-ratio: 4 / 3; } }

/* Skin concerns: photo matches the height of the four cards */
.rr-match-height > .wp-block-column { display: flex; flex-direction: column; }
.rr-match-height .rr-fill-photo { flex: 1 1 auto; position: relative; margin: 0 !important; min-height: 360px; }
.rr-match-height .rr-fill-photo img { position: absolute; inset: 0; width: 100%; height: 100% !important; max-height: none !important; object-fit: cover; }

/* Treatment cards: three across, filling the width */
.rr-treatment-grid, .has-ink-background-color .wp-block-group.is-layout-grid { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)) !important; }
footer.wp-block-template-part .has-ink-background-color .wp-block-group.is-layout-grid, footer.wp-block-template-part .wp-block-group.is-layout-grid { grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)) !important; }

/* Card photos always crop to the same landscape shape */
.is-style-card .wp-block-image img { aspect-ratio: 3 / 2; object-fit: cover; }
/* Side-by-side photos (hero, consultation) are capped so the text stays near the top */
.wp-block-column .wp-block-image img { max-height: min(600px, 72vh); object-fit: cover; }
@media (max-width: 781px) { .wp-block-column .wp-block-image img { max-height: 440px; } }
