/*
Theme Name: Grow with Hafsa
Theme URI: https://growwithhafsa.com
Author: Hafsa El Khiati
Description: Custom theme for Grow with Hafsa (AI & Digital Marketing consulting), matching the site's static design system.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: grow-with-hafsa
*/

/* ==========================================================================
   Grow with Hafsa — Design System
   Colors sampled from the logo (indigo/violet gradient + teal accent dot)
   ========================================================================== */

:root {
  --color-primary: #4B3B96;
  --color-primary-light: #7B6FD6;
  --color-accent: #2DBFAE;
  --color-dark: #17151F;
  --color-gray: #6B7280;
  --color-gray-light: #E5E3F1;
  --color-bg: #FFFFFF;
  --color-bg-alt: #F7F6FB;

  --font-heading: "Poppins", system-ui, -apple-system, Segoe UI, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, Segoe UI, sans-serif;

  --max-width: 1140px;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(23, 21, 31, 0.08);
  --transition: 0.2s ease;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-dark);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.6em;
  color: var(--color-dark);
}

h1 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1em;
  color: var(--color-gray);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 88px 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-header {
  max-width: 640px;
  margin: 0 auto 56px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 12px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 30px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
  color: #fff;
  box-shadow: 0 8px 20px rgba(75, 59, 150, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(75, 59, 150, 0.36);
}

.btn-outline {
  background: transparent;
  border-color: var(--color-dark);
  color: var(--color-dark);
}

.btn-outline:hover {
  background: var(--color-dark);
  color: #fff;
}

.btn-accent {
  background: var(--color-accent);
  color: #08312c;
}

.btn-accent:hover {
  transform: translateY(-2px);
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-gray-light);
}

/* When logged in, WordPress adds a fixed admin bar (32px desktop, 46px on
   narrow screens) that otherwise overlaps our sticky header. */
body.admin-bar .site-header {
  top: 32px;
}

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

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-dark);
}

.brand img {
  height: 52px;
  width: auto;
}

.brand .fallback-mark {
  height: 40px;
  width: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-links a {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-dark);
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after,
.nav-links a.current-menu-item::after {
  width: 100%;
}

.nav-links a.active,
.nav-links li.current-menu-item > a {
  color: var(--color-primary);
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  margin-left: 16px;
}

/* Hidden by default; the 720px breakpoint below swaps which of the two
   instances (desktop header vs. inside the mobile menu) is shown. */
.lang-switch-mobile {
  display: none;
}

.lang-switch a {
  color: var(--color-gray);
  padding: 4px 6px;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}

.lang-switch a.active {
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
  border-radius: 999px;
}

.lang-switch a:hover {
  color: var(--color-primary);
}

.lang-switch span {
  color: var(--color-gray-light);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-dark);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 96px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.hero-copy .eyebrow {
  margin-bottom: 18px;
}

.hero-copy p {
  font-size: 1.1rem;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.hero-media {
  position: relative;
}

.hero-media .image-frame {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
}

.split-media .image-frame {
  aspect-ratio: 4 / 5;
}

.service-media .image-frame {
  aspect-ratio: 4 / 3;
}

.hero-stats {
  position: absolute;
  bottom: -24px;
  left: -24px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 24px;
  display: flex;
  gap: 28px;
}

.hero-stats div strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--color-primary);
}

.hero-stats div span {
  font-size: 0.8rem;
  color: var(--color-gray);
}

/* ---------- Image frames ---------- */
.image-frame {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-bg-alt), var(--color-gray-light));
  border: 1px dashed var(--color-gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
}

.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

/* ---------- Cards ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.card {
  background: #fff;
  border: 1px solid var(--color-gray-light);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--color-primary);
}

.card-icon svg {
  width: 26px;
  height: 26px;
}

/* ---------- Split layout (About teaser, etc.) ---------- */
.split {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 56px;
  align-items: center;
}

.split.reverse {
  grid-template-columns: 1.15fr 0.85fr;
}

.split.reverse .split-media {
  order: 2;
}

