/*
 * Every view except the designed front page: pages, posts, the news list and
 * the other lists, search and "not found" (resources/views/page, single,
 * index, search and 404, with their pieces in partials/inner). Loaded after
 * site.css, which sets the colours (--shirt, --shirt-dark, --shirt-light) and
 * the buttons. Written by hand; after any edit, set this file's ?id= in
 * mix-manifest.json to the first 20 characters of its MD5.
 *
 * Every class starts with in-. Width comes from Bootstrap's .container. The
 * two-column layout starts at 992 px, where the menu also expands.
 */

.in {
  --in-ink: #14171c;
  --in-muted: #5b6472;
  --in-paper: #f5f7fa;
  --in-line: #dfe5ee;
  --in-radius: 12px;
  background: #fff;
  color: var(--in-ink);
  line-height: 1.55;
  overflow-wrap: break-word;
}

/* The footer follows the page's own bottom space directly. */
main:has(.in) + .site-footer {
  margin-top: 0;
}

.in h1,
.in h2,
.in h3,
.in h4,
.in h5,
.in h6 {
  color: inherit;
  font-weight: 700;
  text-transform: none;
}

.in .btn {
  padding: .7rem 1.2rem;
  line-height: 1.2;
}

/* The heading area */
.in-head {
  padding: 34px 0 24px;
}

.in-head h1 {
  max-width: 16em;
  margin: 12px 0 0;
  font-size: clamp(2.1rem, 4.4vw, 3.2rem);
  line-height: 1.06;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.in-eyebrow {
  margin: 0;
  color: var(--shirt);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.in-eyebrow a {
  color: inherit;
  text-decoration: none;
}

.in-eyebrow a:hover {
  text-decoration: underline;
}

.in-lead {
  max-width: 34em;
  margin: 12px 0 0;
  color: var(--in-muted);
  font-size: 1.15rem;
}

/* Small rounded tags (a post's categories) and the line they sit on. */
.in-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
  color: var(--in-muted);
  font-size: .9rem;
}

.in-tag {
  padding: .2em .65em;
  border-radius: 999px;
  background: var(--shirt-light);
  color: var(--shirt-dark);
  font-size: .72rem;
  font-weight: 700;
  text-decoration: none;
}

a.in-tag:hover {
  background: #d5e3f8;
  color: var(--shirt-dark);
}

.in-more,
.in-back {
  color: var(--shirt);
  font-weight: 700;
  text-decoration: none;
}

.in-more:hover,
.in-back:hover {
  text-decoration: underline;
}

/* A post's heading area: the text and, beside it from 992 px, its picture. */
.in-post-head {
  padding: 28px 0 36px;
}

.in-post-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 26px;
  align-items: center;
}

.in-back {
  display: inline-block;
  margin-bottom: 18px;
}

.in-post-head h1 {
  max-width: none;
  margin: 14px 0 16px;
  font-size: clamp(2rem, 3.7vw, 2.75rem);
}

.in-byline {
  margin: 0;
  color: var(--in-muted);
}

.in-post-media {
  display: flex;
  min-width: 0;
}

/* Cropped to 3:2. A picture smaller than its place keeps its own width (set
   inline) and is not enlarged. */
.in-post-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  border-radius: var(--in-radius);
  box-shadow: 0 18px 40px rgba(18, 61, 126, .18);
  object-fit: cover;
  object-position: 50% 30%;
}

/* A post without a picture: the title alone, across the page. */
.in-post-head-plain h1 {
  max-width: 18em;
}

/* The content and, from 992 px, the side column to its right. */
.in-cols {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  padding-top: 28px;
  padding-bottom: 56px;
}

/* The line under the heading area, as wide as the text. */
.in-cols::before {
  content: "";
  position: absolute;
  top: 0;
  right: calc(var(--bs-gutter-x, 1.5rem) * .5);
  left: calc(var(--bs-gutter-x, 1.5rem) * .5);
  border-top: 1px solid var(--in-line);
}

.in-main {
  min-width: 0;
}

/* No side column (nothing to show in it): the content has the page. */
.in-cols:not(:has(> .in-side)) {
  grid-template-columns: minmax(0, 1fr);
}

.in-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  min-width: 0;
}

