/*
Theme Name: Maine Health Insurance Brokers Child
Theme URI: https://mainehealthinsurancebrokers.com/
Description: Responsive child theme for Twenty Fourteen, customized for Maine Health Insurance Brokers.
Author: Maine Health Insurance Brokers
Template: twentyfourteen
Version: 1.11.0
Text Domain: maine-health-insurance-brokers-child
*/

/**
 * Maine Health Insurance Brokers — responsive layout
 * --------------------------------------------------
 * Design targets:
 * - Desktop: centered 1280px site container
 * - Tablet: fluid 768–1024px layout
 * - Mobile: fluid 360–430px layout
 * - Right-hand sidebar on desktop; stacked below content on smaller screens
 * - Readable text measure independent of wider images/media
 */

:root {
	--mhib-site-max: 1280px;
	--mhib-reading-width: 1008px;
	--mhib-heading-width: 1008px;
	--mhib-sidebar-width: 280px;
	--mhib-navy: #082664;
	--mhib-navy-hover: #123b7a;
	--mhib-rule: rgba(0, 0, 0, 0.10);
}

/* -------------------------------------------------------------------------
   1. Site shell: 1280px maximum, fluid below that
   ------------------------------------------------------------------------- */

body {
	background: #f5f5f5;
}

.site,
.site-header {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--mhib-site-max);
	margin-left: auto;
	margin-right: auto;
}

#site-header img {
	display: block;
	width: 100%;
	height: auto;
}

/* Remove Twenty Fourteen's permanent left-rail background. */
.site:before {
	display: none !important;
}

/* -------------------------------------------------------------------------
   2. Brand color: navigation + footer
   ------------------------------------------------------------------------- */

.site-header,
.header-main,
.primary-navigation,
.search-toggle,
.search-box,
.site-footer,
.footer-sidebar {
	background-color: var(--mhib-navy);
}

.search-toggle:hover,
.search-toggle.active,
.primary-navigation li:hover > a,
.primary-navigation li.focus > a,
.primary-navigation ul ul,
.primary-navigation ul ul a:hover,
.primary-navigation ul ul li.focus > a {
	background-color: var(--mhib-navy-hover);
}

.primary-navigation a,
.menu-toggle,
.site-title a,
.site-title a:hover {
	color: #fff;
}

.site-footer,
.site-footer .widget,
.site-footer .widget-title,
.site-footer .site-info,
.site-footer a {
	color: #fff;
}

.site-footer a:hover,
.site-footer a:focus {
	color: #e6edf8;
}

/* -------------------------------------------------------------------------
   3. Neutralize Twenty Fourteen's legacy fixed content offsets
   ------------------------------------------------------------------------- */

.site-content,
.site-main .widecolumn {
	margin-left: 0 !important;
	margin-right: 0 !important;
}

.content-area,
#primary,
#secondary,
.content-sidebar {
	box-sizing: border-box;
	float: none;
	width: auto;
	margin-left: 0;
	margin-right: 0;
}

.site-content .entry-header,
.site-content .entry-content,
.site-content .entry-summary,
.site-content .entry-meta,
.site-content footer.entry-meta,
.page-content,
.archive-header,
.page-header,
.comments-area,
.post-navigation,
.image-navigation {
	box-sizing: border-box;
	max-width: none;
	margin-left: 0;
	margin-right: 0;
	padding-left: 0;
	padding-right: 0;
}

/* -------------------------------------------------------------------------
   4. Mobile-first content layout
   ------------------------------------------------------------------------- */

.main-content {
	box-sizing: border-box;
	width: 100%;
	padding: 32px 18px 48px;
}

/* Keep normal prose from becoming too wide even when the content area grows. */
.site-content .entry-header {
	max-width: var(--mhib-heading-width);
}

.site-content .entry-summary,
.site-content .entry-meta,
.site-content footer.entry-meta,
.page-content,
.archive-header,
.page-header,
.comments-area,
.post-navigation,
.image-navigation {
	max-width: var(--mhib-reading-width);
}

