/*
 * Helian Consulting – Template styles
 *
 * This stylesheet defines the visual appearance for the Helian Consulting
 * website template. Colours and typography are extracted from the
 * corporate branding guidelines provided in the brief. All elements are
 * structured to support a 12‑column responsive grid and respect
 * accessibility guidelines (high contrast, visible focus states, etc.).
 */

/* CSS custom properties for colours, fonts and spacing */
:root {
  /* Primary blues extracted from the logo (approximated) */
  --primary-900: #0c2957; /* deepest blue – used for headings and backgrounds */
  --primary-700: #123e85;
  --primary-500: #1a5ab2;
  --primary-300: #4986d8;
  --primary-100: #eaf2fb; /* lightest blue for subtle backgrounds */
  /* Accent colour for interactive states */
  --accent: #4da6ff;
  /* Greyscale palette */
  --gray-900: #1f1f1f; /* anthracite for body text */
  --gray-700: #3d3d3d;
  --gray-500: #6f6f6f;
  --gray-300: #c4c4c4;
  --gray-100: #f9f9f9;
  /* Typography */
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Roboto', sans-serif;
  /* Spacing scale */
  --space-xxs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--gray-900);
  background-color: var(--gray-100);
}

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

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

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

button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

/* Typography scale */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  margin: 0 0 var(--space-sm) 0;
  line-height: 1.2;
  color: var(--primary-900);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin: 0 0 var(--space-md) 0; }

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

section {
  padding: var(--space-xl) 0;
}

/* Header and navigation */
header {
  position: sticky;
  top: 0;
  width: 100%;
  background-color: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  z-index: 1000;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
}

.logo {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--primary-900);
}

nav {
  display: flex;
  align-items: center;
}

nav ul {
  display: flex;
  gap: var(--space-md);
}

nav li a {
  padding: var(--space-xs) var(--space-sm);
  border-radius: 4px;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
  font-weight: 500;
}

nav li a:hover,
nav li a:focus {
  background-color: var(--primary-100);
  color: var(--primary-900);
}

.cta-btn {
  padding: var(--space-xs) var(--space-md);
  background-color: var(--primary-500);
  color: #ffffff;
  border-radius: 4px;
  font-weight: 600;
  transition: background-color 0.2s ease-in-out;
}

.cta-btn:hover,
.cta-btn:focus {
  background-color: var(--primary-700);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 24px;
  height: 24px;
  margin-left: var(--space-md);
}

.menu-toggle span {
  width: 100%;
  height: 2px;
  background-color: var(--primary-900);
  display: block;
  transition: transform 0.3s ease;
}

/* Hero section */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
  /* Default hero background: overlay a gradient on a decorative image.  The gradient
     ensures text remains readable over the image. Individual pages can override
     this image with an inline style. */
  background-image: linear-gradient(to bottom, var(--primary-100), #ffffff), url('../img/hero.png');
  background-size: cover;
  background-position: center;
  color: var(--primary-900);
  position: relative;
  overflow: hidden;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: var(--space-sm);
}

.hero p {
  font-size: 1.25rem;
  max-width: 640px;
  margin: 0 auto var(--space-md);
  color: var(--gray-700);
}

.hero .btn {
  padding: var(--space-sm) var(--space-lg);
  background-color: var(--primary-500);
  color: #fff;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color 0.25s ease-in-out;
}

.hero .btn:hover,
.hero .btn:focus {
  background-color: var(--primary-700);
}

/* Cards section */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-lg);
}

.card {
  background-color: #ffffff;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  padding: var(--space-lg);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.05);
}

.card-icon {
  font-size: 2rem;
  color: var(--primary-500);
  margin-bottom: var(--space-sm);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--primary-900);
}

.card-text {
  font-size: 0.95rem;
  color: var(--gray-700);
}

/* Sectors grid */
.sectors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
}

.sector-item {
  background-color: #ffffff;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  padding: var(--space-md);
  text-align: center;
  transition: box-shadow 0.2s ease;
}

.sector-item:hover,
.sector-item:focus-within {
  box-shadow: 0 6px 12px rgba(0,0,0,0.05);
}

