/*
 * Styles for page content converted by divi2blocks (core blocks carrying Divi-like class names).
 * Values measured on the old Divi pages: section padding 54px, row width 1080px + 40px bottom margin,
 * Divi gutter-3 column ratios, module spacing 2.75% (29.7px), toggle/blurb/header geometry.
 */
.thairoads-page .entry-content > .d2b-section { margin: 0 !important; }
.d2b-section { position: relative; padding: 54px 0; }
.d2b-section.has-background { padding: 54px 0; }
.d2b-section:has(> .et_pb_fullwidth_header) { padding: 0; }
.d2b-section > * { max-width: 1080px !important; width: 80%; margin-left: auto !important; margin-right: auto !important; }
.d2b-section > .et_pb_fullwidth_header { max-width: none !important; width: 100%; }

/* rows / columns (Divi gutter 3: 5.5%) */
.wp-block-columns.et_pb_row { gap: 0 5.5%; flex-wrap: nowrap !important; margin: 0 auto 40px; align-items: flex-start; }
.d2b-section > .wp-block-columns.et_pb_row:last-child { margin-bottom: 0; }
.wp-block-column.et_pb_column > .wp-block-columns.et_pb_row { margin: 0 !important; padding: 29.7px 0 !important; width: 100%; }
.wp-block-column.et_pb_column { flex-grow: 0 !important; min-width: 0; }
.et_pb_column_4_4 { flex-basis: 100% !important; }
.et_pb_column_1_2 { flex-basis: 47.25% !important; }
.et_pb_column_1_3 { flex-basis: 29.6667% !important; }
.et_pb_column_2_3 { flex-basis: 64.833% !important; }
.et_pb_column_1_4 { flex-basis: 20.875% !important; }
.et_pb_column_3_4 { flex-basis: 73.625% !important; }
/* inner rows inside a 3/4 specialty column keep the inner ratios */
.et_pb_column_3_4 .et_pb_column_1_2 { flex-basis: 47.25% !important; }
.et_pb_column_3_4 .et_pb_column_1_3 { flex-basis: 29.6667% !important; }

/* modules: Divi spaces modules by 2.75% of the row */
.et_pb_column > * + *, .d2b-section > .et_pb_text + * { margin-top: 0 !important; }
.et_pb_text, .et_pb_toggle, .et_pb_blurb, .et_pb_image, .wp-block-separator, .wp-block-embed, .wp-block-shortcode, .et_pb_widget_area { margin-bottom: 29.7px !important; }
.et_pb_column > :last-child, .d2b-section > :last-child { margin-bottom: 0 !important; }
.et_pb_text p { padding-bottom: 1em; }
.et_pb_text p:last-child { padding-bottom: 0; }
.et_pb_text h1, .et_pb_text h2, .et_pb_text h3, .et_pb_text h4, .et_pb_text h5, .et_pb_text h6 { padding-bottom: 10px; }
.et_pb_text ul, .et_pb_text ol { margin-left: 30px; padding-left: 0; }
.has-text-align-center { text-align: center; }
.has-text-align-right { text-align: right; }

