/*
Theme Name: Broker Fermieri
Theme URI: https://brokerulfermierilor.cfro.ro
Author: Clubul Fermierilor Romani
Description: Tema custom pentru brokerulfermierilor.cfro.ro, migrata din exportul static al site-ului.
Version: 1.0
Text Domain: broker-fermieri
*/

/* Sticky footer - neither the export nor cfro.css has this (no min-height
   rule anywhere on html/body), because every real page on the original
   site was tall enough that it never mattered. It shows up now on the
   dead-JotForm replacement pages (Asigura-te devreme, Asigura-ti
   Utilajele Agricole): swapping a 539px iframe for a couple lines of text
   leaves the page shorter than a typical browser window, so the green
   footer ends partway down the viewport with plain white page background
   below it instead of filling to the bottom. Harmless on every other
   page (already taller than 100vh, so this never engages there) - #page-
   content is a plain child of <body> here (the fixed-position header
   doesn't participate in body's flow), so flexing body works without
   touching the header/footer markup. */
body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}
#page-content {
	flex: 1 0 auto;
}
footer.engage-footer {
	flex-shrink: 0;
}

/* Thank You page: the checkmark image and the heading below it wrap into
   separate rows purely because their combined column widths exceed 12
   (col-md-4 then col-md-6) - Bootstrap doesn't add a gap between wrapped
   rows on its own, so the image touches the heading with no breathing room. */
.thank-you-checkmark {
	margin-bottom: 24px;
}

/* Category archive pagination - the original site loaded extra articles via
   JS infinite-scroll (no static markup to mirror), so this is a plain
   WordPress paginate_links() output styled to match the site's brand color. */
.article-pagination {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin: 2rem 0 3rem;
}
.article-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	height: 2.25rem;
	padding: 0 0.5rem;
	border-radius: 4px;
	color: #202020;
	text-decoration: none;
	font-weight: 600;
}
.article-pagination a.page-numbers:hover {
	background: #f0f0f0;
}
.article-pagination .page-numbers.current {
	background: #ea5455;
	color: #ffffff;
}

/* The original "Istoric companie" content used a blank <p><br></p> between
   each year's block purely for vertical spacing (dropped on import - see
   bf_render_pipe_list() in functions.php); restore the gap directly on the
   heading instead. */
.pg-istoric-companie_module-years h2 {
	margin-top: 2.5rem;
}
.pg-istoric-companie_module-years h2:first-child {
	margin-top: 0;
}

/* Video gallery grid (galerie-asigurari-interviuri, galerie-asigurari-video)
   - own minimal styling, not ported from the export: the original gallery
   was a Vue/Masonry.js widget (visitor upload + moderation) with no static
   CSS worth reusing for a plain read-only grid (see .todo). Thumbnails show
   at their natural aspect ratio (not cropped) - YouTube's own hqdefault.jpg
   already has letterboxing baked in for some of these videos. */
.bf-video-gallery {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2rem;
	margin: 2rem 0;
}
@media (max-width: 768px) {
	.bf-video-gallery {
		grid-template-columns: 1fr;
	}
}
.bf-video-gallery-play {
	display: block;
	position: relative;
	width: 100%;
	padding: 0;
	border: 0;
	background: #000;
	cursor: pointer;
}
.bf-video-gallery-play img {
	display: block;
	width: 100%;
	height: auto;
	opacity: 0.85;
}
.bf-video-gallery-play-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 4.5rem;
	height: 4.5rem;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6);
}
.bf-video-gallery-play-icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 56%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 0.9rem 0 0.9rem 1.4rem;
	border-color: transparent transparent transparent #ffffff;
}
.bf-video-gallery-description {
	margin-top: 0.5rem;
	font-size: 0.9375rem;
	color: #202020;
}

/* Video modal (bf-video-gallery.js) - opens the clicked video large and
   centered, rather than inline in its grid cell. */
body.bf-video-modal-open {
	overflow: hidden;
}
.bf-video-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	background: rgba(0, 0, 0, 0.85);
}
.bf-video-modal-dialog {
	position: relative;
	width: 100%;
	max-width: 960px;
}
.bf-video-modal-dialog iframe {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	border: 0;
}
.bf-video-modal-close {
	position: absolute;
	top: -2.5rem;
	right: 0;
	padding: 0;
	border: 0;
	background: none;
	color: #ffffff;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
}

/* CF7 forms (Home Protect and future ones): two fixes for cfro.css rules
   that assume markup CF7 doesn't produce.
   1) .contact-asigurari-form .form-input-container:nth-of-type(n) sets
      width:49% + margin:1% per pair - which sums to exactly 100%, so any
      sub-pixel rounding wraps the pair to two lines instead of one. A hair
      of slack fixes it.
   2) cfro.css styles a <button type="submit"> (green, arrow icon) but CF7
      always renders <input type="submit">, so that rule never matched. */
