/* ==================================================
   style.css (STYLES BUREAU / DESKTOP – écrans > 768px)
   ================================================== */

/* 🎨 Réinitialisation de base (desktop) */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, sans-serif;
  background-color: #fff;
  color: #333;
}

/* 🎯 Header */
.header {
  width: 100%;
  height: 55px !important;
  background: url('../img/panorama_header.png') center center no-repeat;
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  box-sizing: border-box;
  position: relative;
  z-index: 20;
}

.header-inner {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 🧭 Navigation */
.main-nav {
  display: flex;
  gap: 10px;
  background: rgba(0, 0, 0, 0.25);          /* noir transparent */
  backdrop-filter: blur(8px);               /* effet flou (glass) */
  -webkit-backdrop-filter: blur(8px);
  padding: 5px 5px;
  border-radius: 8px;
  align-items: center;
}

.main-nav a {
  text-decoration: none;
  color: #fff;
  font-weight: bold;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.main-nav a:hover {
  background: rgba(0, 0, 0, 0.6);
  color: #66FF99;
  transform: scale(1.1);
}

.main-nav a.active {
  color: #3fa;
  border-bottom: 2px solid #66FF99;
}

/* 🎥 Panorama (desktop) */
#panorama {
  width: 100%;
  height: 100%;
}

/* Contenu générique (ne pas mettre de background ici pour les pages pano) */
.page-content {
  padding: 20px;
  text-align: center;
}

/* ── Logo home (cliquable + zone exacte + zoom desktop) ─────────────────── */
.index-page .logo-link{
  display: inline-flex;      /* zone = contenu */
  justify-content: center;
  align-items: center;
  margin: 10px auto 10px;    /* centrage du lien */
  line-height: 0;            /* évite zone fantôme */
}

.index-page .logo{
  width: clamp(80px, 14vw, 220px);
  height: auto;
  display: block;
  margin: 0;                 /* IMPORTANT: pas de margin auto ici */
  position: relative;
  z-index: 10;

  transform-origin: center;
  transition: transform 220ms ease, filter 220ms ease;
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  .index-page .logo-link:hover .logo{
    transform: scale(1.06);
  }
}

/* ⚓ Footer */
.footer {
  background-color: #333;
  color: #fff;
  padding: 10px;
  text-align: center;
  height: 40px;
}

.panorama-contact {
  background-image: url('../img/panorama_contact.png');
  background-size: cover;
  background-position: center;
  height: 400px;
  position: relative;
}

/* ────────────────────────────────────────────────────────────────────────── */
/*  STRUCTURE FLEXBOX POUR LA PAGE ENTIÈRE (Desktop)                        */
/* ────────────────────────────────────────────────────────────────────────── */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Conteneur panoramique générique (home) */
.panorama-container {
  position: relative;
  flex: 1 0 auto;
  width: 100%;
  height: calc(100vh - 160px - 68px);
  overflow: hidden;
}

#panorama {
  width: 100%;
  height: 100%;
}

/* ────────────────────────────────────────────────────────────────────────── */
/*  HEADER SPÉCIFIQUE ORTHOPHOTO                                            */
/* ────────────────────────────────────────────────────────────────────────── */

.header-inner-ortho {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.header-ortho {
  position: relative;
  height: 55px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
}

/* menu centré */
.header-ortho .main-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  background: rgba(0, 0, 0, 0.25);          /* noir transparent */
  backdrop-filter: blur(8px);               /* effet flou (glass) */
  padding: 5px 10px;
  border-radius: 8px;
  z-index: 2;
}

/* bloc auth */
.nav-auth-ortho {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  z-index: 2;
  color: #eee;
}

.nav-auth-ortho a {
  color: #3fa;
  text-decoration: none;
  }

.nav-auth-ortho a:hover {
  text-decoration: underline;
  font-weight: bold;
}

.viewer-warning {
  font-size: 0.8rem;
  color: #aaa;
}

/* ────────────────────────────────────────────────────────────────────────── */
/*  PAGES PANORAMA COMMUNES (Orthophoto + Services)                         */
/* ────────────────────────────────────────────────────────────────────────── */

/* conteneur global des pages pano */
.page-wrapper-ortho {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* orthophoto = on bloque le scroll vertical (services peut rester sans) */
/*.orthophoto-page {
/*  overflow-y: hidden;
/*}

/* pano plein écran sous header desktop (55px) */
.orthophoto-fullscreen {
  position: relative;
  width: 100%;
  height: calc(100vh - 55px);
  overflow: hidden;
/*  background-image: url('../img/panorama.jpg'); /* fallback éventuel */
  display: block;
}

/* conteneur Pannellum (orthophoto + services) */
.orthophoto-fullscreen .orthophoto-img {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  z-index: 1;
}

/* ── Cadre noir transparent en bas (orthophoto + services) ─────────────── */
.content-overlay-ortho {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.40);
  padding: 8px 10px;
  border-radius: 10px;
  width: 94%;
  max-width: 1500px; /* valeur validée */
  box-sizing: border-box;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
}

