/*
 * Blog sidebar - Figma redesign
 * Restyles the search + categories widgets of the VC blog sidebar into the
 * rounded search field and pill-chip category card from the design.
 * Loaded only on blog contexts (see transcargo_enqueue_blog_sidebar).
 */

/* ---------- Search ---------- */

.sidebar-area .widget_search {
	margin: 0;
}

.sidebar-area .widget_search .search-form {
	margin: 0;
}

.sidebar-area .widget_search input[type="search"],
.sidebar-area .widget_search input[type="search"].form-control {
	height: 56px;
	padding: 16px 56px 16px 20px;
	border: 1px solid #e5e7eb !important;
	border-radius: 12px;
	font-size: 16px;
	line-height: 24px;
	color: #183650;
}

.sidebar-area .widget_search input[type="search"]::placeholder {
	color: #9ca3af;
}

.sidebar-area .widget_search input[type="search"]:focus,
.sidebar-area .widget_search input[type="search"].form-control:focus {
	border: 1px solid #34ccff !important;
	padding: 16px 56px 16px 20px;
}

.sidebar-area .widget_search .search-form button {
	top: 0;
	right: 8px;
	width: 48px;
	height: 56px;
	font-size: 22px;
	color: #111827;
}

/* Search sits closer to the categories card than the theme default 50px */
.sidebar-area .wpb_content_element.vc_wp_search {
	margin: 0 0 24px;
}

/* ---------- Categories card ---------- */

.sidebar-area .widget.widget_categories {
	padding: 24px;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	background: #fff;
}

.sidebar-area .widget.widget_categories .widget_title {
	margin: 0 0 20px;
	font-size: 20px;
	line-height: 28px;
	text-transform: none;
	color: #111827;
}

/* Chips flow and wrap, so short and long names pack into two loose columns */
.sidebar-area .widget.widget_categories ul {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 8px;
}

.sidebar-area .widget.widget_categories ul li {
	margin: 0;
	padding: 0;
	text-transform: none;
	line-height: normal;
}

/* Drop the theme's "›" bullet - chips carry their own shape */
.sidebar-area .widget.widget_categories ul li:before {
	content: none;
}

.sidebar-area .widget.widget_categories ul li a {
	display: block;
	padding: 9px 14px;
	border: 1px solid #e5e7eb;
	border-radius: 999px;
	font-size: 13px;
	line-height: 18px;
	font-weight: 500;
	white-space: nowrap;
	color: #111827;
}

.sidebar-area .widget.widget_categories ul li a:hover {
	border-color: #34ccff;
	color: #34ccff;
}

.sidebar-area .widget.widget_categories ul li.current-cat a {
	border-color: #34ccff;
	background: #34ccff;
	color: #fff;
}

/* ---------- Show all / fewer toggle ---------- */

/* Collapsed is the default so the extra chips never flash before JS runs */
.sidebar-area .widget.widget_categories ul li:nth-child(n + 9) {
	display: none;
}

.sidebar-area .widget.widget_categories.is-expanded ul li:nth-child(n + 9) {
	display: block;
}

.amv-cat-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	margin: 20px 0 0;
	padding: 0;
	border: none;
	background: none;
	outline: none;
	font-size: 16px;
	line-height: 24px;
	font-weight: 500;
	white-space: nowrap;
	color: #34ccff;
	cursor: pointer;
}

.amv-cat-toggle svg {
	flex: none;
	transition: transform 0.3s ease;
}

.widget.widget_categories.is-expanded .amv-cat-toggle svg {
	transform: rotate(180deg);
}

/* ---------- Wider blog layout ---------- */

/*
 * Bootstrap caps .container at 1140px, which leaves the article column narrow
 * and a lot of unused gutter on modern screens. Widen the blog's own
 * containers only - #content excludes the header band and the footer, so the
 * rest of the site keeps the theme's width.
 */
