@media print {

  /* ============================================================
     1. PAGE SETUP
     ============================================================ */

  @page {
    size: letter portrait;
    margin: 0.85in 0.85in 1in 0.85in;
  }

  @page :first {
    margin-top: 0.5in; /* slightly tighter on first page for byline/headline */
  }


  /* ============================================================
     2. GLOBAL RESETS FOR PRINT
     ============================================================ */

  *,
  *::before,
  *::after {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-size: 11pt;
    line-height: 1.55;
    color: black;
    background: white;
    max-width: 100%;
    margin: 0;
    padding: 0;
  }


  /* ============================================================
     3. HIDE NON-EDITORIAL ELEMENTS
     ============================================================ */

  /* Navigation, menus, header chrome */
  header,
  nav,
  .site-header,
  .site-nav,
  .main-nav,
  .top-nav,
  .skip-link,
  .utility-nav,
  .search-form,
  .search-bar,
  [class*="menu"],
  [class*="nav-"],
  [class*="-nav"],
  [id*="menu"],
  [id*="nav"] {
    display: none !important;
  }

  /* Sidebar, related content, widgets */
  aside,
  .sidebar,
  .widget,
  .related-stories,
  .related-content,
  [class*="related"],
  [class*="sidebar"],
  [class*="widget"] {
    display: none !important;
  }

  /* Footer */
  footer,
  .site-footer,
  [class*="footer"] {
    display: none !important;
  }

  /* Social sharing, comments, interactive elements */
  .social-share,
  .share-links,
  .comments,
  .comment-form,
  [class*="share"],
  [class*="social"],
  [class*="comment"],
  button,
  input,
  select,
  textarea,
  video,
  audio,
  iframe,
  object,
  embed {
    display: none !important;
  }

  /* Cookie banners, overlays, modals */
  [class*="cookie"],
  [class*="banner"],
  [class*="modal"],
  [class*="overlay"],
  [class*="popup"],
  [role="dialog"],
  [aria-modal="true"] {
    display: none !important;
  }

  /* Sticky/fixed elements */
  [style*="position: fixed"],
  [style*="position:fixed"],
  [style*="position: sticky"],
  [style*="position:sticky"] {
    display: none !important;
  }


  /* ============================================================
     4. ARTICLE / MAIN CONTENT
     ============================================================ */

  main,
  article,
  .article-body,
  .article-content,
    .container,
  .news-article,
  [class*="article-"],
  [class*="-article"],
  [role="main"] {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
  }


  /* ============================================================
     5. TYPOGRAPHY
     ============================================================ */

  h1 {
    font-size: 20pt;
    font-weight: bold;
    line-height: 1.2;
    margin: 0 0 10pt 0;
    page-break-after: avoid;
    break-after: avoid;
  }

  h2 {
    font-size: 13pt;
    font-weight: bold;
    margin: 18pt 0 20pt 0 !important;
    page-break-after: avoid;
    break-after: avoid;
    border-bottom: 0.5pt solid black;
    padding-bottom: 3pt;
  }

  h3,
  h4,
  h5,
  h6 {
    font-size: 11pt;
    font-weight: bold;
    margin: 14pt 0 4pt 0;
    page-break-after: avoid;
    break-after: avoid;
  }

  p {
    margin: 0 0 8pt 0;
    orphans: 3;
    widows: 3;
  }

  /* Byline / author line — common class patterns */
  .byline,
  .article-byline,
  .author,
  [class*="byline"],
  [class*="author"] {
    font-size: 9.5pt;
    font-style: italic;
    margin-bottom: 4pt;
    display: block;
  }

  /* Publication date */
  .date,
  .published,
  .article-date,
  time,
  [class*="date"] {
    font-size: 9pt;
    display: block;
    margin-bottom: 16pt;
  }


  /* ============================================================
     6. PULL QUOTES AND BLOCKQUOTES
     ============================================================ */

  blockquote {
    margin: 6pt 12pt;
    padding: 4pt 0 4pt 12pt;
    border-left: 2pt solid black;
    font-style: italic;
    font-size: 10.5pt;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Pull quote variations */
  .pullquote,
  .pull-quote,
  [class*="pullquote"],
  [class*="pull-quote"] {
    margin: 16pt 0;
    padding: 10pt 0;
    border-top: 1.5pt solid black;
    border-bottom: 1.5pt solid black;
    font-size: 13pt;
    font-style: italic;
    text-align: left;
    page-break-inside: avoid;
    break-inside: avoid;
  }


  /* ============================================================
     7. LINKS — show full URLs in print
     ============================================================ */

  a,
  a:visited {
    color: black !important;
    text-decoration: underline;
  }

  /* Show the URL after each link in parentheses */
  a[href]::after {
    content: " (" attr(href) ")";
    font-style: italic;
    word-break: break-all;
      color:#666666;
  }

  /* Do NOT show URLs for non-useful links */
  a[href^="#"]::after,        /* anchor/jump links */
  a[href^="javascript"]::after,
  a[href^="mailto"]::after,
  nav a::after,
  [class*="nav"] a::after,
  header a::after {
    content: "" !important;
  }


  /* ============================================================
     8. IMAGES AND MEDIA
     ============================================================ */

  img {
    max-width: 100% !important;
    height: auto !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Hero / feature images — keep, but cap height */
  .hero-image img,
  .article-image img,
  .lead-image img,
  [class*="hero"] img,
  [class*="lead-image"] img {
    max-height: 3.5in;
    object-fit: cover;
    display: block;
    margin: 12pt auto;
  }

  /* Caption text */
  figcaption,
  .caption,
  .image-caption,
  [class*="caption"] {
    font-size: 8.5pt;
    font-style: italic;
    margin-top: 3pt;
    line-height: 1.3;
      width:auto !important;
  }

  figure {
    page-break-inside: avoid;
    break-inside: avoid;
    margin: 12pt 0;
  }


  /* ============================================================
     9. TABLES
     ============================================================ */

  table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  th,
  td {
    border: 0.5pt solid black;
    padding: 4pt 6pt;
    text-align: left;
    vertical-align: top;
  }

  th {
    font-weight: bold;
    background: #eeeeee !important; /* lightest acceptable for print toner */
    color: black !important;
  }


  /* ============================================================
     10. PAGE BREAK CONTROLS
     ============================================================ */

  /* Never break inside these elements */
  figure,
  blockquote,
  .pullquote,
  table,
  pre {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Headings should stay with the content that follows them */
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    break-after: avoid;
  }

  /* Avoid breaking right after the first line of a paragraph */
  p {
    orphans: 3;
    widows: 3;
  }


  /* ============================================================
     11. PRINT HEADER (added via CSS — no JS required)
     Adds the site name at the top of the first page automatically.
     ============================================================ */

  body::before {
    content: url("https://www.bowdoin.edu/_files/img/wordmark-white-136-52.png");
  background: white;

    display: block;
    font-size: 8.5pt;
    font-family: Arial, Helvetica, sans-serif;
    letter-spacing: 0.04em;
    border-bottom: 0.75pt solid black;
    padding-bottom: 4pt;
    margin-bottom: 20pt;
  }


  /* ============================================================
     12. PRINT FOOTER (page numbers via CSS counters)
     ============================================================ */

  @page {
    @bottom-right {
      content: "Page " counter(page) " of " counter(pages);
      font-family: Arial, Helvetica, sans-serif;
      font-size: 6pt;
      color: black;
      }
      @bottom-left {
      content: "Bowdoin College | bowdoin.edu";
      font-family: Arial, Helvetica, sans-serif;
      font-size: 6pt;
      color:#aaaaaa;
    }
  }

} /* end @media print */
}