/* contenu interne du cadre (texte + boutons + login) */
.content-overlay-ortho .page-content {
  background: transparent;
  color: #fff;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  padding: 6px 10px 2px;
}

/* texte descriptif commun (orthophoto: #slider-text, services: #description) */
.panorama-text {
  font-size: clamp(0.85rem, 1.1vw, 1.05rem);
  line-height: 1.3;
  max-width: 980px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.2s ease;
}

/* texte visible (géré par le JS) */
.panorama-text.visible {
  opacity: 1;
  visibility: visible;
}

/* boutons communs */
.panorama-controls {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 6px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

/* texte + boutons apparaissent ensemble : quand le texte devient visible, on révèle les boutons */
.panorama-text.visible ~ .panorama-controls {
  opacity: 1;
  transform: translateY(0);
}

.panorama-controls button {
  background-color: #0077cc;
  color: #fff;
  border: none;
  padding: clamp(6px, 0.7vw, 8px) clamp(10px, 1.2vw, 14px);
  border-radius: 6px;
  cursor: pointer;
  font-size: clamp(0.8rem, 1vw, 0.95rem);
  transition: background 0.3s ease, transform 0.1s ease;
}

.panorama-controls button:hover {
  background-color: #005fa3;
}

.panorama-controls button:active {
  transform: scale(0.97);
}

/* ligne © dans le cadre (reste statique) */
.content-overlay-ortho > *:last-child {
  margin-top: 4px;
  font-size: 0.75rem;
  text-align: center;
  color: #fff;
}

/* bloc auth dans le cadre (reste statique, pas animé) */
.auth-block {
  display: flex;
  margin: 4px 0;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

/* ────────────────────────────────────────────────────────────────────────── */
/*  AUTH / LIENS                                                             */
/* ────────────────────────────────────────────────────────────────────────── */

.auth-user {
  font-size: 1.2em;
  color: #0f0;
  font-weight: bold;
}

.logout-link {
  color: #f66 !important;
  text-decoration: none;
  margin-left: 8px;
}

.logout-link:hover {
  text-decoration: underline;
}

.login-link {
  color: #3fa;
  padding: 10px;
  text-decoration: none;
}

.login-link:hover {
  text-decoration: underline;
}

.viewer-button {
  font-weight: bold;
  color: #fff;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  display: inline-block;
  transition: background 0.3s ease;
}

.viewer-button:hover {
  background: rgba(0, 0, 0, 0.5);
}

#nav-auth a {
  font-size: 1.2em;
}

/* ────────────────────────────────────────────────────────────────────────── */
/*  OVERLAY HOME (centre écran)                                             */
/* ────────────────────────────────────────────────────────────────────────── */

.content-overlay {
  position: absolute;
  top: 65%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.40);
  padding: 10px;
  border-radius: 4px;
  width: 90%;
  max-width: 1500px;
  box-sizing: border-box;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* textes + lien bloc overlay index/contact */
.content-overlay .page-content {
  background-color: transparent !important;
  color: #fff;
  text-align: center;
  padding: 10px 15px;
  margin-top: 10px;
  margin-bottom: 10px;
  width: 100%;
  box-sizing: border-box;
}

.content-overlay .page-content h1 {
  margin: 0 0 10px;
  font-size: clamp(1.2rem, 2.2vw, 2.2rem);
}

.content-overlay .page-content p {
  margin: 0;
  line-height: 1.4;
  font-size: clamp(0.9rem, 1.2vw, 1.1rem);
}

/* Lien vers orthophoto sur la home (index.html) — vert fluo */
.index-page .content-overlay .page-content p a {
  color: #00FF4F !important;   /* vert fluo */
  font-weight: bold;
  text-decoration: underline;
  display: inline-block;
  margin-top: 0.5rem;
  font-size: clamp(1rem, 1.4vw, 1.4rem);
}

.index-page .content-overlay .page-content p a:hover {
  color: #66FF99 !important;   /* vert fluo plus clair au hover */
}

/* Titres et paragraphes en blanc dans #description */
#description h3,
#description p {
  margin: 0;
  color: #fff;
}

/* hotspots du pano */
.hotspot-img {
  transition: transform 0.1s linear, width 0.1s linear;
}

/* éventuel fond sombre pour certaines pages classiques */
.page-wrapper .page-content {
  flex-shrink: 0;
  background-color: #333;
}

