/* ------------------------------------------------------------------
   Mariage Marina & Rémy — 5 juin 2027
   Palette : verts olive/sauge, bleu doux, blanc cassé
------------------------------------------------------------------ */
:root {
  --green-deep: #4a6b3a;
  --green-olive: #6b8e4e;
  --green-sage: #9bb481;
  --green-pale: #d8e3c8;
  --blue-soft: #a8c5d6;
  --blue-deep: #5a8aa1;
  --white-warm: #f8f6ef;
  --white-cream: #fdfbf4;
  --ink: #2f3a26;
  --ink-soft: #4d5a40;
  --shadow: 0 4px 16px rgba(47, 58, 38, 0.12);
  --shadow-lg: 0 8px 32px rgba(47, 58, 38, 0.18);
  --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white-warm);
}

a { color: var(--green-deep); text-decoration: none; }
a:hover { color: var(--green-olive); text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', 'Lora', Georgia, serif;
  font-weight: 600;
  color: var(--green-deep);
  letter-spacing: 0.5px;
  margin: 0 0 0.5em 0;
}
h1 { font-size: 2.6rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.4rem; }

.handwritten {
  font-family: 'Caveat', 'Sacramento', cursive;
}

/* ---------- Header / Nav ---------- */
.site-header {
  background: var(--white-cream);
  border-bottom: 2px solid var(--green-pale);
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.site-header .brand {
  font-family: 'Caveat', cursive;
  font-size: 1.8rem;
  color: var(--green-deep);
  text-decoration: none;
}
.site-header .brand small { color: var(--blue-deep); font-size: 1rem; }
.site-nav { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.site-nav a {
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-size: 0.95rem;
  transition: all 0.18s;
}
.site-nav a:hover { background: var(--green-pale); color: var(--green-deep); text-decoration: none; }
.site-nav a.active { background: var(--green-olive); color: white; }
.site-nav .logout {
  background: transparent;
  border: 1px solid var(--green-sage);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius);
  cursor: pointer;
  margin-left: 0.5rem;
}
.site-nav .logout:hover { background: var(--green-pale); }

/* ---------- Layout ---------- */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}
.page h1 {
  text-align: center;
  margin-bottom: 0.3rem;
}
.page .subtitle {
  text-align: center;
  color: var(--blue-deep);
  font-style: italic;
  font-size: 1.15rem;
  margin-bottom: 2.5rem;
}
.divider {
  text-align: center;
  margin: 2.5rem 0;
  color: var(--green-sage);
  font-size: 1.3rem;
  letter-spacing: 0.3em;
}
.divider::before,
.divider::after {
  content: '';
  display: inline-block;
  width: 60px;
  height: 1px;
  background: var(--green-sage);
  vertical-align: middle;
  margin: 0 0.8em;
}

.card {
  background: var(--white-cream);
  border-radius: var(--radius);
  padding: 1.8rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--green-olive);
}
.card.blue { border-left-color: var(--blue-deep); }
.card h2 { margin-top: 0; }