.contact-asigurari-form .form-input-container:first-of-type,
.contact-asigurari-form .form-input-container:nth-of-type(2),
.contact-asigurari-form .form-input-container:nth-of-type(3),
.contact-asigurari-form .form-input-container:nth-of-type(4) {
	width: 48.5%;
}
.contact-page .contact-page-form input[type=submit] {
	height: unset;
	padding: 13px 60px 13px 36px;
	color: #ffffff;
	font-size: 1rem;
	line-height: 1.5;
	text-transform: unset;
	font-weight: 700;
	background-color: #29B36F;
	border: 0;
	border-radius: 0;
	letter-spacing: 0.8px;
	background-image: url("data:image/svg+xml,%3Csvg width='9' height='13' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 1.533L5.565 6.5 0 11.467 1.717 13 9 6.5 1.717 0 0 1.533z' fill='%23FFFFFF'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 23px bottom 19px;
	filter: unset;
	transition: background-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
	margin-top: 1.875rem;
	margin-bottom: 1.5625rem;
}
.contact-page .contact-page-form input[type=submit]:hover {
	background-color: #007860;
	box-shadow: 0px 0px 0px 2px #007860;
}

/* 4) CF7 fields don't carry Bootstrap's "form-control" class (cfro.css's
   width:100% rules target that), only its own "wpcf7-form-control" - text
   inputs happened to still look full-width by coincidence of column sizing,
   but select/textarea were sized to their content/default cols instead. */
.contact-page .contact-page-form .wpcf7-form-control:not([type=submit]) {
	width: 100%;
}

/* 3) cfro.css's custom checkbox look (.container-checkbox: hidden native
   checkbox + a drawn .checkmark box, hanging-indent text) is a markup
   pattern CF7's [acceptance] tag doesn't produce - reproduce the same
   visual (25x25 box, #616161 border/fill, 12px bold letter-spaced label)
   on CF7's own .wpcf7-list-item structure instead. */
.contact-page .contact-page-form .wpcf7-list-item {
	display: block;
	position: relative;
	padding-left: 35px;
	margin: 0;
	cursor: pointer;
}
.contact-page .contact-page-form .wpcf7-list-item input[type=checkbox] {
	position: absolute;
	left: 0;
	top: -3px;
	width: 25px;
	height: 25px;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}
.contact-page .contact-page-form .wpcf7-list-item-label {
	position: relative;
	font-size: 0.75rem;
	color: #333333;
	font-weight: 600;
	letter-spacing: 0.8px;
}
.contact-page .contact-page-form .wpcf7-list-item-label::before {
	content: "";
	position: absolute;
	top: -3px;
	left: -35px;
	width: 25px;
	height: 25px;
	background-color: #ffffff;
	border: 2px solid #616161;
}
.contact-page .contact-page-form .wpcf7-list-item input[type=checkbox]:checked ~ .wpcf7-list-item-label::before {
	background-color: #616161;
}
.contact-page .contact-page-form .wpcf7-list-item input[type=checkbox]:checked ~ .wpcf7-list-item-label::after {
	content: "";
	position: absolute;
	left: -28px;
	top: 2px;
	width: 8px;
	height: 14px;
	border: solid white;
	border-width: 0 3px 3px 0;
	transform: rotate(45deg);
}

/* 5) cfro.css only ever styles ".widget-form input" (the original's own
   dropdown was a Vue multiselect, never a native <select>) - match that
   same box look here since CF7's judet field is a plain <select>. */
.contact-page .contact-page-form .widget-form select {
	border: 2px solid #d7d7d7;
	height: 44px;
	font-size: 14px;
	line-height: 20px;
	padding: 5px 15px;
	border-radius: 0;
	background-color: #ffffff;
	color: #333333;
}

/* 6) CF7's "Please fill out this field" validation hints inherit the page's
   large base font-size (20px) by default (font-size:1em with no override
   in CF7's own stylesheet) - shrink to a normal small-print error size. */
.wpcf7-not-valid-tip {
	font-size: 0.8125rem;
}

/* Testimonials carousel (bf_render_testimonials_slider() in functions.php,
   Asigurari culturi agricole and later pages) - own styling, not ported:
   the export's version was a Vue/Swiper widget with its CSS injected at
   runtime (never captured by the archiver, same story as fonts_colors.css -
   see .todo), so ".testimonial-card" etc. have no rules anywhere in cfro.css. */
.bf-testimonials-slider {
	position: relative;
	max-width: 1125px;
	margin: 0 auto;
	padding: 0 3.5rem;
}
.bf-testimonials-slide {
	display: none;
	text-align: center;
}
.bf-testimonials-slide.is-active {
	display: block;
}
.testimonial-card img {
	width: 160px;
	height: 160px;
	border-radius: 50%;
	-o-object-fit: cover;
	   object-fit: cover;
	margin: 0 auto;
}
.testimonial-author {
	font-size: 25px;
	font-weight: 600;
	color: #202020;
	margin-top: 0.5rem;
	margin-bottom: 0;
}
.testimonial-position {
	font-size: 16px;
	font-weight: 700;
	font-style: italic;
	color: #202020;
	margin-bottom: 1.625rem;
}
.testimonial-content {
	font-size: 16px;
	font-weight: 400;
	color: #202020;
	line-height: 1.5;
}
.bf-testimonials-prev,
.bf-testimonials-next {
	position: absolute;
	top: 216px;
	transform: translateY(-50%);
	border: 0;
	background: none;
	color: #202020;
	font-size: 1.5rem;
	cursor: pointer;
	padding: 0.5rem;
}
.bf-testimonials-prev {
	left: 0;
}
.bf-testimonials-next {
	right: 0;
}
.bf-testimonials-dots {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin-top: 4.4rem;
}
.bf-testimonials-dot {
	width: 0.625rem;
	height: 0.625rem;
	border-radius: 50%;
	border: 0;
	padding: 0;
	background: #d7d7d7;
	cursor: pointer;
}
.bf-testimonials-dot.is-active {
	background: #007860;
}

/* Regional sales-contact box colors (bf_render_sales_team_directory() in
   functions.php - Program de Loialitate / Contact agenti vanzari). Missed
   by cfro.css entirely: the export generated this ".region-N" palette in a
   page-specific inline <style> tag (same dynamic-per-page-CSS story as
   fonts_colors.css), not in the shared stylesheet - a one-time snapshot of
   that block, copied verbatim from the export. */
.pg-contact-asigurari_module-regiuni .row .module-regiuni_box .region-1 { background-color: #d3a6cd; }
.pg-contact-asigurari_module-regiuni .row .module-regiuni_box .region-2 { background-color: #81d2f7; }
.pg-contact-asigurari_module-regiuni .row .module-regiuni_box .region-3 { background-color: #5eaadc; }
.pg-contact-asigurari_module-regiuni .row .module-regiuni_box .region-4 { background-color: #fdc094; }
.pg-contact-asigurari_module-regiuni .row .module-regiuni_box .region-5 { background-color: #98d2a2; }
.pg-contact-asigurari_module-regiuni .row .module-regiuni_box .region-6 { background-color: #fce889; }
.pg-contact-asigurari_module-regiuni .row .module-regiuni_box .region-7 { background-color: #828dc5; }
.pg-contact-asigurari_module-regiuni .row .module-regiuni_box .region-8 { background-color: #e9bcb9; }
.pg-contact-asigurari_module-regiuni .row .module-regiuni_box .region-9 { background-color: #c0c0c0; }
.pg-contact-asigurari_module-regiuni .row .module-regiuni_box .region-10 { background-color: #828dc5; }
.pg-contact-asigurari_module-regiuni .row .module-regiuni_box .region-11 { background-color: #d8de23; }
.pg-contact-asigurari_module-regiuni .row .module-regiuni_box .region-12 { background-color: #fce889; }

/* Generic horizontal carousel (bf-carousel.js) - a plain scroll-snap strip
   with prev/next buttons + page dots, standing in for Swiper wherever the
   export used it for "browse N items" widgets (Informări page: article
   cards, video previews). Used by bf_render_article_card_grid() and
   bf_render_video_carousel() (functions.php) - each just supplies items
   inside .bf-carousel-track, sized via the compound rules below. 4 items
   per view on desktop (matching the export's own "four-cols" naming),
   dropping to 2 then 1 on narrower screens; bf-carousel.js reads the
   computed item width to build the right number of dots at any size. */
.bf-carousel-row {
	position: relative;
	padding: 0 2.75rem;
}
.bf-carousel-track {
	display: flex;
	align-items: stretch;
	gap: 1.5rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	padding-bottom: 0.5rem;
	/* Hide the native scrollbar - the export's own Swiper carousel had none
	   (it paged via transform, not real overflow-scroll), so a visible
	   system scrollbar under the cards isn't part of the original design. */
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.bf-carousel-track::-webkit-scrollbar {
	display: none;
}
.bf-carousel-track > * {
	scroll-snap-align: start;
	flex: 0 0 calc(25% - 1.125rem);
	display: flex;
	flex-direction: column;
}
@media (max-width: 991px) {
	.bf-carousel-track > * {
		flex-basis: calc(50% - 0.75rem);
	}
}
@media (max-width: 576px) {
	.bf-carousel-track > * {
		flex-basis: 85%;
	}
}
/* Video carousels ("Pastila de Asigurări"/"Interviuri") show 3 per view,
   not 4 - narrower items than the article cards look better at that size. */
.bf-carousel--videos .bf-carousel-track > * {
	flex-basis: calc(33.333% - 1rem);
}
@media (max-width: 991px) {
	.bf-carousel--videos .bf-carousel-track > * {
		flex-basis: calc(50% - 0.75rem);
	}
}
@media (max-width: 576px) {
	.bf-carousel--videos .bf-carousel-track > * {
		flex-basis: 85%;
	}
}
/* AFIR page's "Noutăți despre Submăsura 17.1" (bf_render_article_card_carousel_afir())
   - the export's own 3-cards-per-view carousel, bigger cards than the
   4-per-view article grid elsewhere. */
.bf-carousel--3col .bf-carousel-track > * {
	flex-basis: calc(33.333% - 1rem);
}
@media (max-width: 991px) {
	.bf-carousel--3col .bf-carousel-track > * {
		flex-basis: calc(50% - 0.75rem);
	}
}
@media (max-width: 576px) {
	.bf-carousel--3col .bf-carousel-track > * {
		flex-basis: 85%;
	}
}
.bf-carousel-prev,
.bf-carousel-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 1;
	width: 2.5rem;
	height: 2.5rem;
	border: 0;
	border-radius: 50%;
	background: #ffffff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	color: #202020;
	font-size: 1.125rem;
	cursor: pointer;
}
.bf-carousel-prev {
	left: 0;
}
.bf-carousel-next {
	right: 0;
}
.bf-carousel-dots {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin-top: 1.5rem;
}
.bf-carousel-dot {
	width: 0.625rem;
	height: 0.625rem;
	border-radius: 50%;
	border: 0;
	padding: 0;
	background: #d7d7d7;
	cursor: pointer;
}
.bf-carousel-dot.is-active {
	background: #007860;
}
/* cfro.css sets ".card-article { height: 100% !important; }" - a definite
   (non-auto) cross-size opts the item OUT of flexbox's align-items:stretch
   (per spec, stretch only applies when the cross-size is auto), so cards
   with shorter titles were only as tall as their own content instead of
   matching their tallest carousel-row sibling. Overriding back to auto
   re-enables stretch for the card itself, but .card-article-inner's own
   "height:100%" then still doesn't reliably fill it - the percentage has
   to resolve through the <a> wrapper in between, which isn't part of the
   flex layout. Using flex-grow at every level instead of percentage
   heights sidesteps that: each wrapper grows to fill its stretched
   parent regardless of how percentages would have resolved. */
.bf-carousel-track > .card-article {
	height: auto !important;
	display: flex;
}
.bf-carousel-track > .card-article > a {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	width: 100%;
}
.bf-carousel-track > .card-article .card-article-inner {
	height: auto !important;
	flex: 1 1 auto;
}
/* cfro.css leaves .card-title/.card-published-date at the browser default
   (left) - only .card-delimiter is explicitly centered (auto margins), so
   title/date read left-aligned above a centered dash. Centering them to
   match is a design call the client asked for here. */
.bf-carousel-track .card-title,
.bf-carousel-track .card-published-date,
.bf-carousel-track .card-member-details {
	text-align: center;
}
/* cfro.css forces ".slider-four-cols img { width:100% !important; height:
   9.5rem !important; }" with no object-fit - fine for the export's own
   pre-cropped "..._260_152.jpg" card thumbnails (already that exact
   ratio), but our featured images are a different crop (WordPress's own
   "medium" size), so without object-fit the browser's default ("fill")
   stretches/squashes them to fit the forced box. object-fit:cover crops
   instead of distorting. */
.bf-carousel-track .card-article-inner img {
	object-fit: cover;
}

/* Search results list (search.php) - no equivalent design in the export
   (a static archiver can't capture a dynamic search page), so this is a
   new, minimal list rather than a ported layout. */
.search-results-list {
	max-width: 900px;
}
.search-result-item {
	padding: 20px 0;
	border-bottom: 1px solid #e0e0e0;
}
.search-result-item:first-child {
	padding-top: 0;
}
.search-result-item .article-title {
	margin-bottom: 8px;
}
.search-result-item .article-title a {
	color: rgb(0, 120, 96);
	text-decoration: none;
}
.search-result-item .article-title a:hover {
	text-decoration: underline;
}
.search-result-excerpt {
	color: rgb(50, 50, 50);
	margin-bottom: 0;
}
