/**
 * @file
 * Print stylesheet — Trieste Trasporti
 *
 * Mostra solo l'area del contenuto principale.
 * Nasconde: header, menu, footer, sidebar, ads, social sharing,
 * admin tabs, ricerca, breadcrumb, banner.
 */

 /* Immagine di stampa: nascosta su schermo, ignorata dagli screen reader */
.print-only-img {
  display: none;
  visibility: hidden;
}

@media print {

  /* =============================================
     NASCONDERE TUTTO TRANNE IL CONTENUTO
     ============================================= */

  /* --- Menu principale e secondario (region templates) --- */
  .py--main-menu,
  .position-sticky--menu,
  .position-sticky--secondary-nav,
  .b-black-01.py-10 {
    display: none !important;
  }

  /* --- Menu mobile overlay --- */
  .menu-mobile,
  .js-menu-overlay,
  .hamburger {
    display: none !important;
  }

  /* --- Scroll up / search region --- */
  .scroll-up-search,
  [class*="scroll-up"] {
    display: none !important;
  }

  /* --- Banner principale --- */
  .main-banner,
  .oms-banner {
    display: none !important;
  }

  /* --- Barra di ricerca --- */
  .search-container,
  .search-bar,
  .search-bar--internal {
    display: none !important;
  }

  /* --- Breadcrumb --- */
  .section-breadcrumbs-share {
    display: none !important;
  }

  /* --- Sidebar sinistra e destra --- */
  .hide-for-small.show-for-large.large-2,
  .show-for-xl1.xl1-2 {
    display: none !important;
  }

  /* --- Footer --- */
  footer,
  footer.footer {
    display: none !important;
  }

  /* --- Torna in cima --- */
  .totop {
    display: none !important;
  }

  /* --- Posizione assoluta overlay (posabsall region) --- */
  .posabsall,
  [class*="posabsall"] {
    display: none !important;
  }

  /* --- Banner pubblicitari (Revive Adserver) --- */
  .ads--square,
  .ads--vertical,
  [class*="ads--"],
  ins[data-revive-zoneid],
  ins[data-revive-id] {
    display: none !important;
  }

  /* --- Social sharing (CONDIVIDI) --- */
  .share,
  .share-extended,
  .nav-share,
  #modal-share,
  [class*="social-sharing"],
  [class*="better-social-sharing"] {
    display: none !important;
  }

  /* --- Admin tabs (Visualizza, Modifica, Elimina, etc.) --- */
  .tabs,
  .local-tasks,
  nav.tabs,
  ul.tabs,
  .action-links,
  #block-tt-local-tasks,
  #block-tt-local-actions {
    display: none !important;
  }

  /* --- Modali (alert, share, reveal) --- */
  .reveal,
  .reveal-overlay,
  #modal-alert,
  #modal-share {
    display: none !important;
  }

  /* --- Drupal toolbar e admin bar --- */
  #toolbar-administration,
  #toolbar-bar,
  .toolbar-tray,
  #toolbar-item-administration-tray {
    display: none !important;
  }
  body.toolbar-fixed,
  body.toolbar-horizontal {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }

  /* --- Pre-content / littlebanner region --- */
  .littlebanner,
  [class*="littlebanner"] {
    display: none !important;
  }

  /* --- Avvisi news laterali (ULTIME NEWS ticker) --- */
  .view-avvisi-infomobilita,
  [class*="avvisi-infomobilita"],
  .alert-bar,
  .alert {
    display: none !important;
  }

  /* --- Cookie banner --- */
  #CybotCookiebotDialog,
  [id*="CookieConsent"],
  [id*="cookiebot"],
  .cc-banner {
    display: none !important;
  }

  /* --- Skip link --- */
  .skip-link {
    display: none !important;
  }

  /* --- Home-only columns --- */
  .aside-container {
    display: none !important;
  }

  /* --- Google Tag Manager noscript iframes --- */
  noscript iframe[src*="googletagmanager"] {
    display: none !important;
  }

  /* --- "Ti può interessare" blocks --- */
  .view-ti-puo-interessare {
    display: none !important;
  }

  /* =============================================
     LAYOUT: CONTENUTO A LARGHEZZA PIENA
     ============================================= */

  body {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 12pt;
    line-height: 1.5;
    color: #000 !important;
    background: #fff !important;
  }

  /* Il contenuto deve occupare il 100% */
  .grid-container {
    max-width: 100% !important;
    padding: 0 10pt !important;
    margin: 0 !important;
  }

  .grid-x {
    flex-wrap: nowrap !important;
  }

  /* La cella del contenuto principale (large-10 / xl1-8) → full width */
  .cell.small-12.large-10.xl1-8,
  .cell.small-12.large-10,
  .position-relative {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  .wrapper {
    padding: 0 !important;
    margin: 0 !important;
  }

  main {
    width: 100% !important;
  }

  /* =============================================
     TIPOGRAFIA E CONTRASTO
     ============================================= */

  *,
  *::before,
  *::after {
    color: #000 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* Immagine reale visibile solo in stampa */
  .print-only-img {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin-bottom: 12pt !important;
    page-break-inside: avoid;
  }

  /* Card header: layout lineare in stampa */
  .card-header--page,
  .card-header--element {
    position: relative !important;
    overflow: visible !important;
    padding-bottom: 0 !important;
  }

  .card-header--page > .wrapper,
  .card-header--element > .wrapper {
    position: static !important;
    padding: 0 !important;
  }

  .card-header--page > .wrapper > .content,
  .card-header--element > .wrapper > .content {
    position: static !important;
  }

  .card-header--page > .wrapper > .content > .title > span,
  .card-header--page > .wrapper > .content > .title > h1,
  .card-header--element > .wrapper > .content > .title > span,
  .card-header--element > .wrapper > .content > .title > h1 {
    background-color: transparent !important;
    color: #000 !important;
    padding: 0 !important;
  }

  /* Preservare immagini */
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    orphans: 3;
    widows: 3;
  }

  p, li, blockquote {
    orphans: 3;
    widows: 3;
  }

  table, figure, pre, blockquote {
    page-break-inside: avoid;
  }

  /* Link: mostra URL dopo il testo */
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555 !important;
    word-break: break-all;
  }

  /* Non mostrare URL per ancore interne, javascript e link vuoti */
  a[href^="#"]::after,
  a[href^="javascript:"]::after,
  a[href=""]::after,
  a.link--absolute::after,
  .field--name-field-allegati a[href]::after {
    content: "" !important;
  }

  /* Allegati: mostrare solo il nome file */
  .field--name-field-allegati a[href] {
    text-decoration: underline !important;
  }

  /* =============================================
     INTERRUZIONI DI PAGINA
     ============================================= */

  article,
  .node {
    page-break-before: auto;
  }
}
