/**
 * GSE Theme – Document Page
 * Single-content-page template (`body.document-default`) — used for
 * regular pages *and* news articles like "Ein langer Sommer". Counterpart
 * to modular.css's magazine-style homepage and to list.css's category
 * pages (see list-page.css). On the live site these bundles are mutually
 * exclusive per page; here everything is loaded together, so this file
 * scopes its content to stay safe.
 *
 * `nav`, `main`, the base reset and the `#body`-scoped chrome shared with
 * list pages (section padding/bg, `.divider`, `.content-container`,
 * `.metadata`'s base layout) live in base.css / navigation.css /
 * content-page.css — reused as-is, not repeated here. events.css is
 * needed too (only the Vertretungsplan page renders one, but it's
 * part of this template). articles.css/article-core.css are NOT
 * needed — document pages never render `.article`-classed elements.
 * (header.css is homepage-only, not needed either.)
 * This file only adds what's specific to document pages.
 */
@import url("variables.css");

body.document-default section#body {
  img.avatar {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 100px;
    border: 1px solid #f8f8f8;
    box-shadow: 3px 3px 10px 0px var(--color-dark);

    @media screen and (max-width: 500px) {
      width: 50px;
      height: 50px;
    }

    &.ootb {
      position: relative;
      left: -25px;

      @media screen and (max-width: 500px) {
        left: -7px;
      }
    }
  }

  table {
    margin: 10px 0;
    border-collapse: collapse;
    border-radius: 3px;

    @media screen and (max-width: 500px) {
      display: block;
      overflow-x: auto;
      white-space: nowrap;
    }

    th,
    td {
      padding: 15px;

      @media screen and (max-width: 500px) {
        padding: 5px;
        font-size: var(--fs-sm);
      }
    }

    thead {
      color: var(--color-light);
      background-color: var(--color-yellow);

      th {
        font-family: var(--font-serif);
        font-style: italic;
        font-size: var(--fs-lg);
        font-weight: var(--fw-light);

        @media screen and (max-width: 500px) {
          font-size: var(--fs-sm);
        }
      }
    }

    tbody {
      tr {
        background-color: var(--color-stripe-green);

        &:nth-child(odd) {
          background-color: var(--color-stripe-teal);
        }

        td {
          color: var(--color-dark);
        }

        &.newline {
          border-top: 3px solid var(--color-white);
        }
      }
    }
  }

  h1,
  h2,
  h3,
  h4,
  h5 {
    font-family: var(--font-serif);
    font-size: 36px;
    font-weight: var(--fw-light);
    margin-top: 20px;
    margin-bottom: 5px;
  }
  h1:first-child {
    margin-top: 5px;
  }
  h2 {
    font-size: 27px;
    margin-top: 15px;
    margin-bottom: 5px;
  }
  h3,
  h4,
  h5 {
    font-family: var(--font-sans);
    font-size: var(--fs-xl);
  }

  ol,
  ul {
    list-style-position: inside;

    li {
      padding-bottom: 9px;
    }
  }

  p {
    margin-bottom: 1em;
    line-height: 1.5;
  }

  b {
    color: var(--color-black);
  }

  a {
    color: var(--color-muted);

    &:hover {
      color: var(--color-dark);
      text-decoration: underline;
    }
  }

  .metadata {
    /* base layout (color/flex/breadcrumb/a) comes from content-page.css */
    .date {
      font-family: var(--font-serif);
      font-size: var(--fs-2xl);
      font-style: italic;
      font-weight: var(--fw-light);
      position: relative;
      top: -8px;
    }

    .categories {
      padding: 5px;

      > * {
        margin: 3px;
        padding: 3px 10px;
        border-radius: 3px;
        color: var(--color-light);

        &:nth-child(1) {
          background-color: var(--color-orange);
        }
        &:nth-child(2) {
          background-color: var(--color-yellow);
        }
        &:nth-child(3) {
          background-color: var(--color-green);
        }
        &:nth-child(4) {
          background-color: var(--color-teal);
        }
      }
    }
  }

  .content-container.wide-documents {
    /* base layout comes from content-page.css */
    flex-direction: column-reverse;
  }

  .document-container {
    background-color: var(--color-grey-light);
    color: var(--color-dark);
    padding: 20px;
    margin: 0 20px 0 0;
    min-width: 145px;
    max-width: 145px;
    border-radius: 3px;
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow: hidden;

    /* .wide and the ≤800px breakpoint both collapse this sidebar into
       a horizontal row — kept as two rules because either condition
       can apply independently (a .wide box below 800px still needs
       both), not because they're accidentally duplicated. */
    @media screen and (max-width: 800px) {
      flex-direction: row;
      min-width: initial;
      max-width: initial;
      align-items: flex-start;
      justify-content: space-between;
      margin: 0;

      .pdf-element {
        margin: 0 5px;
      }
    }

    &.wide {
      flex-direction: row;
      min-width: initial;
      max-width: initial;
      align-items: flex-start;
      justify-content: space-between;
      margin: 0;

      .pdf-element {
        margin: 0 5px;
      }
      .title {
        display: none;
      }
    }

    .title {
      font-size: var(--fs-lg);
      color: var(--color-muted);

      @media screen and (max-width: 800px) {
        display: none;
      }
    }

    .pdf-element {
      padding: 15px 0;
      max-width: 145px;

      .download-link {
        word-break: break-word;
        font-size: var(--fs-sm);
        color: var(--color-dark);

        &:hover {
          text-decoration: underline;
        }
      }
    }

    .pdf-item {
      cursor: pointer;
      border: 1px solid var(--color-black);
      box-shadow: 3px 3px 5px var(--color-dark);
      width: 105px;
      height: 150px;
      background-color: var(--color-white);
      color: var(--color-orange);
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 10px;

      > * {
        display: block;
      }

      .default {
        font-size: 48px;
      }
      .hover {
        display: none;
      }

      &:hover {
        .hover {
          display: initial;
        }
        .default {
          display: none;
        }
      }
    }
  }
}
