/* Additions for the static copy of tmroofing.ca: CSS for what the WordPress theme's JavaScript used to do.
   Loaded after the theme stylesheets (see app/layout.tsx). */

/* Ultimate Addons row background (hero): the plugin's script moved this into the row at runtime. */
.vc_row .upb_row_bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.vc_row .upb_row_bg .upb_bg_overlay { position: absolute; inset: 0; }
.vc_row-has-fill > .upb_row_bg ~ .wpb_column { position: relative; z-index: 1; }

/* Sticky header */
.masthead.fixed-masthead { position: fixed !important; top: 0; left: 0; width: 100%; z-index: 500; }
.masthead.sticky-on, .masthead.sticky-mobile-on { background-color: #fff !important; box-shadow: 0 0 15px 1px rgba(0, 0, 0, 0.07); }
.masthead.sticky-on .header-bar { height: 60px; }
.masthead.sticky-on .branding img { max-height: 50px; width: auto; }
.transparent .masthead:not(.fixed-masthead) { position: absolute; width: 100%; z-index: 102; }

/* Mobile menu overlay */
.mobile-sticky-header-overlay.active { opacity: 1; visibility: visible; }

/* Portfolio grids (Isotope on the live site; laid out in Effects.tsx) */
.iso-container > .wf-cell { box-sizing: border-box; opacity: 1 !important; visibility: visible !important; }

/* Image carousels (Owl Carousel on the live site) */
.tm-carousel { position: relative; display: block !important; opacity: 1 !important; }
.tm-carousel .tm-track { display: flex; gap: var(--tm-gap, 10px); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.tm-carousel .tm-track::-webkit-scrollbar { display: none; }
.tm-carousel .tm-slide { flex: 0 0 calc((100% - (var(--tm-cols, 3) - 1) * var(--tm-gap, 10px)) / var(--tm-cols, 3)); scroll-snap-align: start; }
.tm-carousel .tm-slide figure { margin: 0; }
.tm-carousel .tm-slide img { width: 100%; height: auto; display: block; }
.tm-carousel .owl-nav button { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.75); background: rgba(0, 0, 0, 0.25); color: #fff; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2; }
.tm-carousel .owl-nav button:hover { background: var(--the7-accent-color, #2bb3d5); border-color: var(--the7-accent-color, #2bb3d5); }
.tm-carousel .owl-prev { left: 10px; }
.tm-carousel .owl-next { right: 10px; }

/* Lightbox (PhotoSwipe on the live site) */
.tm-lightbox-box { position: fixed; inset: 0; z-index: 10000; background: rgba(0, 0, 0, 0.9); display: none; align-items: center; justify-content: center; }
.tm-lightbox-box.open { display: flex; }
.tm-lightbox-box img { max-width: 92vw; max-height: 88vh; }
.tm-lightbox-box button { position: absolute; background: none; border: 0; color: #fff; font-size: 28px; cursor: pointer; padding: 12px; opacity: 0.75; }
.tm-lightbox-box button:hover { opacity: 1; }
.tm-lb-close { top: 4px; right: 8px; font-size: 40px !important; line-height: 1; }
.tm-lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.tm-lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
.tm-lb-count { position: absolute; top: 16px; left: 20px; color: #fff; font-size: 14px; opacity: 0.75; }

/* Images the theme lazy-loaded are shown straight away. */
img.preload-me { opacity: 1 !important; }
.tm-form-status { margin-top: 10px; }

/* Ultimate Addons heading line: centred under centred headings (the plugin did this with JavaScript). */
.uvc-heading[data-halign="center"] .uvc-headings-line { margin-left: auto; margin-right: auto; }

/* WPBakery media grid (masonry script on the live site) */
.vc_masonry_media_grid .vc_pageable-slide-wrapper { display: flex; flex-wrap: wrap; align-items: flex-start; }

/* ---------- Mutual One booking calendar (same module as mutualcom.com, app/components/BookingSection.tsx).
   Colours are TM Roofing's accent instead of Mutualcom's orange. */
#the7-body .mc-cal {
  --mc-orange: #2bb3d5; --mc-orange-dark: #1d93b1; --mc-dark: #333333; --mc-text: #5f6b7a;
  --mc-peach: #c9ecf5; --mc-peach-light: #eef9fc;
}
#the7-body .mc-ticks { list-style: none !important; margin: 10px 0 15px !important; padding: 0 !important; }
#the7-body .mc-ticks li { list-style: none !important; margin-left: 0 !important; position: relative; padding-left: 24px; margin-bottom: 6px; }
#the7-body .mc-ticks li:before { content: "\f00c"; font-family: "Font Awesome 5 Free"; font-weight: 900; position: absolute; left: 0; color: var(--mc-orange); }
#the7-body .mc-form-row { display: flex; gap: 20px; }
#the7-body .mc-form-row > * { flex: 1; min-width: 0; }
@media (max-width: 767px) { #the7-body .mc-form-row { flex-direction: column; gap: 0; } }
#the7-body .mc-cal :where(button) { text-transform: none; letter-spacing: 0; padding: 0; line-height: 1.2; box-shadow: none; min-height: 0; }
#the7-body .mc-cal {
  display: flex; max-width: 1000px; margin: 0 auto 20px; background: #ffffff; border: 1px solid #e6e8eb;
  border-radius: 8px; box-shadow: 0 4px 24px rgba(19, 38, 63, 0.08); text-align: left; overflow: hidden;
}
#the7-body .mc-cal-info { flex: 0 0 280px; padding: 28px 24px; border-right: 1px solid #e6e8eb; }
#the7-body .mc-cal-logo { height: 28px; width: auto; margin-bottom: 18px; }
#the7-body .mc-cal-info h3 { color: var(--mc-dark); font-size: 24px; margin: 0 0 16px; text-transform: none; letter-spacing: 0; }
#the7-body .mc-cal-meta { color: var(--mc-text); font-size: 15px; margin: 0 0 10px; }
#the7-body .mc-cal-meta i { width: 20px; color: #8a96a5; }
#the7-body .mc-cal-when { color: var(--mc-dark); font-weight: 600; }
#the7-body .mc-cal-info .mc-ticks { margin-top: 18px !important; font-size: 14px; }
#the7-body .mc-cal-info .mc-ticks li { text-transform: none; letter-spacing: 0; color: var(--mc-text) !important; }
#the7-body .mc-cal-main { flex: 1; min-width: 0; padding: 28px 28px 24px; }
#the7-body .mc-cal-main h3 { color: var(--mc-dark); font-size: 20px; margin: 0 0 18px; text-transform: none; letter-spacing: 0; }
#the7-body .mc-cal-main button { font: inherit; cursor: pointer; }
#the7-body .mc-cal-loading { padding: 40px 0; color: var(--mc-text); text-align: center; }

#the7-body .mc-cal-pick { display: flex; gap: 28px; }
#the7-body .mc-cal-month { flex: 1; min-width: 0; max-width: 420px; }
#the7-body .mc-cal-nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 14px; color: var(--mc-dark); font-size: 16px; }
#the7-body .mc-cal-nav button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--mc-peach-light); color: var(--mc-orange); font-size: 22px; line-height: 1; }
#the7-body .mc-cal-nav button:disabled { background: transparent; color: #cccccc; cursor: default; }
#the7-body .mc-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px 4px; text-align: center; }
#the7-body .mc-cal-wd { font-size: 11px; text-transform: uppercase; color: #8a96a5; padding-bottom: 6px; }
#the7-body .mc-cal-day { justify-self: center; width: 44px; height: 44px; max-width: 100%; border-radius: 50%; border: 0; background: transparent; color: #b5bcc5; font-size: 15px; }
#the7-body .mc-cal-day.open { background: var(--mc-peach-light); color: var(--mc-orange); font-weight: 700; }
#the7-body .mc-cal-day.open:hover { background: var(--mc-peach); }
#the7-body .mc-cal-day.active, #the7-body .mc-cal-day.active:hover { background: var(--mc-orange); color: #ffffff; }
#the7-body .mc-cal-day:disabled { cursor: default; }
#the7-body .mc-cal-tz { margin: 18px 0 0; font-size: 14px; color: var(--mc-text); }
#the7-body .mc-cal-tz i { margin-right: 4px; }

#the7-body .mc-cal-times { flex: 0 0 220px; scroll-margin-top: 90px; }
#the7-body .mc-cal-times h4 { color: var(--mc-dark); font-size: 15px; margin: 52px 0 14px; text-transform: none; letter-spacing: 0; }
#the7-body .mc-cal-times ul { list-style: none !important; margin: 0 !important; padding: 0 !important; max-height: 380px; overflow-y: auto; }
#the7-body .mc-cal-times li { list-style: none !important; margin: 0 0 10px !important; display: flex; gap: 8px; }
#the7-body .mc-cal-time {
  flex: 1; height: 50px; border: 1px solid var(--mc-orange); border-radius: 4px; background: #ffffff;
  color: var(--mc-orange); font-weight: 700 !important; font-size: 15px !important; transition: all 0.15s;
}
#the7-body .mc-cal-time:hover { border-width: 2px; }
#the7-body .mc-cal-times li.chosen .mc-cal-time { background: #5f6b7a; border-color: #5f6b7a; color: #ffffff; }
#the7-body .mc-cal-next { flex: 1; height: 50px; border: 0; border-radius: 4px; background: var(--mc-orange); color: #ffffff; font-weight: 700 !important; font-size: 15px !important; }
#the7-body .mc-cal-next:hover { background: var(--mc-orange-dark); }

#the7-body .mc-cal-details { max-width: 560px; }
#the7-body .mc-cal-back { border: 0; background: none; color: var(--mc-orange); padding: 0; margin-bottom: 14px; font-size: 15px !important; }
#the7-body .mc-cal-picked { color: var(--mc-dark); font-weight: 600; margin: -6px 0 20px; }
#the7-body .mc-cal-picked i { color: var(--mc-orange); margin-right: 6px; }
#the7-body .mc-cal-field { display: block; margin-bottom: 16px; }
#the7-body .mc-cal-field span { display: block; font-size: 14px; font-weight: 600; color: var(--mc-dark); margin-bottom: 6px; text-transform: none; letter-spacing: 0; }
#the7-body .mc-cal-field input, #the7-body .mc-cal-field select, #the7-body .mc-cal-field textarea {
  width: 100%; box-sizing: border-box; border: 1px solid #cfd5dc; border-radius: 6px; padding: 10px 12px;
  font: inherit; font-size: 16px; color: #333333; background: #ffffff; height: auto; margin: 0;
}
#the7-body .mc-cal-field input:focus, #the7-body .mc-cal-field select:focus, #the7-body .mc-cal-field textarea:focus { outline: none; border-color: var(--mc-orange); box-shadow: 0 0 0 3px var(--mc-peach); }
#the7-body .mc-cal-submit { border: 0; border-radius: 30px; background: var(--mc-orange); color: #ffffff; padding: 13px 28px; font-weight: 700 !important; font-size: 15px !important; }
#the7-body .mc-cal-submit:hover { background: var(--mc-orange-dark); }
#the7-body .mc-cal-submit:disabled { opacity: 0.7; }
#the7-body .mc-cal-error { color: #c0392b; margin-top: 12px; }
#the7-body .mc-cal-done { text-align: center; padding: 30px 10px; color: var(--mc-text); }
#the7-body .mc-cal-done > i { font-size: 44px; color: var(--mc-orange); }
#the7-body .mc-cal-done h3 { margin: 12px 0 10px !important; }
#the7-body .mc-cal-link { border: 0; background: none; color: var(--mc-orange); text-decoration: underline; }

@media (max-width: 900px) {
  #the7-body .mc-cal { flex-direction: column; }
  #the7-body .mc-cal-info { flex: none; border-right: 0; border-bottom: 1px solid #e6e8eb; padding: 20px; }
  #the7-body .mc-cal-info .mc-ticks, #the7-body .mc-cal-when { display: none; }
  #the7-body .mc-cal-info h3 { font-size: 20px; margin-bottom: 10px; }
  #the7-body .mc-cal-main { padding: 20px 16px; }
  #the7-body .mc-cal-pick { flex-direction: column; gap: 10px; }
  #the7-body .mc-cal-month { max-width: none; }
  #the7-body .mc-cal-times { flex: none; }
  #the7-body .mc-cal-times h4 { margin: 10px 0 12px; }
  #the7-body .mc-cal-times ul { max-height: none; }
}
@media (max-width: 767px) {
  #the7-body .mc-cal { border-radius: 0; border-left: 0; border-right: 0; }
  #the7-body .mc-cal-day { width: 40px; height: 40px; }
}
#the7-body .mc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }


/* ======================================================================================================
   Design fixes (not on the live site)
   ====================================================================================================== */

/* Readable text: the theme's greys were below the WCAG AA contrast ratio (4.5:1). */
:root {
  --the7-base-color: #5c5c5c;
  --the7-widget-footer-color: #a9adb3;
  --the7-page-title-breadcrumbs-color: #6b7075;
  --the7-secondary-text-color: #767676;
}
#footer .contact-info li, #footer .soc-ico a { color: var(--the7-widget-footer-color); }
#footer .contact-info a.tm-contact { color: var(--the7-widget-footer-color); }
#footer .contact-info a.tm-contact:hover { color: #fff; }
.page-title .breadcrumbs, .page-title .breadcrumbs li, .page-title .breadcrumbs a { color: var(--the7-page-title-breadcrumbs-color); }

/* Phone numbers and email addresses are links now; keep them looking like the text around them. */
a.tm-contact { color: inherit; text-decoration: none; }
a.tm-contact:hover { color: var(--the7-accent-color, #2bb3d5); }

/* Home: room above "Schedule a Free Appointment" (it sat right under the service texts). */
#appointment { padding-top: 70px; padding-bottom: 30px; }

/* Home services: four narrow columns were cramped on tablets; use two (image + text) per row. */
@media (min-width: 768px) and (max-width: 991px) {
  .tm-services-row { display: flex; flex-wrap: wrap; }
  .tm-services-row > .vc_col-sm-3 { width: 50%; float: none; display: flex; }
  .tm-services-row > .vc_col-sm-3 > .vc_column-inner { width: 100%; }
  .tm-services-row > .vc_col-sm-3.vc_col-has-fill > .vc_column-inner { min-height: 320px; background-size: cover !important; background-position: center !important; }
}

/* Project tiles show their name only on mouse hover; on touch screens show it over a dark fade. */
@media (hover: none), (max-width: 767px) {
  .gradient-overlay-layout-list.hover-fade article .post-entry-content {
    opacity: 1; visibility: visible; top: auto !important; bottom: 0; height: auto; justify-content: flex-end;
    padding: 50px 15px 14px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  }
  .gradient-overlay-layout-list.hover-fade article .post-entry-content .entry-title a,
  .gradient-overlay-layout-list.hover-fade article .post-entry-content .entry-meta a { color: #fff; }
}

/* Phones: less empty space under section headings, and bigger tap targets for small text links. */
@media (max-width: 767px) {
  .uvc-heading-spacer.line_only { margin-bottom: 35px !important; }
  #appointment { padding-top: 50px; }
  .breadcrumbs a, .portfolio-categories a, .paginator a, .post-navigation a { display: inline-block; padding: 8px 0; }
  .soc-ico a { margin: 0 6px 6px 0; }
}

/* Single testimonial pages */
#page .tm-testimonial { margin: 20px auto 30px; max-width: 760px; padding: 4px 0 4px 28px; border-left: 3px solid var(--the7-accent-color, #2bb3d5); background: none !important; font-size: 18px; line-height: 1.7; font-weight: 400 !important; color: #333; }
#page .tm-testimonial p { font: inherit !important; color: inherit; }
#page .tm-testimonial p { margin-bottom: 14px; }
#page .tm-testimonial footer { font-size: 15px; font-weight: 600; color: #333; }
#page .tm-testimonial footer span { font-weight: 400; color: var(--the7-secondary-text-color); }
.tm-back { max-width: 760px; margin: 0 auto 40px; }

/* Project write-ups: full-width text lines were ~1200px long; keep them readable. */
.project-content .vc_col-sm-12 > .vc_column-inner > .wpb_wrapper > .wpb_text_column { max-width: 900px; }
