/* Tailwind CSS Base + Custom Styles - Production Build */

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  border-width: 0;
  border-style: solid;
  border-color: currentColor;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
  font-feature-settings: normal;
  font-variation-settings: normal;
}

body {
  margin: 0;
  line-height: inherit;
}

main.container {
  max-width: 100% !important;
}

/* ===== TAILWIND UTILITY CLASSES ===== */
.min-h-screen {
  min-height: 100vh;
}

.flex {
  display: flex;
}

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

.flex-1 {
  flex: 1 1 0%;
}

.flex-grow {
  flex-grow: 1;
}

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

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

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

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

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.container {
  width: 100%;
}

@media (min-width: 640px) {
  .container {
    max-width: 640px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

@media (min-width: 1536px) {
  .container {
    max-width: 1536px;
  }
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.py-3 {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.py-4 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.py-12 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.pt-32 {
  padding-top: 8rem;
}

.pb-12 {
  padding-bottom: 3rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

.mt-8 {
  margin-top: 2rem;
}

.w-full {
  width: 100%;
}

.max-w-2xl {
  max-width: 42rem;
}

.max-w-6xl {
  max-width: 72rem;
}

.max-w-\[1600px\] {
  max-width: 1600px;
}

.max-w-\[1200px\] {
  max-width: 1200px;
}

.max-w-\[300px\] {
  max-width: 300px;
}

.max-w-lg {
  max-width: 32rem;
}

.rounded-full {
  border-radius: 9999px;
}

.rounded-lg {
  border-radius: 0.5rem;
}

.overflow-x-hidden {
  overflow-x: hidden;
}

.overflow-hidden {
  overflow: hidden;
}

.fixed {
  position: fixed;
}

.absolute {
  position: absolute;
}

.relative {
  position: relative;
}

.inset-x-0 {
  left: 0;
  right: 0;
}

.inset-0 {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.top-0 {
  top: 0;
}

.left-0 {
  left: 0;
}

.left-4 {
  left: 1rem;
}

.right-0 {
  right: 0;
}

.right-2 {
  right: 0.5rem;
}

.top-1\/2 {
  top: 50%;
}

.z-50 {
  z-index: 50;
}

.z-60 {
  z-index: 60;
}

.-translate-y-1\/2 {
  --tw-translate-y: -50%;
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.translate-y-0 {
  --tw-translate-y: 0px;
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.hidden {
  display: none;
}

.border {
  border-width: 1px;
}

.border-b {
  border-bottom-width: 1px;
}

.bg-white\/5 {
  background-color: rgb(255 255 255 / 0.05);
}

.bg-white\/6 {
  background-color: rgb(255 255 255 / 0.06);
}

.bg-white {
  background-color: white;
}

.bg-amber-500 {
  background-color: rgb(217 119 6);
}

.bg-red-900\/20 {
  background-color: rgb(120 53 53 / 0.2);
}

.bg-\[\#1a1a1a\] {
  background-color: #1a1a1a;
}

.bg-gradient-to-b {
  background-image: linear-gradient(to bottom, var(--tw-gradient-stops));
}

.from-black\/60 {
  --tw-gradient-from: rgb(0 0 0 / 0.6) var(--tw-gradient-from-position);
  --tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.to-transparent {
  --tw-gradient-to: transparent var(--tw-gradient-to-position);
}

.text-white {
  color: white;
}

.text-black {
  color: black;
}

.text-gray-400 {
  color: rgb(156 163 175);
}

.text-gray-500 {
  color: rgb(107 114 128);
}

.text-red-400 {
  color: rgb(248 113 113);
}

.text-xs {
  font-size: 0.75rem;
  line-height: 1rem;
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
}

.font-extrabold {
  font-weight: 800;
}

.font-semibold {
  font-weight: 600;
}

.placeholder-gray-400::placeholder {
  color: rgb(156 163 175);
}

.transition {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.shadow-lg {
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
}

.border-red-900\/50 {
  border-color: rgb(120 53 53 / 0.5);
}

.border-white\/3 {
  border-color: rgba(255,255,255,0.03);
}

.border-white\/6 {
  border-color: rgb(255 255 255 / 0.06);
}

.border-amber-400 {
  border-color: rgb(251 191 36);
}

.focus\:border-amber-400:focus {
  border-color: rgb(251 191 36);
}

.focus\:ring-0:focus {
  outline-offset: 2px;
  outline-width: 2px;
  outline-style: solid;
  outline-color: transparent;
}

.backdrop-blur-md {
  backdrop-filter: blur(12px);
}

.pr-4 {
  padding-right: 1rem;
}

.pl-12 {
  padding-left: 3rem;
}

.min-h-\[1.5rem\] {
  min-height: 1.5rem;
}

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

.role-alert {
  role: alert;
}

/* =========================================
   STYLE COSMOS - Styles globaux et personnalisés
   ========================================= */

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #fff;
    color: var(--text);
}

.hero-card {
    background: linear-gradient(160deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
}

.hero-cta {
    transform: translateY(0);
    transition: transform 220ms ease, box-shadow 220ms ease, filter 220ms ease;
}

.hero-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 36px rgba(0,0,0,0.45);
    filter: saturate(1.05);
}

.hero-visual {
    border-radius: 0.75rem;
    overflow: hidden;
}

#heroImage {
    background-size: cover;
    background-position: center center;
}

.hero-cta, #searchBtn, #headerCta {
    background: linear-gradient(90deg, var(--brand-start), var(--brand-end));
    color: black;
}

#heroVisualWrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(92,33,182,0.12), rgba(124,58,237,0.06));
    pointer-events: none;
}

:root {
    --bg: #0b1220;
    --bg-alt: #0f172a;
    --text: #e5e7eb;
    --brand-start: #6366f1;
    --brand-end: #22d3ee;
    --accent: #38bdf8;
    --card: rgba(255,255,255,0.06);
    --muted: #94a3b8;
}

.rounded-xl {
    border-radius: 1rem;
}

.shadow-2xl {
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
}

#heroVisualWrap {
    transition: transform 280ms cubic-bezier(.2,.9,.2,1);
}

#heroVisualWrap:hover {
    transform: translateY(-6px) scale(1.01);
}

#heroImage .hero-overlay {
    background: linear-gradient(180deg, rgba(11,18,32,0.0), rgba(11,18,32,0.82));
}

#imageModal .modal-shell {
    width: min(1200px, 96vw);
    max-height: 92vh;
    height: auto;
}

#imageModal .modal-media {
    min-height: 60vh;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.06), transparent 45%), #000;
}

