/*
 * MMC Property Management website stylesheet
 *
 * This stylesheet implements a mobile‑first, responsive design. The layout uses
 * flexbox and grid to organize content for small screens, and media queries
 * progressively enhance the experience on larger viewports. Colour palette
 * draws inspiration from the archived site while remaining clean and modern.
 */

/* Reset basic elements */
/* CSS variables for consistent colour palette derived from the MMC logo */
:root {
  --primary-color: #007E3A; /* dark green from logo */
  --secondary-color: #F2C230; /* golden yellow accent from logo */
  --text-color: #333;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #f9f9f9;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: var(--secondary-color);
}

header {
  background-color: var(--primary-color);
  color: #fff;
  padding: 1rem;
  position: relative;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo styling */
header img.logo {
  /* Display the logo symbol at a fixed height, preserving aspect ratio. */
  height: 40px;
  width: auto;
  object-fit: contain;
  margin-right: 0.5rem;
}

header h1 {
  font-size: 1.2rem;
  letter-spacing: 1px;
}

/* Navigation styles */
nav {
  position: relative;
}

nav > ul {
  list-style: none;
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  background-color: var(--primary-color);
  position: absolute;
  right: 0;
  top: 100%;
  width: 200px;
  padding: 1rem;
  border-radius: 0 0 4px 4px;
}

nav > ul li {
  margin: 0;
}

nav > ul li a {
  color: #fff;
  padding: 0.3rem 0.5rem;
  display: block;
}

nav button {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Show menu when toggled */
nav.open > ul {
  display: flex;
}

/* Desktop navigation */
@media (min-width: 768px) {
  nav > ul {
    position: static;
    display: flex !important;
    flex-direction: row;
    gap: 1.5rem;
    background: none;
    width: auto;
    padding: 0;
  }
  nav button {
    display: none;
  }

/* Dropdown submenu styles */
nav .dropdown {
  position: relative;
}

nav .dropdown > ul {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}

/* Dropdown opens when the `.open` class is applied (set via JavaScript click) */
nav .dropdown.open > ul {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--primary-color);
  border-radius: 0 0 4px 4px;
  z-index: 1000;
}

nav .dropdown > ul li a {
  color: #fff;
  padding: 0.3rem 0.5rem;
  display: block;
}

nav .dropdown > ul li a:hover {
  background-color: var(--secondary-color);
  color: #333;
}

/* Show dropdown submenus in mobile menu only when open */
nav.open .dropdown.open > ul {
  display: block;
  position: static;
  background: none;
  margin-left: 1rem;
}

/* Slider navigation buttons */
.hero .slider-nav {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 1rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.hero .slider-nav button {
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #fff;
  font-size: 2rem;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.3s ease;
}

.hero .slider-nav button:hover {
  background: rgba(0, 0, 0, 0.8);
}
}

/* Hero section */
.hero {
  position: relative;
  width: 100%;
  height: 50vh;
  overflow: hidden;
}

.hero .slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease;
}

.hero .slide.active {
  opacity: 1;
}

.hero .caption {
  position: absolute;
  bottom: 10%;
  left: 5%;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  max-width: 80%;
}

/* Section styles */
section {
  padding: 2rem 1rem;
}

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

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

h3 {
  font-size: 1.2rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

p {
  margin-bottom: 1rem;
}

/* Cards for services and facilities */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.card {
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-content {
  padding: 1rem;
  flex-grow: 1;
}

.card-content h3 {
  margin-top: 0;
}

.card-content p {
  flex-grow: 1;
}

/* Links inside card content inherit the primary colour */
.card-content a {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--primary-color);
  font-weight: bold;
}

@media (min-width: 576px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Footer */
footer {
  background-color: var(--primary-color);
  color: #fff;
  padding: 2rem 1rem;
}

footer .footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

footer h4 {
  margin-bottom: 0.5rem;
  color: #fff;
}

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

footer ul li a {
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.8;
  transition: color 0.3s ease;
}

footer ul li a:hover {
  color: var(--secondary-color);
}

footer p {
  font-size: 0.9rem;
  line-height: 1.6;
}

@media (min-width: 768px) {
  footer .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}