/* fullwidth header band */
.et_pb_fullwidth_header { padding: 30px 0 !important; text-align: center; }
.et_pb_fullwidth_header h1 { font-size: 36px; color: #333; padding-bottom: 10px; line-height: 1.3; }
.et_pb_fullwidth_header p { padding: 0; }

/* image module */
.wp-block-image.et_pb_image { margin: 0 0 29.7px; line-height: 0; }
.wp-block-image.et_pb_image img { display: block; }

/* toggles → <details> */
.wp-block-details.et_pb_toggle { background: #f4f4f4; border: 1px solid #d9d9d9; padding: 20px; margin: 0 0 29.7px !important; }
.wp-block-details.et_pb_toggle[open] { background: #fff; }
.wp-block-details.et_pb_toggle > summary { list-style: none; cursor: pointer; font-family: RSURegular, Thonburi, sans-serif; font-size: 20px; line-height: 26px; color: #666; padding-right: 50px; position: relative; }
.wp-block-details.et_pb_toggle > summary::-webkit-details-marker { display: none; }
.wp-block-details.et_pb_toggle > summary::after { content: "+"; position: absolute; right: 0; top: -2px; font-size: 22px; color: #ccc; font-family: Arial, sans-serif; }
.wp-block-details.et_pb_toggle[open] > summary { color: #333; }
.wp-block-details.et_pb_toggle[open] > summary::after { content: "\2212"; }
.wp-block-details.et_pb_toggle > :not(summary) { padding-top: 20px; }
/* toggle custom CSS from Divi (in-the-news toggles): images float left at least 300px wide */
.et_pb_toggle img { min-width: 300px; float: left; }

/* blurbs */
.et_pb_blurb h4 { font-size: 17px; line-height: 1.3; padding-bottom: 5px; }
.et_pb_blurb h4 a { color: #333; }
.et_pb_blurb_position_left .d2b-blurb-cols { gap: 0 !important; margin: 0 !important; padding: 0 !important; align-items: flex-start; }
.et_pb_blurb_position_left .d2b-blurb-img { flex: 0 0 80px !important; }
.et_pb_blurb_position_left .d2b-blurb-img .wp-block-image { margin: 0 0 12px; }
.wp-block-column.et_pb_column > .wp-block-columns.et_pb_row .et_pb_blurb { margin-bottom: 0 !important; }
.et_pb_blurb_position_left .d2b-blurb-text { flex: 1 1 auto !important; padding-left: 15px; }
.et_pb_blurb_position_top .et_pb_main_blurb_image { text-align: center; margin-bottom: 30px; }

/* separators / spacers */
.wp-block-separator { border: 0; height: 1px; margin: 0 0 29.7px; opacity: 1; }

/* converted Divi fallbacks (contact form, map) are replaced by real blocks; keep a neutral look if any remain */
.d2b-fallback { border: 0; padding: 0; }

/* embeds */
.wp-block-embed iframe { width: 100%; }

/* ---- chrome fixes after the first visual pass ---- */
/* Divi printed the footer colour inline (et_divi footer_bg); the child CSS background shorthand resets it. */
#main-footer { background-color: #0060b6 !important; }
#logo { margin-top: -9px; }
/* Divi drew the submenu arrow as an ETmodules chevron glyph (line-height 50px); without that font, draw it with borders, centred */
#top-menu .menu-item-has-children > a:first-child::after { top: 50%; right: 17px; width: 7px; height: 7px; margin-top: -6px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
/* Divi's #main-header rule kept top-menu links un-underlined, current item included */
#main-header #top-menu a { text-decoration: none; }

/* map embeds are iframes: block so the section's auto margins centre them */
.d2b-section > iframe, iframe.d2b-map { display: block; }

/* Contact Form 7 laid out like the Divi contact form: grey fields, name + email side by side, captcha and button on one line */
.et_pb_contact_form_container h1.et_pb_contact_main_title { font-size: 26px; padding-bottom: 10px; }
.wpcf7 form { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.wpcf7 form > p { width: 100%; padding: 0 0 3%; margin: 0; }
.wpcf7 form > p:nth-of-type(1), .wpcf7 form > p:nth-of-type(2) { width: 48.5%; }
.wpcf7 form > p:nth-of-type(4) { width: auto; margin-left: auto; padding-right: 12px; }
.wpcf7 form > p:nth-of-type(5) { width: auto; }
.wpcf7 label { font-size: 0; display: block; }
.wpcf7 label .wpcf7-form-control-wrap { font-size: 14px; }
.wpcf7 input[type=text], .wpcf7 input[type=email], .wpcf7 textarea { width: 100%; background: #eee; border: 0; padding: 16px; font-size: 14px; color: #999; font-family: Boon300, sans-serif; }
.wpcf7 textarea { height: 150px; }
.wpcf7 .wpcf7-quiz-label { font-size: 14px; color: #999; margin-right: 6px; }
.wpcf7 input.wpcf7-quiz { width: 50px; padding: 10px 6px; background: #eee; border: 0; }
.wpcf7 input[type=submit] { background: transparent; border: 2px solid #2ea3f2; border-radius: 3px; color: #2ea3f2; font-size: 20px; padding: 6px 20px; cursor: pointer; font-family: Boon300, sans-serif; }
.wpcf7 .wpcf7-spinner { display: none; }
.wpcf7-response-output { width: 100%; font-size: 14px; }
