/* =========================================================
   SOCIETE DE REALISATION DE TRAVAUX ELECTRIQUES - Base Styles (base.css)
   Style: modern, adventurous, immersive, dynamic, PL gaming
   ========================================================= */

/* =====================
   Variables
   ===================== */
:root {
  /* Color Palette - Adventure / Ruins Inspired */
  --color-background: #05070c; /* near-black, deep cave */
  --color-surface: #070b12;
  --color-elevated: #0f1622;

  --color-text: #f5f7ff;
  --color-text-muted: #a3afc7;

  --color-primary: #18b0ff; /* energetic cyan */
  --color-primary-soft: rgba(24, 176, 255, 0.1);
  --color-primary-strong: #0f86c0;

  --color-accent-gold: #f0c15b; /* treasure / artifacts */
  --color-accent-gold-soft: rgba(240, 193, 91, 0.12);

  --color-success: #2ecc71;
  --color-warning: #f1c40f;
  --color-danger: #e74c3c;

  --gray-50: #f8fafc;
  --gray-100: #e2e8f0;
  --gray-200: #cbd5f5;
  --gray-300: #94a3b8;
  --gray-400: #64748b;
  --gray-500: #475569;
  --gray-600: #334155;
  --gray-700: #1e293b;
  --gray-800: #0f172a;
  --gray-900: #020617;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  --font-display: "Rajdhani", "Archivo Black", system-ui, sans-serif;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem;  /* 36px */
  --font-size-5xl: 3rem;     /* 48px */

  --line-height-tight: 1.2;
  --line-height-snug: 1.35;
  --line-height-normal: 1.6;

  /* Spacing scale (0–96px) */
  --space-0: 0;
  --space-1: 0.125rem; /* 2px */
  --space-2: 0.25rem;  /* 4px */
  --space-3: 0.375rem; /* 6px */
  --space-4: 0.5rem;   /* 8px */
  --space-5: 0.625rem; /* 10px */
  --space-6: 0.75rem;  /* 12px */
  --space-8: 1rem;     /* 16px */
  --space-10: 1.25rem; /* 20px */
  --space-12: 1.5rem;  /* 24px */
  --space-16: 2rem;    /* 32px */
  --space-20: 2.5rem;  /* 40px */
  --space-24: 3rem;    /* 48px */
  --space-32: 4rem;    /* 64px */
  --space-40: 5rem;    /* 80px */
  --space-48: 6rem;    /* 96px */

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.5);
  --shadow-hard: 0 18px 45px rgba(0, 0, 0, 0.75);
  --shadow-outline: 0 0 0 2px rgba(24, 176, 255, 0.65);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-base: 200ms ease-out;
  --transition-slow: 320ms ease-out;

  /* Layout helpers */
  --max-width-content: 1400px;
  --nav-height: 72px;
}

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

html {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  margin: 0;
}

h1, h2, h3, h4, h5, h6,
ul, ol, li,
figure, figcaption,
blockquote, dl, dd,
p {
  margin: 0;
  padding: 0;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  margin: 0;
  font: inherit;
  color: inherit;
}

button {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
}

body {
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* =====================
   Base Styles
   ===================== */
body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background: radial-gradient(circle at top, #101628 0, #05070c 55%) fixed;
}

main {
  min-height: calc(100vh - var(--nav-height));
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--line-height-tight);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text);
}

h1 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-12);
}

h2 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-10);
}

h3 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-8);
}

h4 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-6);
}

p {
  margin-bottom: var(--space-6);
  color: var(--color-text-muted);
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 600;
  color: var(--color-text);
}

em {
  font-style: italic;
}

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

a:hover,
a:focus-visible {
  color: var(--color-accent-gold);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
}

hr {
  border: none;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  margin: var(--space-16) 0;
}

/* =====================
   Accessibility & Motion
   ===================== */
:focus-visible {
  outline: none;
  box-shadow: var(--shadow-outline);
}

/* Ensure focus rings for custom interactive elements */
[tabindex]:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--shadow-outline);
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =====================
   Utilities
   ===================== */

/* Layout: Container */
.container {
  width: 100%;
  max-width: var(--max-width-content);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-8);
  padding-right: var(--space-8);
}

@media (min-width: 1024px) {
  .container {
    padding-left: var(--space-12);
    padding-right: var(--space-12);
  }
}

/* Flex Helpers */
.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.flex-row {
  flex-direction: row;
}

.flex-column {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

.gap-xs {
  gap: var(--space-4);
}

.gap-sm {
  gap: var(--space-6);
}

.gap-md {
  gap: var(--space-8);
}

.gap-lg {
  gap: var(--space-12);
}

/* Grid Helpers */
.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-10);
}

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