/* ---------- Blog cards ---------- */
.blog-card {
  background: #fff;
  border: 1px solid var(--color-gray-light);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.blog-card .image-frame {
  aspect-ratio: 16 / 10;
  border-radius: 0;
  border: none;
}

.blog-card-body {
  padding: 24px 24px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-meta {
  font-size: 0.78rem;
  color: var(--color-accent);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.blog-card h3 {
  margin-bottom: 10px;
}

.blog-card .read-more {
  margin-top: auto;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-primary);
  padding-top: 12px;
}

/* ---------- CTA banner ---------- */
.cta-banner {
  background: linear-gradient(135deg, var(--color-primary), #2c2263);
  border-radius: 28px;
  padding: 64px 48px;
  text-align: center;
  color: #fff;
}

.cta-banner h2,
.cta-banner p {
  color: #fff;
}

.cta-banner p {
  opacity: 0.85;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Reviews ---------- */
.review-card {
  display: flex;
  flex-direction: column;
}

.review-quote {
  color: var(--color-dark);
  font-size: 0.98rem;
  flex: 1;
}

.review-author {
  margin-top: 8px;
}

.review-author strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  color: var(--color-dark);
}

.review-author span {
  font-size: 0.82rem;
  color: var(--color-gray);
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
}

.contact-info-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 28px;
}

.contact-info-item {
  display: flex;
  gap: 14px;
  align-items: center;
}

.contact-info-item .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--color-bg-alt);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-info-item strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.85rem;
}

.contact-info-item a,
.contact-info-item span.value {
  color: var(--color-gray);
  font-size: 0.92rem;
}

.contact-form {
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 500;
}

.form-field input,
.form-field textarea {
  border: 1px solid var(--color-gray-light);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: #fff;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--color-primary-light);
  outline-offset: 1px;
}

.form-note {
  font-size: 0.82rem;
  color: var(--color-gray);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-dark);
  color: #fff;
  padding: 64px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-grid p {
  color: rgba(255, 255, 255, 0.6);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.footer-brand img {
  height: 44px;
  filter: brightness(0) invert(1);
}

.footer-col h4 {
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.92rem;
  transition: color var(--transition);
}

.footer-col a:hover {
  color: var(--color-accent);
}

.footer-contact-link {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-contact-link svg {
  flex-shrink: 0;
  opacity: 0.75;
}

.footer-bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.82rem;
}

.footer-bottom a {
  text-decoration: underline;
}

.footer-socials {
  display: flex;
  gap: 14px;
}

.footer-socials a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background var(--transition), border-color var(--transition);
}

.footer-socials a:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  padding: 56px 0 40px;
  text-align: center;
}

.page-hero .eyebrow {
  display: block;
}

.page-hero p {
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Post / page content ---------- */
.post-body,
.page-content {
  max-width: 720px;
  margin: 0 auto;
}

.post-body h2,
.page-content h2 {
  margin-top: 1.6em;
}

.post-body h3,
.page-content h3 {
  margin-top: 1.2em;
}

.post-body ul,
.page-content ul {
  margin: 0 0 1.2em;
  padding-left: 1.2em;
  list-style: disc;
}

.post-body li,
.page-content li {
  color: var(--color-gray);
  margin-bottom: 0.5em;
}

/* ---------- Table of contents (blog posts) ---------- */
.toc {
  background: var(--color-bg-alt);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 8px 0 32px;
}

.toc strong {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-heading);
  color: var(--color-dark);
}

.toc ul {
  list-style: disc;
  padding-left: 1.2em;
  margin: 0;
}

.toc li {
  margin-bottom: 4px;
}

.toc a {
  color: var(--color-primary);
  font-weight: 500;
}

/* ---------- FAQ accordion ---------- */
.faq-item {
  border-bottom: 1px solid var(--color-gray-light);
  padding: 22px 0;
}

.faq-item summary {
  font-family: var(--font-heading);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--color-primary);
  transition: transform var(--transition);
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  margin-top: 12px;
}

.post-hero-img {
  max-width: 720px;
  margin: 0 auto 40px;
}

.post-hero-img .image-frame {
  aspect-ratio: 16/8;
}

.post-meta {
  text-align: center;
  color: var(--color-gray);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

/* ---------- Utility ---------- */
.text-center {
  text-align: center;
}

.mt-lg {
  margin-top: 48px;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid,
  .contact-grid,
  .split,
  .split.reverse {
    grid-template-columns: 1fr;
  }

  .split .split-media,
  .split.reverse .split-media {
    order: -1;
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--color-gray-light);
    transform: translateY(-140%);
    transition: transform var(--transition);
  }

  .nav-links.open {
    transform: translateY(0);
  }

  .nav-toggle {
    display: flex;
  }

  /* The desktop language pill moves into the mobile menu instead, so the
     header row (logo, Book a Call, hamburger) has room to breathe. */
  .lang-switch-desktop {
    display: none;
  }

  .lang-switch-mobile {
    display: flex;
    margin-left: 0;
  }

  .site-header .btn-primary {
    padding: 10px 18px;
    font-size: 0.85rem;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    position: static;
    margin-top: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 64px 0;
  }
}

/* Offset anchor-linked sections so the sticky header doesn't cover them. */
.service-detail {
  scroll-margin-top: 100px;
}