@media (min-width: 1200px) {
	body.amv-blog-header #content .container {
		width: clamp(1140px, 94vw, 1440px);
	}

	/*
	 * Spend the extra width on the article, not the sidebar: the cards are
	 * drawn around a ~385px column and look stretched much past that, and a
	 * text column beyond ~780px gets tiring to read.
	 */
	body.amv-blog-header #content .container > .row:has(> .col-lg-3 > .sidebar-area) {
		display: flex;
	}

	body.amv-blog-header #content .container > .row:has(> .col-lg-3 > .sidebar-area) > .col-lg-9 {
		flex: 1 1 auto;
		width: auto;
	}

	body.amv-blog-header #content .container > .row:has(> .col-lg-3 > .sidebar-area) > .col-lg-3 {
		flex: 0 0 415px;
		width: 415px;
	}
}

/* ---------- Wider sidebar column ---------- */

/*
 * The design needs ~310px of card interior for chips to pair up; the theme's
 * col-lg-3 leaves ~205px. transcargo_get_structure() hardcodes 9/3 and is
 * shared with the vacancy templates, so widen to 8/4 here instead - this
 * stylesheet only loads on blog contexts.
 */
@media (min-width: 992px) {
	.container > .row:has(> .col-lg-3 > .sidebar-area) > .col-lg-9 {
		width: 66.66666667%;
	}

	.container > .row:has(> .col-lg-3 > .sidebar-area) > .col-lg-3 {
		width: 33.33333333%;
	}
}

/*
 * WPBakery wraps the sidebar in .vc_row/.vc_column-inner, which spends 15px of
 * each side on padding the card does not need. Reclaiming it gives the chips
 * the ~300px of interior the design assumes.
 */
.sidebar-area .vc_row {
	margin-left: 0;
	margin-right: 0;
}

.sidebar-area .wpb_column,
.sidebar-area .vc_column-inner {
	/* js_composer's stylesheet loads after the theme's, hence !important */
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* ---------- Help card (stm_help_card) ---------- */

.sidebar-area .stm_help_card {
	padding: 32px 24px;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	background: #fff;
	text-align: center;
}

.sidebar-area .stm_help_card_icon {
	margin: 0 0 16px;
	line-height: 0;
	color: #34ccff;
}

.sidebar-area .stm_help_card_eyebrow {
	margin: 0 0 10px;
	font-size: 12px;
	line-height: 16px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #111827;
}

.sidebar-area .stm_help_card_title {
	margin: 0 0 12px;
	font-size: 20px;
	line-height: 28px;
	font-weight: 700;
	text-transform: none;
	color: #111827;
}

.sidebar-area .stm_help_card_text {
	margin: 0 0 24px;
	font-size: 14px;
	line-height: 22px;
	color: #6b7280;
}

.sidebar-area .stm_help_card_btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	border-radius: 12px;
	background: #34ccff;
	font-size: 15px;
	line-height: 20px;
	font-weight: 600;
	color: #fff;
	text-decoration: none !important;
	transition: background 0.3s ease;
}

.sidebar-area .stm_help_card_btn:hover,
.sidebar-area .stm_help_card_btn:focus {
	background: #16b8ee;
	color: #fff;
}

/* ---------- Download card (stm_download_card) ---------- */

.sidebar-area .stm_download_card {
	display: flex;
	align-items: center;
	gap: 16px;
	width: 100%;
	padding: 20px;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	background: #fff;
	outline: none;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.3s ease;
}

.sidebar-area .stm_download_card:hover,
.sidebar-area .stm_download_card:focus {
	border-color: #34ccff;
}

.sidebar-area .stm_download_card_icon {
	flex: none;
	line-height: 0;
	color: #34ccff;
}

.sidebar-area .stm_download_card_text {
	flex: 1 1 auto;
	min-width: 0;
}

.sidebar-area .stm_download_card_title {
	display: block;
	font-size: 17px;
	line-height: 24px;
	font-weight: 700;
	color: #111827;
}

.sidebar-area .stm_download_card_sub {
	display: block;
	font-size: 13px;
	line-height: 18px;
	color: #9ca3af;
}

.sidebar-area .stm_download_card_arrow {
	flex: none;
	line-height: 0;
	color: #34ccff;
}

/* ---------- Print ---------- */

/*
 * The download card calls window.print(), so strip the page chrome and let the
 * article run full width - otherwise the reader saves a PDF of the whole site.
 */
@media print {
	#header,
	.breadcrumbs,
	.sidebar-area,
	.am-footer,
	.amv-sticky-quote-bar,
	.amv-sticky-menu-wrapper,
	.stm_post_comments,
	ul.page-numbers,
	.page-links {
		display: none !important;
	}

	.container > .row > .col-lg-9 {
		width: 100% !important;
		float: none !important;
	}
}