@media (max-width: 768px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Spacing utilities (Y-axis) */
.section {
  padding-top: var(--space-24);
  padding-bottom: var(--space-24);
}

.section--tight {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

.section--wide {
  padding-top: var(--space-32);
  padding-bottom: var(--space-32);
}

.mt-0 { margin-top: 0; }
.mt-xs { margin-top: var(--space-4); }
.mt-sm { margin-top: var(--space-8); }
.mt-md { margin-top: var(--space-12); }
.mt-lg { margin-top: var(--space-16); }
.mt-xl { margin-top: var(--space-24); }

.mb-0 { margin-bottom: 0; }
.mb-xs { margin-bottom: var(--space-4); }
.mb-sm { margin-bottom: var(--space-8); }
.mb-md { margin-bottom: var(--space-12); }
.mb-lg { margin-bottom: var(--space-16); }
.mb-xl { margin-bottom: var(--space-24); }

.text-center {
  text-align: center;
}

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

.text-muted {
  color: var(--color-text-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(15, 118, 110, 0.16);
  color: var(--color-text-muted);
}

.badge--primary {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.badge--gold {
  background: var(--color-accent-gold-soft);
  color: var(--color-accent-gold);
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =====================
   Components
   ===================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-size: var(--font-size-sm);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  background: linear-gradient(135deg, #1d4ed8, #18b0ff);
  color: #f9fafb;
  box-shadow: 0 12px 25px rgba(15, 118, 255, 0.45);
  transition:
    background var(--transition-base),
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #0f172a, #18b0ff);
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.6);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.9);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn--ghost {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.4);
  color: var(--color-text-muted);
  box-shadow: none;
}

.btn--ghost:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: var(--color-primary);
  color: var(--color-text);
}

.btn--outline {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.7);
  color: var(--color-text);
  box-shadow: none;
}

.btn--outline:hover {
  border-color: var(--color-primary);
  background: rgba(15, 23, 42, 0.85);
}

/* Prominent CTA - Google Play */
.btn--primary-cta {
  background: linear-gradient(120deg, #22c55e, #16a34a);
  box-shadow: 0 16px 40px rgba(22, 163, 74, 0.65);
}

.btn--primary-cta:hover {
  background: linear-gradient(120deg, #15803d, #22c55e);
  box-shadow: 0 18px 46px rgba(21, 128, 61, 0.8);
}

.btn--icon-left svg,
.btn--icon-right svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* Inputs & Forms */
.input,
textarea,
select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.9);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    background var(--transition-base);
}

.input::placeholder,
textarea::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

.input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-outline);
  outline: none;
}

.input--error {
  border-color: var(--color-danger);
}

.label {
  display: block;
  margin-bottom: var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--gray-100);
}

.form-helper {
  margin-top: var(--space-4);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.form-helper--error {
  color: var(--color-danger);
}

/* Card */
.card {
  position: relative;
  background: radial-gradient(circle at top left, rgba(24, 176, 255, 0.18), transparent 55%),
              radial-gradient(circle at bottom right, rgba(240, 193, 91, 0.18), transparent 55%),
              rgba(15, 23, 42, 0.95);
  border-radius: var(--radius-lg);
  padding: var(--space-16);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px);
}

.card--flat {
  box-shadow: none;
  backdrop-filter: none;
}

.card__header {
  margin-bottom: var(--space-8);
}

.card__title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-4);
}

.card__meta {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

.card__body {
  font-size: var(--font-size-sm);
}

/* Visual Placeholder for gameplay scenes, etc. */
.visual-placeholder {
  position: relative;
  width: 100%;
  min-height: 220px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(148, 163, 184, 0.5);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.98)),
    radial-gradient(circle at 20% 0%, rgba(56, 189, 248, 0.35), transparent 55%),
    radial-gradient(circle at 80% 100%, rgba(240, 193, 91, 0.32), transparent 55%);
  overflow: hidden;
}


/* Hero / immersive section helpers */
.hero {
  position: relative;
  padding-top: calc(var(--space-32) + var(--nav-height));
  padding-bottom: var(--space-32);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.35), transparent 55%),
              radial-gradient(circle at 100% 100%, rgba(240, 193, 91, 0.4), transparent 55%);
  opacity: 0.35;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
}

/* Tagline / section label */
.section-label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-accent-gold);
  margin-bottom: var(--space-4);
}

/* Navigation (generic skeleton) */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-height);
  backdrop-filter: blur(18px);
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.82));
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.navbar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar__brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.navbar__brand span:nth-child(2) {
  color: var(--color-accent-gold);
}

.navbar__nav {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.navbar__link {
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-text-muted);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition:
    color var(--transition-base),
    border-color var(--transition-base);
}

.navbar__link--active,
.navbar__link:hover {
  color: var(--color-text);
  border-color: var(--color-primary);
}

/* Responsive nav hint */
@media (max-width: 900px) {
  .navbar__nav {
    display: none; /* can be replaced by JS-driven mobile menu */
  }
}

/* Pills for filters (e.g., guides, categories) */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.pill {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: var(--color-text-muted);
  background: rgba(15, 23, 42, 0.85);
  cursor: pointer;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast),
    color var(--transition-fast);
}

.pill--active,
.pill:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  color: var(--color-text);
}

/* Simple tag-like label for difficulty / type */
.tag-difficulty {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.tag-difficulty--easy {
  border-color: rgba(34, 197, 94, 0.7);
  color: #bbf7d0;
}

.tag-difficulty--normal {
  border-color: rgba(59, 130, 246, 0.7);
  color: #bfdbfe;
}

.tag-difficulty--hard {
  border-color: rgba(239, 68, 68, 0.7);
  color: #fecaca;
}

/* Footnotes / meta info */
.meta-info {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* Callout blocks for tips / warnings */
.callout {
  border-radius: var(--radius-md);
  padding: var(--space-8);
  border-left: 3px solid var(--color-primary);
  background: rgba(15, 23, 42, 0.85);
  font-size: var(--font-size-sm);
}

.callout--warning {
  border-left-color: var(--color-warning);
}

.callout--danger {
  border-left-color: var(--color-danger);
}

/* FAQ details */
.faq-item {
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.95);
  padding: var(--space-8) var(--space-10);
}

.faq-item + .faq-item {
  margin-top: var(--space-6);
}

.faq-item__question {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-4);
}

.faq-item__answer {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* Blog list item */
.post-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.post-preview__title {
  font-size: var(--font-size-xl);
}

.post-preview__excerpt {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.post-preview__meta {
  font-size: var(--font-size-xs);
  color: var(--gray-300);
}