.site-content .entry-content > p,
.site-content .entry-content > ul,
.site-content .entry-content > ol,
.site-content .entry-content > dl,
.site-content .entry-content > blockquote,
.site-content .entry-content > pre,
.site-content .entry-content > address,
.site-content .entry-content > table,
.site-content .entry-content > form,
.site-content .entry-content > h1,
.site-content .entry-content > h2,
.site-content .entry-content > h3,
.site-content .entry-content > h4,
.site-content .entry-content > h5,
.site-content .entry-content > h6 {
	max-width: var(--mhib-reading-width);
}

/* Classic Editor often wraps an inserted image in a paragraph. Let those
   image paragraphs use the wider content column in modern browsers. */
@supports selector(p:has(img)) {
	.site-content .entry-content > p:has(> img),
	.site-content .entry-content > p:has(> a > img),
	.site-content .entry-content > p:has(> iframe),
	.site-content .entry-content > p:has(> video) {
		max-width: 100%;
	}
}

.entry-content img,
.entry-summary img,
.page-content img,
.entry-content iframe,
.entry-content video,
.entry-content embed,
.entry-content object,
.wp-block-image img {
	max-width: 100%;
	height: auto;
}

/* Right sidebar stacks under content on phones and portrait tablets. */
.content-sidebar {
	border: 0;
	border-top: 1px solid var(--mhib-rule);
	margin-top: 40px;
	padding: 32px 0 0;
}

.content-sidebar .widget {
	margin-bottom: 36px;
}

/* The parent theme's Primary Sidebar is intentionally rendered inside the
   right Content Sidebar by sidebar-content.php in this child theme. */
#secondary {
	display: none;
}

/* -------------------------------------------------------------------------
   5. Tablets: 768px–899px stay single-column for comfortable reading
   ------------------------------------------------------------------------- */

@media screen and (min-width: 768px) {
	.main-content {
		padding: 44px 32px 56px;
	}

	.content-sidebar {
		margin-top: 48px;
		padding-top: 36px;
	}
}

/* -------------------------------------------------------------------------
   6. Landscape tablets / laptops: right sidebar
   ------------------------------------------------------------------------- */

@media screen and (min-width: 900px) {
	.mhib-has-right-sidebar .main-content {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 260px;
		column-gap: 36px;
		align-items: start;
	}

	.mhib-has-right-sidebar .featured-content {
		grid-column: 1 / -1;
	}

	.mhib-has-right-sidebar #primary {
		grid-column: 1;
		min-width: 0;
	}

	.mhib-has-right-sidebar #content-sidebar {
		grid-column: 2;
		min-width: 0;
		border-top: 0;
		border-left: 1px solid var(--mhib-rule);
		margin-top: 0;
		padding: 0 0 0 28px;
	}

	.mhib-no-right-sidebar #primary {
		max-width: 920px;
	}
}

/* -------------------------------------------------------------------------
   7. Desktop / laptop target: 1280px container on a 1440px frame
   ------------------------------------------------------------------------- */

@media screen and (min-width: 1200px) {
	.main-content {
		padding: 56px 48px 68px;
	}

	.mhib-has-right-sidebar .main-content {
		grid-template-columns: minmax(0, 1fr) var(--mhib-sidebar-width);
		column-gap: 48px;
	}

	.mhib-has-right-sidebar #content-sidebar {
		padding-left: 32px;
	}
}

/* -------------------------------------------------------------------------
   8. Small phones: 360px–430px and similar widths
   ------------------------------------------------------------------------- */

@media screen and (max-width: 430px) {
	.main-content {
		padding: 28px 18px 42px;
	}

	.entry-title {
		font-size: 28px;
		line-height: 1.2;
	}

	.site-content .entry-content,
	.site-content .entry-summary {
		font-size: 16px;
		line-height: 1.6;
	}

	.content-sidebar {
		margin-top: 36px;
		padding-top: 28px;
	}
}

