/*
 * JP2 Franchising
 *
 * This stylesheet defines a clean, minimal design inspired by the
 * colours in the JP2 Franchising logo. It uses CSS variables for
 * easy customisation and provides responsive styling for different
 * screen widths. Sections alternate subtle background shades to
 * enhance readability without adding clutter.
 */

/* Colour palette derived from the provided logo */
:root {
  --color-background: #f7f5ef; /* light beige background */
  --color-primary: #0e2a47;    /* dark navy for text and headings */
  --color-accent: #5f87b3;     /* mid‑blue accent used in the logo */
  --color-secondary: #314d6a;  /* deep slate blue for secondary buttons */
  --color-light: #ffffff;      /* pure white */
  --color-gray: #f0eeea;       /* subtle off‑white section background */
  --font-body: 'Montserrat', sans-serif;
}

/* Reset some default styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--color-primary);
  background-color: var(--color-background);
  /* Prevent horizontal scrollbars on small devices by hiding any accidental overflow */
  overflow-x: hidden;
}

/* Navigation bar */
/*
 * The header is kept in normal document flow rather than sticky so
 * that it scrolls away on mobile. A light box shadow separates it from
 * the content on larger screens.
 */
header {
  background-color: var(--color-light);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.navbar {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
}

.logo-container {
  display: flex;
  align-items: center;
}

.nav-logo {
  height: 48px;
  width: auto;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--color-primary);
  font-weight: 600;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--color-accent);
}

/* Hamburger menu button for mobile */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--color-primary);
  border-radius: 2px;
}

/* Hero section */
.hero-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 2rem 1rem;
  background-color: var(--color-gray);
  border-radius: 8px;
}

.hero-content {
  flex: 1 1 400px;
  padding-right: 2rem;
}

.hero-content h1 {
  font-size: 2.5rem;
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.hero-content p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  max-width: 500px;
}

.hero-image {
  flex: 1 1 300px;
  text-align: center;
}

/* JP2 logo in hero section */
.hero-logo {
  max-width: 220px;
  height: auto;
  margin-bottom: 1rem;
}

.hero-image img {
  max-width: 100%;
  height: auto;
}

/* Content sections */
.content-section {
  padding: 3rem 1rem;
}

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

.container {
  max-width: 900px;
  margin: 0 auto;
}

.container.narrow {
  max-width: 750px;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

h3 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  color: var(--color-secondary);
}

p {
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: 1.25rem;
  color: var(--color-primary);
}

a.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-light);
}

.btn-primary:hover {
  background-color: var(--color-secondary);
  color: var(--color-light);
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: var(--color-light);
}

.btn-secondary:hover {
  background-color: var(--color-accent);
  color: var(--color-light);
}

/* Contact section */
.contact-section {
  padding: 3rem 1rem;
}

.contact-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  flex: 1 1 100%;
}

.form-group {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
}

.form-group.full-width {
  flex: 1 1 100%;
}

.form-group label {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-group input {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-size: 1rem;
  background-color: var(--color-light);
}

.contact-form button {
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  background-color: var(--color-accent);
  color: var(--color-light);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.contact-form button:hover {
  background-color: var(--color-secondary);
}

.direct-contact {
  margin-top: 1.5rem;
  font-size: 0.95rem;
}

.direct-contact a {
  color: var(--color-accent);
  text-decoration: none;
}

.direct-contact a:hover {
  text-decoration: underline;
}

/* Footer styling */
footer {
  background-color: var(--color-primary);
  color: var(--color-light);
  padding: 1.5rem 1rem;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-left p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.footer-left a {
  color: var(--color-accent);
  text-decoration: none;
}

.footer-left a:hover {
  text-decoration: underline;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.linkedin-link {
  color: var(--color-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 2px;
}

.linkedin-link:hover {
  color: var(--color-accent);
}

.linkedin-icon {
  width: 24px;
  height: 24px;
}

.bai-logo {
  height: 40px;
  width: auto;
  /* Desaturate slightly so the logo sits softly within the footer. */
  filter: grayscale(40%) brightness(1.1);
  opacity: 0.8;
}

/* JP2 logo in the footer */
.footer-jp2-logo {
  height: 32px;
  width: auto;
  margin-right: 0.5rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .hero-section {
    flex-direction: column;
    text-align: center;
  }
  .hero-content {
    padding-right: 0;
  }
  .nav-links {
    gap: 1rem;
  }
  .form-group {
    flex: 1 1 100%;
  }
  .footer-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .footer-right {
    flex-direction: row;
    gap: 0.75rem;
  }
}

/* Additional responsive rules for very small screens */
@media (max-width: 600px) {
  /* Stack navbar items vertically and reveal a hamburger toggle */
  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .hamburger {
    display: flex;
    margin-left: auto;
  }
  /* Hide navigation links by default; reveal when toggle is active */
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: 0.5rem;
    gap: 0.75rem;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    padding: 0.5rem 0;
  }
  /* Adjust hero section layout for narrow screens */
  .hero-section {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem 1rem;
    justify-content: center;
  }
  .hero-content {
    text-align: center;
    padding-right: 0;
    margin-bottom: 1.5rem;
  }
  .hero-content h1 {
    font-size: 1.8rem;
    line-height: 1.2;
    word-wrap: break-word;
  }
  .hero-content p {
    font-size: 1rem;
  }
  .hero-image {
    width: 100%;
    margin-top: 0;
  }
  .hero-image img {
    max-width: 100%;
    height: auto;
  }
  /* Provide horizontal padding so content doesn't touch screen edges */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .content-section {
    padding: 2rem 1rem;
  }
  /* Stack form fields and tighten spacing for the contact form */
  .contact-form {
    flex-direction: column;
    gap: 0.5rem;
  }
  /* Override row grouping so each input sits on its own line */
  .form-row {
    flex-direction: column;
    gap: 0.5rem;
  }
  .direct-contact {
    font-size: 0.9rem;
  }
}

/* Further reduce heading size on extra small screens */
@media (max-width: 400px) {
  .hero-content h1 {
    font-size: 1.6rem;
  }
}