/* ============================================================
   HEADER SITE
============================================================ */

/* ============================================================
   ICÔNE MÉTÉO — CYCLE PLUIE / SOLEIL / NUAGES
============================================================ */

.weather-icon {
  position: relative;
  width: 56px;
  height: 65px;
  margin-right: 10px;
}

.weather-icon svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: translateX(-2px);
}

/* ===============================
   PHASES (fade in / out)
================================ */

.rain-phase {
  opacity: 0;
  animation: phaseRain var(--weather-cycle) linear infinite;
}

.sun-phase {
  opacity: 0;
  animation: phaseSun var(--weather-cycle) linear infinite;
}

.cloud-phase {
  opacity: 0;
  animation: phaseCloud var(--weather-cycle) linear infinite;
}

@keyframes phaseRain {
  0%   { opacity: 0; }
  3%   { opacity: 1; }
  30%  { opacity: 1; }
  36%  { opacity: 0; }
  100% { opacity: 0; }
}

@keyframes phaseSun {
  0%   { opacity: 0; }
  34%  { opacity: 0; }
  38%  { opacity: 1; }
  62%  { opacity: 1; }
  68%  { opacity: 0; }
  100% { opacity: 0; }
}

@keyframes phaseCloud {
  0%   { opacity: 0; }
  66%  { opacity: 0; }
  70%  { opacity: 1; }
  94%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ===============================
   PLUIE
================================ */

.rain-phase line {
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-dasharray: 0 60;
  stroke-dashoffset: 0;
  opacity: 0;
  animation: rainLine var(--weather-cycle) linear infinite;
}

@keyframes rainLine {
  0% {
    opacity: 0;
    stroke-dasharray: 0 60;
    stroke-dashoffset: 0;
  }
  2%   { opacity: 0; }
  6%   { opacity: 1; }
  10%  { stroke-dasharray: 6 60; }
  16%  { stroke-dasharray: 16 60; }
  22%  { stroke-dashoffset: -70; }
  30%  { opacity: 0; }
  100% {
    opacity: 0;
    stroke-dasharray: 0 60;
    stroke-dashoffset: 0;
  }
}

.rain-phase line:nth-child(1)  { animation-delay: 0s; }
.rain-phase line:nth-child(2)  { animation-delay: 0.4s; }
.rain-phase line:nth-child(3)  { animation-delay: 0.9s; }
.rain-phase line:nth-child(4)  { animation-delay: 0.2s; }
.rain-phase line:nth-child(5)  { animation-delay: 1.2s; }
.rain-phase line:nth-child(6)  { animation-delay: 0.6s; }
.rain-phase line:nth-child(7)  { animation-delay: 1.6s; }
.rain-phase line:nth-child(8)  { animation-delay: 0.1s; }
.rain-phase line:nth-child(9)  { animation-delay: 1.4s; }
.rain-phase line:nth-child(10) { animation-delay: 0.8s; }

/* ===============================
   SOLEIL
================================ */

.sun-phase circle {
  fill: #ffd93b;
}

.sun-rays line {
  stroke: #ffd93b;
  stroke-linecap: round;
  animation: rayThickness 3s ease-in-out infinite;
}

.sun-rays line:nth-child(odd) {
  animation-delay: 0.25s;
}

@keyframes rayThickness {
  0% {
    stroke-width: 1.6;
    opacity: 0.95;
  }
  50% {
    stroke-width: 2.4;
    opacity: 1;
  }
  100% {
    stroke-width: 1.6;
    opacity: 0.95;
  }
}

/* ===============================
   NUAGES
================================ */

.cloud-big {
  fill: rgba(255, 255, 255, 0.85);
  animation: cloudDriftBig var(--weather-cycle) linear infinite;
}

.cloud-small {
  fill: rgba(255, 255, 255, 0.65);
  animation: cloudDriftSmall var(--weather-cycle) linear infinite;
}

.cloud-small-right {
  transform: translateY(-3px);
}

@keyframes cloudDriftBig {
  0%, 66% { transform: translate(-10px, 4px); }
  70%     { transform: translate(-10px, 4px); }
  100%    { transform: translate(10px, 4px); }
}

@keyframes cloudDriftSmall {
  0%, 66% { transform: translate(10px, -4px); }
  70%     { transform: translate(10px, -4px); }
  100%    { transform: translate(-10px, -4px); }
}

/* ============================================================
   STRUCTURE HEADER
============================================================ */

.weather-icon,
.header-center,
.header-right {
  position: relative;
  z-index: 2;
}

.header-image {
  position: absolute;
  top: 15px;
  bottom: 10px;
  left: 360px;
  width: 41%;
  z-index: 1;
  opacity: 0;
  transform: translateY(4px);
  animation: headerImageReveal 3s ease forwards;
  animation-delay: 2s;
}

@keyframes headerImageReveal {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  padding: 15px 7px 10px 12px;
  min-height: 90px;
  isolation: isolate;
}

.header-left {
  display: flex;
  align-items: center;
  padding-right: 18px;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
}

.header-left img {
  display: block;
  margin-right: 20px;
}

.header-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  gap: 10px;
  padding-top: 2px;
}

/* ============================================================
   TITRE SVG — styles neutres, animation pilotée par JS
============================================================ */

.site-title {
  display: flex;
  align-items: center;
  line-height: 1;
  opacity: 1;
  min-height: 24px;
}

.site-title svg {
  width: 260px;
  height: auto;
  display: block;
  overflow: visible;
  filter:
    drop-shadow(0 0 4px rgba(0, 255, 102, 0.6))
    drop-shadow(0 0 10px rgba(0, 255, 102, 0.4));
}

.site-title svg .glyph {
  fill: none;
  stroke: var(--neon-green);
  stroke-width: 0.45;
  stroke-linecap: butt;
  stroke-linejoin: round;
  opacity: 1;
  visibility: hidden;
}

.glyph-fill-path {
  fill: var(--neon-green);
  stroke: none;
}

.fill-rect {
  transform: translateY(0);
}

/* ============================================================
   SOUS-TITRE / DATE
============================================================ */

.site-subtitle {
  font-size: 0.82em;
  font-weight: 400;
  letter-spacing: 0.6px;
  opacity: 0;
  margin: 2px 0;
  margin-top: -1px;
  line-height: 1.1;
  transform: translateY(6px);
  min-height: 16px;
  display: block;
}

.site-date {
  font-size: 0.7em;
  font-weight: 300;
  opacity: 0.9;
  min-height: 14px;
  display: block;
}

#live-clock {
  display: inline-block;
  min-width: 42px;
}
/* ============================================================
   KEYFRAMES UTILISÉES PAR JS / SVG
============================================================ */

@keyframes glyphDrawForward {
  from {
    stroke-dashoffset: var(--glyph-start);
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes glyphDrawBackward {
  from {
    stroke-dashoffset: calc(var(--glyph-start) * -1);
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes fillUp {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-16.4px);
  }
}

@keyframes subtitleFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}