/* ==========================================================================
   ArtTracker - Main Stylesheet (Edge-to-Edge Compact Header Theme)
   ========================================================================== */

@font-face {
  font-family: "SF Pro Text";
  src: url("../Polices/SF-Pro/SF-Pro-Text-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SF Pro Text";
  src: url("../Polices/SF-Pro/SF-Pro-Text-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SF Pro Text";
  src: url("../Polices/SF-Pro/SF-Pro-Text-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SF Pro Text";
  src: url("../Polices/SF-Pro/SF-Pro-Text-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SF Pro Display";
  src: url("../Polices/SF-Pro/SF-Pro-Display-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SF Pro Display";
  src: url("../Polices/SF-Pro/SF-Pro-Display-Semibold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SF Pro Display";
  src: url("../Polices/SF-Pro/SF-Pro-Display-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SF Pro Display";
  src: url("../Polices/SF-Pro/SF-Pro-Display-Black.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "NT Wagner";
  src: url("../Polices/Prenom/NT%20Wagner%20(only%20personal%20use).otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Polices disponibles dans le banc d'essai temporaire du prénom. */
@font-face {
  font-family: "Prenom Craze";
  src: url("../Polices/Prenom/Craze-BF6a7c580c5c0ae.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Prenom Tropical Regions";
  src: url("../Polices/Prenom/TROPICAL-REGIONS-DEMO-BF6a2b7d21000bf.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Prenom Migra ExtraLight";
  src: url("../Polices/Prenom/Migra-Extralight.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Prenom Migra ExtraBold";
  src: url("../Polices/Prenom/Migra-Extrabold.otf") format("opentype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Prenom Migra Italic ExtraLight";
  src: url("../Polices/Prenom/MigraItalic-ExtralightItalic.otf") format("opentype");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Prenom Migra Italic ExtraBold";
  src: url("../Polices/Prenom/MigraItalic-ExtraboldItalic.otf") format("opentype");
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Prenom BBH Hegarty";
  src: url("../Polices/Prenom/BBHHegarty-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Prenom Cike";
  src: url("../Polices/Prenom/Cike-Thin-BF6a7be3f00d8ae.otf") format("opentype");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Prenom Cike";
  src: url("../Polices/Prenom/Cike-Extralight-BF6a7be3f08dd79.otf") format("opentype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Prenom Cike";
  src: url("../Polices/Prenom/Cike-Light-BF6a7be3f07ffda.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Prenom Cike";
  src: url("../Polices/Prenom/Cike-Regular-BF6a7be3f0532df.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Prenom Cike";
  src: url("../Polices/Prenom/Cike-Medium-BF6a7be3f09c2f2.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Prenom Cike";
  src: url("../Polices/Prenom/Cike-Semibold-BF6a7be3f044c8e.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Prenom Cike";
  src: url("../Polices/Prenom/Cike-Bold-BF6a7be3f0b55c8.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Prenom Cike";
  src: url("../Polices/Prenom/Cike-Extrabold-BF6a7be3f0b5650.otf") format("opentype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Prenom Cike";
  src: url("../Polices/Prenom/Cike-Black-BF6a7be3f0b5552.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Prenom Qualli";
  src: url("../Polices/Prenom/Qualli-BF6a7bd6e481a87.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Prenom Liyanea Brush";
  src: url("../Polices/Prenom/LiyaneaBrushRegular_demo-BF6a7c2743b2f35.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Color Palette - Minimalist Monochromatic Theme */
  --bg-dark: #08080a;
  --bg-card: #0d0d10;
  --bg-card-hover: #141418;
  --bg-surface: #16161a;
  --bg-surface-elevated: #222226;
  
  --border-color: rgba(255, 255, 255, 0.1);
  --border-color-hover: rgba(255, 255, 255, 0.25);
  
  /* Primary & Accent Colors */
  --primary: #ffffff;
  --primary-hover: #e4e4e7;
  --primary-glow: rgba(255, 255, 255, 0.15);
  --secondary: #a1a1aa;
  
  /* Status Colors */
  --color-success: #22c55e;
  --color-success-bg: rgba(34, 197, 94, 0.1);
  --color-success-border: rgba(34, 197, 94, 0.3);
  
  --color-partial: #eab308;
  --color-partial-bg: rgba(234, 179, 8, 0.1);
  --color-partial-border: rgba(234, 179, 8, 0.3);
  
  --color-failed: #ef4444;
  --color-failed-bg: rgba(239, 68, 68, 0.1);
  --color-failed-border: rgba(239, 68, 68, 0.3);
  
  --color-future: #71717a;
  --color-future-bg: rgba(113, 113, 122, 0.1);
  --color-future-border: rgba(113, 113, 122, 0.3);
  
  --color-today: #ffffff;
  --color-today-bg: rgba(255, 255, 255, 0.08);

  /* Text Colors */
  --text-main: #fafafa;
  --text-muted: #a1a1aa;
  --text-dim: #52525b;
  
  /* Shadows & Glassmorphism */
  --shadow-sm: none;
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.9);
  --glass-bg: rgba(8, 8, 10, 0.94);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-backdrop: blur(16px);
  
  /* Radius & Spacing */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Global Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: "SF Pro Text", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  background-color: var(--bg-dark);
  color: var(--text-main);
  color-scheme: dark;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
}

/* Évite qu'un double-tape déclenche le zoom du navigateur sur les écrans
   tactiles, tout en conservant le défilement normal de la page. */
@media (pointer: coarse) {
  html, body { touch-action: manipulation; }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

:root { --app-header-height: 54px; }

/* Header & Navbar - Fixed Compact Height & Font Sizes */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  height: var(--app-header-height);
  min-height: var(--app-header-height);
  max-height: var(--app-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}

.brand {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: #ffffff;
  color: #000000;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
}

.brand-title {
  display: block;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  overflow: hidden;
  font-family: "NT Wagner", "SF Pro Display", system-ui, sans-serif;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.15em;
  color: var(--text-main);
  text-shadow: 0 1px 14px rgba(255, 255, 255, 0.12);
  white-space: nowrap;
  transform: translateY(2px);
}

/* Le titre reste invisible jusqu'au chargement de la typographie enregistrée,
   afin d'éviter l'apparition furtive de la police par défaut. */
.brand-title.brand-style-pending { visibility: hidden; }
.brand-title.brand-style-ready { visibility: visible; }

.brand-name-group {
  display: inline-block;
  transform-origin: left center;
  white-space: nowrap;
}

.nav-controls {
  flex: 0 0 auto;
  min-width: max-content;
  display: flex;
  align-items: center;
  gap: 10px;
}

.calendar-auth-link {
  text-decoration: none;
}

.calendar-auth-link:hover,
.calendar-auth-link:focus-visible {
  text-decoration: none;
}

/* La connexion est volontairement représentée par une icône unique.
   L'état connecté ne prend plus de place dans la barre. */
.calendar-auth-label,
.gallery-access-label,
.gallery-auth-label { display: none !important; }

/* Depuis le calendrier, Galerie devient le contrôle de navigation placé à
   droite. Son état légèrement éclairci le distingue sans rompre la DA. */
body:not(.gallery-page) .nav-controls > a.btn[href^="/galerie"] {
  order: 3;
  border-color: rgba(242, 242, 242, 0.2);
  background: #202024;
  color: #ffffff;
  text-decoration: none;
}

body:not(.gallery-page) .nav-controls > a.btn[href^="/galerie"]:hover {
  border-color: rgba(242, 242, 242, 0.5);
  background: #29292e;
  color: #ffffff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-color-hover);
  color: #ffffff;
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: #ffffff;
  color: #000000;
  border: none;
  font-weight: 600;
}

.btn-primary:hover {
  background: #e4e4e7;
  color: #000000;
}

.btn-icon {
  padding: 6px 10px;
  border-radius: var(--radius-md);
}

.btn-streak {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-streak:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-color-hover);
}

.date-picker-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  outline: none;
}

.date-picker-input:focus {
  border-color: var(--primary);
}

/* Main Container Layout */
.app-container {
  width: 100%;
  max-width: 100%;
  padding: 0;
  flex: 1;
}

/* Off-canvas Drawers */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal);
  box-shadow: var(--shadow-lg);
}

.drawer.active {
  transform: translateX(-420px);
}

.drawer-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.drawer-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

@media (max-width: 768px) {
  .app-header {
    padding-inline: 0.55rem;
    gap: 0.4rem;
  }

  .brand { overflow: hidden; }
  .brand-indent { display: none; }
  .brand-title {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    font-size: clamp(20px, 5.6vw, 25px);
    letter-spacing: 0.09em;
    text-overflow: ellipsis;
  }

  .nav-controls { flex: 0 0 auto; min-width: max-content; gap: 0.35rem; }
  .nav-controls .btn { padding-inline: 0.62rem; }
  .nav-controls .btn i,
  .month-nav-bar > .btn i { font-size: 1rem; }

  body.gallery-page #btnToggleGalleryFilters { font-size: 0; gap: 0; }
  body.gallery-page #btnToggleGalleryFilters i { font-size: 1rem; }

  .calendar-auth-link .calendar-auth-label,
  .gallery-auth-control .gallery-auth-label,
  #galleryLoginAccess .gallery-access-label,
  #galleryCalendarAccess .gallery-access-label { display: none; }

  .calendar-auth-link,
  .gallery-auth-control,
  #galleryLoginAccess,
  #galleryCalendarAccess { gap: 0; }

  body:not(.gallery-page) #btnChooseMediaFolder { display: none; }
  body:not(.gallery-page) #btnToggleCalendar span { display: none; }
  body:not(.gallery-page) #btnToggleCalendar #btnStreakCount { display: inline; }
  body:not(.gallery-page) .nav-controls > a.btn[href^="/galerie"] { font-size: 0; gap: 0; }
  body:not(.gallery-page) .nav-controls > a.btn[href^="/galerie"] i { font-size: 1rem; }

  .drawer { right: -100vw; max-width: 100vw; }
  .drawer.active { transform: translateX(-100vw); }
  .drawer-header, .drawer-body { padding: 0.85rem; }
}

@media (max-width: 480px) {
  /* Le banc d'essai typographique reste disponible sur ordinateur et iPad,
     mais ne doit pas sacrifier le nom complet sur un petit téléphone. */
  body.gallery-page .gallery-font-test-toggle { font-size: 0; gap: 0; }
  body.gallery-page .gallery-font-test-toggle i { font-size: 1rem; }
}

/* Sur un écran carré ou portrait large (notamment tablette), on adopte aussi
   la composition compacte du téléphone : l'indentation disparaît et les
   boutons libèrent la place nécessaire au nom complet. */
@media (max-aspect-ratio: 6/5) {
  .app-header {
    padding-inline: .55rem;
    gap: .4rem;
  }

  .brand { overflow: hidden; }
  .brand-indent { display: none; }
  .brand-title {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    font-size: clamp(20px, 5.6vw, 25px);
    letter-spacing: .09em;
  }

  .nav-controls {
    flex: 0 0 auto;
    min-width: max-content;
    gap: .35rem;
  }

  .nav-controls .btn { padding-inline: .62rem; }
  .nav-controls .btn i,
  .month-nav-bar > .btn i { font-size: 1rem; }

  body.gallery-page #btnToggleGalleryFilters { font-size: 0; gap: 0; }
  body.gallery-page #btnToggleGalleryFilters i { font-size: 1rem; }

  .calendar-auth-link .calendar-auth-label,
  .gallery-auth-control .gallery-auth-label,
  #galleryLoginAccess .gallery-access-label,
  #galleryCalendarAccess .gallery-access-label { display: none; }

  .calendar-auth-link,
  .gallery-auth-control,
  #galleryLoginAccess,
  #galleryCalendarAccess { gap: 0; }

  body:not(.gallery-page) #btnChooseMediaFolder { display: none; }
  body:not(.gallery-page) #btnToggleCalendar span { display: none; }
  body:not(.gallery-page) #btnToggleCalendar #btnStreakCount { display: inline; }
  body:not(.gallery-page) .nav-controls > a.btn[href^="/galerie"] { font-size: 0; gap: 0; }
  body:not(.gallery-page) .nav-controls > a.btn[href^="/galerie"] i { font-size: 1rem; }
}

@media (max-width: 768px), (max-aspect-ratio: 6/5) {
  body.gallery-page .gallery-font-test-toggle { font-size: 0; gap: 0; }
  body.gallery-page .gallery-font-test-toggle i { font-size: 1rem; }
}
