/*
 * Responsive rules for the SSDH utility bar, main navigation and first Hero.
 * This file is loaded after the theme's legacy responsive stylesheet so the
 * scoped rules below do not need to change unrelated theme components.
 */

.ssdh-main-head .ssdh-mobile-search-panel {
	display: none;
}

@media only screen and (min-width: 1200px) {
	.ssdh-main-head .ssdh-mobile-search-panel {
		display: none !important;
	}

	.ssdh-navigation .mobile {
		display: none !important;
	}

	.ssdh-navigation .mobile .ssdh-mobile-search-toggle {
		display: none !important;
	}
}

@media only screen and (max-width: 1199px) {
	.ssdh-utility .top-bar-content > .search {
		display: none;
	}

	.ssdh-utility .top-bar-content {
		min-width: 0;
		flex-wrap: nowrap;
	}

	.ssdh-utility .trending-ticker {
		min-width: 0;
		white-space: nowrap;
	}

	.ssdh-utility .top-bar-content > .textwidget .social-icons li {
		display: none;
	}

	.ssdh-utility .top-bar-content > .textwidget .social-icons li:nth-child(2) {
		display: block;
	}

	.ssdh-main-head .ssdh-header {
		height: 59px !important;
		min-height: 59px !important;
		padding: 0 16px;
	}

	.ssdh-main-head .ssdh-header-inner {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 14px;
		height: 59px;
		min-height: 59px;
		width: 100%;
		box-sizing: border-box;
	}

	.ssdh-main-head .ssdh-brand {
		flex: 0 1 auto;
		width: 185px;
		max-width: calc(100% - 110px);
		margin: 0;
		padding: 0;
	}

	.ssdh-main-head .ssdh-brand .logo-mobile {
		display: none;
		width: 0;
		height: 0;
	}

	.ssdh-main-head .ssdh-brand .logo-mobile + .logo-image {
		display: block;
		width: 100%;
		height: auto;
		padding: 0;
	}

	.ssdh-main-head .ssdh-navigation-wrap {
		flex: 1 1 auto;
		width: auto;
		min-width: 0;
	}

	.ssdh-main-head .ssdh-navigation,
	.ssdh-main-head .ssdh-nav-inner {
		height: 59px;
		min-height: 59px;
		width: 100%;
	}

	/* The desktop menu wrapper remains a flex item even when its list is hidden. */
	.ssdh-main-head .ssdh-navigation .menu-menu-main-container {
		display: none;
	}

	.ssdh-navigation .menu-menu-main-container > .menu {
		display: none;
	}

	.ssdh-navigation .mobile {
		display: flex !important;
		align-items: center;
		justify-content: flex-end;
		width: auto;
		height: 59px;
		margin-left: auto;
		flex: 0 0 96px;
	}

	.ssdh-navigation .mobile .selected {
		display: flex;
		align-items: center;
		justify-content: flex-end;
		gap: 8px;
		width: 96px;
		height: 44px;
		margin: 0;
		padding: 0;
		background: transparent;
		color: inherit;
		line-height: 44px;
		overflow: visible;
	}

	.ssdh-navigation .mobile .current {
		display: none;
	}

	.ssdh-navigation .mobile .hamburger,
	.ssdh-navigation .mobile .search-button {
		position: static;
		float: none;
		display: grid;
		place-items: center;
		flex: 0 0 44px;
		width: 44px;
		height: 44px;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: 50%;
		background: #f1f5fa;
		color: #234c7e;
		font-size: 16px;
		line-height: 1;
		text-align: center;
	}

	.ssdh-navigation .mobile .hamburger {
		font-style: normal;
	}

	.ssdh-navigation .mobile .search {
		position: static;
		display: flex;
		align-items: center;
		flex: 0 0 44px;
		width: 44px;
		height: 44px;
		margin: 0;
		padding: 0;
		float: none;
	}

	.ssdh-navigation .mobile .search form {
		position: relative;
		width: 100%;
		height: 44px;
	}

	.ssdh-navigation .mobile .search .query {
		display: none;
	}

	.ssdh-navigation .mobile .search-button .fa {
		display: block;
		width: auto;
		height: auto;
		margin: 0;
		padding: 0;
		background: transparent;
		color: inherit;
		line-height: 1;
	}

	.ssdh-navigation .mobile .search-button:hover,
	.ssdh-navigation .mobile .search-button:focus,
	.ssdh-navigation .mobile .hamburger:hover,
	.ssdh-navigation .mobile .hamburger:focus {
		background: #f1f5fa;
		color: #234c7e;
	}

	.ssdh-navigation .mobile .search.active {
		position: absolute;
		top: 8px;
		right: 52px;
		left: 0;
		width: auto;
		flex: none;
		margin: 0;
	}

	.ssdh-navigation .mobile .search.active form {
		display: flex;
		align-items: center;
		position: relative;
		width: 100%;
		height: 44px;
	}

	.ssdh-navigation .mobile .search.active .query {
		display: block;
		width: 100%;
		height: 44px;
		margin: 0;
		box-sizing: border-box;
	}

	.ssdh-navigation .mobile .search.active .search-button {
		position: absolute;
		top: 0;
		right: 0;
	}

	/* Keep the Tablet/Mobile controls in one right-aligned group. */
	.ssdh-navigation .mobile {
		flex: 0 0 auto;
		width: auto;
		gap: 8px;
		margin-left: auto;
	}

	.ssdh-navigation .mobile .selected,
	.ssdh-navigation .mobile .ssdh-mobile-search-toggle {
		box-sizing: border-box;
		flex: 0 0 44px;
		width: 44px;
		height: 44px;
		min-height: 44px;
		margin: 0;
		padding: 0;
		border: 1px solid #e3eaf2;
		border-radius: 50%;
		background: #f1f5f9;
		color: #1f4e79 !important;
		line-height: 44px;
		text-align: center;
		opacity: 1;
	}

	.ssdh-navigation .mobile .selected {
		display: grid;
		place-items: center;
		justify-content: center;
		align-content: center;
		text-decoration: none;
	}

	.ssdh-navigation .mobile .selected:hover,
	.ssdh-navigation .mobile .selected:focus,
	.ssdh-navigation .mobile .ssdh-mobile-search-toggle:hover,
	.ssdh-navigation .mobile .ssdh-mobile-search-toggle:focus {
		background: #f1f5f9;
		color: #1f4e79 !important;
		outline: 2px solid rgba(35, 76, 126, .25);
		outline-offset: 2px;
	}

	.ssdh-navigation .mobile .selected .hamburger,
	.ssdh-navigation .mobile .ssdh-mobile-search-toggle .fa {
		display: block;
		width: auto;
		height: auto;
		margin: 0;
		padding: 0;
		background: transparent;
		color: #1f4e79 !important;
		font-size: 17px;
		line-height: 1;
		opacity: 1;
	}

	.ssdh-navigation .mobile .ssdh-mobile-search-toggle {
		display: grid;
		place-items: center;
		appearance: none;
		-webkit-appearance: none;
		cursor: pointer;
		font-size: 16px;
	}

	.ssdh-main-head .ssdh-mobile-search-panel {
		display: none;
		box-sizing: border-box;
		width: 100%;
		margin: 0;
		padding: 16px;
		border-top: 1px solid #e6ebf1;
		border-bottom: 1px solid #e6ebf1;
		background: #f1f5fa;
	}

	.ssdh-main-head .ssdh-mobile-search-panel.is-open {
		display: block;
	}

	.ssdh-mobile-search-panel h2 {
		margin: 0 0 10px;
		color: #234c7e;
		font-size: 16px;
		font-weight: 600;
		line-height: 1.4;
	}

	.ssdh-mobile-search-panel form {
		display: flex;
		align-items: center;
		gap: 8px;
		width: 100%;
		margin: 0;
	}

	.ssdh-mobile-search-panel input[name="s"] {
		box-sizing: border-box;
		flex: 1 1 auto;
		min-width: 0;
		width: auto;
		height: 44px;
		margin: 0;
		padding: 0 16px;
		border: 1px solid #d8e1eb;
		border-radius: 22px;
		background: #fff;
		color: #33465c;
		font-size: 14px;
		line-height: 44px;
	}

	.ssdh-mobile-search-panel input[name="s"]:focus {
		border-color: #234c7e;
		outline: 2px solid rgba(35, 76, 126, .2);
		outline-offset: 1px;
	}

	.ssdh-mobile-search-panel .ssdh-mobile-search-submit {
		box-sizing: border-box;
		flex: 0 0 44px;
		width: 44px;
		height: 44px;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: 50%;
		background: #f1f5fa;
		color: #234c7e;
		cursor: pointer;
		font-size: 16px;
		line-height: 44px;
		text-align: center;
	}

	.ssdh-mobile-search-panel .ssdh-mobile-search-submit:hover,
	.ssdh-mobile-search-panel .ssdh-mobile-search-submit:focus {
		background: #e7eef6;
		color: #234c7e;
		outline: 2px solid rgba(35, 76, 126, .25);
		outline-offset: 2px;
	}

	.ssdh-navigation .mobile-menu-container {
		display: none;
		position: absolute;
		top: 100%;
		right: -5px;
		left: auto;
		width: 100vw;
		max-height: calc(100vh - 110px);
		overflow-y: auto;
		z-index: 110;
	}

	.ssdh-navigation .mobile-menu-container.active {
		display: block;
	}

	.ssdh-navigation .mobile-menu-container .menu {
		display: none;
		width: 100%;
		margin: 0;
		padding: 0;
	}

	.ssdh-navigation .mobile-menu-container.active .menu {
		display: block;
	}

	.ssdh-navigation .mobile-menu-container .menu li {
		display: block;
		float: none;
		clear: both;
		width: 100%;
	}

	.ssdh-navigation .mobile-menu-container .menu li > a {
		display: block;
		float: none;
		width: 100%;
		min-height: 44px;
		line-height: 44px;
		padding: 0 20px;
		box-sizing: border-box;
		border-top: 1px solid #e6ebf1;
		background: #fff !important;
		color: #33465c !important;
		font-weight: 600;
	}

	.ssdh-navigation .mobile-menu-container .menu li.menu-item-has-children > a::after {
		display: block !important;
		content: "›" !important;
		float: right;
		margin-left: 14px;
		color: #9ca7b3;
		font-family: Arial, Helvetica, sans-serif;
		font-size: 17px;
		font-weight: 400;
		line-height: 44px;
	}

	.ssdh-navigation .mobile-menu-container .menu li > ul.sub-menu {
		position: static;
		display: none;
		width: 100%;
		min-width: 0;
		transform: none;
		visibility: visible;
		opacity: 1;
		pointer-events: auto;
	}

	.ssdh-navigation .mobile-menu-container .menu li.active > ul.sub-menu,
	.ssdh-navigation .mobile-menu-container .menu li.item-active > ul.sub-menu {
		display: block;
	}

	.ssdh-navigation .mobile-menu-container .menu li > a.chevron,
	.ssdh-navigation .mobile-menu-container .menu li > ul.sub-menu > li > a::after {
		display: none;
	}

	.ssdh-home-slider {
		width: calc(100% - 32px);
		margin-right: 16px;
		margin-left: 16px;
		box-sizing: border-box;
		transition: height .25s ease;
	}

	.ssdh-home-slider .ssdh-slider-slide img {
		object-fit: contain;
	}
}

