/*
Theme Name: MyRoof Hub
Theme URI: https://myroofhub.local
Author: MyRoof Hub Sdn. Bhd.
Author URI: https://myroofhub.my
Description: Premium roofing solutions marketing theme for MyRoof Hub, Penampang, Kota Kinabalu, Sabah.
Version: 1.0.0
Text Domain: myroofhub
*/

:root {
  --color-ink: #0b0b0c;
  --color-ink-soft: #5c5b57;
  --color-sun: #f8d637;
  --color-sun-deep: #7a5e00;
  --color-paper: #f7f5f0;
  --color-concrete: #d9d6cf;
  --color-slate: #2a2d31;
  --color-mist: #a6a39b;
  --color-danger: #b42318;
  --header-height: 4.5rem;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-roof: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ==========================================================================
   Site Header & Layout Styling (Next.js 1:1 Parity)
   ========================================================================== */

/* Site Container Utility */
.container-site {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  max-width: 88rem;
  padding-left: clamp(1.25rem, 4vw, 3rem);
  padding-right: clamp(1.25rem, 4vw, 3rem);
  box-sizing: border-box;
}

/* Fixed Header Bar */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4.5rem;
  z-index: 50;
  color: var(--color-ink, #0b0b0c);
  background-color: transparent;
  border-bottom: 1px solid transparent;
  transition: transform 0.4s var(--ease-out-expo), background-color 0.4s ease, border-color 0.4s ease;
  box-sizing: border-box;
}

/* Adjust for WordPress Admin Bar when logged in */
body.admin-bar .site-header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

/* Scrolled state: solid paper background with soft hairline border */
.site-header.scrolled {
  background-color: rgba(247, 245, 240, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: rgba(11, 11, 12, 0.1);
}

.header-hidden {
  transform: translateY(-100%) !important;
}

/* Header Content Flexbox (Direct Child Only) */
.site-header > .container-site {
  display: flex !important;
  height: 100% !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 1.5rem !important;
}

/* Desktop Navigation Menu */
.site-header nav.header-nav {
  display: none;
}

@media (min-width: 1024px) {
  .site-header nav.header-nav {
    display: block !important;
  }
}

.site-header nav.header-nav ul {
  display: flex !important;
  align-items: center !important;
  gap: 2rem !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.site-header nav.header-nav ul li {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  display: inline-flex !important;
  align-items: center !important;
}

/* ==========================================================================
   Header Navigation Link Underline (Yellow #f8d637 matching CTA button)
   ========================================================================== */
.site-header .nav-link {
  position: relative;
  display: inline-block;
  padding: 0.5rem 0;
  font-family: var(--font-display, 'Saira', sans-serif);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.025em;
  color: rgba(11, 11, 12, 0.75);
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.site-header .nav-link:hover {
  color: var(--color-ink, #0b0b0c);
}

.site-header .nav-link.is-active,
.site-header .nav-link[aria-current="page"] {
  font-weight: 600;
  color: var(--color-ink, #0b0b0c);
}

/* Yellow Underline matching CTA button */
.site-header .nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0px;
  height: 2.5px;
  background-color: var(--color-sun, #f8d637);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 1px;
}

.site-header .nav-link:hover::after,
.site-header .nav-link.is-active::after,
.site-header .nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

/* Header Right Actions */
.site-header .header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
}

/* Header CTA Button (Enquire Now) */
.site-header .header-cta-btn {
  position: relative;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background-color: var(--color-ink, #0b0b0c);
  padding: 0.625rem 1.25rem;
  font-family: var(--font-display, 'Saira', sans-serif);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-paper, #f7f5f0);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

@media (min-width: 640px) {
  .site-header .header-cta-btn {
    display: inline-flex !important;
  }
}

.site-header .header-cta-btn:hover {
  background-color: var(--color-slate, #2a2d31);
}

.site-header .header-cta-btn::after {
  content: '';
  position: absolute;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 0.375rem;
  height: 1.5px;
  background-color: var(--color-sun, #f8d637);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-header .header-cta-btn:hover::after {
  transform: scaleX(1);
}

/* Mobile Hamburger Toggle */
.site-header #mobile-menu-btn {
  display: flex !important;
  width: 2.75rem;
  height: 2.75rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: inherit;
  margin-right: -0.5rem;
}

@media (min-width: 1024px) {
  .site-header #mobile-menu-btn {
    display: none !important;
  }
}

/* Mobile Drawer Slideout */
#mobile-drawer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: none;
  background-color: var(--color-paper, #f7f5f0);
  color: var(--color-ink, #0b0b0c);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, visibility 0.4s;
  will-change: transform;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#mobile-drawer.is-open {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@media (min-width: 1024px) {
  #mobile-drawer {
    display: none !important;
  }
}

body.admin-bar #mobile-drawer {
  top: 46px;
  height: calc(100dvh - 46px);
}
@media (min-width: 783px) {
  body.admin-bar #mobile-drawer {
    top: 32px;
    height: calc(100dvh - 32px);
  }
}

body.admin-bar section:first-of-type > .container-site {
  padding-top: calc(var(--header-height) + 46px + 1.25rem) !important;
}
@media (min-width: 783px) {
  body.admin-bar section:first-of-type > .container-site {
    padding-top: calc(var(--header-height) + 32px + 1rem) !important;
  }
}

#mobile-drawer .mobile-drawer-header {
  display: flex !important;
  height: 4.5rem !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-shrink: 0;
}

#mobile-drawer nav.mobile-drawer-nav {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  height: auto !important;
  width: 100% !important;
  padding-top: 2rem !important;
  padding-bottom: 3rem !important;
}

#mobile-drawer nav.mobile-drawer-nav ul {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

#mobile-drawer a.is-active,
#mobile-drawer a[aria-current="page"] {
  color: var(--color-sun-deep, #7a5e00) !important;
  border-bottom: 2px solid var(--color-sun, #f8d637) !important;
}

/* Mobile Weather Card Legibility */
@media (max-width: 767px) {
  .weather-card {
    background-color: rgb(255 255 255 / 0.92) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.12);
    border: 1px solid rgb(11 11 12 / 0.08);
    width: 100%;
  }
}


/* ==========================================================================
   Contact Form 7 - MyRoof Hub Custom Styling
   ========================================================================== */
.wpcf7 {
  position: relative;
  width: 100%;
}

.wpcf7-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.wpcf7-form-control-wrap {
  display: block;
  position: relative;
  width: 100%;
}

.mrh-form-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 0.375rem;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="email"],
.wpcf7 input[type="number"],
.wpcf7 select,
.wpcf7 textarea {
  display: block;
  width: 100%;
  border-radius: 0.125rem;
  border: 1px solid rgba(11, 11, 12, 0.2);
  background-color: #ffffff;
  padding: 0.75rem 0.875rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.wpcf7 input[type="text"]::placeholder,
.wpcf7 input[type="tel"]::placeholder,
.wpcf7 input[type="email"]::placeholder,
.wpcf7 textarea::placeholder {
  color: rgba(92, 91, 87, 0.7);
}

.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="tel"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
  border-color: var(--color-ink);
  outline: 2px solid var(--color-ink);
  outline-offset: 1px;
}

.wpcf7 select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%235c5b57' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25rem;
  padding-right: 2.5rem;
}

.wpcf7 textarea {
  resize: vertical;
  min-height: 7.5rem;
}

/* Unit Wrap (m²) */
.mrh-unit-wrap {
  position: relative;
}

.mrh-unit-wrap input {
  padding-right: 3rem !important;
}

.mrh-unit-suffix {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  color: var(--color-ink-soft);
  pointer-events: none;
}

/* Checkbox Chips (Interests) */
.mrh-chips-wrap .wpcf7-list-item {
  margin: 0 0.5rem 0.5rem 0;
  display: inline-block;
}

.mrh-chips-wrap .wpcf7-list-item label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid rgba(11, 11, 12, 0.2);
  background-color: #ffffff;
  color: var(--color-ink);
  transition: all 0.2s ease;
  user-select: none;
}