/* -------------------------------------------------------------------------
   9. Right-sidebar link colors
   ------------------------------------------------------------------------- */

.content-sidebar .widget a,
.content-sidebar .widget a:visited {
	color: var(--mhib-navy);
}

.content-sidebar .widget a:hover,
.content-sidebar .widget a:focus,
.content-sidebar .widget a:active {
	color: var(--mhib-navy-hover);
}

/* -------------------------------------------------------------------------
   10. Footer centering
   ------------------------------------------------------------------------- */

/* Center site-info links/text and any footer-widget text or links.
   Twenty Fourteen applies several desktop offsets/floats, so these rules
   deliberately override them at all breakpoints. */
.site-footer {
	text-align: center !important;
}

.site-footer .site-info {
	display: flex !important;
	flex-wrap: wrap;
	justify-content: center !important;
	align-items: center;
	gap: 0.75em;
	box-sizing: border-box;
	float: none !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 15px 18px !important;
	text-align: center !important;
}

.site-footer .site-info a,
.site-footer .site-info span,
.site-footer .site-info p,
.footer-sidebar,
.footer-sidebar .widget,
.footer-sidebar .widget-title,
.footer-sidebar .textwidget,
.footer-sidebar p,
.footer-sidebar a {
	float: none !important;
	text-align: center !important;
}

.footer-sidebar {
	box-sizing: border-box;
	width: 100% !important;
	max-width: var(--mhib-site-max);
	margin-left: auto !important;
	margin-right: auto !important;
}

.footer-sidebar .widget {
	margin-left: auto !important;
	margin-right: auto !important;
}

/* If a Navigation Menu widget is used in the footer, center its links as a
   group rather than leaving Twenty Fourteen's list alignment in place. */
.footer-sidebar .widget_nav_menu ul.menu {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 18px;
	margin-left: 0 !important;
	padding-left: 0 !important;
	list-style: none;
}

.footer-sidebar .widget_nav_menu ul.menu > li {
	float: none !important;
	margin: 0;
}

@media screen and (min-width: 768px) {
	.site-footer .site-info {
		padding-left: 32px !important;
		padding-right: 32px !important;
	}
}

@media screen and (min-width: 1200px) {
	.site-footer .site-info {
		padding-left: 48px !important;
		padding-right: 48px !important;
	}
}

/* -------------------------------------------------------------------------
   11. Align the top of the article and right sidebar
   ------------------------------------------------------------------------- */

/* Twenty Fourteen applies spacing at several nested levels. Normalize the
   first content block and first widget so both columns begin on the same
   horizontal line when the two-column layout is active. */
@media screen and (min-width: 900px) {
	.mhib-has-right-sidebar #primary,
	.mhib-has-right-sidebar #content-sidebar {
		align-self: start;
		margin-top: 0 !important;
	}

	.mhib-has-right-sidebar #primary .site-content,
	.mhib-has-right-sidebar #primary .site-content > article:first-child,
	.mhib-has-right-sidebar #primary .site-content > article:first-child .entry-header,
	.mhib-has-right-sidebar #content-sidebar > .widget:first-child,
	.mhib-has-right-sidebar #content-sidebar > .widget:first-child .widget-title {
		margin-top: 0 !important;
		padding-top: 0 !important;
	}
}



/* -------------------------------------------------------------------------
   12. Footer widget centering — override Twenty Fourteen desktop widths
   ------------------------------------------------------------------------- */

/* Twenty Fourteen gives footer widgets fixed 50%/25% widths at larger
   breakpoints. That centers the text inside a narrow widget on the left
   rather than across the full footer. Make each footer widget a full-width,
   centered row instead. */
#supplementary,
#footer-sidebar.footer-sidebar {
	box-sizing: border-box;
	width: 100% !important;
	max-width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	text-align: center !important;
}

