/*
 Theme Name:   Astra Child - Master Flex
 Theme URI:    https://masterflex.mk
 Description:  Professional child theme for Master Flex construction company
 Author:       Master Flex
 Template:     astra
 Version:      1.0.0
 Text Domain:  astra-child
*/

/* ============================================
   1. COLOR SYSTEM
   Primary Red: #CF2E2E
   Dark Neutral: #1E293B
   Light BG: #F8FAFC
   ============================================ */

:root {
  --mf-red: #CF2E2E;
  --mf-dark: #1E293B;
  /* Override Astra's default blue global colors */
  --ast-global-color-0: #CF2E2E !important;
  --ast-global-color-1: #a82424 !important;
  --ast-global-color-2: #1E293B !important;
  --ast-global-color-3: #64748B !important;
  --ast-global-color-4: #CF2E2E !important;
  --ast-global-color-5: #1E293B !important;
  --mf-light: #F8FAFC;
  --mf-gray: #64748B;
  --mf-border: #E2E8F0;
}

body {
  background-color: var(--mf-light);
  color: var(--mf-dark);
}

/* Override ALL orange #ff6600 and blue #046BD2 */
a,
a:visited {
  color: var(--mf-red);
}
a:hover,
a:focus {
  color: #a82424;
}

/* Buttons — primary red (default) */
.wp-block-button__link,
.wp-element-button,
.ast-button,
button,
input[type="submit"],
.menu-toggle {
  background-color: var(--mf-red);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 12px 28px;
  transition: all 0.25s ease;
}
.wp-block-button__link:hover,
.wp-element-button:hover,
.ast-button:hover,
button:hover,
input[type="submit"]:hover {
  background-color: #a82424;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(207, 46, 46, 0.3);
}

/* Outline button variant */
.wp-block-button.is-style-outline .wp-block-button__link {
  background-color: transparent !important;
  color: #fff !important;
  border: 2px solid #fff !important;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background-color: #fff !important;
  color: var(--mf-red) !important;
}

/* White button on red backgrounds */
.wp-block-button .has-white-background-color.wp-block-button__link,
.wp-block-button__link.has-white-background-color {
  background-color: #fff !important;
  color: var(--mf-red) !important;
  border: none !important;
}
.wp-block-button .has-white-background-color.wp-block-button__link:hover,
.wp-block-button__link.has-white-background-color:hover {
  background-color: #f1f5f9 !important;
  color: #a82424 !important;
}

/* Stat numbers and accent text — replace orange */
.wp-block-heading[style*="color:#ff6600"],
.wp-block-heading[style*="color: #ff6600"],
p[style*="color:#ff6600"],
p[style*="color: #ff6600"],
h2[style*="color:#ff6600"],
h4[style*="color:#ff6600"] {
  color: var(--mf-red) !important;
}

/* Stat cards border */
.wp-block-column[style*="border-color:#ff6600"] {
  border-color: var(--mf-red) !important;
}

/* Left accent borders on service cards */
.wp-block-column[style*="border-left-color:#ff6600"] {
  border-left-color: var(--mf-red) !important;
}

/* Orange separators */
.wp-block-separator[style*="#ff6600"] {
  background-color: var(--mf-red) !important;
  color: var(--mf-red) !important;
}

/* Contact page orange links */
a[style*="color:#ff6600"] {
  color: var(--mf-red) !important;
}

/* Override vivid-red to our exact red */
.has-vivid-red-background-color {
  background-color: var(--mf-red) !important;
}
.has-vivid-red-color {
  color: var(--mf-red) !important;
}

/* Back-to-top arrow */
#ast-scroll-top,
.ast-scroll-top-icon {
  background-color: var(--mf-red) !important;
  color: #fff !important;
  border-radius: 50%;
}

/* Any remaining blue overrides */
*[style*="color:#046BD2"],
*[style*="color: #046BD2"] {
  color: var(--mf-red) !important;
}
*[style*="background-color:#046BD2"],
*[style*="background-color: #046BD2"] {
  background-color: var(--mf-red) !important;
}

/* ============================================
   2. TYPOGRAPHY — Montserrat + Inter
   ============================================ */

body,
p,
li,
td,
th,
input,
textarea,
select {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--mf-dark);
}

h1, h2, h3, h4, h5, h6,
.wp-block-heading,
.entry-title,
.ast-site-title-wrap .site-title,
.ast-site-title-wrap .site-title a {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--mf-dark);
  letter-spacing: -0.01em;
}

h1, .wp-block-heading[style*="font-size:48px"] { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.125rem; font-weight: 600; }

/* White headings on dark backgrounds */
.wp-block-cover h1,
.wp-block-cover h2,
.wp-block-cover h3,
.wp-block-cover h4,
.wp-block-cover .wp-block-heading {
  color: #fff;
}

/* ============================================
   3. HEADER FIXES
   ============================================ */

