/* "Card" layout: a single bordered card centred in the viewport, floating over
   a full-bleed background image inside an optional decorative frame. */

.card-page {
  background-color: var(--color-bg);
  font-weight: 100;
  margin: 0;
  width: 100%;
}

/* ---------------------------------------------------------------- backdrop */

/* The frame sits at the viewport edge; the image sits just inside it. */
.card-page .project-border,
.card-page .broider {
  position: fixed;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(100% - 20px);
  width: calc(100vw - 20px);
  margin: 10px;
  box-sizing: border-box;
}

.card-page .project-border {
  height: 100%;
  width: 100%;
  /* height: calc(100% - 38px);
  width: calc(100vw - 38px); */
  /* margin: 19px; */
  margin: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Optional decorative frame. Off by default; a site opts in from site.css:
     .broider {
       border-image: url('/public/border.svg') 92 92 repeat;
       border-width: 9px;
       border-style: solid;
     } */
.broider {
  border: none;
}

@media print {
  .broider {
    border: none;
  }
}

/* ------------------------------------------------------------------- cards */

.card-page .cards {
  font-family: var(--font-body);
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  margin: auto;
  width: calc(100% - 20px);
  max-width: 450px;
  z-index: 1;
  opacity: 0.95;
}

.card-page .cards p {
  line-height: 1.3em;
  text-align: left;
  margin: 0 auto;
}

.card-page .cards ul {
  padding: 0;
}

.card-page .cards li {
  font-weight: 100;
  font-size: 13px;
  list-style: none;
  margin: 25px auto;
  text-align: left;
  text-decoration: none;
}

.card-page .card-container {
  background-color: var(--color-bg);
  border: solid var(--color-fg) 1px;
  border-radius: 2px;
  aspect-ratio: 8 / 5;
  contain: strict;
  box-shadow: 2px 2px 0 0 rgba(0, 0, 0, 0.6);
}

/* The reverse of the card, stacked below the front. */
.card-page .card-container + .card-container {
  margin-top: 40px;
}

/* Optional photo on the reverse, set from front matter with `cardBackImage`.
   It fills the inner rule rather than the whole card, so the photo reads as a
   plate inset in the card. The rule keeps its `z-index: -1`, which puts the
   photo behind the text; site.css can knock it back with a filter. */
.card-page .card.back .container-background {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.card-page .card {
  box-sizing: border-box;
  position: relative;
  width: 100%;
  height: 100%;
  margin: auto;
}

/* The card body is absolutely positioned, so it is the containing block for
   anything a site places with `position: absolute` inside its content. */
.card-page .card .container {
  position: absolute;
  display: flex;
  align-items: center;
  height: calc(100% - 40px);
  width: calc(100% - 40px);
  margin: 20px;
  padding: 8px;
  font-size: 13px;
  line-height: 15px;
}

.card-page .card header {
  width: 100%;
}

.card-page .card.front header {
  font-size: 14px;
}

/* Logo mark, pinned to the bottom-right of the card body. Sites re-place or
   resize it from site.css — e.g. `--card-logo-height` or full overrides. */
.card-page .card-logo {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  margin: auto;
  height: var(--card-logo-height, 60px);
  width: auto;
  display: none;
}

.card-page .container a {
  color: var(--color-fg);
  text-decoration: none;
  border-bottom: solid var(--color-rule) 1px;
}

/* Inner rule, inset from the card edge. */
.card-page .container-background {
  position: absolute;
  z-index: -1;
  border: solid var(--color-fg) 1px;
  border-radius: 2px;
  height: calc(100% - 20px);
  width: calc(100% - 20px);
  margin: 10px;
}

.card-page .card p {
  margin-top: 0;
  margin-bottom: 10px;
  width: 100%;
  text-align: center;
}

/* Nothing follows the back's single paragraph, so drop the trailing margin
   that would otherwise push it off the container's vertical centre. */
.card-page .card.back p {
  margin-bottom: 0;
  font-size: 14px;
}

.card-page .card ul {
  margin-top: 0;
}

.card-page .card li {
  line-height: 15px;
  margin: 0 0 6px;
}

/* ------------------------------------------------- card header and footer */

.card-page .card .card-header {
  position: absolute;
  display: inline;
  top: -2px;
  left: 0;
  right: 0;
  text-align: center;
}

.card-page .cards .card-footer {
  position: absolute;
  display: inline;
  bottom: -2px;
  left: 0;
  right: 0;
  margin: auto;
  text-align: center;
  z-index: 1;
}

.card-page .cards .card-footer p,
.card-page .card .card-header p {
  display: inline-block;
  background: var(--color-bg);
  font-family: var(--font-card);
  font-size: 10px;
  margin: 6px;
  padding: 0 5px;
  text-align: center;
  width: auto;
}

.card-page .card .card-header p {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 6px auto;
  width: fit-content;
}

.card-page .card .card-header a {
  color: var(--color-fg);
  text-decoration: none;
}

/* Small asterism between header links. */
.card-page .card .card-header a:not(:last-child)::after {
  content: "✺";
  position: absolute;
  margin-left: 5px;
  font-size: 5px;
}
