/**
 * Global Base CSS
 * Shared typography, spacing, and responsive foundation for the site.
 * Load this file first on all pages.
 */

@import url('typography.css');

/* ===== CSS Variables (colors, spacing, hero – typography in typography.css) ===== */
:root {
  /* Colors */
  --color-primary: #A42E30;
  --color-primary-dark: #950101;
  --color-text: #333;
  --color-text-muted: #515151;
  --color-text-light: #717171;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Page hero standard */
  --hero-min-height: clamp(280px, 55vh, 380px);
  --hero-height: clamp(280px, 55vh, 380px);
  --hero-padding: clamp(2rem, 6vw, 3.5rem) clamp(1rem, 4vw, 2rem);
  --hero-max-width: 1280px;
  --hero-title-size: var(--h1-size);
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  color: var(--color-text);
  overflow-x: hidden;
}

/* ===== Typography spacing (sizes from typography.css) ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  margin: 0 0 var(--space-md);
}

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

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

/* ===== Image defaults - prevent distortion and overflow ===== */
img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Images in containers - use object-fit for aspect ratio preservation */
.img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-contain {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ===== Responsive container ===== */
.container-base {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

@media (max-width: 768px) {
  .container-base {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
}

@media (max-width: 480px) {
  .container-base {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }
}

/* ===== Page hero standard (match digitalmagazines – height, padding, alignment) ===== */
.block-main,
.blog-hero,
.magazine-hero,
.partners-hero,
.voyages-page-hero,
.voyage-mesure-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: var(--hero-min-height);
  height: var(--hero-height);
  padding: var(--hero-padding);
  margin: 0 auto;
  max-width: var(--hero-max-width);
  width: 100%;
  box-sizing: border-box;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.block-main h1,
.blog-hero__title,
.magazine-hero__title,
.partners-hero h1,
.voyages-page-hero h1,
.voyage-mesure-hero__title {
  font-size: var(--h1-size);
  line-height: var(--line-height-heading);
  margin: 0;
  z-index: 2;
  position: relative;
}

@media (max-width: 1024px) {
  .block-main,
  .blog-hero,
  .magazine-hero,
  .partners-hero,
  .voyages-page-hero,
  .voyage-mesure-hero {
    min-height: 240px;
    height: 240px;
  }
}

@media (max-width: 768px) {
  .block-main,
  .blog-hero,
  .magazine-hero,
  .partners-hero,
  .voyages-page-hero,
  .voyage-mesure-hero {
    min-height: 200px;
    height: 200px;
    padding: 2rem 1rem;
  }
}

@media (max-width: 480px) {
  .block-main,
  .blog-hero,
  .magazine-hero,
  .partners-hero,
  .voyages-page-hero,
  .voyage-mesure-hero {
    min-height: 180px;
    height: 180px;
    padding: 1.5rem 1rem;
  }
}
