/* =============================================
   PRINT STYLESHEET - PROGRAMME PAGES
   Voyage Majordhome - Professional PDF Output
   ============================================= */

@media print {

  /* ==========================================
     1. PAGE SETUP
     ========================================== */
  @page {
    size: A4 portrait;
    margin: 1.5cm 2cm;
  }

  @page :first {
    margin-top: 0;
  }

  /* ==========================================
     2. GLOBAL PRINT RESET
     ========================================== */
  :root {
    --background: 0 0% 100% !important;
    --foreground: 0 0% 10% !important;
    --primary-foreground: 0 0% 10% !important;
    --muted-foreground: 0 0% 40% !important;
    --accent: 0 0% 30% !important;
    --border: 0 0% 80% !important;
  }

  html {
    font-size: 11pt !important;
    line-height: 1.4 !important;
  }

  body {
    color: #1a1a1a !important;
    background: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    font-family: Georgia, "Times New Roman", Times, serif !important;
  }

  * {
    border-color: #cccccc !important;
  }

  /* ==========================================
     3. HIDE NON-PRINT ELEMENTS
     ========================================== */
  .do-not-print {
    display: none !important;
  }

  header {
    display: none !important;
  }

  footer {
    display: none !important;
  }

  #iubenda-cs-banner,
  .iubenda-cs-container,
  [id^="iubenda-"],
  [class*="iubenda"],
  iframe[title="GPP Locator"] {
    display: none !important;
  }

  [data-sonner-toaster] {
    display: none !important;
  }

  #nprogress {
    display: none !important;
  }

  .fixed,
  .sticky {
    position: static !important;
  }

  /* ==========================================
     4. CONTAINER & LAYOUT
     ========================================== */
  .container {
    padding-top: 0 !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
  }

  .relative.container.mt-4 {
    margin-top: 0 !important;
  }

  /* ==========================================
     5. PAGE BREAK STRATEGY
     ========================================== */

  /* Remove blanket page-break-after on all sections */
  section {
    page-break-after: auto !important;
    break-after: auto !important;
    margin-top: 0.5rem !important;
  }

  section {
    page-break-inside: auto;
    break-inside: auto;
  }

  /* Tables, figures and images should not break across pages */
  table,
  figure,
  img {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* Headings should not be orphaned at bottom of page */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    page-break-after: avoid !important;
    break-after: avoid !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* Keep heading + next content together */
  h2 + div,
  h3 + div,
  h2 + p,
  h3 + p {
    page-break-before: avoid !important;
    break-before: avoid !important;
  }

  /* === COVER PAGE === */
  [data-v-7819f9b3] > section:nth-of-type(2) {
    page-break-after: always !important;
    break-after: page !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 90vh !important;
    text-align: center !important;
    padding: 3cm 2cm !important;
  }

  /* === DAY SECTIONS: page break before "Details jour par jour" === */
  [data-v-7819f9b3] > div:last-child {
    page-break-before: always !important;
    break-before: page !important;
  }

  /* Individual day sections flow naturally with separator */
  [data-v-7819f9b3] > div:last-child > section {
    page-break-inside: auto !important;
    break-inside: auto !important;
    margin-bottom: 1.5rem !important;
    padding-bottom: 1rem !important;
    border-bottom: 1px solid #e0e0e0 !important;
  }

  /* Last day section: no bottom border */
  [data-v-7819f9b3] > div:last-child > section:last-child {
    border-bottom: none !important;
  }

  /* ==========================================
     6. COVER PAGE STYLING
     ========================================== */

  /* Logo container on cover page */
  [data-v-7819f9b3] > section:nth-of-type(2) .w-56 {
    width: 120px !important;
    margin: 2rem auto !important;
  }

  /* Logo SVG */
  .logo svg,
  [data-v-7819f9b3] > section:nth-of-type(2) svg {
    fill: #1a1a1a !important;
  }

  /* "VOYAGES" text on cover */
  [data-v-7819f9b3] > section:nth-of-type(2) .text-5xl {
    font-size: 28pt !important;
    letter-spacing: 0.3em !important;
    color: #333333 !important;
    margin-bottom: 2rem !important;
    font-weight: 600 !important;
    border-bottom: 2px solid #cca44b !important;
    padding-bottom: 1rem !important;
    display: inline-block !important;
  }

  /* Programme name (h1) on cover */
  [data-v-7819f9b3] > section:nth-of-type(2) h1 {
    font-size: 22pt !important;
    line-height: 1.3 !important;
    color: #1a1a1a !important;
    font-weight: 700 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
  }

  /* Description on cover */
  [data-v-7819f9b3] > section:nth-of-type(2) > div:last-of-type {
    font-size: 11pt !important;
    line-height: 1.6 !important;
    color: #444444 !important;
    max-width: 85% !important;
    margin: 0 auto !important;
  }

  /* Last updated date on cover */
  .text-sm.text-accent {
    font-size: 9pt !important;
    color: #888888 !important;
    margin-top: 2rem !important;
    display: block !important;
  }

  /* ==========================================
     7. TYPOGRAPHY FOR PRINT
     ========================================== */
  h1 {
    font-size: 18pt !important;
    line-height: 1.3 !important;
    margin-top: 0.8rem !important;
    margin-bottom: 0.5rem !important;
    color: #1a1a1a !important;
  }

  h2 {
    font-size: 15pt !important;
    line-height: 1.3 !important;
    margin-top: 1rem !important;
    margin-bottom: 0.4rem !important;
    color: #1a1a1a !important;
    padding-bottom: 0.3rem !important;
    border-bottom: 1px solid #cca44b !important;
  }

  h3 {
    font-size: 13pt !important;
    line-height: 1.3 !important;
    margin-top: 0.6rem !important;
    margin-bottom: 0.3rem !important;
    color: #222222 !important;
  }

  p {
    font-size: 10.5pt !important;
    line-height: 1.5 !important;
    margin-bottom: 0.3rem !important;
    orphans: 3 !important;
    widows: 3 !important;
  }

  li {
    font-size: 10.5pt !important;
    line-height: 1.4 !important;
  }

  ul,
  ol {
    margin-left: 1.2rem !important;
    margin-top: 0.3rem !important;
    margin-bottom: 0.3rem !important;
  }

  strong,
  b {
    color: #1a1a1a !important;
  }

  /* Section icon styling (reduce Lucide icons) */
  .flex.gap-4 svg {
    width: 20px !important;
    height: 20px !important;
    stroke: #cca44b !important;
    flex-shrink: 0 !important;
  }

  /* ==========================================
     8. IMAGE SIZING FOR PRINT
     ========================================== */
  .rich-text-image {
    width: 60% !important;
    max-width: 400px !important;
    height: auto !important;
    margin: 0.8rem auto !important;
    display: block !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* Accommodation section images: smaller (there are many) */
  [data-v-7819f9b3] > section:nth-of-type(5) .rich-text-image {
    width: 50% !important;
    max-width: 300px !important;
  }

  /* Day section images */
  [data-v-7819f9b3] > div:last-child .rich-text-image {
    width: 55% !important;
    max-width: 350px !important;
    margin: 0.6rem auto !important;
  }

  /* Generic img fallback */
  img:not(.rich-text-image) {
    max-width: 100% !important;
    height: auto !important;
  }

  /* ==========================================
     9. TABLE STYLING FOR PRINT
     ========================================== */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 9.5pt !important;
    margin: 0.5rem 0 !important;
  }

  th,
  td {
    border: 1px solid #cccccc !important;
    padding: 4px 8px !important;
    text-align: left !important;
  }

  th {
    background-color: #f5f5f5 !important;
    font-weight: 700 !important;
  }

  /* ==========================================
     10. SECTION SPACING
     ========================================== */
  section[data-v-7819f9b3] {
    margin-bottom: 1rem !important;
  }

  /* ==========================================
     11. LINK STYLING FOR PRINT
     ========================================== */
  a {
    color: #1a1a1a !important;
    text-decoration: none !important;
  }

}
