/*
    JSPWiki - a JSP-based WikiWiki clone.

    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); fyou may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
*/
/*
Section: Print-media
    Styles to improve the page rendering during printing.
    Printing displays the page-titel and page-content; other blocks
    like the favorites, login-sections, search box, menu dropdowns etc. are hidden.

    Tabbed sections are printed one after the other.
    Accordion sections are printed one after the other.
*/

@media print {

/*
Inherit parts of Bootstrap:print.less ;
*/
//
// Basic print styles
// --------------------------------------------------
// Source: https://github.com/h5bp/html5-boilerplate/blob/master/css/main.css

  * {
    text-shadow: none !important;
    //color: #000 !important; // Black prints faster: h5bp.com/s
    //background: transparent !important;
    box-shadow: none !important;
  }

  .pagename {
    font-size:@font-size-h1;
    line-height:1;
    margin-bottom:1em;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

/* seems too intrusive
  a[href]:after {
    content: " (" attr(href) ")";
    font-size:85%;
    color:grey;
    font-family:"Courier New", Courier, mono; font-size:8pt;
  }

  // Dont show links for images, or javascript/internal links
  a[href^="javascript:"]:after,
  a[href^="#"]:after {
    content: "";
  }
*/

  pre,
  blockquote {
    //border: 1px solid #999;
    page-break-inside: avoid;
  }

  thead {
    display: table-header-group; // h5bp.com/t
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  img {
    max-width: 100% !important;
  }

  @page {
    margin: 2cm 1cm;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }

  // Chrome (OSX) fix for https://github.com/twbs/bootstrap/issues/11245
  // Once fixed, we can just straight up remove this.
  select {
    background: #fff !important;
  }


/*
  .table {
    td,
    th {
      background-color: #fff !important;
    }
  }
  .btn,
  .dropup > .btn {
    > .caret {
      border-top-color: #000 !important;
    }
  }
  .label {
    border: 1px solid #000;
  }
*/

header, footer,
  table, tt,pre {
    overflow:visible;
    page-break-before: avoid;
    page-break-inside: avoid;
  }

  .table {
    border-collapse: collapse !important;
  }
  .table-bordered {
    th,
    td {
      border: 1px solid #ddd !important;
    }
  }


/*

JSPWiki print-specific styles

*/

.sidebar { display: none; }
.content:after { display:none; }  //hide sidebar background color
.content.active .page { width:100%; }  //nok in chrome

//chome bug see https://code.google.com/p/chromium/issues/detail?id=412281
.content, .page, .sidebar  { .transition(none); }


//FF hack,  was printing only the first page
//See https://bugzilla.mozilla.org/show_bug.cgi?id=258397#c13
//Remove overflow on content,  and remove sticky footer (flex)
.content {
    overflow: visible;
    flex: none;
}
body > .container-fluid,
body > .container {
    display: block;
    flex-flow: initial;
}

.header .logo, .userbox, .titlebox, .searchbox, .breadcrumb, .row.sticky,
.header .navigation,
a.feed[href], .editsection, .hashlink, .filter-input, .slmbx,
.index .header, a[href='#top'] {
    display:none;
}
.header, .footer {
    background: none !important; //overwrite all background-xxx settings on header & footer
    color: inherit;
}
//.footer { margin-top: 1em; }  //CHECKME

//show long pagenames without ellipsis  (undo text-overflow)
.header .pagename {
  overflow: visible;
  //text-overflow: ellipsis;
  white-space: normal;
}

/* hidden tabs are made visible during print
 * when printing a page, also the attachment tab gets printed
 */
.tabmenu {
    display:block;
    visibility:visible;
}
.hidetab {
    display:block;
    margin:1em 0;
}
.tabs { border:none; }
//todo : open all accordion sections


//CHECK -- ff bug : avoid floats during printing
//.commentbox { float:none; }

//FIXME: Page-break: force a new page with the explicit %%page-break style.
.page-break {
    //height:0;
    page-break-before:always;
    border:none;
    margin:0;
}


//make the special block markers print friendly by adding an icon in the left margin
div.info, div.information, div.warning, div.danger, div.error {
    position:relative;
    padding-left:3em;
}
div.info::before, div.information::before,
div.warning::before,
div.danger::before, div.error::before {
    position:absolute;
    font-family: 'FontJspwiki';
    left:0.75em;
    top:0.5em;
    font-size:1.5em;
}
div.info, div.information { .icon-info; }
div.warning { .icon-warning; }
div.danger, div.error { .icon-error; }


// CHECKME: Make sure to print collapsed items as if they were not collapsed
div.clpse {
    display:block;
    height:auto !important;
    //width:auto !important;
}


} /* end of @media print */
