/* Custom overrides on top of the re-terminal theme. */

/* --- Profile photo ------------------------------------------------------ */

.profile-photo {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border: 2px solid var(--accent);
  border-radius: 4px;
  margin: 0 0 20px 0;
}

.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.profile-header .profile-photo {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.profile-header__text {
  flex: 1 1 260px;
  min-width: 260px;
}

.profile-header__text > *:first-child {
  margin-top: 0;
}

/* --- Print / "Save as PDF" ---------------------------------------------- */
/*
   The module requires being able to hand in a PDF version of this site.
   Browsers can do that natively (Ctrl+P -> Save as PDF), but the default
   output keeps the dark theme and the site chrome. These rules make the
   printed version readable on paper.
*/

@media print {
  :root {
    --accent: #000;
    --background: #fff;
    --color: #000;
    --menu-color: #000;
    --border-color: #999;
    --accent-contrast-color: #fff;
  }

  html,
  body {
    background: #fff !important;
    color: #000 !important;
  }

  .container {
    border: none !important;
    max-width: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
  }

  /* Site chrome adds nothing on paper. */
  .navigation-menu,
  .menu--mobile,
  .menu--desktop,
  .footer,
  .pagination,
  #banner {
    display: none !important;
  }

  .header {
    border-bottom: 1px solid #999;
    margin-bottom: 16px;
  }

  .logo {
    background: none !important;
    color: #000 !important;
    padding: 0 !important;
    font-weight: bold;
  }

  a {
    color: #000 !important;
    text-decoration: underline;
  }

  /* Print the destination of real links, so a paper copy stays useful.
     Skip in-page anchors and the heading anchor markers. */
  .post-content a[href^="http"]::after,
  .index-content a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    word-break: break-all;
  }

  .hanchor {
    display: none !important;
  }

  /* Keep headings attached to the text that follows them. */
  h1,
  h2,
  h3,
  h4 {
    page-break-after: avoid;
    break-after: avoid;
  }

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

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

  .post {
    border-bottom: none !important;
  }

  .post-title {
    border-bottom: 1px solid #000 !important;
  }

  .post-title::after {
    display: none !important;
  }

  pre,
  code,
  kbd {
    background: #f4f4f4 !important;
    color: #000 !important;
    border: 1px solid #ccc;
  }

  blockquote {
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
  }
}