#footer-sidebar.footer-sidebar {
	display: flex !important;
	flex-direction: column;
	align-items: center !important;
	justify-content: center !important;
}

#footer-sidebar.footer-sidebar .widget {
	box-sizing: border-box;
	float: none !important;
	clear: both !important;
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 auto 18px !important;
	padding-left: 18px !important;
	padding-right: 18px !important;
	text-align: center !important;
}

#footer-sidebar.footer-sidebar .widget:last-child {
	margin-bottom: 0 !important;
}

#footer-sidebar .widget-title,
#footer-sidebar .textwidget,
#footer-sidebar .custom-html-widget,
#footer-sidebar .widget p,
#footer-sidebar .widget ul,
#footer-sidebar .widget ol,
#footer-sidebar .widget li,
#footer-sidebar .widget a {
	text-align: center !important;
}

#footer-sidebar .widget ul,
#footer-sidebar .widget ol {
	margin-left: auto !important;
	margin-right: auto !important;
	padding-left: 0 !important;
}

/* Keep footer menus centered as a group. */
#footer-sidebar .widget_nav_menu ul.menu,
#footer-sidebar .menu {
	display: flex !important;
	flex-wrap: wrap;
	justify-content: center !important;
	align-items: center;
	gap: 8px 18px;
	width: 100% !important;
	margin-left: auto !important;
	margin-right: auto !important;
	padding-left: 0 !important;
}

#footer-sidebar .widget_nav_menu ul.menu > li,
#footer-sidebar .menu > li {
	float: none !important;
	width: auto !important;
	margin: 0 !important;
}

/* -------------------------------------------------------------------------
   13. Match the first article heading to the first sidebar heading (v1.7)
   ------------------------------------------------------------------------- */

/* Twenty Fourteen assigns the primary content area 72px of top padding at
   desktop widths. The child theme already removes the right sidebar's extra
   padding, but the original content-area padding remained. In the current
   layout this places the visible article heading about 48px below the first
   sidebar heading. Retain 24px of inset for consistent baseline alignment;
   change only vertical spacing and leave both column widths untouched. */
@media screen and (min-width: 900px) {
	.mhib-has-right-sidebar #primary {
		padding-top: 24px !important;
	}
}

/* -------------------------------------------------------------------------
   14. Navy right sidebar + white links (v1.8)
   ------------------------------------------------------------------------- */

:root {
	--mhib-link-hover-grey: #cbd0d7;
}

/* Color the full right-column surface, not just individual widget boxes.
   Desktop stretch fills the column alongside longer pages. */
#content-sidebar {
	background-color: var(--mhib-navy);
	color: #fff;
}

#content-sidebar .widget,
#content-sidebar .widget-title,
#content-sidebar .widget p,
#content-sidebar .widget li,
#content-sidebar .textwidget,
#content-sidebar .custom-html-widget,
#content-sidebar .secondary-navigation {
	color: #fff;
}

/* Includes Navigation Menu and Text/Custom HTML widget links. */
#content-sidebar a,
#content-sidebar a:link,
#content-sidebar a:visited,
#content-sidebar .widget a,
#content-sidebar .widget a:visited,
#content-sidebar .secondary-navigation a,
#content-sidebar .secondary-navigation a:visited {
	color: #fff;
}

#content-sidebar a:hover,
#content-sidebar a:focus,
#content-sidebar a:active,
#content-sidebar .widget a:hover,
#content-sidebar .widget a:focus,
#content-sidebar .secondary-navigation a:hover,
#content-sidebar .secondary-navigation a:focus {
	color: var(--mhib-link-hover-grey);
}

/* Main navigation and footer: white links, gray hover/focus. Override the
   parent theme's green current-page link without changing its layout. */
.primary-navigation a,
.primary-navigation a:visited,
.primary-navigation .current_page_item > a,
.primary-navigation .current_page_ancestor > a,
.primary-navigation .current-menu-item > a,
.primary-navigation .current-menu-ancestor > a,
.site-footer a,
.site-footer a:visited {
	color: #fff;
}

