/* ==========================================================================
   ADEX Investment Bank — Responsive Stylesheet
   Mobile-first approach with breakpoints at 768px, 1024px, 1440px
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. BASE (Mobile First — 0 to 767px)
   -------------------------------------------------------------------------- */

/* Typography scaling */
html {
  font-size: 15px;
}

h1, .hero__title, .page-hero__title {
  font-size: var(--fs-2xl);
}

h2, .section-title, .cta__title {
  font-size: var(--fs-xl);
}

h3 {
  font-size: var(--fs-lg);
}

h4 {
  font-size: var(--fs-md);
}

/* Layout */
.section {
  padding: var(--space-3xl) 0;
}

.container {
  padding: 0 var(--space-md);
}

.container-px {
  --container-px: var(--space-md);
}

/* Grid: everything stacks */
.grid--2,
.grid--3,
.grid--4 {
  grid-template-columns: 1fr;
}

/* Form rows stack */
.form-row {
  grid-template-columns: 1fr;
}

/* Header */
.header {
  height: 64px;
}

:root {
  --header-h: 64px;
}

.header__nav {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background-color: var(--color-navy);
  flex-direction: column;
  justify-content: center;
  gap: var(--space-2xl);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
  z-index: var(--z-overlay);
}

.header__nav.open {
  opacity: 1;
  visibility: visible;
}

.header__nav-links {
  flex-direction: column;
  gap: var(--space-xl);
  text-align: center;
}

.header__nav-link {
  font-size: var(--fs-xl);
}

.header__lang {
  order: 2;
}

.header__lang-btn {
  font-size: var(--fs-md);
}

.header__lang-dropdown {
  position: static;
  opacity: 1;
  visibility: visible;
  transform: none;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
  text-align: center;
  min-width: auto;
  border-radius: 0;
  margin-top: var(--space-md);
}

.header__lang-dropdown:not(.open) {
  display: none;
}

.header__lang-option {
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  padding: var(--space-sm) var(--space-lg);
}

.header__lang-option:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

/* Show hamburger */
.hamburger {
  display: flex;
}

/* Hero */
.hero {
  min-height: 100svh;
  padding: calc(var(--header-h) + var(--space-2xl)) var(--space-md) var(--space-2xl);
}

.hero__content {
  max-width: 100%;
}

.hero__label {
  font-size: var(--fs-xs);
}

.hero__title {
  font-size: var(--fs-2xl);
  line-height: 1.15;
}

.hero__subtitle {
  font-size: var(--fs-base);
}

.hero__cta {
  flex-direction: column;
  align-items: stretch;
}

.hero__cta .btn {
  width: 100%;
  text-align: center;
  justify-content: center;
}

.hero__scroll-indicator {
  display: none;
}

/* Stats */
.stats__grid {
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.stat__number {
  font-size: var(--fs-2xl);
}

/* Cards */
.card {
  padding: var(--space-xl);
}

.service-card {
  padding: var(--space-xl);
}

/* Portfolio */
.portfolio-item {
  grid-template-columns: 1fr;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
}

.portfolio-item__value {
  text-align: left;
}

/* CTA */
.cta {
  padding: var(--space-3xl) 0;
}

/* Footer */
.footer__grid {
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
}

.footer__brand {
  max-width: 100%;
}

.footer__bottom {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-lg);
}

.footer__bottom-links {
  flex-wrap: wrap;
  gap: var(--space-md);
}

/* Cookie consent */
.cookie-consent__inner {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-lg);
}

.cookie-consent__actions {
  flex-direction: column;
  width: 100%;
}

.cookie-consent__actions .btn {
  width: 100%;
  text-align: center;
  justify-content: center;
}

/* Page hero */
.page-hero {
  padding: calc(var(--header-h) + var(--space-3xl)) var(--space-md) var(--space-2xl);
}

/* Team card */
.team-card {
  padding: var(--space-lg);
}

/* Breadcrumbs */
.breadcrumbs {
  justify-content: flex-start;
  flex-wrap: wrap;
}

/* Value items */
.value-item {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
}


/* --------------------------------------------------------------------------
   1. TABLET (768px and up)
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  html {
    font-size: 16px;
  }

  h1, .hero__title, .page-hero__title {
    font-size: var(--fs-3xl);
  }

  h2, .section-title, .cta__title {
    font-size: var(--fs-2xl);
  }

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

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

  /* Grids */
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Form rows */
  .form-row {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Hero */
  .hero {
    padding: calc(var(--header-h) + var(--space-3xl)) var(--space-xl) var(--space-3xl);
  }

  .hero__title {
    font-size: var(--fs-3xl);
  }

  .hero__cta {
    flex-direction: row;
    justify-content: center;
  }

  .hero__cta .btn {
    width: auto;
  }

  .hero__scroll-indicator {
    display: flex;
  }

  /* Stats */
  .stat__number {
    font-size: var(--fs-3xl);
  }

  /* Cards */
  .card {
    padding: var(--space-2xl);
  }

  /* Portfolio */
  .portfolio-item {
    grid-template-columns: 1fr auto;
    gap: var(--space-xl);
  }

  .portfolio-item__value {
    text-align: right;
  }

  /* Footer */
  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__bottom {
    flex-direction: row;
    justify-content: space-between;
  }

  /* Cookie consent */
  .cookie-consent__inner {
    flex-direction: row;
    align-items: center;
  }

  .cookie-consent__actions {
    flex-direction: row;
    width: auto;
  }

  .cookie-consent__actions .btn {
    width: auto;
  }

  /* Page hero */
  .page-hero {
    padding: calc(var(--header-h) + var(--space-4xl)) var(--space-xl) var(--space-2xl);
  }

  /* Breadcrumbs */
  .breadcrumbs {
    justify-content: center;
  }

  /* Value items */
  .value-item {
    flex-direction: row;
    align-items: flex-start;
  }
}