/* ---------- Gallery carousel (stm_gallery_carousel) ---------- */

.sidebar-area .stm_gallery_carousel {
	text-align: center;
}

.sidebar-area .stm_gallery_carousel_title {
	margin: 0 0 16px;
	font-size: 18px;
	line-height: 26px;
	font-weight: 700;
	text-transform: none;
	color: #111827;
}

.sidebar-area .stm_gallery_carousel_stage {
	position: relative;
	border-radius: 12px;
	overflow: hidden;
}

.sidebar-area .stm_gallery_carousel_stage img {
	display: block;
	width: 100%;
	height: auto;
}

/* Circular arrows sit over the image, centred vertically */
.sidebar-area .stm_gallery_carousel_stage .owl-controls,
.sidebar-area .stm_gallery_carousel_stage .owl-nav {
	margin: 0;
}

/* this owl build renders nav as divs inside .owl-controls, not buttons */
.sidebar-area .stm_gallery_carousel_stage .owl-prev,
.sidebar-area .stm_gallery_carousel_stage .owl-next {
	position: absolute;
	top: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: -18px 0 0;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 8px rgba(17, 24, 39, 0.15);
	color: #34ccff;
	transition: background 0.3s ease;
}

.sidebar-area .stm_gallery_carousel_stage .owl-prev {
	left: 12px;
}

.sidebar-area .stm_gallery_carousel_stage .owl-next {
	right: 12px;
}

.sidebar-area .stm_gallery_carousel_stage .owl-prev:hover,
.sidebar-area .stm_gallery_carousel_stage .owl-next:hover {
	background: #f3f4f6;
}

.sidebar-area .stm_gallery_carousel_dots {
	margin: 16px 0 0;
	line-height: 0;
}

.sidebar-area .stm_gallery_carousel_dots .owl-dot {
	display: inline-block;
	width: 9px;
	height: 9px;
	margin: 0 4px;
	border-radius: 50%;
	background: #d1d5db;
}

.sidebar-area .stm_gallery_carousel_dots .owl-dot.active {
	background: #34ccff;
}

.sidebar-area .stm_gallery_carousel_caption {
	margin: 14px 0 0;
	font-size: 13px;
	line-height: 18px;
	color: #9ca3af;
}

.sidebar-area .stm_gallery_carousel_link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 10px 0 0;
	font-size: 15px;
	line-height: 20px;
	font-weight: 500;
	color: #34ccff;
}

/* ---------- Recent posts cards (stm_recent_posts_cards) ---------- */

.sidebar-area .stm_recent_cards_title {
	margin: 0 0 16px;
	font-size: 18px;
	line-height: 26px;
	font-weight: 700;
	text-transform: none;
	color: #111827;
}

.sidebar-area .stm_recent_cards_list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sidebar-area .stm_recent_cards_item {
	margin: 0 0 16px;
	padding: 0;
	text-transform: none;
	line-height: normal;
}

.sidebar-area .stm_recent_cards_item:last-child {
	margin: 0;
}

.sidebar-area .stm_recent_cards_item:before {
	content: none;
}

.sidebar-area .stm_recent_cards_link {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	background: #fff;
	text-decoration: none !important;
	transition: border-color 0.3s ease;
}

.sidebar-area .stm_recent_cards_link:hover {
	border-color: #34ccff;
}

/* Placeholder block when the post has no featured image */
.sidebar-area .stm_recent_cards_thumb {
	flex: none;
	width: 56px;
	height: 56px;
	border-radius: 10px;
	background: #e2e8f0;
	overflow: hidden;
}

.sidebar-area .stm_recent_cards_thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sidebar-area .stm_recent_cards_body {
	flex: 1 1 auto;
	min-width: 0;
}

.sidebar-area .stm_recent_cards_meta {
	display: block;
	margin: 0 0 4px;
	font-size: 14px;
	line-height: 20px;
	font-weight: 400;
	color: #9ca3af;
}

.sidebar-area .stm_recent_cards_heading {
	display: block;
	font-size: 14px;
	line-height: 20px;
	font-weight: 700;
	color: #111827;
}
