/*
Theme Name: Windsor Divi Child
Template: Divi
Description: Child theme for The 239: Windsor pilot. Custom footer bar, designed 404 and search templates. No default Divi footer credits.
Version: 0.2.2
*/

/* Hide the default Divi footer bottom bar (replaced by .windsor-site-footer from functions.php) */
#footer-bottom { display: none !important; }

/* Windsor footer bar */
.windsor-site-footer { background: #1E3A4C; color: #ffffff; padding: 34px 20px; margin-top: 40px; }
.windsor-footer-inner { max-width: 1080px; margin: 0 auto; text-align: center; }
.windsor-footer-nav ul { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; }
.windsor-footer-nav a { color: #ffffff; text-decoration: none; }
.windsor-footer-nav a:hover { color: #B98A2F; }
.windsor-footer-credits { margin: 0; font-size: 15px; color: #e8e2d8; }
.windsor-footer-credits a { color: #ffffff; }
.windsor-footer-credits a:hover { color: #B98A2F; }

/* Windsor buttons on 404/search templates (match sitewide standard: 220px min, 12px radius, navy) */
.windsor-btn { display: inline-block; min-width: 220px; text-align: center; background: #1E3A4C; color: #ffffff !important; border-radius: 12px; padding: 12px 20px; margin: 6px 8px 0; text-decoration: none; }
.windsor-btn:hover { background: #274a61; }

/* 404 + search template layout */
.windsor-404, .windsor-search { max-width: 860px; margin: 0 auto; padding: 80px 20px 60px; }
.windsor-404 { text-align: center; }
.windsor-search-results { list-style: none; margin: 24px 0 0; padding: 0; }
.windsor-search-results li { border-bottom: 1px solid #e5e0d8; padding: 16px 0; }
.windsor-search-results a { color: #1E3A4C; font-weight: 600; }
.windsor-search-results a:hover { color: #B98A2F; }

@media (max-width: 640px) {
  .windsor-btn { width: 100%; margin: 8px 0 0; box-sizing: border-box; }
}

/* Phase 5 additions */
/* Equal image frames sitewide (3:2, cover) - standalone image modules */
.et_pb_image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; display: block; }
/* Header CTA menu item styled as a button (same standard as sitewide buttons) */
.menu-cta > a { background: #1E3A4C !important; color: #ffffff !important; border-radius: 12px; min-width: 220px; text-align: center; }
.menu-cta > a:hover { background: #274a61 !important; }
/* Gravity Forms submit matches sitewide buttons (broad selectors for GF3 themes) */
.gform_wrapper .gform_button, .gform_wrapper button[type="submit"], .gform_wrapper input[type="submit"], .gform-theme .gform_button { min-width: 220px !important; border-radius: 12px !important; background: #1E3A4C !important; color: #ffffff !important; border: none !important; padding: 12px 20px; }

/* Phase 7b additions (applied via child stylesheet - the effective CSS route confirmed by live CTA button styling) */

/* Header: keep the wide Windsor wordmark inside the 80px header so it cannot overlap the nav */
#main-header .logo_container img#logo { max-width: 240px; width: auto; height: auto; max-height: 44px; }
@media (max-width: 980px) {
  #main-header .logo_container img#logo { max-width: 200px; max-height: 38px; }
}

/* Header CTA button: vertical centering of its label */
.menu-cta > a { display: inline-flex !important; align-items: center; justify-content: center; line-height: 1.4 !important; padding-top: 10px !important; padding-bottom: 10px !important; min-height: 44px; box-sizing: border-box; }

/* Hero overlay + stacking (background image itself is printed by functions.php with the live attachment URL) */
.et_pb_fullwidth_header { position: relative; background-size: cover !important; background-position: center !important; }
.et_pb_fullwidth_header:before { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.35); }
.et_pb_fullwidth_header > * { position: relative; z-index: 1; }
@media (max-width: 768px) {
  .et_pb_fullwidth_header { padding-top: 48px !important; padding-bottom: 48px !important; }
  .et_pb_fullwidth_header h1 { font-size: 30px !important; line-height: 1.25 !important; }
  .et_pb_fullwidth_header .et_pb_fullwidth_header_container { width: 100% !important; max-width: 100% !important; }
}

/* Gravity Forms 3 grid: kill negative row margins that caused the 6px spill at 390px, keep the gutter as column-gap */
#gform_1 .gform-grid-row { margin-left: 0 !important; margin-right: 0 !important; column-gap: 16px; }
#gform_1 .gform-grid-row > .gform-grid-col:first-child { padding-left: 0 !important; }
#gform_1 .gform-grid-row > .gform-grid-col:last-child { padding-right: 0 !important; }

/* Contact page: Divi 5 compat renders this page's modules without rows, so content runs flush to the edges - contain it */


/* Phase 7b follow-up: keep logo+nav+CTA on one line in the 981-1200 narrow-desktop band (verified wrap at 981/1080) */
@media (min-width: 981px) and (max-width: 1200px) {
  #main-header .logo_container img#logo { max-width: 150px; }
  #top-menu li { padding-right: 8px; }
  #top-menu .menu-cta { padding-right: 0; }
  .menu-cta > a { min-width: 150px; }
}

/* Name field: First/Last side by side on desktop, stacked on phone (pilot 0.2.1, GF3 grid did not split the row) */
#gform_1 .ginput_container_name { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
@media (max-width: 640px) {
  #gform_1 .ginput_container_name { grid-template-columns: 1fr; row-gap: 12px; }
}
/* Pages whose Divi 4 shortcode sections render without rows in Divi 5 compat (bare text/button modules run flush to the edges) - contain them.
   Scoped per page; The House gallery (et_pb_gallery) is excluded so its accepted full-bleed layout is untouched. Row-wrapped content is never a direct child, so grids are unaffected. */
body.page-id-5 .et_pb_section > .et_pb_module:not(.et_pb_gallery),
body.page-id-6 .et_pb_section > .et_pb_module,
body.page-id-7 .et_pb_section > .et_pb_module,
body.page-id-8 .et_pb_section > .et_pb_module { width: 100%; max-width: 1080px; margin-left: auto !important; margin-right: auto !important; padding-left: 24px; padding-right: 24px; box-sizing: border-box; }
