/*
Theme Name: Pacific General Construction
Theme URI: https://pacgencon.com/
Author: Razorfrog Web Design
Author URI: https://razorfrog.com/
Description: Block theme for Pacific General Construction, modeled on the 2014 site. Core blocks only, no page builder or licensed plugins, so the site can run on automatic updates.
Version: 1.9.18
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
License: GPLv2 or later
Text Domain: pacgencon
*/

:root { color-scheme: dark; }

/* Focus: always visible. */
:where(a, button, input, select, textarea, summary, .wp-block-button__link, .wp-block-navigation-item__content):focus-visible {
	outline: 3px solid var(--wp--preset--color--teal-light);
	outline-offset: 3px;
}

.screen-reader-text {
	border: 0; clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden;
	padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important;
}

/* Links in running text stay underlined. */
.wp-block-post-content p a:not(.wp-block-button__link),
.wp-block-post-content li a { text-decoration: underline; text-underline-offset: 3px; }

/* Template sections sit flush. */
.wp-site-blocks > * { margin-block-start: 0; }
.wp-block-post-content > .alignfull:first-child { margin-block-start: 0; }

/* Header */
.pgc-header .wp-block-site-logo img { height: auto; max-width: 100%; }
.pgc-header .wp-block-navigation a { text-decoration: none; color: var(--wp--preset--color--white); }
.pgc-header .wp-block-navigation a:hover,
.pgc-header .wp-block-navigation .current-menu-item > a,
.pgc-header .wp-block-navigation a[aria-current="page"],
.pgc-in-projects .pgc-header .pgc-nav-projects > a { color: var(--wp--preset--color--teal); }
.pgc-header .wp-block-navigation { padding-top: 1.25rem; }
.pgc-header .wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--header) !important; }

/* Header: logo and menu share a row; below 600px (where the menu becomes a button) they never wrap. */
.pgc-header .wp-block-site-logo { flex-shrink: 0; max-width: 100%; }
@media (max-width: 599px) {
	.pgc-header-row { flex-wrap: nowrap !important; }
	.pgc-header .wp-block-site-logo { flex: 0 1 auto; min-width: 0; }
	.pgc-header .wp-block-navigation { flex: 0 0 auto; }
}

/* Page banner (featured image behind the page title) */
.pgc-banner { padding-top: 0; padding-bottom: 0; }
.pgc-banner .wp-block-post-title { margin: 0; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
/* WCAG 1.4.3: a 50% overlay (the template's is 30%) keeps the white title readable on light banner photos. */
.pgc-banner > .wp-block-cover__background { opacity: .5 !important; }
/* WCAG 1.4.3: photo captions sit on a solid dark band instead of the default faint gradient. */
.wp-block-gallery.has-nested-images figure.wp-block-image figcaption.wp-element-caption { background: rgba(0,0,0,.72); }

/* Home slider: slides stack in one grid cell and fade; the controls sit below the photo. */
.pgc-slider { position: relative; }
.pgc-slider.is-ready { display: grid; gap: 0; touch-action: pan-y; }
/* Before the script runs: show only the first slide and keep room for the controls bar, so nothing jumps. */
.pgc-slider:not(.is-ready) > .wp-block-cover:not(:first-child) { display: none; }
.pgc-slider:not(.is-ready)::after { content: ""; display: block; height: 4.25rem; background: var(--wp--preset--color--header); }
/* Contained to the page width (1180px plus the root side padding), so its edges line up with the
   header and footer content (Max, 2026-12-01). The block is still alignfull in the page content. */
.wp-block-post-content > .pgc-slider.alignfull { max-width: var(--wp--style--global--wide-size); margin-left: auto !important; margin-right: auto !important; }
/* Taller so less of the 4:3 photos is cropped (Max, 2026-12-01), but never taller than the screen minus
   the header and controls. */
.pgc-slider > .wp-block-cover { min-height: min(58vw, 720px, calc(100svh - 11rem)) !important; margin: 0 !important; }
.pgc-slider.is-ready > .wp-block-cover { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility 0s linear .5s; }
.pgc-slider.is-ready > .wp-block-cover.is-active { opacity: 1; visibility: visible; transition: opacity .5s ease; }
/* WCAG 1.4.3: a dark gradient rising from the bottom behind each caption, so white text passes on bright photos too. */
.pgc-slider > .wp-block-cover > .wp-block-cover__background { background: linear-gradient(to top, rgba(0,0,0,.8) 0, rgba(0,0,0,.65) 35%, rgba(0,0,0,0) 70%) !important; opacity: 1 !important; }
.pgc-slider .wp-block-cover__inner-container { align-self: flex-end; padding-bottom: 2rem; }
.pgc-slide-caption { display: flex; flex-wrap: nowrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem; }
.pgc-slide-caption p { flex: 1 1 auto; }
.pgc-slide-caption .wp-block-buttons { flex: 0 0 auto; }
.pgc-slide-caption p { margin: 0; font-size: clamp(1.4rem, 2.6vw, 2.25rem); line-height: 1.2; text-shadow: 0 2px 8px rgba(0,0,0,.9), 0 0 2px rgba(0,0,0,.9); }
.pgc-slide-caption .wp-block-buttons { margin: 0; }
.pgc-slide-caption .wp-block-button__link { padding: .55rem 1.1rem; }
.pgc-slide-caption .wp-block-button__link::after { content: " \203A"; }
.pgc-slider .wp-block-cover::before { content: ""; position: absolute; inset: 50% 0 0; z-index: 1; pointer-events: none; background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,.55)); }
.pgc-slider-controls {
	grid-area: 2 / 1; display: flex; align-items: center; justify-content: center; gap: 1rem;
	padding: .75rem 1rem; background: var(--wp--preset--color--header);
}
.pgc-slider-btn {
	touch-action: manipulation; -webkit-tap-highlight-color: transparent;
	width: 2.75rem; height: 2.75rem; border: 1px solid var(--wp--preset--color--line); border-radius: 0; cursor: pointer;
	background: var(--wp--preset--color--panel); color: #fff; font: 700 1.75rem/1 Arial, sans-serif;
	display: inline-flex; align-items: center; justify-content: center; padding: 0 0 .2rem;
}
@media (hover: hover) { .pgc-slider-btn:hover { background: var(--wp--preset--color--teal-button); border-color: var(--wp--preset--color--teal-button); } }
.pgc-slider-controls { margin: 0 !important; }
.pgc-slider-btn.is-prev::before { content: "\2039"; }
.pgc-slider-btn.is-next::before { content: "\203A"; }
.pgc-slider-dots { display: flex; align-items: center; gap: .25rem; }
/* The controls must never make the slider wider than the screen: with 10 slides they need about 428px,
   and the grid grew to fit them, pushing MORE and the next button off the right edge on phones. */