.mrh-chips-wrap .wpcf7-list-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  margin: 0;
}

.mrh-chips-wrap .wpcf7-list-item label:hover {
  border-color: rgba(11, 11, 12, 0.5);
}

.mrh-chips-wrap .wpcf7-list-item label:has(input:checked),
.mrh-chips-wrap .wpcf7-list-item.is-checked label {
  background-color: var(--color-ink);
  color: var(--color-paper);
  border-color: var(--color-ink);
}

/* Radio Buttons (Preferred Contact) */
.mrh-radio-wrap .wpcf7-list-item {
  margin: 0 0.5rem 0.5rem 0;
  display: inline-block;
}

.mrh-radio-wrap .wpcf7-list-item label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid rgba(11, 11, 12, 0.2);
  background-color: #ffffff;
  color: var(--color-ink);
  transition: all 0.2s ease;
  user-select: none;
}

.mrh-radio-wrap .wpcf7-list-item input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  margin: 0;
}

.mrh-radio-wrap .wpcf7-list-item label:hover {
  border-color: rgba(11, 11, 12, 0.5);
}

.mrh-radio-wrap .wpcf7-list-item label:has(input:checked),
.mrh-radio-wrap .wpcf7-list-item.is-checked label {
  background-color: var(--color-ink);
  color: var(--color-paper);
  border-color: var(--color-ink);
}