#imageModal .modal-sidebar {
    max-height: 92vh;
}

@media (max-width: 768px) {
    #imageModal .modal-shell {
        max-height: none;
        height: 96vh;
    }
    #imageModal .modal-media,
    #imageModal .modal-sidebar {
        min-height: 40vh;
    }
}

#heroModal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 60;
}

#heroModal.active {
    display: flex;
}

.hero-modal-card {
    max-width: 820px;
    width: 94%;
    background: #0f0f10;
    border: 1px solid rgba(255,255,255,0.04);
    padding: 1.25rem;
    border-radius: 0.5rem;
    color: #e6e6e9;
}

.hero-modal-card a {
    color: #ffd87a;
    font-weight: 600;
}

::-webkit-scrollbar {
    width: 10px;
    background-color: var(--bg);
}

::-webkit-scrollbar-thumb {
    background-color: rgba(148, 163, 184, 0.4);
    border-radius: 6px;
}

.loader {
    border: 3px solid rgba(148, 163, 184, 0.25);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
}

.small-loader {
    border: 2px solid rgba(148, 163, 184, 0.25);
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.site-title {
    font-family: 'DM Serif Text', 'Space Grotesk', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
    letter-spacing: 0;
    font-style: normal;
}

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
    padding: 1.5rem 1.75rem 2rem;
    width: 100%;
}

@media (max-width: 1024px) {
    .masonry-grid {
        grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    }
}

@media (max-width: 768px) {
    .masonry-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 480px) {
    .masonry-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
        max-width: 100%;
    }
}

.masonry-item {
    margin-bottom: 0.75rem;
    cursor: pointer;
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: inline-block;
    width: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
    --card-height: 260px;
    height: var(--card-height);
}

.masonry-item:hover {
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    transform: translateY(-4px);
}

.masonry-item:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(11, 18, 32, 0.75), transparent);
    pointer-events: none;
}

.page-count-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.page-count-badge i {
    margin-right: 0.25rem;
}

.masonry-img-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(90deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    display: block;
}

.masonry-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 300ms ease, transform 300ms ease;
    opacity: 0;
    transform: scale(1.02);
    display: block;
}

.masonry-img.loaded {
    opacity: 1;
    transform: scale(1);
}

.masonry-img-wrapper.fallback {
    padding-bottom: 75%;
    height: auto;
}

.masonry-img-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.01) 0%, rgba(255,255,255,0.02) 50%, rgba(255,255,255,0.01) 100%);
    opacity: 0.04;
    transition: opacity 240ms ease;
    pointer-events: none;
}

.search-suggestion-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
}

.search-suggestion-item:hover {
    background: rgba(255,255,255,0.02);
}

.search-suggestion-title {
    font-size: 0.9rem;
    color: #e6e6e9;
}

.search-suggestion-sub {
    font-size: 0.72rem;
    color: #9ca3af;
}

.masonry-lqip {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(8px) saturate(80%);
    transform: scale(1.06);
    transition: opacity 280ms ease, filter 300ms ease, transform 300ms ease;
    opacity: 1;
}

.masonry-lqip.hidden {
    opacity: 0;
    filter: blur(1px) saturate(100%);
    transform: scale(1);
}

.nav-btn {
    transition: background-color 0.15s, opacity 0.3s;
}

.nav-btn:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-btn:disabled {
    cursor: not-allowed;
}