.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border: none;
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.95rem;
  background: var(--green-olive);
  color: white;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s;
}
.btn:hover { background: var(--green-deep); color: white; text-decoration: none; transform: translateY(-1px); }
.btn.secondary { background: var(--blue-deep); }
.btn.secondary:hover { background: #466e83; color: white; }
.btn.outline {
  background: transparent;
  color: var(--green-deep);
  border: 1px solid var(--green-olive);
}
.btn.outline:hover { background: var(--green-pale); color: var(--green-deep); }

/* ---------- Login page ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(rgba(248, 246, 239, 0.85), rgba(248, 246, 239, 0.85)),
    url('/static/images/olivier.jpg') center/cover no-repeat;
  padding: 2rem;
}
.login-card {
  background: var(--white-cream);
  border-radius: 14px;
  padding: 3rem 2.5rem;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-card h1 {
  font-family: 'Caveat', cursive;
  font-size: 3rem;
  margin-bottom: 0.2rem;
  color: var(--green-deep);
}
.login-card .date {
  color: var(--blue-deep);
  font-style: italic;
  margin-bottom: 1.8rem;
}
.login-card label {
  display: block;
  text-align: left;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}
.login-card input[type="password"] {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--green-sage);
  border-radius: var(--radius);
  font: inherit;
  margin-bottom: 1rem;
  background: var(--white-warm);
}
.login-card input:focus { outline: 2px solid var(--green-olive); border-color: transparent; }
.login-card .error {
  background: #fbe8e3;
  color: #8a3a2a;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.login-card .btn { width: 100%; }

/* ---------- Home page : olivier + planches ---------- */
.home-stage {
  position: relative;
  min-height: 100vh;
  background: url('/static/images/olivier.jpg') center/cover no-repeat;
  overflow: hidden;
}
.home-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(248, 246, 239, 0.15) 60%, rgba(248, 246, 239, 0.5) 100%);
}
.home-title {
  position: relative;
  text-align: center;
  padding: 1.5rem 1rem 0.5rem;
  font-family: 'Caveat', cursive;
  color: var(--white-cream);
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6);
}
.home-title .names {
  font-size: 4rem;
  line-height: 1;
  margin: 0;
}
.home-title .date {
  font-size: 1.8rem;
  margin-top: 0.3rem;
  font-style: italic;
}
.planks {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.2rem 1.5rem;
  padding: 4rem 1rem 3rem;
  max-width: 1180px;
  margin: 0 auto;
}
.plank {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 130px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.25s ease;
  border-radius: 6px;
  overflow: hidden;
}
.plank-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  /* Le blanc résiduel de l'image se fond dans la photo de l'olivier */
  mix-blend-mode: multiply;
  pointer-events: none;
  user-select: none;
}
.plank-text {
  position: relative;
  z-index: 2;
  font-family: 'Caveat', 'Sacramento', cursive;
  font-size: 1.6rem;
  color: #3a2a18;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.55);
  padding: 0 0.5rem;
  line-height: 1.05;
}
.plank::after {
  /* Ombre portée sur le conteneur (pas sur l'image) pour ne pas être affectée par le mix-blend-mode */
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 6px;
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
.plank:hover {
  transform: translateY(-6px) rotate(0deg) !important;
  text-decoration: none;
}
.plank:hover::after {
  box-shadow: 0 14px 22px rgba(0, 0, 0, 0.5);
}

/* Variante : pancarte déjà détourée (PNG transparent avec texte intégré) */
.plank--img {
  border-radius: 0;
  overflow: visible;
  background: none;
  /* width/height définis par la classe spécifique (.plank--hebergements, etc.) */
}
.plank--img::after { display: none; }
.plank-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.5));
  pointer-events: none;
  user-select: none;
  transition: filter 0.25s ease;
}
.plank--img:hover .plank-img {
  filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.6));
}

/* Tailles calées sur le ratio natif de chaque PNG (pas de letterbox). */
.plank--hebergements {
  /* 723×445 natif (ratio 1.62:1) */
  width: 260px;
  height: 160px;
}

.plank:nth-child(1) { transform: rotate(-4deg); }
.plank:nth-child(2) { transform: rotate(3deg); margin-top: 1.5rem; }
.plank:nth-child(3) { transform: rotate(-2deg); }
.plank:nth-child(4) { transform: rotate(4deg); margin-top: 1.5rem; }
.plank:nth-child(5) { transform: rotate(-3deg); }

.home-footer {
  position: relative;
  text-align: center;
  padding: 1rem;
  color: var(--white-cream);
  font-family: 'Caveat', cursive;
  font-size: 1.2rem;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.6);
}