/* The text the club writes in the editor */
.in-prose {
  max-width: 43em;
  font-size: 1rem;
  line-height: 1.68;
}

.in-prose > * {
  margin-top: 0;
  margin-bottom: 0;
}

.in-prose > * + * {
  margin-top: 1.05em;
}

/* Pages type their subheadings as <h2 class="h5"> and <h3 class="h6">; the
   sizes are set here, whatever the class says. */
.in-prose h2 {
  margin-top: 1.9em;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -.02em;
  scroll-margin-top: 24px;
}

.in-prose h3 {
  margin-top: 1.6em;
  font-size: 1.2rem;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.in-prose h4,
.in-prose h5,
.in-prose h6 {
  margin-top: 1.5em;
  font-size: 1.06rem;
  line-height: 1.3;
}

.in-prose h2 + *,
.in-prose h3 + *,
.in-prose h4 + * {
  margin-top: .5em;
}

.in-prose > :first-child {
  margin-top: 0;
}

.in-prose a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.in-prose a:hover {
  color: var(--shirt-dark);
}

.in-prose a.btn {
  text-decoration: none;
}

.in-prose ul,
.in-prose ol {
  padding-left: 1.2em;
}

.in-prose li + li {
  margin-top: .4em;
}

.in-prose li::marker {
  color: var(--shirt);
}

.in-prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--in-radius);
}

/* A picture typed on a line of its own inside a paragraph (WordPress joins
   the two with a line break) keeps a paragraph's distance from the text
   before and after it. */
.in-prose p > br + img,
.in-prose p > br + a > img {
  margin-top: 1.05em;
}

.in-prose p > img:has(+ br),
.in-prose p > a:has(+ br) > img {
  margin-bottom: 1.05em;
}

.in-prose iframe,
.in-prose video,
.in-prose embed,
.in-prose object {
  max-width: 100%;
}

.in-prose blockquote {
  padding-left: 1em;
  border-left: 3px solid var(--shirt-light);
  color: var(--in-muted);
}

.in-prose .small,
.in-prose small {
  color: var(--in-muted);
  font-size: .88rem;
}

.in-prose .table-responsive + .small {
  margin-top: .6em;
}

/* Tables: the training times, the top scorer lists, and tables typed into a
   page. A light blue header row and thin lines. */
.in-prose .table-responsive {
  border: 1px solid var(--in-line);
  border-radius: var(--in-radius);
}

.in-prose table {
  width: 100%;
  max-width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: .95rem;
  line-height: 1.4;
}

/* A table typed into a text (not the training times or a top scorer list,
   which have their own box) scrolls sideways inside itself when it is wider
   than the column, on every screen. */
.in-prose > table,
.in-prose :not(.table-responsive):not(.dataTables_wrapper) > table {
  display: block;
  overflow-x: auto;
  border: 1px solid var(--in-line);
}

/* Its rows still fill the frame when the table is narrower than the column. */
.in-prose > table > tbody:only-child,
.in-prose :not(.table-responsive):not(.dataTables_wrapper) > table > tbody:only-child {
  display: table;
  width: 100%;
}

.in-prose caption {
  padding: 12px 16px;
  border-bottom: 1px solid var(--in-line);
  background: var(--in-paper);
  color: var(--in-muted);
  font-size: .85rem;
  text-align: left;
  caption-side: top;
}

.in-prose th,
.in-prose td {
  padding: 12px 16px;
  border: 0;
  border-top: 1px solid var(--in-line);
  background-color: transparent;
  box-shadow: none;
  text-align: left;
  vertical-align: top;
}