/* ===== Custom redesign overrides ===== */
:root {
    --bg: #ffffff;
    --bg-soft: #f5f7fb;
    --ink: #0f172a;
    --muted: #475569;
    --accent: #0f172a;
    --accent-2: #2563eb;
    --pill: #0f172a;
    --ring: rgba(37, 99, 235, 0.25);
    --border: #e2e8f0;
    --shadow: 0 20px 50px rgba(15, 23, 42, 0.10);
}

body {
    color: var(--ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
}

.site-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px clamp(18px, 2vw, 32px);
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand {
    font-family: 'Playfair Display', 'Inter', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 1.45rem;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: 0.01em;
}
.search-button:active { transform: translateY(-50%) scale(0.98); }
.search-suggestions { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 28px 70px rgba(15,23,42,0.18); overflow: hidden; animation: fadeIn 180ms ease; z-index: 10; }
.search-suggestion-item { padding: 12px 16px; cursor: pointer; transition: background 160ms ease; }
.search-suggestion-item:hover { background: #f8fafc; }
.search-suggestion-title { font-size: 0.98rem; font-weight: 600; color: var(--ink); }
.search-suggestion-sub { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }



.results-shell { position: relative; margin-top: clamp(24px, 5vw, 48px); padding: 0 clamp(18px, 4vw, 42px) clamp(64px, 6vw, 96px); z-index: 2; }
.alert { max-width: 680px; margin: 0 auto 16px; padding: 14px 16px; background: #fef2f2; color: #b91c1c; border: 1px solid #fecdd3; border-radius: 14px; text-align: center; }
.results-info { text-align: center; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }
.results-grid-wrapper { max-width: 1400px; margin: 28px auto 0; }
.masonry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; padding: clamp(16px, 2vw, 24px); width: 100%; }
@media (max-width: 640px) { .masonry-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } }
.masonry-item { position: relative; cursor: pointer; border-radius: 18px; overflow: hidden; border: 1px solid var(--border); background: #fff; transition: transform 220ms ease, box-shadow 220ms ease; --card-height: 280px; height: var(--card-height); }
.masonry-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
.page-count-badge { position: absolute; top: 10px; right: 10px; background: rgba(15,23,42,0.82); color: #fff; padding: 6px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; box-shadow: 0 10px 28px rgba(15,23,42,0.25); z-index: 10; }
.page-count-badge i { margin-right: 6px; }
.masonry-img-wrapper { position: relative; width: 100%; height: 100%; overflow: hidden; background: #f8fafc; }
.masonry-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 320ms ease, transform 320ms ease; opacity: 0; transform: scale(1.02); display: block; }
.masonry-img.loaded { opacity: 1; transform: scale(1); }
.masonry-img-wrapper.fallback { padding-bottom: 75%; height: auto; }
.masonry-img-wrapper::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(148,163,184,0.08) 0%, rgba(148,163,184,0.14) 50%, rgba(148,163,184,0.08) 100%); opacity: 0.18; animation: shimmer 1.6s infinite; }
.masonry-lqip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(10px) saturate(90%); transform: scale(1.05); opacity: 1; transition: opacity 260ms ease, filter 280ms ease, transform 280ms ease; }
.masonry-lqip.hidden { opacity: 0; filter: blur(2px); transform: scale(1); }
.end-indicator { text-align: center; color: var(--muted); padding: 18px; }

#imageModal { background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(10px); }
#imageModal .modal-shell { width: min(1200px, 96vw); max-height: 92vh; height: auto; background: #f8f9fa; border: 1px solid #e0e0e0; box-shadow: 0 28px 70px rgba(0,0,0,0.2); border-radius: 20px; }
#imageModal .modal-media { min-height: 60vh; background: #000; }
#imageModal .modal-sidebar { max-height: 92vh; background: #ffffff; border-left: 1px solid #e0e0e0; }
#imageModal .modal-sidebar h2 { color: #1a1a1a; }
#imageModal .modal-sidebar p { color: #4a4a4a; }
#imageModal .modal-sidebar h3 { color: #6b6b6b; letter-spacing: 0.15em; }
#imageModal a, #imageModal button { transition: transform 160ms ease, background 160ms ease, color 160ms ease; }
#imageModal a:hover, #imageModal button:hover { transform: translateY(-1px); }
#imageModal .modal-sidebar .border-l { border-color: rgba(255,255,255,0.12); }
#pageNavContainer { box-shadow: 0 12px 30px rgba(0,0,0,0.35); }

.loader { border: 3px solid rgba(148, 163, 184, 0.25); border-top: 3px solid #2563eb; border-radius: 50%; width: 28px; height: 28px; animation: spin 0.8s linear infinite; }
.small-loader { border: 2px solid rgba(148, 163, 184, 0.25); border-top: 2px solid #2563eb; border-radius: 50%; width: 18px; height: 18px; animation: spin 0.8s linear infinite; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { 0% { background-position: -200px 0; } 100% { background-position: 200px 0; } }

@media (max-width: 768px) {
  .site-header__inner { flex-direction: column; align-items: flex-start; }
  .hero-section { min-height: 90vh; padding-top: 64px; }
  .hero-notes { grid-template-columns: 1fr; }
}
