/**
 * Theme Name: Thomas Lily Theme
 * Description: Thomas Lily Tree Care theme (Child of Twenty Twenty-Five)
 * Version: 1.0.1
 * Author: Egret Digital
 * Author URI: https://egret.digital/
 * Text Domain: thomaslily-theme
 * Domain Path: /assets/lang
 * Tested up to: 6.8
 * License: GNU General Public License v2.0 or later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * Template: twentytwentyfive
 */

/* List spacing (carried over from the old Elementor Custom Code snippet) */
ul { margin-bottom: 15px; }

/* Unset underline on header/footer links */
header a, footer a { text-decoration: none; }

/* Footer sits straight under the content */
footer.wp-block-template-part, .wp-site-blocks > footer { margin-block-start: 0; }
.wp-site-blocks > main { margin-block-start: 0; }

/* ---------- Header ---------- */
.tl-header .wp-block-site-logo img { height: auto; }
.tl-header nav a:hover { text-decoration: none; }
.tl-header nav .current-menu-item > a,
.tl-header nav a[aria-current="page"],
.tl-header nav a:hover { color: var(--wp--preset--color--secondary); }
.tl-header .wp-block-navigation__responsive-container-open svg { width: 44px; height: 44px; color: var(--wp--preset--color--leaf); fill: var(--wp--preset--color--leaf); }
.tl-header .wp-block-navigation__responsive-container.is-menu-open { background-color: #fffffff5 !important; }
.tl-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { align-items: center !important; justify-content: center; }
.tl-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { align-items: center !important; font-size: var(--wp--preset--font-size--large); }
.tl-hero-img { min-height: 194px; }
@media (max-width: 781px) {
	.tl-hide-mobile { display: none !important; }
	.tl-header-home .tl-logo-row { flex-wrap: nowrap !important; }
	.tl-header-home .tl-logo-row > .wp-block-column:first-child { flex-basis: 100% !important; }
	.tl-header-home .tl-home-logo img { width: 187px !important; }
	.tl-header .wp-block-site-logo img { max-width: 60vw; }
}
@media (min-width: 782px) {
	.tl-hide-desktop { display: none !important; }
}

/* ---------- Green bands ---------- */
.tl-band h1, .tl-band h2 { color: #fff; letter-spacing: 0.2rem; }
.tl-title-band h1 { font-size: 1.875rem; font-weight: 500; letter-spacing: 0.2rem; text-transform: uppercase; margin: 0; }
.tl-pill .wp-block-button__link { max-width: 227px; line-height: 1.2; padding: 5px 24px 4px; border-radius: 90px; background: #F6F6F6; font-family: var(--wp--preset--font-family--outfit); font-size: var(--wp--preset--font-size--medium); font-weight: 300; }
@media (max-width: 781px) {
	.tl-home-band { flex-direction: column; align-items: flex-start !important; min-height: 230px; justify-content: center !important; }
}

/* ---------- Cards ---------- */
.tl-cards { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.tl-cards > * { margin: 0 !important; }
.tl-card h3 { color: var(--wp--preset--color--contrast); font-size: var(--wp--preset--font-size--large); letter-spacing: 0.04rem; line-height: 1.05; }
@media (max-width: 1024px) { .tl-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .tl-cards { grid-template-columns: 1fr; } .tl-card h3 { font-size: 1.6rem; } }

/* ---------- Panels with an icon sitting on the top edge ---------- */
.tl-panel { position: relative; }
.tl-panel > .tl-panel-icon { position: absolute; top: 0; left: 32px; transform: translateY(-50%); margin: 0 !important; }
.tl-panel > .tl-panel-icon img { width: 80px; height: auto; display: block; }
.tl-panels { margin-top: 60px !important; }
.tl-panels + .tl-panels { margin-top: 50px !important; }
@media (max-width: 781px) {
	.tl-panels .wp-block-column + .wp-block-column { margin-top: 50px; }
	.tl-panel { padding: 50px 30px 30px !important; }
}

/* ---------- Image panels (photo as background) ---------- */
.tl-photo { min-height: 300px; }
.tl-photo .wp-block-cover__image-background { object-position: 100% 50%; }

/* ---------- "Let's talk trees" heading tab ---------- */
.tl-tab { display: block; max-width: 544px; }
.tl-tab h2 { color: #fff; font-size: 1.875rem; letter-spacing: 0.4rem; margin: 0; }

/* ---------- Reviews (Google Business Reviews plugin) ---------- */
.gmbrr.forest .heading, .gmbrr.forest .listing .rating, .gmbrr.forest .listing a, .gmbrr.forest .rating, .gmbrr.forest .rating .star, .gmbrr.forest a {
	color: var(--wp--preset--color--primary);
}
.tl-reviews-link a { color: var(--wp--preset--color--secondary); }

/* ---------- CTA band ---------- */
.tl-cta-text { font-family: var(--wp--preset--font-family--fjalla-one); font-size: var(--wp--preset--font-size--large); font-weight: 500; letter-spacing: 0.04rem; line-height: 1.4; color: #fff; }

/* ---------- Team (About) ---------- */
.tl-team { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.tl-team > * { margin: 0 !important; padding: 10px; }
.tl-team figure img { width: 370px; max-width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.tl-team details { margin-top: 0; }
.tl-team summary { color: var(--wp--preset--color--leaf); font-family: var(--wp--preset--font-family--fjalla-one); font-size: var(--wp--preset--font-size--large); letter-spacing: 0.04rem; cursor: pointer; list-style: none; padding: 4px 0; }
.tl-team summary::-webkit-details-marker { display: none; }
.tl-team summary::before { content: "+"; display: inline-block; width: 1em; font-family: var(--wp--preset--font-family--outfit); }
.tl-team details[open] summary::before { content: "\2212"; }
.tl-team details > *:not(summary) { margin-top: 12px; }
@media (max-width: 1024px) { .tl-team { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .tl-team { grid-template-columns: 1fr; } }

/* ---------- Compliance gallery ---------- */
.tl-gallery.wp-block-gallery figure.wp-block-image img { aspect-ratio: 1; object-fit: cover; transition: opacity .8s; }
.tl-gallery.wp-block-gallery figure.wp-block-image a:hover img { opacity: .5; }
.tl-gallery.wp-block-gallery figure.wp-block-image a { background: #000; display: block; }

/* ---------- Contact / Gravity Forms ---------- */
.tl-contact-list p { margin-bottom: 15px; }
.gform_wrapper .gform_button, .gform_wrapper input[type="submit"] {
	width: 100%; background: var(--wp--preset--color--accent) !important; color: var(--wp--preset--color--contrast) !important;
	border: 1px solid var(--wp--preset--color--contrast) !important; border-radius: 12px !important; padding: 5px 24px 4px !important;
	font-family: var(--wp--preset--font-family--fjalla-one) !important; font-size: var(--wp--preset--font-size--large) !important; font-weight: 500 !important; letter-spacing: .04rem; cursor: pointer;
}
.gform_wrapper .gform_button:hover { background: var(--wp--preset--color--tertiary) !important; border-color: #5A6771 !important; border-radius: 1px !important; }
.gform_wrapper .gfield_label, .gform_wrapper legend.gfield_label { font-family: var(--wp--preset--font-family--outfit); font-weight: 700 !important; font-size: 15px !important; color: var(--wp--preset--color--contrast); }
.gform_wrapper input:not([type="submit"]), .gform_wrapper textarea { font-family: var(--wp--preset--font-family--outfit); font-size: 15px; border: 1px solid #666; border-radius: 3px; padding: 8px; background: #fff; }
.gform_wrapper textarea { height: 120px !important; }
.tl-map iframe { width: 100% !important; height: 300px; border: 0; display: block; }

/* ---------- Footer ---------- */
.tl-footer, .tl-footer a { color: #fff; }
.tl-footer a:hover { text-decoration: underline; }
.tl-footer p { margin: 0; }
.tl-footer .tl-footer-heading { font-family: var(--wp--preset--font-family--outfit); font-size: 1.424rem; font-weight: 400; color: #fff; margin: 0 0 4px; }
.tl-footer { font-size: 1.125rem; line-height: 1.2; }
@media (max-width: 1024px) {
	.tl-footer .tl-footer-cols { flex-direction: column; align-items: center !important; text-align: center; }
	.tl-footer .tl-footer-cols > * { align-items: center !important; justify-content: center !important; text-align: center !important; }
}

/* Archive pages - core fix for loop images sometimes being wider than containers */
.archive .wp-block-post-featured-image { max-width: 100% !important; }

/* ---------- Home: "Let's talk trees" intro ---------- */
.tl-talk-text { max-width: 584px; }
.tl-talk-text > p { margin-top: 6px !important; margin-bottom: 0; }
.tl-talk-text > .tl-tab { margin-bottom: 18px !important; }

/* ---------- Spacing of sub-headings inside panels ---------- */
.tl-panel h2 { margin-top: 30px; }
.tl-panel p + h4, .tl-panel ul + h4, .tl-panel p + h3, .tl-panel ul + h3 { margin-top: 36px; }

/* ---------- CTA panel leaf (path relative to this stylesheet, works on staging and live) ---------- */
.tl-cta-panel { background-image: url('../../uploads/2024/04/Green-norway-maple-leaf-1-1-300x300.png'); background-repeat: no-repeat; background-size: contain; background-position: 174px 116px; }

/* ---------- Content links: dark text like the old site ---------- */
.entry-content a:not(.wp-element-button), .wp-block-post-content a:not(.wp-element-button) { color: var(--wp--preset--color--contrast); }
.entry-content a:not(.wp-element-button):hover, .wp-block-post-content a:not(.wp-element-button):hover { color: var(--wp--preset--color--primary); }

/* ---------- Compliance gallery: square tiles ---------- */
.tl-gallery.wp-block-gallery.is-cropped figure.wp-block-image { aspect-ratio: 1; }
.tl-gallery.wp-block-gallery.is-cropped figure.wp-block-image a, .tl-gallery.wp-block-gallery.is-cropped figure.wp-block-image img { height: 100%; width: 100%; }

/* ---------- Panel with centred content (privacy shield) ---------- */
.tl-panel.tl-center-content { display: flex; flex-direction: column; justify-content: center; }

@media (min-width: 1025px) { .tl-card { min-height: 222px; } }

/* ---------- Mobile tuning to match the old site ---------- */
@media (max-width: 767px) {
	body { font-size: 1rem; }
	.tl-header-home { padding-top: 0 !important; }
	.tl-header-home .tl-logo-row > .wp-block-column:first-child { padding-top: 10px !important; padding-bottom: 10px !important; }
	.tl-header { padding-top: 10px !important; padding-bottom: 10px !important; }
	.tl-header .wp-block-site-logo img { width: 240px !important; }
	.tl-header-home .wp-block-site-logo img { width: 187px !important; }
	.tl-pill .wp-block-button__link { max-width: none; }
	.tl-home-band h2 { font-size: 1.875rem; }
	.tl-photo { min-height: 250px !important; }
	.tl-talk-text { padding-left: 20px !important; }
}

/* ---------- 1.0.1: wide screens (above 1440px) ----------
   Line the home header, green band and full-width photo rows up with the 1400px content box.
   Background bands stay full-bleed; only their contents move in. Nothing changes at 1440px and below. */
@media (min-width: 1441px) {
	/* Home header: nav row and logo + hero row (parent is full viewport width) */
	.tl-header-home > .tl-hide-mobile,
	.tl-header-home > .tl-logo-row {
		padding-left: calc(50% - 700px) !important;
		padding-right: calc(50% - 700px) !important;
	}
	/* Home green band (parent content box is viewport minus 2 x 20px root padding) */
	.wp-block-post-content > .tl-home-band {
		padding-left: calc(50% - 680px) !important;
		padding-right: calc(50% - 680px) !important;
	}
	/* Full-width photo + text rows (Home "Let's talk trees", About) */
	.wp-block-post-content > .wp-block-columns.alignfull {
		max-width: 1400px;
		margin-left: auto !important;
		margin-right: auto !important;
	}
}
