/* Sitewide display fixes, loaded after the Astro stylesheet. See scripts/site-polish.mjs. */

/* Price and comparison tables fill their card on tablet and desktop; on phones they scroll. */
@media (min-width: 768px) {
	.owned-service-section-body table, .article-prose table, .service-content-body table { display: table; table-layout: auto; }
}
.owned-service-section-body table th, .owned-service-section-body table td { padding: 14px 18px; text-align: left; vertical-align: top; border-bottom: 1px solid rgba(15, 23, 42, .08); }
.owned-service-section-body table thead th { background: #101827; color: #fff; font-size: 14px; font-weight: 800; }
.owned-service-section-body table tbody tr:nth-child(even) td { background: #fafaf8; }
.owned-service-section-body table tbody tr:last-child td { border-bottom: 0; }
.owned-service-section-body table td:nth-child(2):last-child { font-weight: 650; color: #0f2f5c; }

/* Keep running text to a readable line length; tables and cards still use the full width. */
.owned-service-section-body > p, .owned-service-section-body > ul, .owned-service-section-body > ol,
.markdown-content > section > .landing-section-copy > p, .landing-page-body .markdown-content > p,
.landing-page-body .markdown-content > h2 + p, .hub-page-body .markdown-content > p { max-width: 780px; }
.owned-service-section-body ul, .owned-service-section-body ol { padding-left: 1.25em; }
.owned-service-section-body li { margin-top: 10px; }
.owned-service-section-body li::marker { color: #0b4aa2; }

/* Text-only sections sit in a light card so long pages read as distinct blocks, not one wall of text. */
.landing-section.text-section.content-section .landing-section-copy {
	background: #fff; border: 1px solid rgba(15, 23, 42, .07); border-radius: 20px; padding: clamp(22px, 3.2vw, 40px);
	box-shadow: 0 14px 34px -24px rgba(15, 23, 42, .28);
}
.landing-section.text-section.content-section .landing-section-copy h2 { margin-top: 0; }
.landing-section.text-section.content-section + .landing-section.text-section.content-section { margin-top: 0; }
.markdown-content > section.landing-section.text-section { border-top: 0; padding-top: 18px; padding-bottom: 18px; }
.markdown-content > hr { display: none; }

/* Hero media for pages without a photo of their own. */
.homey-hero-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.homey-hero-panel { background: linear-gradient(160deg, #0b4aa2, #123a7a); color: #fff; border-radius: 22px; padding: clamp(24px, 3vw, 36px); box-shadow: 0 24px 60px rgba(11, 74, 162, .25); }
.homey-hero-panel__eyebrow { margin: 0 0 14px; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #bcd3f5; }
.homey-hero-panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.homey-hero-panel li { position: relative; padding-left: 32px; font-size: 16px; line-height: 1.55; color: #e7eefb; }
.homey-hero-panel li::before { content: '\2713'; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 999px; background: #22c55e; color: #052e16; font-size: 13px; font-weight: 900; display: grid; place-items: center; }
.homey-hero-panel li strong { color: #fff; }
.homey-hero-panel .button { margin-top: 22px; background: #25d366; color: #052e16; box-shadow: none; }

/* Service directory: masonry columns so short and long categories pack without gaps. */
.hub-directory-grid.homey-directory { display: block; columns: 3 300px; column-gap: 18px; }
.homey-directory .hub-directory-card { break-inside: avoid; margin: 0 0 18px; display: block; }
.homey-directory .hub-directory-card ul { columns: 1; }

/* Footer: the "All services" link stands out from the list. */
.footer a.homey-footer-all { margin-top: 14px; font-weight: 800; color: #8fb7ff; }

/* "Chat with us on WhatsApp" links after card groups read as buttons, not stray underlined text. */
.markdown-content div > a[href="#service-enquiry"]:only-child {
	display: inline-flex; margin-top: 14px; padding: 10px 18px; border-radius: 999px; background: #eaf1fb; color: #0b4aa2; font-weight: 800; text-decoration: none;
}

/* Phones: tables fit the screen width and wrap instead of scrolling sideways; the hero panel is
   dropped (the CTA buttons above it already do the job) so the estimator sits closer to the top. */
@media (max-width: 640px) {
	.owned-service-section-body table, .article-prose table { display: table; width: 100%; table-layout: fixed; }
	.owned-service-section-body table th, .owned-service-section-body table td { padding: 10px 10px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
	.hero-media:has(.homey-hero-panel) { display: none; }
	.landing-section.text-section.content-section .landing-section-copy { padding: 20px 16px; border-radius: 16px; }
}

/* WhatsApp button floats on every page at every width. The Astro stylesheet made it a static
   block at the very bottom of the page on phones under 480px. */
body .floating-whatsapp { position: fixed !important; right: 16px; bottom: 16px; left: auto; margin: 0 !important; z-index: 60; width: 56px; min-height: 56px; }

/* Homepage directory: 3 links per category, then a link to the full list. */
.homey-directory .homey-directory-more a { font-weight: 800; color: #0b4aa2; }

/* Homepage on phones: steps and trust cards in two columns, shorter images, less scrolling. */
@media (max-width: 640px) {
	.home-process-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
	.home-process-card { padding: 16px 14px !important; min-height: 0 !important; }
	.home-process-card h3 { font-size: 16px !important; margin-top: 10px !important; }
	.home-process-card p { display: none; }
	.home-process-card span { margin-bottom: 8px !important; width: 34px !important; height: 34px !important; }
	.home-trust-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
	.home-trust-card img { aspect-ratio: 4 / 3 !important; }
	.home-trust-card > div { padding: 12px !important; }
	.home-trust-card h3 { font-size: 15px !important; }
	.home-trust-card p { display: none; }
	.home-services .hub-directory-grid.homey-directory { columns: 2; column-gap: 10px; }
	.home-services .homey-directory .hub-directory-card { padding: 14px 12px; margin-bottom: 10px; }
	.home-services .homey-directory .hub-directory-card h3 { font-size: 15px; line-height: 1.25; }
	.home-services .homey-directory .hub-directory-card li { padding: 0 !important; }
	.home-services .homey-directory .hub-directory-card li a { display: block; font-size: 13px; padding: 6px 0 !important; min-height: 0 !important; }
	.footer { grid-template-columns: 1fr 1fr !important; gap: 24px 16px !important; }
	.footer .footer-brand { grid-column: 1 / -1; }
}

/* Card grids that replace link lists: "More on curtains" on the curtain pages. */
.homey-card-hub h2 { margin: 0 0 22px; }
.homey-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; }
.homey-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; background: #fff; border: 1px solid rgba(15, 23, 42, .08); box-shadow: 0 14px 34px -24px rgba(15, 23, 42, .3); color: #111827; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.homey-card:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -22px rgba(15, 23, 42, .4); }
.homey-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.homey-card span { display: grid; gap: 4px; padding: 16px 18px 18px; }
.homey-card strong { font-size: 17px; }
.homey-card em { font-style: normal; font-size: 14px; color: #556070; }
@media (max-width: 640px) { .homey-card-grid { grid-template-columns: 1fr 1fr; gap: 10px; } .homey-card em { display: none; } .homey-card span { padding: 10px 12px 12px; } .homey-card strong { font-size: 14px; } }

/* /services/ hub: a photo heading per category over a grid of service tiles. */
.homey-hub { display: grid; gap: 34px; }
.homey-hub-cat__head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.homey-hub-cat__head img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; flex: none; }
.homey-hub-cat__head h3 { margin: 0; font-size: 24px; }
.homey-hub-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.homey-tile { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 58px; padding: 12px 16px; border-radius: 14px; background: #fff; border: 1px solid rgba(15, 23, 42, .08); box-shadow: 0 10px 24px -20px rgba(15, 23, 42, .35); color: #0f2f5c; font-weight: 750; font-size: 15px; text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.homey-tile::after { content: '\2192'; color: #0b4aa2; opacity: .6; }
.homey-tile:hover { border-color: #0b4aa2; transform: translateY(-2px); }
@media (max-width: 640px) { .homey-hub-tiles { grid-template-columns: 1fr 1fr; gap: 8px; } .homey-tile { min-height: 52px; padding: 10px 12px; font-size: 14px; } .homey-hub-cat__head img { width: 48px; height: 48px; } .homey-hub-cat__head h3 { font-size: 20px; } }