/* ==================================================
   mobile.css (STYLES MOBILE – écrans ≤ 720)
   ================================================== */
@media (max-width: 720px) {

  html,
  body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial, sans-serif;
    background-color: #fff;
    color: #333;
    overflow-x: hidden;
  }

  /* 🎯 Header (mobile) */
  .header {
    width: 100%;
    height: 29px !important;
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    z-index: 10;
  }

  /* Logo home mobile */
  .index-page .logo {
    width: clamp(70px, 30vw, 140px);
    height: auto;
    display: block;
    margin: 20px auto 10px;
    position: relative;
    z-index: 10;
  }

  .header-inner {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  /* 🧭 Navigation (mobile) */
  .main-nav {
    display: flex;
    gap: 12px;
    background: rgba(0, 0, 0, 0.25);          /* noir transparent */
    backdrop-filter: blur(8px);               /* effet flou (glass) */
   -webkit-backdrop-filter: blur(8px);

    padding: 4px 8px;
    border-radius: 6px;
    box-sizing: border-box;
  }

  .main-nav a {
    text-decoration: none;
    color: #fff;
    font-weight: bold;
    font-size: 0.8rem;
    padding: 3px 6px;
    border-radius: 4px;
    transition: background 0.3s ease, transform 0.3s ease;
  }

  .main-nav a:hover {
    background: rgba(0, 0, 0, 0.6);
    color: #66FF99;
    transform: scale(1.05);
  }

  .main-nav a.active {
  color: #3fa;
  border-bottom: 2px solid #66FF99;
  }


  /* 🎥 Conteneur panoramique (mobile) pour la home */
  .panorama-container {
    display: flex;
    flex: 1 0 auto;
    width: 100%;
    overflow: hidden;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    z-index: 1;
  }

  #panorama {
    width: 100%;
    height: 100%;
  }

  /* Contenu générique */
  .page-content {
    padding: 10px;
    text-align: center;
  }

  .footer {
    width: 100%;
    height: 40px;
    background-color: #333;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    box-sizing: border-box;
    z-index: 10;
  }

  .panorama-contact {
    background-image: url('../img/panorama_contact.png');
    background-size: cover;
    background-position: center;
    height: 400px;
    position: relative;
  }

  /* Overlay home/contact mobile */
  .content-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 4px;
    width: 94%;
    max-width: 520px;
    box-sizing: border-box;
    z-index: 10;
  }

  .content-overlay .page-content {
    background-color: transparent !important;
    color: #fff;
    text-align: center;
  }

  .content-overlay .page-content h1 {
    margin: 0 0 8px;
    font-size: clamp(1rem, 4vw, 1.4rem);
  }

  .content-overlay .page-content p {
    margin: 0;
    line-height: 1.4;
    font-size: clamp(0.8rem, 3.2vw, 1rem);
  }

  .index-page .content-overlay .page-content p a {
    color: #00FF4F !important;
    text-decoration: underline;
    font-size: clamp(0.85rem, 3.4vw, 1rem);
  }

  .index-page .content-overlay .page-content p a:hover {
    color: #66FF99 !important;
  }

  .auth-user {
    color: #0f0;
    font-weight: bold;
  }

  .logout-link {
    color: #f66;
    text-decoration: none;
    margin-left: 8px;
  }

  .logout-link:hover {
    text-decoration: underline;
  }

  .login-link {
    color: #3fa;
    padding: 10px;
    text-decoration: none;
  }

  .login-link:hover {
    text-decoration: underline;
  }

  .viewer-button {
    font-weight: bold;
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s ease;
  }

  .viewer-button:hover {
    background: rgba(0, 0, 0, 0.5);
  }

  #nav-auth a {
    font-size: 1.0em;
  }

  /* texte pano mobile */
  #slider-text,
  #description.panorama-text {
    font-size: 0.75rem;
    line-height: 1.2;
    padding: 4px 4px 0;
  }

  /* boutons pano mobile */
  .panorama-controls {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }

  .panorama-controls button {
    flex: 0 0 auto;
    padding: 6px 8px;
    font-size: 0.75rem;
    white-space: normal;
  }

  .page-wrapper {
    display: flex;
    flex-direction: column;
    height: 100dvh;
  }

  .page-wrapper .page-content {
    padding: 10px;
    flex-shrink: 0;
    background-color: #f5f5f5;
  }

  .panorama-container,
  .content-overlay {
    overflow-x: hidden;
  }

  /* pano pleine hauteur sous header mobile (29px) */
  .orthophoto-fullscreen {
    position: relative;
    width: 100%;
    height: calc(100vh - 29px);
    overflow: hidden;
    background-image: url('/img/panorama.jpg');
    display: block;
  }

  .orthophoto-fullscreen .orthophoto-img {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: 1;
  }
}