.sector-item .icon {
  font-size: 2rem;
  color: var(--primary-500);
  margin-bottom: var(--space-xs);
}

/* When a sector item uses an image instead of an icon font, ensure it is sized consistently */
.sector-item .icon img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: var(--space-xs);
}

.sector-item h3 {
  font-size: 1rem;
  margin-bottom: var(--space-xs);
  color: var(--primary-900);
}

.sector-item p {
  font-size: 0.85rem;
  color: var(--gray-700);
}

/* Reference carousel */
.references-section {
  background-color: var(--primary-100);
}

.swiper {
  padding: var(--space-lg) 0;
}

.swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
}

.client-logo {
  max-height: 60px;
  max-width: 120px;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.client-logo:hover,
.client-logo:focus {
  opacity: 1;
}

/* CTA band */
.cta-band {
  background-color: var(--primary-500);
  color: #ffffff;
  padding: var(--space-lg) 0;
  text-align: center;
}

.cta-band h2 {
  color: #ffffff;
  margin-bottom: var(--space-md);
}

.cta-band .btn-inverse {
  background-color: #ffffff;
  color: var(--primary-500);
  padding: var(--space-sm) var(--space-md);
  border-radius: 4px;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.cta-band .btn-inverse:hover,
.cta-band .btn-inverse:focus {
  background-color: var(--primary-100);
  color: var(--primary-700);
}

/* Footer */
footer {
  background-color: var(--primary-900);
  color: #ffffff;
  padding: var(--space-lg) 0;
}

footer .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
}

footer h4 {
  margin-bottom: var(--space-sm);
  font-size: 1.125rem;
  color: #ffffff;
}

footer a {
  color: #ffffff;
  opacity: 0.9;
  font-size: 0.9rem;
  display: block;
  margin-bottom: var(--space-xs);
  transition: opacity 0.2s ease;
}

footer a:hover,
footer a:focus {
  opacity: 1;
  text-decoration: underline;
}

.footer-bottom {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: 0.8rem;
  opacity: 0.8;
}

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--gray-300);
  margin-bottom: var(--space-lg);
}

.tab {
  padding: var(--space-sm) var(--space-md);
  margin-right: var(--space-sm);
  border: 1px solid var(--gray-300);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  background-color: #fdfdfd;
  font-weight: 500;
}

.tab.active {
  background-color: var(--primary-100);
  border-color: var(--primary-300);
  color: var(--primary-900);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Accordion */
.accordion {
  border: 1px solid var(--gray-300);
  border-radius: 4px;
}

.accordion-item + .accordion-item {
  border-top: 1px solid var(--gray-300);
}

.accordion-header {
  padding: var(--space-sm);
  background-color: #ffffff;
  cursor: pointer;
  font-weight: 600;
  position: relative;
}

.accordion-header::after {
  content: '+';
  position: absolute;
  right: var(--space-sm);
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
}

.accordion-header.active::after {
  content: '−';
}

.accordion-content {
  display: none;
  padding: var(--space-sm);
  background-color: var(--primary-100);
  font-size: 0.95rem;
}

.accordion-content.active {
  display: block;
}

/* Counters */
.counters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.counter {
  text-align: center;
}

.counter-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-500);
  margin-bottom: var(--space-xs);
}

.counter-label {
  font-size: 0.9rem;
  color: var(--gray-700);
}

/* Timeline */
.timeline {
  position: relative;
  margin: var(--space-lg) 0;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--primary-300);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-lg);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -9px;
  top: 0.25rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--primary-500);
}

.timeline-content {
  padding: var(--space-sm) var(--space-md);
  background-color: #ffffff;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

/* Accessibility helper classes */
.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
  clip-path: inset(50%);
  border: 0;
}

/* Responsive layout adjustments */
@media (max-width: 768px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.25rem; }
  .hero { min-height: 60vh; }
  nav ul {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #ffffff;
    flex-direction: column;
    gap: 0;
    width: 200px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    padding: var(--space-sm) 0;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
  }
  nav ul.open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  nav li a {
    display: block;
    padding: var(--space-sm) var(--space-md);
  }
  .menu-toggle {
    display: flex;
  }
  .cta-btn {
    display: none;
  }
}