/* ---------- Programme ---------- */
.day-block { margin-bottom: 3rem; }
.day-title {
  font-family: 'Caveat', cursive;
  font-size: 2.5rem;
  text-align: center;
  color: var(--green-deep);
  margin-bottom: 1.5rem;
  text-transform: capitalize;
}
.event {
  background: var(--white-cream);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--green-olive);
}
.event h3 {
  margin: 0 0 0.4rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
}
.event .time {
  background: var(--green-pale);
  color: var(--green-deep);
  font-family: 'Caveat', cursive;
  font-size: 1.4rem;
  padding: 0.05rem 0.8rem;
  border-radius: 999px;
}
.event address {
  font-style: normal;
  color: var(--ink-soft);
  margin: 0.4rem 0 0.6rem;
}
.event .map-embed {
  margin-top: 0.8rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.event .map-embed iframe {
  display: block;
  width: 100%;
  height: 280px;
  border: 0;
}
.notice {
  background: #fff7e0;
  border: 1px solid #e8d59a;
  color: #6b5511;
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  margin-top: 1rem;
}

/* ---------- Hébergements table ---------- */
.lodgings {
  width: 100%;
  border-collapse: collapse;
  background: var(--white-cream);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
}
.lodgings thead { background: var(--green-olive); color: white; }
.lodgings th, .lodgings td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--green-pale);
  font-size: 0.95rem;
  vertical-align: top;
}
.lodgings tbody tr:hover { background: var(--green-pale); }
.lodgings .price {
  font-family: 'Caveat', cursive;
  font-size: 1.3rem;
  color: var(--green-deep);
  white-space: nowrap;
}
.lodgings a { word-break: break-word; }
.table-scroll { overflow-x: auto; border-radius: var(--radius); }

/* ---------- Galerie photos ---------- */
.gallery-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 1.8rem;
}
.gallery-tabs button {
  background: var(--white-cream);
  border: 1px solid var(--green-sage);
  color: var(--ink-soft);
  font: inherit;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s;
}
.gallery-tabs button:hover { background: var(--green-pale); }
.gallery-tabs button.active { background: var(--green-olive); color: white; border-color: var(--green-olive); }

.upload-card {
  background: var(--green-pale);
  border: 2px dashed var(--green-olive);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
}
.upload-card h2 { margin-top: 0; font-size: 1.4rem; color: var(--green-deep); }
.upload-card form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  align-items: center;
}
.upload-card select, .upload-card input[type="file"] {
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--green-sage);
  border-radius: var(--radius);
  background: white;
  font: inherit;
}
.upload-status {
  margin-top: 0.8rem;
  font-size: 0.95rem;
  min-height: 1.3em;
}
.upload-status.ok { color: var(--green-deep); }
.upload-status.err { color: #8a3a2a; }

.gallery-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: flex-end;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.gallery-item {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--green-pale);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: block;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.gallery-item:hover img { transform: scale(1.05); }
.gallery-item .dl-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--green-deep);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  text-decoration: none;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.2s;
}
.gallery-item:hover .dl-btn { opacity: 1; }
.gallery-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-soft);
  font-style: italic;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 95vw; max-height: 90vh; object-fit: contain; box-shadow: 0 0 50px rgba(0,0,0,0.5); }
.lightbox .close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 2.5rem;
  background: none;
  border: none;
  cursor: pointer;
}

/* ---------- Petits plus ---------- */
.kit-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.kit-list li {
  padding: 0.6rem 0 0.6rem 2rem;
  position: relative;
  border-bottom: 1px dashed var(--green-pale);
}
.kit-list li:last-child { border-bottom: 0; }
.kit-list li::before {
  content: '🌿';
  position: absolute;
  left: 0;
  top: 0.55rem;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.contact-card {
  background: var(--white-cream);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--green-olive);
}
.contact-card .name {
  font-family: 'Caveat', cursive;
  font-size: 2.5rem;
  color: var(--green-deep);
  margin-bottom: 1rem;
}
.contact-card a { display: block; margin: 0.4rem 0; word-break: break-word; }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  background: var(--white-cream);
  border-top: 1px solid var(--green-pale);
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .page { padding: 1.5rem 1rem 3rem; }
  h1 { font-size: 2rem; }
  .home-title .names { font-size: 2.8rem; }
  .home-title .date { font-size: 1.3rem; }
  .plank { width: 160px; height: 105px; }
  .plank-text { font-size: 1.3rem; }
  .plank--hebergements { width: 200px; height: 123px; }
  .planks { padding-top: 2.5rem; }
  .site-header { padding: 0.6rem 1rem; }
  .site-nav a { padding: 0.3rem 0.6rem; font-size: 0.88rem; }
  .lodgings th, .lodgings td { padding: 0.6rem 0.5rem; font-size: 0.85rem; }
  .login-card { padding: 2rem 1.5rem; }
  .login-card h1 { font-size: 2.4rem; }
}
