/* =====================================================================
   Flippin Overrides — flippinimage.co.uk
   Loaded after Printex (diviprintextheme/style.css).
   Rule of thumb: use a Divi setting where one works; add CSS here only
   where a Printex or Divi rule blocks the setting. Comment every rule.
   ===================================================================== */


/* ---------------------------------------------------------------------
   HEADER — slide-in button (Theme Builder header, .dct_popup_header_btn)
   --------------------------------------------------------------------- */

/* Printex colours the hover icon via ::after; force white on the black hover. */
body .dct_popup_header_btn:hover::after {
	color: #fff !important;
}

/* Divi's module CSS offsets the icon with top + translateY, leaving it high.
   Reset both so it sits vertically centred. */
body #page-container .et_pb_section .dct_popup_header_btn::after {
	top: 0 !important;
	transform: none !important;
}

/* The module's 1px white border shows as a ring on the black hover. */
body #page-container .et_pb_section .dct_popup_header_btn:hover {
	border-color: transparent !important;
}


/* ---------------------------------------------------------------------
   HEADER — menu links (.dct_hdr_v1)
   Printex hovers links to Primary (#f29d00) = the header background,
   so hovered links vanish. Make the hovered link black.
   (Also clear the Menu module's own hover text colour in the builder.)
   --------------------------------------------------------------------- */
body .dct_hdr_v1 ul li a:hover {
	color: #000 !important;
}


/* ---------------------------------------------------------------------
   HOME — Printing gallery
   Divi Gallery module with CSS Class "flippin-print-gallery"
   (Advanced → Attributes, or Advanced → CSS ID & Classes).
   Calm hover in place of Printex's spinning blurb icons:
   slight zoom + lift + soft shadow. Lightbox is the module's own.
   --------------------------------------------------------------------- */
.flippin-print-gallery .et_pb_gallery_item {
	border-radius: 6px;
	overflow: hidden;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.flippin-print-gallery .et_pb_gallery_image {
	overflow: hidden;          /* keep the zoom inside the card */
}
.flippin-print-gallery .et_pb_gallery_image img {
	transition: transform 0.35s ease;
}
.flippin-print-gallery .et_pb_gallery_item:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.flippin-print-gallery .et_pb_gallery_item:hover .et_pb_gallery_image img {
	transform: scale(1.05);
}

/* Respect visitors who ask their OS for reduced motion. */
@media (prefers-reduced-motion: reduce) {
	.flippin-print-gallery .et_pb_gallery_item,
	.flippin-print-gallery .et_pb_gallery_image img {
		transition: none;
	}
	.flippin-print-gallery .et_pb_gallery_item:hover,
	.flippin-print-gallery .et_pb_gallery_item:hover .et_pb_gallery_image img {
		transform: none;
	}
}


/* ---------------------------------------------------------------------
   HOME — Print portfolio filters: colours
   Filterable Portfolio module with CSS Class "flippin-portfolio".
   Printex dct_ptf_v1 class removed from the module, so these replace
   Printex's Primary/Secondary filter colours.
   --------------------------------------------------------------------- */
body #page-container .flippin-portfolio .et_pb_portfolio_filters li a {
	color: #fff !important;
	padding: 10px 20px;
	margin: 0;                 /* spacing comes from the list's gap */
	background-color: #ff7e3f !important;
	border: 0 !important;
}
body #page-container .flippin-portfolio .et_pb_portfolio_filters li a:hover {
	background-color: #e86a2c !important;
}
body #page-container .flippin-portfolio .et_pb_portfolio_filters li a.active {
	background-color: #fff !important;
	color: #ff7e3f !important;
}


/* ---------------------------------------------------------------------
   HOME — Print portfolio filters: desktop layout (stage 1)
   981px+: filters as a vertical list in a 200px left column,
   items (and pagination, if enabled) in the right column.
   Module's direct children: .et_pb_portfolio_filters,
   .et_pb_portfolio_items_wrapper (+ pagination when on).
   Divi's module CSS forces display:block, hence !important on grid.
   Tablet/phone unchanged (Divi defaults) until stage 2.
   --------------------------------------------------------------------- */
@media (min-width: 981px) {
	/* Module becomes a two-column grid */
	body #page-container .flippin-portfolio {
		display: grid !important;
		grid-template-columns: 200px 1fr;
		column-gap: 30px;
		align-items: start;
	}
	body #page-container .flippin-portfolio::before,
	body #page-container .flippin-portfolio::after {
		display: none;         /* clearfix pseudo-elements would become grid cells */
	}

	/* Left column: filters as a vertical list */
	body #page-container .flippin-portfolio > .et_pb_portfolio_filters {
		grid-column: 1;
		grid-row: 1 / span 2;
		margin: 0;
	}
	body #page-container .flippin-portfolio .et_pb_portfolio_filters ul {
		display: flex;
		flex-direction: column;
		gap: 6px;
	}
	body #page-container .flippin-portfolio .et_pb_portfolio_filters ul::before,
	body #page-container .flippin-portfolio .et_pb_portfolio_filters ul::after {
		display: none;
	}
	body #page-container .flippin-portfolio .et_pb_portfolio_filters li {
		float: none;
		width: 100% !important;
	}

	/* Right column: items wrapper and pagination */
	body #page-container .flippin-portfolio > :not(.et_pb_portfolio_filters) {
		grid-column: 2;
	}
}

/* ---------------------------------------------------------------------
   TIMELINE — connector grows/retracts with scroll (CSS only, no JS)
   Must live here: Divi strips animation-timeline from page/module CSS.
   --------------------------------------------------------------------- */
/* Divi sets overflow:hidden on #page-container (and rows/sections can have
   it too), which hijacks the scroll timeline. clip hides overflow the same
   way but isn't a scroll box. Only on containers that hold a timeline. */
body #page-container:has(.et_pb_timeline),
body #page-container .et_pb_section:has(.et_pb_timeline),
body #page-container .et_pb_row:has(.et_pb_timeline),
body #page-container .et_pb_column:has(.et_pb_timeline) {
	overflow: clip !important;
}

/* Grey track = the connector itself. */
.et_pb_timeline .et_pb_timeline_connector {
	background-color: rgba(0, 0, 0, 0.12) !important;
}

/* Orange fill, scaled 0→1 as the connector passes a line 60% down the screen. */
@supports (animation-timeline: view()) {
	.et_pb_timeline .et_pb_timeline_connector::after {
		content: "";
		position: absolute;
		inset: 0;
		background: var(--gcid-primary-color, #f29d00);
		transform-origin: top;
		animation: flippin-grow linear both;
		animation-timeline: view(block auto 40%);
		animation-range: entry 0% entry 100%;
	}
}
@keyframes flippin-grow {
	from { transform: scaleY(0); }
	to   { transform: scaleY(1); }
}


/* Divi hides grid gallery items (display:none) until its gallery script
   shows them; on some page loads the script doesn't, leaving the row
   empty. Show them regardless. Safe here: the gallery has one page,
   so no pagination needs to hide items. */
.flippin-print-gallery.et_pb_gallery_grid .et_pb_gallery_item {
	display: block !important;
}

/* Divi hides grid gallery items (display:none) until its gallery script
   shows them; on some page loads the script doesn't, leaving the row
   empty. Show them regardless. Safe here: the gallery has one page,
   so no pagination needs to hide items. */
.flippin-print-gallery.et_pb_gallery_grid .et_pb_gallery_item {
	display: block !important;
}
