/*
 * MACBH theme additions: replacements for the removed Joomla plugins
 * (Camera slideshow, Marquee, Animate It!, SqueezeBox, Scroll-to-top),
 * WordPress/Contact Form 7 integration and accessibility fixes.
 * The original look lives in template.css / responsive.css / maximenu.css.
 */

/* ---------- Base ---------- */
body { background: #fff; }
img { max-width: 100%; height: auto; }
.screen-reader-text,
.wpcf7 label.screen-reader-text {
	position: absolute !important;
	display: block !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto; margin: 0;
	top: 8px; left: 8px; z-index: 100001;
	padding: 10px 16px; background: #fff; color: #117805;
}
a:focus-visible, button:focus-visible, .separator:focus-visible, input:focus-visible, textarea:focus-visible {
	outline: 2px solid #ff9933;
	outline-offset: 2px;
}
.site-title { color: #117805; font-size: 26px; font-weight: 700; line-height: 90px; }

/* Page loader: faded out by main.js (and by CSS after 4s as a fallback). */
.loader { transition: opacity .6s ease, visibility .6s ease; animation: mac-loader-out .6s ease 4s forwards; }
.loader.is-hidden { opacity: 0; visibility: hidden; }
@keyframes mac-loader-out { to { opacity: 0; visibility: hidden; } }

/* ---------- Menus (tap / keyboard support on top of the original hover CSS) ---------- */
div#maximenu-desktop ul.maximenuck li.maximenuck:focus-within > div.floatck,
div#maximenu-desktop ul.maximenuck li.maximenuck.is-open > div.floatck,
div#maximenu-mobile ul.maximenuck li.maximenuck:focus-within > div.floatck,
div#maximenu-mobile ul.maximenuck li.maximenuck.is-open > div.floatck { display: block; }
.separator { cursor: pointer; }
/* Two-column Products dropdown (the old Maximenu script floated these at runtime). */
div#maximenu-desktop ul.maximenuck li.item224 ul.maximenuck2 > li.maximenuck { float: left !important; width: 49% !important; margin-right: 4px; }
.main-menu ul, .main-menu li { list-style: none; }

/* ---------- Home banner slideshow ---------- */
.mac-slideshow { position: relative; width: 100%; aspect-ratio: 100 / 62; overflow: hidden; background: #fff; }
.mac-slideshow__slide { position: absolute; inset: 0; opacity: 0; transition: opacity 2s ease; }
.mac-slideshow__slide.is-active { opacity: 1; }
.mac-slideshow__slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
/*
 * Desktop: the original Camera slideshow ran in "fullpage" mode — a fixed, full-viewport
 * background behind the whole home page, with the ticker, service buttons and contact strip
 * floating over it. (#Home-banner keeps the original z-index:-1000.)
 */
.desktop-home-banner .mac-slideshow { position: fixed; inset: 0; width: 100%; height: 100vh; aspect-ratio: auto; background: transparent; }

/* ---------- Flash news ticker ---------- */
.mac-marquee { overflow: hidden; white-space: nowrap; }
.mac-marquee__text { display: inline-block; padding-left: 100%; animation: mac-marquee 20s linear infinite; }
.mac-marquee:hover .mac-marquee__text { animation-play-state: paused; }
@keyframes mac-marquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }

/* ---------- Sidebar announcement (vertical ticker) ---------- */
.mac-marquee-v { height: 150px; overflow: hidden; padding: 10px 15px; color: #fff; font-family: "Comic Sans MS", cursive, sans-serif; }
.mac-marquee-v p { text-align: left !important; padding-bottom: 6px; }
.mac-marquee-v.is-scrolling .mac-marquee-v__track { animation: mac-marquee-up 12s linear infinite; }
.mac-marquee-v.is-scrolling:hover .mac-marquee-v__track { animation-play-state: paused; }
.mac-marquee-v__item { padding-bottom: 40px; }
@keyframes mac-marquee-up { from { transform: translateY(0); } to { transform: translateY(-50%); } }

/* ---------- Gallery (replaces Camera slideshow) ---------- */
.mac-gallery { width: 100%; float: left; margin: 0 0 20px; line-height: 1.5; }
.mac-gallery__stage { position: relative; height: min(var(--mac-gallery-h, 450px), 75vw); background: #111; overflow: hidden; }
.mac-gallery.camera_black_skin .mac-gallery__stage { background: #000; }
.mac-gallery__slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 1s ease; z-index: 0; }
.mac-gallery__slide.is-active { opacity: 1; z-index: 1; }
.mac-gallery__slide a { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.mac-gallery__slide img { width: 100%; height: 100%; object-fit: contain; display: block; }
.mac-gallery .camera_caption { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 10px 15px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 14px; text-align: center; }
.mac-gallery__nav {
	position: absolute; top: 50%; z-index: 2; width: 40px; height: 40px; margin-top: -20px;
	border: 0; border-radius: 3px; background: rgba(0, 0, 0, .55); cursor: pointer; opacity: 0; transition: opacity .3s;
}
.mac-gallery__stage:hover .mac-gallery__nav, .mac-gallery__nav:focus-visible { opacity: 1; }
.mac-gallery__nav::before { content: ""; position: absolute; top: 50%; left: 50%; width: 10px; height: 10px; border: solid #fff; border-width: 0 3px 3px 0; }
.mac-gallery__prev { left: 10px; }
.mac-gallery__prev::before { transform: translate(-30%, -50%) rotate(135deg); }
.mac-gallery__next { right: 10px; }
.mac-gallery__next::before { transform: translate(-70%, -50%) rotate(-45deg); }
.mac-gallery.camera_red_skin .mac-gallery__nav { background: rgba(217, 31, 23, .85); }
.text-main .mac-gallery__thumbs { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 0; padding: 3px 0 4px; background: none; }
.text-main .mac-gallery__thumbs li { background: none; padding: 0; margin: 0; }
.mac-gallery__thumbs button { display: block; padding: 0; border: 2px solid transparent; background: none; cursor: pointer; opacity: .65; transition: opacity .3s, border-color .3s; line-height: 0; }
.mac-gallery__thumbs button:hover, .mac-gallery__thumbs button.is-active { opacity: 1; }
.mac-gallery__thumbs button.is-active { border-color: #D91F17; }
.mac-gallery.camera_black_skin .mac-gallery__thumbs button.is-active { border-color: #222; }
.mac-gallery__thumbs img { width: var(--mac-thumb-w, 70px); height: var(--mac-thumb-h, 55px); object-fit: cover; display: block; }
.mac-gallery.awards-div { margin-left: 0; }
@media (max-width: 480px) {
	.mac-gallery__thumbs img { width: min(var(--mac-thumb-w, 70px), 55px); height: min(var(--mac-thumb-h, 55px), 45px); }
}

/* ---------- Content blocks ---------- */
.all-services { float: left; margin-bottom: 20px; }
.all-services.sub-pro div h2 { font-size: 11px; text-align: center; padding: 4px 2px 10px; }
.all-services.sub-pro > p { float: none; clear: both; }
.all-services.sub-pro a.modal { display: block; }
.welfare-div div h2 span, .infra-div div h2 span, .all-products div h2 span { display: inline-block; width: 100%; padding: 10px 0; background: rgba(217, 31, 23, .9); color: #fff; line-height: 1; font-weight: 100; }
.welfare-div div h2 a { min-height: 16px; }
.mac-title-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 10px; }
.mac-title-row h1 { margin-bottom: 0; }
.mac-title-row img { width: 100px; height: auto; }
.content-top-menu li a .image-title { width: auto !important; max-width: 160px; }
.mac-video-heading { text-align: center !important; }
.mac-video-heading span { color: #ff0000; text-decoration: underline; font-family: tahoma, arial, helvetica, sans-serif; font-size: 12pt; }
.mac-video { text-align: center !important; }
.mac-video video { max-width: 100%; height: auto; }
.text-main .entry-content::after, .item-page::after { content: ""; display: table; clear: both; }
.item-page { display: block; }
.mac-button { display: inline-block; padding: 8px 20px; background: #D91F17; color: #fff; }
.mac-button:hover { background: #005CA2; }
.mac-tel { color: inherit; }

/* Contact page: let visitors use the map (the original banner sat behind the page at z-index:-1000). */
#Home-banner.mac-map { z-index: 0; line-height: 0; }
#Home-banner.mac-map iframe { display: block; }

/* ---------- Contact Form 7 (keeps the original Visforms look) ---------- */
.visform .wpcf7-form-control-wrap { display: block; }
.visform fieldset > div { margin-bottom: 10px; }
.visform .visCSSinput { box-sizing: border-box; width: 97%; font: inherit; font-size: 15px; }
.visform textarea { height: 80px; resize: vertical; }
.visform .visBtnCon .wpcf7-spinner { margin: 0 8px; }
.visform #field43, .visform #field44 { font: inherit; font-size: 15px; border-radius: 0; }
.wpcf7-not-valid-tip { color: #d81a11; font-size: 13px; padding-top: 3px; }
.wpcf7 form .wpcf7-response-output { margin: 10px 0 0; padding: 8px 12px; color: #000; border-radius: 7px; font-size: 14px; }
.mac-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Scroll to top ---------- */
#scrollToTop {
	position: fixed; right: 20px; bottom: 20px; z-index: 9999;
	width: 40px; height: 40px; border: 0; border-radius: 3px; cursor: pointer;
	background: #000; color: #fff; opacity: .8; transition: opacity .2s, background-color .2s;
}
#scrollToTop::before { content: ""; position: absolute; top: 55%; left: 50%; width: 10px; height: 10px; border: solid #fff; border-width: 3px 0 0 3px; transform: translate(-50%, -50%) rotate(45deg); }
#scrollToTop:hover { opacity: 1; background: #D91F17; }

/* ---------- Lightbox (replaces SqueezeBox) ---------- */
.mac-lightbox-overlay { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .88); }
.mac-lightbox-overlay[hidden] { display: none; }
.mac-lightbox-overlay img { max-width: 90vw; max-height: 88vh; width: auto; height: auto; box-shadow: 0 0 30px rgba(0, 0, 0, .6); background: #fff; }
.mac-lightbox-overlay button { position: absolute; border: 0; background: rgba(255, 255, 255, .15); color: #fff; cursor: pointer; font-size: 34px; line-height: 1; width: 48px; height: 48px; border-radius: 3px; }
.mac-lightbox-overlay button:hover { background: #D91F17; }
.mac-lightbox-close { top: 15px; right: 15px; }
.mac-lightbox-prev { left: 15px; top: 50%; margin-top: -24px; }
.mac-lightbox-next { right: 15px; top: 50%; margin-top: -24px; }
body.mac-lightbox-open { overflow: hidden; }

/* ---------- Entrance animations (subset of Animate It! used by the home page) ---------- */
.animated { animation-duration: 1s; animation-fill-mode: both; }
.duration1 { animation-duration: 1s; }
.delay1 { animation-delay: .5s; }
.delay2 { animation-delay: 1s; }
.delay3 { animation-delay: 1.5s; }
.delay4 { animation-delay: 2s; }
.delay5 { animation-delay: 2.5s; }
.delay6 { animation-delay: 3s; }
.fadeInLeft { animation-name: fadeInLeft; }
.fadeInRight { animation-name: fadeInRight; }
.fadeInUp { animation-name: fadeInUp; }
@keyframes fadeInLeft { from { opacity: 0; transform: translate3d(-100%, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes fadeInRight { from { opacity: 0; transform: translate3d(100%, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes fadeInUp { from { opacity: 0; transform: translate3d(0, 100%, 0); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
	.animated, .mac-marquee__text, .mac-marquee-v__track { animation: none !important; }
	.mac-marquee__text { padding-left: 0; white-space: normal; }
	.mac-slideshow__slide, .mac-gallery__slide { transition: none; }
}