.in-prose th {
  padding-top: 10px;
  padding-bottom: 10px;
  background-color: var(--shirt-light);
  color: var(--shirt);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.in-prose thead th {
  border-top: 0;
  white-space: nowrap;
}

.in-prose tr:first-child > td,
.in-prose thead + tbody > tr:first-child > td {
  border-top: 0;
}

.in-prose thead + tbody > tr:first-child > td {
  border-top: 1px solid var(--in-line);
}

/* Bootstrap draws a heavy line between a table's head and body. */
.in-prose .table > :not(:first-child) {
  border-top: 0;
}

.in-prose td .small,
.in-prose td small {
  color: var(--in-muted);
  font-size: .9em;
}

/* The top scorer lists' sortable table (DataTables): ten columns, so less
   air, and none of the script's own black lines. */
.in-prose table.dataTable thead th {
  padding: 10px 16px 10px 10px;
  border-bottom: 0;
}

.in-prose table.dataTable tbody td {
  padding: 10px;
}

.in-prose table.dataTable.no-footer {
  border-bottom: 0;
}

.in-prose .dataTables_filter {
  margin: 0;
  padding: 10px 12px;
  color: var(--in-muted);
  font-size: .9rem;
}

.in-prose .dataTables_filter input {
  max-width: 100%;
  padding: .35rem .6rem;
  border: 1px solid var(--in-line);
  border-radius: 8px;
}

/* On a phone app.css makes every table cell tiny and unbreakable, which
   suits the ten-column list. Other tables keep a readable size and scroll
   sideways inside their own box instead. */
@media (max-width: 767.98px) {
  .in-prose table:not(.dataTable) th,
  .in-prose table:not(.dataTable) td {
    padding: 10px 12px !important;
    white-space: normal;
    text-align: left;
  }

  .in-prose table:not(.dataTable) td {
    font-size: .88rem;
  }

  .in-prose table:not(.dataTable) th {
    font-size: .68rem;
    white-space: nowrap;
  }

  .in-prose .table-responsive > table:not(.dataTable) {
    min-width: 520px;
  }

  .in-prose caption {
    padding-right: 12px;
    padding-left: 12px;
  }
}

/* A list of posts: one row each, led by its date, its picture on the right. */
.in-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.in-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--in-line);
}

.in-row:first-child {
  padding-top: 0;
}

.in-row-date {
  grid-row: 1 / span 2;
  margin: 0;
  color: var(--shirt-dark);
  line-height: 1.2;
}

.in-row-date b {
  display: block;
  color: var(--shirt);
  font-size: 1.8rem;
  line-height: 1;
  letter-spacing: -.03em;
}

.in-row-date span {
  font-size: .76rem;
  font-weight: 700;
}

.in-row-text {
  grid-column: 2;
  min-width: 0;
}

.in .in-row-title {
  margin: 8px 0;
  font-size: 1.2rem;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.in-row-title a {
  color: inherit;
  text-decoration: none;
}

.in-row-title a:hover {
  color: var(--shirt);
}

.in-row-excerpt p {
  margin: 0 0 10px;
  color: var(--in-muted);
}

.in-row-by {
  margin: 0;
  color: var(--in-muted);
  font-size: .85rem;
}

/* On a phone the picture sits above the title, in the text's column. */
.in-row-photo {
  grid-row: 1;
  grid-column: 2;
  align-self: start;
}

.in-row-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--in-radius);
  background: var(--shirt-light);
  object-fit: cover;
  object-position: 50% 30%;
}

/* Search results: no date block. */
.in-row-undated {
  grid-template-columns: minmax(0, 1fr);
}

.in-row-undated .in-row-text {
  grid-column: 1;
}

.in-row-undated .in-row-title:first-child {
  margin-top: 0;
}

@media (min-width: 600px) {
  .in-row {
    grid-template-columns: 84px minmax(0, 1fr) 224px;
    gap: 0 24px;
    padding: 28px 0;
  }

  .in-row-date {
    grid-row: auto;
  }

  .in-row-date b {
    font-size: 2.3rem;
  }

  .in-row-date span {
    font-size: .85rem;
  }

  .in-row-text {
    grid-column: 2 / -1;
  }

  .in-row-pictured .in-row-text {
    grid-column: 2;
  }

  .in .in-row-title {
    margin-top: 10px;
    font-size: 1.4rem;
  }

  .in-row-photo {
    grid-row: auto;
    grid-column: 3;
  }

  .in-row-undated {
    grid-template-columns: minmax(0, 1fr);
  }

  .in-row-undated .in-row-text {
    grid-column: 1;
  }
}

/* Older and newer posts */
.in-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 36px;
}

/* "Seneste nyt" over the rows, while the news list is the front page. */
.in .in-rows-title {
  margin: 1.9em 0 1em;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -.02em;
}

/* The search form, on "not found" and on a search without results. */
.in-prose .search-form {
  margin-top: 1.4em;
}