@media only screen and (max-width: 767px) {
	.ssdh-utility .top-bar-content {
		justify-content: space-between;
		gap: 0;
		padding: 0 14px;
	}

	.ssdh-utility .trending-ticker {
		flex: 0 1 auto;
		margin: 0;
	}

	.ssdh-utility .top-bar-content > .search,
	.ssdh-utility .top-bar-content > .ssdh-tv-link {
		display: none;
	}

	.ssdh-utility .top-bar-content > .textwidget {
		flex: 0 0 auto;
		margin-left: auto;
	}

	.ssdh-utility .top-bar-content > .textwidget .social-icons li:nth-child(2) {
		display: block;
	}

	.ssdh-main-head .ssdh-brand {
		width: 180px;
		max-width: calc(100% - 110px);
	}

	.ssdh-main-head .ssdh-mobile-search-panel {
		padding: 16px 14px 18px;
	}

	.ssdh-home-slider {
		width: calc(100% - 20px);
		margin-right: 10px;
		margin-left: 10px;
	}
}

/* Keep the TV mark aligned with its label on small tablets. */
@media only screen and (min-width: 768px) and (max-width: 799px) {
	.ssdh-utility .top-bar-content > .ssdh-tv-link {
		display: inline-flex;
		align-items: center;
		gap: 5px;
		white-space: nowrap;
	}

	.ssdh-utility .top-bar-content > .ssdh-tv-link > .duhoctv {
		position: static !important;
		display: block;
		width: 27px;
		height: 27px;
		margin: 0 !important;
		object-fit: contain;
		vertical-align: middle;
	}
}
