/* ============================================
   M&P Family Invest — Static Website CSS
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: 'Inter', sans-serif; font-size: 16px; line-height: 1.7; color: #222; background: #fff; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
h1, h2, h3, h4 { font-family: 'Playfair Display', serif; font-weight: 700; line-height: 1.25; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }
p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

/* --- CSS Custom Properties --- */
:root {
  --gold: rgb(200, 164, 92);
  --gold-light: rgba(200, 164, 92, 0.15);
  --warm-bg: rgb(251, 250, 246);
  --warm-bg-2: rgb(255, 246, 244);
  --white: #ffffff;
  --black: #000000;
  --text: #222222;
  --text-light: #555555;
  --text-white: #ffffff;
  --max-width: 1200px;
  --max-width-narrow: 800px;
  --max-width-wide: 1000px;
  --max-width-boxed: 1100px;
  --section-padding: 100px;
  --section-padding-tablet: 70px;
  --section-padding-mobile: 50px;
  --header-height: 80px;
  --transition: 0.3s ease;
}

/* --- Body padding for fixed header on non-hero pages --- */
body.has-hero { padding-top: 0; }
body:not(.has-hero) { padding-top: var(--header-height); }

/* --- Layout --- */
.row-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 30px;
}
.row-main.wide { max-width: var(--max-width-wide); }
.row-main.narrow { max-width: var(--max-width-narrow); }
.row-main.boxed { max-width: var(--max-width-boxed); }

/* --- Grid --- */
.grid { display: grid; gap: 40px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6-6 { grid-template-columns: 1fr 1fr; }
.grid-4-8 { grid-template-columns: 1fr 2fr; }
.grid-5-7 { grid-template-columns: 5fr 7fr; }
.grid-7-5 { grid-template-columns: 7fr 5fr; }
.grid-5-1-6 { grid-template-columns: 5fr 0.5fr 6fr; }

/* --- Sections --- */
.section {
  position: relative;
  padding: var(--section-padding) 0;
  overflow: hidden;
}
.section--hero {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-white);
}
.section--hero .hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.section--hero .hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.section--hero .hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--gold);
  mix-blend-mode: multiply;
  z-index: 1;
}
.section--hero .hero-content {
  position: relative;
  z-index: 2;
}
.section--medium { padding: 80px 0; }
.section--high { min-height: 80vh; display: flex; align-items: center; }
.section--bg-warm { background: var(--warm-bg); }
.section--bg-warm-2 { background: var(--warm-bg-2); }
.section--bg-white { background: var(--white); }
.section--bg-black { background: var(--black); color: var(--text-white); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.color-gold { color: var(--gold); }

/* --- Header / Navigation --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: background var(--transition), box-shadow var(--transition);
  height: var(--header-height);
}
.header .row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}
.header--transparent { background: transparent; }
.header--scrolled {
  background: rgba(255,255,255,0.97);
  box-shadow: 0 1px 10px rgba(0,0,0,0.08);
}
.header--transparent .logo--primary { display: none; }
.header--transparent .logo--secondary { display: block; }
.header--scrolled .logo--primary { display: block; }
.header--scrolled .logo--secondary { display: none; }

/* On pages without hero inverse */
.header--default { background: var(--white); box-shadow: 0 1px 10px rgba(0,0,0,0.08); }
.header--default .logo--primary { display: block; }
.header--default .logo--secondary { display: none; }
.header--default .nav__link { color: var(--text); }
.header--default .nav__link:hover,
.header--default .nav__link.active { color: var(--gold); }

.logo img { height: 32px; width: auto; }

.nav { display: flex; align-items: center; gap: 35px; }
.nav__link {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-white);
  position: relative;
  padding: 5px 0;
  transition: color var(--transition);
}
.header--scrolled .nav__link { color: var(--text); }
.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width var(--transition);
}
.nav__link:hover::after,
.nav__link.active::after { width: 100%; }
.header--scrolled .nav__link:hover,
.header--scrolled .nav__link.active { color: var(--gold); }
.header--transparent .nav__link:hover { color: var(--gold); }

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 5px;
  z-index: 1001;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: var(--transition);
}
.header--transparent .nav-toggle span { background: var(--text-white); }
.header--scrolled .nav-toggle span { background: var(--text); }

.nav-toggle.is-active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 12px 0;
  border: none;
  background: none;
  color: var(--text);
  cursor: pointer;
  position: relative;
  transition: color var(--transition);
}
.btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gold);
}
.btn:hover { color: var(--gold); }

.btn--submit {
  background: var(--gold);
  color: var(--white);
  padding: 14px 40px;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
}
.btn--submit::after { display: none; }
.btn--submit:hover { background: #b8923e; }

/* --- Flexcard (Icon + Text) --- */
.flexcard {
  text-align: center;
}
.flexcard .icon-wrapper {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
}
.flexcard .icon-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.flexcard h3 { margin-bottom: 10px; }
.flexcard--left { text-align: left; }
.flexcard--left .icon-wrapper { margin: 0 0 20px 0; }

/* --- Image cards (portfolio) --- */
.portfolio-card {
  margin-bottom: 30px;
}
.portfolio-card__logo {
  background: #f5f5f5;
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  aspect-ratio: 2.132;
  margin-bottom: 0;
}
.portfolio-card__logo img {
  max-width: 200px;
  max-height: 60px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.portfolio-card__subtitle {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 8px;
  text-align: center;
}
.portfolio-card__image {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
  display: block;
}
.portfolio-card__caption {
  padding: 25px 0;
}
.portfolio-card__caption h3 { margin-bottom: 8px; }
.portfolio-card__caption p { color: var(--text-light); font-size: 0.95rem; }

/* --- Text utility --- */
.text-large { font-size: 1.15rem; }

/* --- Stats --- */
.stats { text-align: center; }
.stats h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 5px; }
.stats p { font-size: 1.05rem; color: var(--text-light); }

/* --- Values grid --- */
.values-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 35px; }
.values-grid h3 { margin-bottom: 8px; }
.values-grid p { color: var(--text-light); font-size: 0.95rem; }