.primary-navigation a:hover,
.primary-navigation a:focus,
.primary-navigation li:hover > a,
.primary-navigation li.focus > a,
.primary-navigation .current_page_item > a:hover,
.primary-navigation .current_page_ancestor > a:hover,
.primary-navigation .current-menu-item > a:hover,
.primary-navigation .current-menu-ancestor > a:hover,
.site-footer a:hover,
.site-footer a:focus {
	color: var(--mhib-link-hover-grey);
}

/* Retain the v1.7 top alignment and existing 280px sidebar/grid dimensions. */
@media screen and (min-width: 900px) {
	.mhib-has-right-sidebar #content-sidebar {
		align-self: stretch !important;
	}
}

/* When the sidebar stacks below content, inset text from the new navy edge. */
@media screen and (max-width: 899px) {
	#content-sidebar {
		padding-right: 18px;
		padding-bottom: 24px;
		padding-left: 18px;
	}
}


/* -------------------------------------------------------------------------
   15. Navy-sidebar widget polish (v1.9)
   ------------------------------------------------------------------------- */

/* Twenty Fourteen adds a 5px black rule above content-sidebar widget titles.
   Remove it on the navy surface; retain accessible white headings. */
#content-sidebar .widget .widget-title {
	border-top: 0;
	border-bottom: 0;
	padding-top: 0;
	margin: 0 0 12px;
	color: #fff;
}

/* Replace mixed parent/child widget gaps with one compact, consistent rhythm.
   This also reduces the gap between the quote graphic and Popular Pages. */
#content-sidebar > .widget {
	margin-top: 0;
	margin-bottom: 26px;
}

#content-sidebar > .widget:last-child {
	margin-bottom: 0;
}

/* Trim inherited margins inside text/HTML widgets without touching their
   content or removing intentional line breaks. */
#content-sidebar .widget p {
	margin-bottom: 12px;
}

#content-sidebar .textwidget > :last-child,
#content-sidebar .custom-html-widget > :last-child {
	margin-bottom: 0;
}

/* Keep the company logo and quote image within the right-hand column. */
#content-sidebar .widget img {
	max-width: 100%;
	height: auto;
}

/* Make menu-link rows more even and let long page titles wrap naturally. */
#content-sidebar .widget_nav_menu li,
#content-sidebar .widget_pages li,
#content-sidebar .widget_recent_entries li,
#content-sidebar .widget_archive li,
#content-sidebar .widget_categories li {
	padding-top: 6px;
	padding-bottom: 7px;
	line-height: 1.4;
	border-color: rgba(255, 255, 255, 0.14);
}

/* Match the first widget heading to the article's 24px desktop top inset.
   This changes only internal vertical spacing, not sidebar dimensions. */
@media screen and (min-width: 900px) {
	.mhib-has-right-sidebar #content-sidebar {
		padding-top: 24px;
	}
}

/* -------------------------------------------------------------------------
   16. Whole-word line wrapping site-wide (v1.11)
   ------------------------------------------------------------------------- */

/* Twenty Fourteen also sets word-wrap: break-word in several contexts.
   hyphens: none alone prevents inserted hyphens but can still allow a word
   to be split mid-word. Restore normal wrapping so the browser moves the
   *entire* word to the following line instead. In the case of an unusually
   long unbroken token (such as a URL), the token may overflow its container;
   this is intentional rather than splitting normal words. */
#page,
#page * {
    -webkit-hyphens: none !important;
    -moz-hyphens: none !important;
    -ms-hyphens: none !important;
    hyphens: none !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    word-wrap: normal !important;
}

/* Preserve sensible handling of long, unbroken URL/code strings only; these
   are not ordinary prose and otherwise can extend past the phone viewport. */
#page pre,
#page code,
#page .wp-block-code,
#page .wp-block-preformatted {
    overflow-wrap: anywhere !important;
}