/* Hide the redundant text site title — logo already says Master Flex */
.ast-site-title-wrap .site-title,
.ast-site-title-wrap .site-title a {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* Remove width constraint */
.ast-site-title-wrap {
  max-width: none !important;
  width: auto !important;
}

/* Constrain logo size */
.custom-logo {
  max-height: 80px !important;
  width: auto !important;
}
.ast-site-identity {
  padding: 8px 0;
}

/* Clean header styling */
.ast-primary-header,
.site-header {
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Nav link styling */
.ast-header-sections-navigation a,
.main-navigation a,
.ast-nav-menu a {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--mf-dark) !important;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}
.ast-header-sections-navigation a:hover,
.main-navigation a:hover,
.ast-nav-menu a:hover {
  color: var(--mf-red) !important;
}

/* ============================================
   4. PROJECT CARDS
   ============================================ */

/* Cards on the projects section */
.wp-block-columns.alignwide .wp-block-column {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Project card styling — scoped to project sections */
.mf-project-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.mf-project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}
.mf-project-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}
.mf-project-card .mf-card-body {
  padding: 20px;
}
.mf-project-card h4 {
  margin: 0 0 8px;
  font-size: 1.125rem;
  color: var(--mf-dark);
}
.mf-project-card p {
  margin: 0;
  font-size: 14px;
  color: var(--mf-gray);
  line-height: 1.5;
}

/* ============================================
   5. SERVICES GRID
   ============================================ */

.mf-services-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}
.mf-services-grid .mf-service-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  transition: transform 0.3s ease, background 0.3s ease;
}
.mf-services-grid .mf-service-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.1);
}
.mf-services-grid .mf-service-card svg {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
}
.mf-services-grid .mf-service-card h4 {
  color: #fff;
  font-size: 1rem;
  margin: 0 0 8px;
}
.mf-services-grid .mf-service-card p {
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 1024px) {
  .mf-services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .mf-services-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   6. STAT CARDS
   ============================================ */

.wp-block-columns.alignwide > .wp-block-column[style*="border-width:2px"] {
  border-radius: 12px !important;
  border-width: 0 !important;
  border-left: 4px solid var(--mf-red) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease;
}
.wp-block-columns.alignwide > .wp-block-column[style*="border-width:2px"]:hover {
  transform: translateY(-3px);
}

/* ============================================
   7. HERO / COVER SECTION
   ============================================ */

.wp-block-cover.alignfull:first-child {
  min-height: 70vh !important;
}
.wp-block-cover.alignfull:first-child .wp-block-cover__inner-container {
  max-width: 1240px;
  margin: 0 auto;
}

/* ============================================
   8. SECTION SPACING
   ============================================ */

.wp-block-spacer {
  height: 60px !important;
}

.entry-content > .alignwide,
.entry-content > .wp-block-columns {
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

.wp-block-cover.alignfull {
  padding-top: 80px !important;
  padding-bottom: 80px !important;
}

/* ============================================
   9. FOOTER
   ============================================ */

/* Remove Powered by Astra */
.ast-footer-copyright .ast-footer-html-inner a[href*="developer.wordpress.org"],
.ast-footer-copyright .ast-footer-html-inner a[href*="developer.wordpress"],
.site-footer .ast-builder-layout-element .ast-footer-copyright p {
  visibility: visible;
}
.ast-small-footer-wrap,
.ast-small-footer {
  background-color: var(--mf-dark) !important;
  color: #94a3b8;
}

/* Custom footer */
.mf-footer {
  background-color: var(--mf-dark);
  color: #94a3b8;
  padding: 60px 20px 30px;
}
.mf-footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
.mf-footer h4 {
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 16px;
  position: relative;
  padding-bottom: 10px;
}
.mf-footer h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 3px;
  background: var(--mf-red);
  border-radius: 2px;
}
.mf-footer p,
.mf-footer li {
  font-size: 14px;
  line-height: 1.8;
  color: #94a3b8;
}
.mf-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.mf-footer a {
  color: #94a3b8 !important;
  text-decoration: none;
  transition: color 0.2s ease;
}
.mf-footer a:hover {
  color: var(--mf-red) !important;
}
.mf-footer-bottom {
  max-width: 1240px;
  margin: 30px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 13px;
  color: #64748b;
}

@media (max-width: 768px) {
  .mf-footer-inner {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .mf-projects-grid {
    grid-template-columns: 1fr !important;
  }
  .mf-project-card img {
    height: 260px;
  }
}

/* Hide default Astra footer credit */
.ast-small-footer-section,
.ast-footer-copyright,
.site-footer .ast-builder-layout-element {
  display: none !important;
}

/* ============================================
   10. GENERAL POLISH
   ============================================ */

/* Rounded images */
.wp-block-image img {
  border-radius: 8px;
}

/* Better blockquotes */
blockquote {
  border-left: 4px solid var(--mf-red);
  padding: 16px 24px;
  margin: 24px 0;
  font-style: italic;
  color: var(--mf-gray);
}

/* Form styling */
.gform_wrapper input[type="text"],
.gform_wrapper input[type="email"],
.gform_wrapper input[type="tel"],
.gform_wrapper textarea,
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  border: 1px solid var(--mf-border);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  transition: border-color 0.2s ease;
}
.gform_wrapper input:focus,
.gform_wrapper textarea:focus,
input:focus,
textarea:focus {
  border-color: var(--mf-red);
  outline: none;
  box-shadow: 0 0 0 3px rgba(207, 46, 46, 0.1);
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Fix Astra container */
.ast-container {
  max-width: 1240px;
}

/* Override Astra's inline blue focus states */
input:focus,
select:focus,
textarea:focus,
input[type="checkbox"]:focus,
input[type="radio"]:focus {
  border-color: var(--mf-red) !important;
}

/* Override any Astra global color references */
.ast-custom-button:hover,
.ast-custom-button:focus {
  background-color: var(--mf-red) !important;
}
