/*
  FMX – Computer and Peripheral Services – Global Stylesheet

  This CSS file defines the typography, colour palette and responsive
  layout for the FMX website.  Flexbox places each section’s image and
  text side-by-side on wide screens and stacks them vertically on small
  devices.  The banner has been given a full-width treatment and the
  About section is now left-aligned, as requested.
*/

/* -------------------- Base styles -------------------- */

html {
  box-sizing: border-box;
}
*, *::before, *::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
}

/* Links */
a {
  color: #003366;
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

/* Skip-link – only visible when focused */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #003366;
  color: #fff;
  padding: 8px 16px;
  z-index: 100;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
}

/* -------------------- Header & banner -------------------- */

.site-header {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  background-color: #f5f5f5;
}

.site-header h1 {
  margin: 0 0 0.5rem;
  font-size: 2.25rem;
  font-weight: 700;
}

/* Full-width banner image */
.banner {
  margin: 0 auto 1rem;
  max-width: 800px; /* keeps the banner in line with content width on very wide screens */
  width: 100%;
}

.banner img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.5rem;
}

/* -------------------- Navigation -------------------- */

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.site-nav a {
  display: block;
  padding: 0.75rem 1.25rem;
  border-radius: 0.25rem;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus {
  background-color: #003366;
  color: #fff;
}

/* -------------------- Section layout -------------------- */

.section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2.5rem 1.5rem;
}

/* Alternate light/grey backgrounds for readability */
.section:nth-of-type(odd) {
  background-color: #fafafa;
}

.section:nth-of-type(even) {
  background-color: #f0f0f0;
}

/* Image and text containers */
.section-image {
  flex: 1 1 45%;
  max-width: 45%;
}

.section-text {
  flex: 1 1 50%;
  max-width: 50%;
}

.section-image img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

.section-text h2 {
  margin-top: 0;
  font-size: 1.75rem;
}

.section-text p {
  margin-bottom: 1rem;
}

/* Image left alignment (desktop) */
.section.image-left .section-image {
  order: 1;
}

.section.image-left .section-text {
  order: 2;
  text-align: left;
}

/* Image right alignment (desktop) */
.section.image-right .section-image {
  order: 2;
}

.section.image-right .section-text {
  order: 1;
  text-align: left;
}

/* Back-to-top link wrapper */
.back-to-top {
  margin-top: 1rem;
}

/* -------------------- About section override -------------------- */
#about {
  justify-content: flex-start; /* align the content to the left edge */
}

#about .section-text {
  text-align: left;
  max-width: 100%; /* optional narrower width for readability */
}

/* -------------------- Contact form -------------------- */

#contact form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 420px;
  width: 100%;
}

#contact label {
  font-weight: 600;
}

#contact input,
#contact textarea {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 0.25rem;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
}

#contact button {
  align-self: flex-start;
  border: none;
  background-color: #003366;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0.25rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#contact button:hover,
#contact button:focus {
  background-color: #00254d;
}

/* -------------------- Footer -------------------- */

.site-footer {
  background-color: #003366;
  color: #fff;
  text-align: center;
  padding: 2rem 1rem;
}

.site-footer .footer-content {
  max-width: 800px;
  margin: 0 auto;
}

.site-footer p {
  margin: 0.25rem 0;
}

.site-footer .footer-contact {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.site-footer .footer-contact .envelope {
  font-size: 1.2rem;
}

.site-footer .footer-contact a {
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
}

/* -------------------- Mobile layout -------------------- */
@media (max-width: 768px) {
  /* Stack everything vertically */
  .section {
    flex-direction: column;
    padding: 1.5rem 1rem;
  }

  /* Always show text first */
  .section .section-text {
    order: 1;
    max-width: 100%;
    text-align: left;
  }

  /* Move every image below its text */
  .section .section-image {
    order: 2;
    max-width: 100%;
    margin-top: 1rem;
  }

  /* Override desktop rules for Hardware & Software section */
  .section.image-left .section-text {
    order: 1;
    text-align: left;
  }
  .section.image-left .section-image {
    order: 2;
  }

  /* Header and navigation tweaks */
  .site-header h1 {
    font-size: 1.75rem;
  }
  .section-text h2 {
    font-size: 1.25rem;
  }
  .site-nav ul {
    flex-direction: column;
    align-items: center;
  }
  .site-nav a {
    padding: 0.5rem 1rem;
  }
  #contact form {
    width: 100%;
  }
}