/* --------------------------------------------------------------------------
   2. DESKTOP (1024px and up)
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  html {
    font-size: 16px;
  }

  h1, .hero__title, .page-hero__title {
    font-size: var(--fs-4xl);
  }

  h2, .section-title, .cta__title {
    font-size: var(--fs-3xl);
  }

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

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

  /* Header: desktop nav visible */
  .header {
    height: 80px;
  }

  :root {
    --header-h: 80px;
  }

  .header__nav {
    position: static;
    width: auto;
    height: auto;
    background-color: transparent;
    flex-direction: row;
    justify-content: flex-end;
    gap: var(--space-xl);
    opacity: 1;
    visibility: visible;
  }

  .header__nav-links {
    flex-direction: row;
    gap: var(--space-lg);
  }

  .header__nav-link {
    font-size: var(--fs-sm);
  }

  .header__lang {
    order: 0;
  }

  .header__lang-btn {
    font-size: var(--fs-sm);
  }

  .header__lang-dropdown {
    position: absolute;
    top: calc(100% + var(--space-sm));
    right: 0;
    min-width: 160px;
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
    z-index: var(--z-dropdown);
    text-align: left;
  }

  .header__lang-dropdown:not(.open) {
    display: block;
  }

  .header__lang-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .header__lang-option {
    color: var(--color-dark);
    text-align: left;
    padding: var(--space-sm) var(--space-md);
  }

  .header__lang-option:hover {
    background-color: var(--color-light);
  }

  /* Hide hamburger */
  .hamburger {
    display: none;
  }

  /* Grids */
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Hero */
  .hero__title {
    font-size: var(--fs-4xl);
  }

  .hero__subtitle {
    font-size: var(--fs-lg);
  }

  /* Stats */
  .stats__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Footer */
  .footer__grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }

  .footer__brand {
    max-width: 320px;
  }
}


/* --------------------------------------------------------------------------
   3. WIDE (1440px and up)
   -------------------------------------------------------------------------- */
@media (min-width: 1440px) {
  html {
    font-size: 16px;
  }

  .container {
    max-width: var(--max-width-lg);
    padding: 0 var(--space-2xl);
  }

  h1, .hero__title, .page-hero__title {
    font-size: var(--fs-5xl);
  }

  .hero__title {
    font-size: var(--fs-5xl);
  }

  .hero__content {
    max-width: 900px;
  }

  .section-subtitle {
    max-width: 720px;
  }
}


/* --------------------------------------------------------------------------
   4. RTL RESPONSIVE ADJUSTMENTS
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  [dir="rtl"] .header__nav {
    flex-direction: column;
  }

  [dir="rtl"] .header__nav-links {
    flex-direction: column;
    text-align: center;
  }

  [dir="rtl"] .cookie-consent__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  [dir="rtl"] .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* --------------------------------------------------------------------------
   5. ACCESSIBILITY — RESPONSIVE
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  .high-contrast .header__nav-link {
    font-size: var(--fs-sm);
  }
}

/* Large touch targets on mobile for accessibility */
@media (max-width: 767px) {
  .header__nav-link {
    padding: var(--space-sm);
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .footer__link {
    padding: var(--space-xs) 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}


/* --------------------------------------------------------------------------
   6. SPECIFIC MOBILE OVERRIDES
   -------------------------------------------------------------------------- */

/* Small screens: ensure minimum touch target sizes */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .hero {
    min-height: 90svh;
  }

  .hero__title {
    font-size: var(--fs-2xl);
  }

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

  .stat {
    padding: var(--space-md);
  }

  .stat__number {
    font-size: var(--fs-xl);
  }

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

  .page-hero__title {
    font-size: var(--fs-xl);
  }

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

  .cookie-consent__text {
    font-size: var(--fs-xs);
  }
}


/* --------------------------------------------------------------------------
   7. LANDSCAPE / SHORT VIEWPORTS
   -------------------------------------------------------------------------- */
@media (max-height: 600px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: calc(var(--header-h) + var(--space-2xl)) 0 var(--space-2xl);
  }

  .hero__scroll-indicator {
    display: none;
  }
}
