/* ============================================================
   LAYOUT.CSS — Containers, grids, sections, header, footer
   ============================================================ */

/* ---------- Page wrapper ---------- */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* ---------- Container ---------- */
.container {
  width: 92%;
  max-width: 1200px;
  margin: 0 auto;
}

.container--narrow {
  width: 92%;
  max-width: 780px;
  margin: 0 auto;
}

/* ---------- Section ---------- */
.section {
  padding: var(--space-7) 0;
}

.section--sm {
  padding: var(--space-5) 0;
}

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

.section--teal {
  background: var(--teal-light);
}

.section--gradient {
  background: var(--grad-main);
  color: var(--text-white);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.section-header h2 {
  margin-bottom: var(--space-2);
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.section-tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--teal-primary);
  background: var(--teal-light);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-2);
}

.section--gradient .section-tag {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* ---------- Grids ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 2px 16px rgba(47,127,136,0.07);
  transition: box-shadow var(--transition);
  min-height: 10vh;
}

.site-header.scrolled {
  box-shadow: 0 4px 24px rgba(47,127,136,0.13);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: var(--space-3);
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--teal-deep);
  white-space: nowrap;
  flex-shrink: 0;
}

.site-logo img {
  height: 44px;
  width: auto;
}

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.site-nav a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-body);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  transition: color var(--transition), background var(--transition);
  position: relative;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--teal-primary);
  background: var(--teal-light);
}

.site-nav a.nav-cta {
  background: var(--grad-main);
  color: #fff;
  padding: 9px 20px;
  border-radius: var(--radius-full);
}

.site-nav a.nav-cta:hover {
  opacity: 0.88;
  background: var(--grad-main);
  color: #fff;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: var(--radius-sm);
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--teal-deep);
  border-radius: 2px;
  transition: var(--transition);
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-white);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-5);
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--text-dark);
  padding: var(--space-2);
  transition: color var(--transition);
}

.mobile-nav a:hover { color: var(--teal-primary); }

.mobile-nav-close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 2rem;
  color: var(--text-muted);
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--text-dark);
  color: rgba(255,255,255,0.75);
  padding: var(--space-6) 0 var(--space-3);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.footer-brand .site-logo {
  color: #fff;
  margin-bottom: var(--space-2);
}

.footer-brand p {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  line-height: 1.7;
}

.footer-col h4 {
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col ul li a {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer-col ul li a:hover { color: var(--teal-primary); }

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.65);
}

.footer-contact-item svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-3);
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
}

/* ---------- Responsive layout ---------- */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
  }
}

@media (max-width: 768px) {
  .section { padding: var(--space-5) 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }

  .site-nav { display: none; }
  .nav-toggle { display: flex; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
}