/* Consent Acceptance Checkbox */
.mrh-consent-field .wpcf7-acceptance label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--color-ink);
  cursor: pointer;
}

.mrh-consent-field input[type="checkbox"] {
  margin-top: 0.2rem;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  accent-color: var(--color-ink);
}

/* Submit Button */
.wpcf7 input.mrh-submit-btn {
  font-family: 'Saira', sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-weight: 600;
  white-space: nowrap;
  background-color: var(--color-ink);
  color: var(--color-paper);
  border: none;
  padding: 1rem 2.25rem;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.3s var(--ease-out-expo), background-color 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
}

@media (min-width: 640px) {
  .wpcf7 input.mrh-submit-btn {
    width: auto;
  }
}

.wpcf7 input.mrh-submit-btn:hover {
  background-color: var(--color-slate);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(11, 11, 12, 0.15);
}

/* Validation & Feedback Notices */
.wpcf7-not-valid-tip {
  color: var(--color-danger);
  font-size: 0.875rem;
  margin-top: 0.375rem;
  display: block;
}

.wpcf7 .wpcf7-not-valid {
  border-color: var(--color-danger) !important;
}

.wpcf7 .wpcf7-spinner {
  display: inline-block;
  margin-left: 0.75rem;
  vertical-align: middle;
}

.wpcf7-response-output {
  margin: 1.5rem 0 0 0 !important;
  padding: 1rem 1.25rem !important;
  border-radius: 0.25rem !important;
  font-size: 0.95rem !important;
  line-height: 1.5 !important;
}

.wpcf7-mail-sent-ok {
  background-color: #fdf8ea !important;
  border: 1px solid var(--color-sun) !important;
  color: var(--color-ink) !important;
}

.wpcf7-validation-errors {
  background-color: #fef3f2 !important;
  border: 1px solid #fecdca !important;
  color: var(--color-danger) !important;
}

/* ========================================================
   Floating Widgets: WhatsApp & AI Chatbot Styles
   ======================================================== */
.chat-bubble {
  animation: fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ========================================================
   Hero Title Rise-Word Masks (Prevent descender clipping on 'g', 'y', 'p', 'q')
   ======================================================== */
.rise-word-mask,
.pb-\[0\.3em\],
.pb-\[0\.08em\] {
  padding-bottom: 0.3em !important;
  margin-bottom: -0.3em !important;
}