.in-search-field {
  min-width: 0;
  max-width: 100%;
  padding: .6rem .9rem;
  border: 1px solid var(--in-line);
  border-radius: 8px;
}

/* A card in the side column, built like the front page's "Næste træning". */
.in-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--in-line);
  border-radius: var(--in-radius);
  background: #fff;
}

.in .in-card-title {
  margin: 0;
  padding: 13px 20px;
  background: var(--shirt-light);
  color: var(--shirt);
  font-size: .76rem;
  line-height: 1.4;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.in-card-body {
  padding: 16px 20px;
}

/* A list of links in a card: the page's headings, the categories. */
.in-links {
  margin: 0;
  padding: 8px 20px;
  list-style: none;
}

.in-links a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--in-line);
  color: var(--in-ink);
  font-weight: 700;
  text-decoration: none;
}

.in-links li:last-child a {
  border-bottom: 0;
}

.in-links a:hover,
.in-links a[aria-current] {
  color: var(--shirt);
}

.in-links span {
  color: var(--in-muted);
  font-weight: 400;
}

/* "Seneste nyt": title and date, and the way to all of them under the list. */
.in-latest .in-links a {
  display: block;
  font-weight: 400;
}

.in-latest b {
  display: block;
  line-height: 1.3;
}

.in-latest small {
  color: var(--in-muted);
  font-size: .85rem;
}

.in-card-foot {
  margin: 0;
  padding: 12px 20px;
  border-top: 1px solid var(--in-line);
  background: var(--in-paper);
  font-size: .9rem;
}

/* "På denne side" would come after the text it points into on a phone. */
.in-toc {
  display: none;
}

.in-toc .in-links a {
  padding: 7px 0;
  font-weight: 400;
}

/* The club's own box (Global Settings): whatever is typed there must sit in
   a 320 px column. */
.in-box .in-card-body {
  font-size: .95rem;
  overflow-wrap: anywhere;
}

.in-box .in-card-body > * {
  margin-top: 0;
  margin-bottom: 0;
}

.in-box .in-card-body > * + * {
  margin-top: .8em;
}

.in-box ul,
.in-box ol {
  padding-left: 1.2em;
}

.in-box img,
.in-box iframe {
  max-width: 100%;
  height: auto;
}

.in-box table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  font-size: .88rem;
}

.in-box td,
.in-box th {
  padding: 4px 10px 4px 0 !important;
  font-size: .88rem;
  text-align: left;
  vertical-align: top;
}

/* The compact training times ([traeningstider kompakt="ja"]). */
.in-times-day {
  margin: 14px 0 4px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

.in-times-day:first-child {
  margin-top: 0;
}

.in-times-slot {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 5px 0;
  color: var(--in-muted);
  font-size: .95rem;
}

.in-times-slot b {
  min-width: 6.6em;
  color: var(--in-ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.in-times-slot small {
  display: block;
  font-size: .82rem;
}

.in-times-place {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--in-line);
  color: var(--in-muted);
  font-size: .88rem;
}

.in-side-cta {
  width: 100%;
}

@media (min-width: 992px) {
  .in-head {
    padding: 52px 0 30px;
  }

  .in-cols {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: clamp(40px, 5vw, 72px);
    align-items: start;
    padding-top: 38px;
    padding-bottom: 84px;
  }

  .in-prose {
    font-size: 1.06rem;
  }

  .in-post-head {
    padding: 48px 0 56px;
  }

  .in-post-head-plain {
    padding-bottom: 40px;
  }

  .in-post-grid {
    grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
    column-gap: 56px;
  }

  .in-post-head-plain .in-post-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .in-back {
    margin-bottom: 26px;
  }

  /* A picture narrower than its half sits at the right edge. */
  .in-post-media {
    justify-content: flex-end;
  }

  .in-toc {
    display: block;
  }
}

/* The side column follows the reader down the page. partials/inner/side
   sets .in-side-follows and how far from the top it stays: 24 px, or, when
   the column is higher than the screen, far enough up that its bottom shows.
   Without scripts it scrolls with the page. */
@media (min-width: 992px) {
  .in-side-follows {
    position: sticky;
  }
}

@media (prefers-reduced-motion: reduce) {
  .in * {
    transition: none !important;
  }
}