/* --- Gallery (logos strip) --- */
.logo-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.logo-gallery__item {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: var(--white);
  border: 1px solid #f0f0f0;
}
.logo-gallery__item img {
  max-width: 70%;
  max-height: 70%;
  object-fit: contain;
}

/* --- Process steps --- */
.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.process-step .icon-wrapper {
  width: 60px;
  height: 60px;
  margin-bottom: 20px;
}
.process-step .icon-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.process-step h3 { margin-bottom: 10px; }
.process-step p { color: var(--text-light); font-size: 0.95rem; }

/* --- Contact page --- */
.contact-info p { margin-bottom: 0.5em; }
.contact-info a { color: var(--gold); text-decoration: underline; }
.contact-info .address { margin-top: 20px; }

.contact-form {
  background: var(--warm-bg);
  padding: 50px;
  max-width: 900px;
  margin: 0 auto;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}
.form-group { display: flex; flex-direction: column; }
.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}
.form-group label .required { color: var(--gold); }
.form-group input,
.form-group textarea {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  padding: 12px 16px;
  border: 1px solid #ddd;
  background: var(--white);
  transition: border-color var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--gold); }
.form-group textarea { min-height: 150px; resize: vertical; }
.form-group--full { grid-column: 1 / -1; }

/* --- Map --- */
.map-container {
  width: 100%;
  aspect-ratio: 16/10;
  background: #eee;
  overflow: hidden;
}
.map-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
  filter: saturate(0) contrast(1.1);
}

/* --- Footer --- */
.footer {
  background: var(--black);
  color: var(--text-white);
  padding: 60px 0 40px;
}
.footer .row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer__logo img { height: 32px; width: auto; }
.footer__email a {
  color: var(--gold);
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--transition);
}
.footer__email a:hover { opacity: 0.8; }
.footer__social a {
  color: var(--text-white);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color var(--transition);
}
.footer__social a:hover { color: var(--gold); }
.footer__social svg { width: 20px; height: 20px; fill: currentColor; }
.footer__divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.15);
  margin: 30px auto;
  max-width: 33%;
}
.footer__brand {
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}

/* --- Cookie Bar --- */
.cookie-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  z-index: 9999;
  padding: 25px 30px;
  display: none;
}
.cookie-bar.is-visible { display: block; }
.cookie-bar__message {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 15px;
}
.cookie-bar__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.cookie-bar__btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  padding: 8px 20px;
  border: 1px solid #ddd;
  background: var(--white);
  cursor: pointer;
  transition: var(--transition);
}
.cookie-bar__btn:hover { border-color: var(--gold); }
.cookie-bar__btn--primary {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}
.cookie-bar__btn--primary:hover { background: #b8923e; }

/* --- Spacer utility --- */
.spacer { display: block; }
.spacer--sm { height: 30px; }
.spacer--md { height: 50px; }
.spacer--lg { height: 100px; }

/* --- Divider --- */
.divider {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 0;
}
.divider--inverse { border-color: rgba(255,255,255,0.15); }

/* --- Image with text side by side --- */
.media-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.media-content--reverse { direction: rtl; }
.media-content--reverse > * { direction: ltr; }
.media-content__image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* --- Animation on scroll (simple) --- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 992px) {
  :root {
    --section-padding: 70px;
    --header-height: 70px;
  }
  .nav-toggle { display: flex; }
  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    transition: right var(--transition);
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    z-index: 1000;
  }
  .nav.is-open { right: 0; }
  .nav__link { color: var(--text) !important; font-size: 1rem; }
  .grid-2, .grid-3, .grid-4, .grid-6-6, .grid-4-8, .grid-5-7, .grid-7-5, .grid-5-1-6 {
    grid-template-columns: 1fr;
  }
  .media-content { grid-template-columns: 1fr; gap: 30px; }
  .media-content--reverse { direction: ltr; }
  .values-grid { grid-template-columns: 1fr; gap: 25px; }
  .process-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .logo-gallery { grid-template-columns: repeat(2, 1fr); }
  .contact-form { padding: 30px 20px; }
  .footer .row-main { flex-direction: column; gap: 20px; text-align: center; }
  .footer__divider { max-width: 50%; }

  /* Mobile menu overlay bg */
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
  }
  .nav-overlay.is-open { display: block; }
}

@media (max-width: 720px) {
  :root {
    --section-padding: 50px;
  }
  .section--hero { min-height: 60vh; }
  .section--high { min-height: auto; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  .process-grid { grid-template-columns: 1fr; }
  .row-main { padding: 0 20px; }
  .spacer--md { height: 25px; }
  .spacer--lg { height: 50px; }
}

@media (max-width: 480px) {
  .logo-gallery { grid-template-columns: repeat(2, 1fr); }
  .cookie-bar__actions { flex-direction: column; }
  .cookie-bar__btn { width: 100%; text-align: center; }
}
