/* Shared Screen Showcase & Print Engine for A3 / A2 2-Sided Laminated Pitch Boards */
@page {
  size: A3 portrait;
  margin: 0;
}

* {
  box-sizing: border-box;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

html, body {
  margin: 0;
  padding: 0;
}

/* Screen Preview Environment (Desktop + Mobile iPhone/Android Safe) */
@media screen {
  body {
    background: #111615;
    min-height: 100vh;
    padding: 72px 16px 48px;
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
  }

  .preview-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-height: 56px;
    z-index: 9999;
    background: rgba(13, 21, 18, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(200, 166, 104, 0.38);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 18px;
    color: #f3efe6;
    gap: 10px;
    flex-wrap: wrap;
  }

  .pb-left, .pb-right {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
  }

  .pb-home {
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ebd5a7;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(200, 166, 104, 0.4);
    background: rgba(200, 166, 104, 0.1);
    white-space: nowrap;
  }

  .pb-home:hover {
    background: rgba(200, 166, 104, 0.22);
  }

  .pb-tab {
    text-decoration: none;
    color: rgba(243, 239, 230, 0.78);
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    transition: all 0.2s ease;
    white-space: nowrap;
  }

  .pb-tab:hover {
    color: #fff;
    border-color: rgba(200, 166, 104, 0.55);
  }

  .pb-tab.active {
    background: #c8a668;
    color: #102019;
    border-color: #c8a668;
    font-weight: 700;
  }

  .pb-btn {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: #f3efe6;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 11px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
  }

  .pb-btn:hover {
    border-color: #c8a668;
    color: #f5deb0;
  }

  .pb-btn.active {
    background: rgba(200, 166, 104, 0.22);
    border-color: #c8a668;
    color: #f5deb0;
  }

  .pb-btn-print {
    background: #236b48;
    border-color: #369366;
    color: #fff;
    font-weight: 600;
  }

  .pb-btn-print:hover {
    background: #2b8258;
    border-color: #4db380;
    color: #fff;
  }

  .sheet-stage {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 28px;
    max-width: 100%;
    margin: 0 auto;
  }

  .sheet-stage.one-up {
    flex-direction: column;
    align-items: center;
  }

  .sheet-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .side-pill {
    margin-bottom: 10px;
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(200, 166, 104, 0.4);
    color: #ebd5a7;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
  }

  .sheet-scaler {
    position: relative;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
  }

  .sheet-scaler > .sheet {
    transform-origin: top left;
  }

  body.editing-enabled .sheet [contenteditable="true"] {
    outline: 1px dashed rgba(200, 166, 104, 0.8);
    outline-offset: 2px;
    cursor: text;
  }

  @media (max-width: 760px) {
    body {
      padding: 102px 10px 36px;
    }
    .preview-bar {
      padding: 8px 10px;
      gap: 6px;
    }
    .pb-tab, .pb-btn, .pb-home {
      font-size: 11px;
      padding: 5px 9px;
    }
    #toggleEditBtn, #toggleZoomBtn {
      display: none;
    }
    .side-pill {
      font-size: 10px;
      padding: 4px 11px;
    }
  }
}

/* Core ISO A3 / A2 Sheet Geometry (297mm x 420mm = 1 : 1.4142) */
.sheet {
  width: 297mm;
  height: 420mm;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Print Exact Rules */
@media print {
  html, body {
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 297mm !important;
  }

  .no-print, .preview-bar, .side-pill {
    display: none !important;
  }

  .sheet-stage, .sheet-wrap, .sheet-scaler {
    display: block !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  .sheet {
    zoom: 1 !important;
    transform: none !important;
    width: 297mm !important;
    height: 420mm !important;
    margin: 0 !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .sheet-front {
    page-break-after: always !important;
    break-after: page !important;
  }

  .sheet-back {
    page-break-after: auto !important;
    break-after: auto !important;
  }
}