.pgc-slider.is-ready { grid-template-columns: minmax(0, 1fr); }
.pgc-slider-btn { flex: none; }
.pgc-slider-dots { min-width: 0; }
.pgc-slider-dot { flex: 0 1 24px; min-width: 0; }
@media (max-width: 599px) {
	.pgc-slider-controls { gap: .5rem; padding-inline: .75rem; }
	.pgc-slider-dots { gap: 0; }
}
.pgc-slider-dot { width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.pgc-slider-dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--wp--preset--color--gray); background: transparent; transition: background-color .2s ease, border-color .2s ease; }
.pgc-slider-dot[aria-current="true"]::before { background: var(--wp--preset--color--teal); border-color: var(--wp--preset--color--teal); }
@media (hover: hover) { .pgc-slider-dot:hover::before { border-color: var(--wp--preset--color--white); } }
/* Anything tappable gets no double-tap zoom delay. */
a, button, .wp-block-button__link { touch-action: manipulation; }

/* Photo tiles: project types on /projects/, projects on each type page */
.pgc-type-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1.25rem; }
.pgc-tile { position: relative; border: 1px solid var(--wp--preset--color--line); padding: 6px 6px 0; margin: 0; }
.pgc-tile a { display: block; position: relative; color: #fff; text-decoration: none; }
/* 4:3 like the galleries and the lightbox (Max, 2026-12-01). */
.pgc-tile img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.pgc-tile .wp-block-post-featured-image { margin: 0; }
.pgc-tile .wp-block-post-featured-image img { aspect-ratio: 4 / 3; }
.pgc-tile-title, .pgc-tile .wp-block-post-title {
	position: absolute; left: 0; right: 0; bottom: 0; margin: 0;
	padding: 1.6rem .6rem .7rem; font-size: 1.0625rem; font-weight: 400; line-height: 1.2;
	text-transform: none; color: #fff;
	background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,.85) 55%);
}
.pgc-tile .wp-block-post-title a { color: #fff; text-decoration: none; }
.pgc-tile .wp-block-post-title a::after { content: ""; position: absolute; inset: -200px 0 0 0; }
.pgc-tile a:hover .pgc-tile-title, .pgc-tile .wp-block-post-title a:hover { color: var(--wp--preset--color--teal-light); }
.pgc-tiles .wp-block-post-template > li { border: 1px solid var(--wp--preset--color--line); padding: 6px 6px 0; }

/* Framed image (About, Services) */
.pgc-frame img { border: 6px solid var(--wp--preset--color--panel); outline: 1px solid var(--wp--preset--color--line); }

/* Contact info row */

/* Forms (for the contact form plugin) */
input[type="text"], input[type="email"], input[type="tel"], textarea, select {
	background: var(--wp--preset--color--panel); color: #fff; border: 1px solid var(--wp--preset--color--line);
	padding: .9rem 1rem; font: inherit; width: 100%;
}
::placeholder { color: var(--wp--preset--color--gray); opacity: 1; }

/* Footer */
.pgc-footer { border-top: 1px solid #1f1f1f; }
.pgc-footer p { margin: 0; }
.pgc-footer-name { color: var(--wp--preset--color--white); font-weight: 600; }
.pgc-footer .pgc-footer-nav { font-size: inherit; font-weight: 400; text-transform: none; letter-spacing: normal; }
/* WCAG 2.5.8: 2px above and below makes each policy link 25px tall, so the stacked links are at least 24px apart. */
.pgc-footer-nav .wp-block-navigation-item__content { padding: .125rem 0; }
.pgc-footer-nav a[aria-current="page"] { color: var(--wp--preset--color--teal); }
.pgc-footer-bottom { border-top: 1px solid var(--wp--preset--color--line); padding-top: 1.25rem; font-size: .8125rem; }

/* Gallery on project pages */
/* 4:3 thumbnails, the same shape as the lightbox (Max, 2026-12-01). */
.wp-block-gallery.has-nested-images figure.wp-block-image img { aspect-ratio: 4 / 3; object-fit: cover; }
/* Phones (two small thumbnails across): a smaller caption band, at most two lines, so it covers about a
   third of the photo instead of half. The lightbox shows the full caption. */
@media (max-width: 600px) {
	.wp-block-gallery.has-nested-images figure.wp-block-image figcaption.wp-element-caption {
		font-size: .75rem; line-height: 1.3; padding: 5px 6px; max-height: none;
		display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
	}
}
.wp-block-gallery.has-nested-images figure.wp-block-image { border: 1px solid var(--wp--preset--color--line); padding: 4px; background: var(--wp--preset--color--panel); }
.wp-block-gallery.has-nested-images figure.wp-block-image { flex-grow: 0 !important; }
.pgc-project-body { padding-top: 1.5rem; }
.pgc-back a { color: var(--wp--preset--color--gray); text-decoration: none !important; }
.pgc-back a:hover { color: var(--wp--preset--color--teal); }
.pgc-job-list { columns: 2 18rem; column-gap: 3rem; }
.pgc-job-list li { break-inside: avoid; margin-bottom: .35rem; }
/* Lightbox (core image "Expand on click") on the dark site */
.wp-lightbox-overlay .scrim { background-color: #000 !important; }
.wp-lightbox-overlay .close-button { color: #fff; }
/* The photo's caption under the enlarged photo, added by accessibility.js. */
.pgc-lightbox-caption { position: fixed; z-index: 100001; transform: translateX(-50%); width: max-content; max-width: min(90vw, 50rem); margin: 0; padding: .4rem .9rem; background: rgba(0,0,0,.75); color: #fff; font-size: 1.0625rem; line-height: 1.35; text-align: center; pointer-events: none; }

@media (max-width: 781px) {
	.pgc-header .wp-block-site-logo img { width: 300px; max-width: 100%; }
	.pgc-header .wp-block-navigation { padding-top: 0; }
	.pgc-header .wp-block-navigation__responsive-container-open { padding: .5rem; }
	.pgc-header .wp-block-navigation__responsive-container-open svg { width: 32px; height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Fixes after the first comparison with the 2014 site */
.wp-block-post-content > .pgc-slider { margin-block-start: 0 !important; }
.pgc-type-tiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.pgc-tile img { height: auto; }
.pgc-banner .wp-block-cover__inner-container { max-width: none !important; }
.pgc-banner + .wp-block-post-content { padding-top: 2.5rem; }
.pgc-banner .wp-block-cover__inner-container { width: 100% !important; }
@media (max-width: 781px) {
	.pgc-slider > .wp-block-cover { min-height: 70vw !important; }
	.pgc-slider .wp-block-cover__inner-container { padding-bottom: 1rem; }
	.pgc-slide-caption p { font-size: 1.25rem; }
	.pgc-slide-caption .wp-block-button__link { padding: .45rem .9rem; font-size: .9375rem; }
}
.pgc-banner .wp-block-post-title { width: 100%; max-width: var(--wp--style--global--content-size); margin-inline: auto !important; }

/* Contact form (WPForms Lite, modern markup) on the dark site */
.pgc-content .wpforms-container, .wp-block-post-content .wpforms-container {
	--wpforms-label-color: #fff;
	--wpforms-label-sublabel-color: var(--wp--preset--color--gray);
	--wpforms-label-error-color: #ff9b8f;
	--wpforms-field-background-color: var(--wp--preset--color--panel);
	--wpforms-field-border-color: #6b6b6b;
	--wpforms-field-text-color: #fff;
	--wpforms-field-border-radius: 0;
	--wpforms-field-size-input-height: 46px;
	--wpforms-field-size-font-size: 16px;
	--wpforms-label-size-font-size: 16px;
	--wpforms-button-background-color: var(--wp--preset--color--teal-button);
	--wpforms-button-border-radius: 0;
	--wpforms-button-text-color: #fff;
	margin-top: 0;
}
.wpforms-container .wpforms-required-label { color: var(--wp--preset--color--teal-light) !important; }
.wpforms-container .wpforms-field input:focus, .wpforms-container .wpforms-field textarea:focus { border-color: var(--wp--preset--color--teal-light) !important; box-shadow: 0 0 0 1px var(--wp--preset--color--teal-light) !important; }
.wpforms-container button[type=submit] { text-transform: uppercase; font-weight: 700; letter-spacing: .02em; }


/* Contact page: details panel (left) and form (right); stacked on phones, details first. */
.pgc-contact { align-items: flex-start; }
.pgc-contact-details { background: var(--wp--preset--color--panel); border-top: 4px solid var(--wp--preset--color--teal); padding: 2rem; }
.pgc-contact-details h2 { font-size: .8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--wp--preset--color--teal-light); margin: 1.5rem 0 .35rem; }
.pgc-contact-details h2:first-child { margin-top: 0; }
.pgc-contact-details p { margin: 0; color: var(--wp--preset--color--white); font-size: 1.0625rem; line-height: 1.5; }
.pgc-contact-details a { color: var(--wp--preset--color--white); text-decoration: none; }
.pgc-contact-details a:hover, .pgc-contact-details a:focus-visible { color: var(--wp--preset--color--teal-light); text-decoration: underline; }
.pgc-contact-details .pgc-contact-license { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--wp--preset--color--line); color: var(--wp--preset--color--gray); font-size: .875rem; }
.pgc-contact-form h2 { margin-top: 0; }
.pgc-contact-form .pgc-contact-intro { color: var(--wp--preset--color--gray); margin: .5rem 0 1.75rem; }
.pgc-contact-form .wpforms-container { margin-top: 0; }
@media (max-width: 781px) {
	.pgc-contact-form { margin-top: 2.5rem; }
}
@media (max-width: 599px) {
	.pgc-contact-form .wpforms-field.wpforms-one-half { width: 100% !important; margin-left: 0 !important; float: none !important; clear: both; }
}

/* Sitemap page: three panels side by side, stacked on phones. */
.pgc-sitemap-intro { font-size: var(--wp--preset--font-size--large); margin-bottom: var(--wp--preset--spacing--40); }
.pgc-sitemap { gap: var(--wp--preset--spacing--40); margin-bottom: var(--wp--preset--spacing--50); }
.pgc-sitemap-panel { background: var(--wp--preset--color--panel); border-top: 4px solid var(--wp--preset--color--teal-button); padding: var(--wp--preset--spacing--40); }
.pgc-sitemap-panel > * { margin-block-start: 0; }
.pgc-sitemap-panel h2 { margin: 0 0 .5rem; font-size: var(--wp--preset--font-size--x-large); }
.pgc-sitemap-list { list-style: none; padding: 0; margin: 0; }
.pgc-sitemap-list li { margin: 0; border-bottom: 1px solid var(--wp--preset--color--line); }
.pgc-sitemap-list li:last-child { border-bottom: 0; }
.pgc-sitemap-list a { display: block; padding: .6rem 0; font-size: var(--wp--preset--font-size--medium); }
.wp-block-post-content .pgc-sitemap-list a:not(.wp-block-button__link) { text-decoration: none; }
.wp-block-post-content .pgc-sitemap-list a:not(.wp-block-button__link):hover { text-decoration: underline; }
.pgc-sitemap-list .wp-block-post-title { font-size: inherit; font-weight: 400; text-transform: none; margin: 0; }

/* 404 page: centered in the space between header and footer, with plenty of room. */
.pgc-404 { min-height: 65vh; display: flex; flex-direction: column; justify-content: center; text-align: center;
	padding: clamp(4rem, 12vh, 9rem) var(--wp--style--root--padding-right, 1.25rem); }
.pgc-404 > * { margin-left: auto !important; margin-right: auto !important; }
.pgc-404-code { font-size: clamp(4rem, 12vw, 8rem); font-weight: 700; line-height: 1; color: var(--wp--preset--color--teal); margin: 0 0 1rem; }
.pgc-404 h1 { font-size: var(--wp--preset--font-size--xx-large); margin: 0 0 1.25rem; }
.pgc-404-text { font-size: var(--wp--preset--font-size--large); max-width: 36rem; margin-bottom: 2.5rem; }
.pgc-404-buttons { justify-content: center; gap: 1rem; }
