/* ==========================================================================
   Constants and variables

   ToDo: switch to custom properties
   ========================================================================== */
/*
$body-font-family: "Roboto Flex", sans-serif;
$header-font-family: $body-font-family;
*/
/*
$font-weight-thin: 100;
$font-weight-light: 300;
$font-weight-normal: 300;
$font-weight-bold: 600;
$font-width: 75%;
$header-font-weight-thin: $font-weight-thin;
$header-font-weight-light: $font-weight-light;
$header-font-weight-normal: $font-weight-normal;
$header-font-weight-bold: 650;
$header-font-width: 62.5%;
*/
/* We need these variables as we can't use custom properties in media/container queries */
/* ==========================================================================
   Moved from main style sheet.
   ========================================================================== */
/* ==========================================================================
    Forms and buttons
    ========================================================================== */
/* ==========================================================================
  Polaroid classes
  ========================================================================== */
.polaroid {
  --polaroid-size: 648px;
  --corners: 2px;
  --twist-it: -1deg;
}

figure.image {
  margin: 0;
  padding: 0;
}

.polaroid {
  width: calc(var(--polaroid-size) / 2);
  border-radius: var(--corners);
  padding: clamp(6px, 5%, 17px);
  padding-bottom: clamp(51px, 25%, 85px);
  background-color: hsl(0, 0%, 90%);
  border: 2px solid;
  border-color: #fff hsl(0, 0%, 75%) #666 hsl(0, 0%, 75%);
  background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 8 8"%3E%3Cg fill="%239C92AC19" fill-opacity="0.4"%3E%3Cpath fill-rule="evenodd" d="M0 0h4v4H0V0zm4 4h4v4H4V4z"/%3E%3C/g%3E%3C/svg%3E');
  box-shadow: 0px 5px 5px rgba(0, 0, 0, 0.25), 0px 5px 25px rgba(0, 0, 0, 0.2);
  transform: rotate(var(--twist-it));
}

.image {
  position: relative;
  background-color: #333;
  height: 100%;
  width: 100%;
  box-shadow: inset 1px 1px 4px #555;
  border-radius: var(--corners, 0);
  aspect-ratio: 1/1;
}

.polaroid img {
  top: 0;
  left: 0;
  width: 100%;
  object-fit: cover;
  aspect-ratio: 1/1;
  border-radius: var(--corners, 0);
}

.frame {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
  box-shadow: inset 1px 1px 4px #333;
  border-radius: var(--corners, 0);
}

.vignette-colorful {
  position: relative;
  display: block;
}

.vignette-colorful:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: radial-gradient(circle, transparent 50%, red 150%);
  mix-blend-mode: difference;
  border-radius: var(--corners, 0);
}

.vignette-colorful:hover:after {
  background: none;
}

.has-linktip {
  position: relative;
  display: inline-block;
}

.linktip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  font-size: var(--font-size-xs);
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  white-space: nowrap;
  transition: opacity 0.3s;
  opacity: 0;
}

.polaroid.has-linktip .linktip {
  display: block;
  opacity: 1;
  bottom: initial;
  top: 108%;
  background-color: rgba(255, 255, 255, 0.25);
  color: #000;
  font-family: monospace;
  font-size: 11px;
  text-align: center;
  transform: translateX(-50%) rotateZ(var(--twist-it));
  white-space: normal;
  width: 90%;
  margin-inline: auto;
}

.polaroid a {
  color: var(--link-color);
}

.has-linktip:hover .linktip {
  display: block;
  opacity: 1;
}

/* ==========================================================================
   Helper classes
   ========================================================================== */
.browserupgrade {
  margin: 0.2em 0;
  background: #ccc;
  color: #000;
  padding: 0.2em 0;
}

.hide--sm {
  display: none;
}
@media only screen and (min-width: 30rem) {
  .hide--sm {
    display: block;
  }
}

.print-only {
  display: none;
}

/*
* Twitter embedded tweets
*/
.twitter-tweet.twitter-tweet-rendered {
  margin-right: auto;
  margin-left: auto;
}

/*
   * Hide only visually, but have it available for screen readers:
   * https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
   *
   * 1. For long content, line feeds are not interpreted as spaces and small width
   *    causes content to wrap 1 word per line:
   *    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
   */
.visuallyhidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  white-space: nowrap; /* 1 */
}

/*
* Extends the .visuallyhidden class to allow the element
* to be focusable when navigated to via the keyboard:
* https://www.drupal.org/node/897638
*/
.visuallyhidden.focusable:active,
.visuallyhidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  width: auto;
  white-space: inherit;
}

/*
* Hide visually and from screen readers, but maintain layout
*/
.invisible {
  visibility: hidden;
}

/*
* Clearfix: contain floats
*
* For modern browsers
* 1. The space content is one way to avoid an Opera bug when the
*    `contenteditable` attribute is included anywhere else in the document.
*    Otherwise it causes space to appear at the top and bottom of elements
*    that receive the `clearfix` class.
* 2. The use of `table` rather than `block` is only necessary if using
*    `:before` to contain the top-margins of child elements.
*/
.clearfix:before,
.clearfix:after {
  content: " "; /* 1 */
  display: table; /* 2 */
}

.clearfix:after {
  clear: both;
}

.text-assistive.display-at-top-on-focus:focus {
  clip-path: none;
  z-index: 999;
  height: 80px;
  line-height: 80px;
  background: var(--header-bg-color, white);
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--text-color, black);
  text-align: center;
}
[data-theme=dark] .text-assistive.display-at-top-on-focus:focus {
  color: var(--header-title-color, black);
}
@media (prefers-color-scheme: dark) {
  .text-assistive.display-at-top-on-focus:focus {
    color: var(--header-title-color, black);
  }
}

#skip-to-main:focus,
#skip-to-nav:focus,
#skip-to-footer:focus {
  background: var(--dark-theme-color, white);
  color: var(--light-theme-color, black);
}
[data-theme=dark] #skip-to-main:focus,
[data-theme=dark] #skip-to-nav:focus,
[data-theme=dark] #skip-to-footer:focus {
  background: var(--light-theme-color, white);
  color: var(--dark-theme-color, black);
}
@media (prefers-color-scheme: dark) {
  #skip-to-main:focus,
  #skip-to-nav:focus,
  #skip-to-footer:focus {
    background: var(--light-theme-color, white);
    color: var(--dark-theme-color, black);
  }
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   https://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */
@media print {
  a,
  a:visited {
    border: none;
    border-image: none;
    border-style: none;
    text-decoration: none;
  }
  a[href]::after {
    content: "";
  }
  .main-nav,
  .contentinfo__social,
  .article-ping,
  .article-nav,
  .theme-switcher,
  .print-none,
  .php-debug,
  .perch-debug {
    display: none;
  }
  .print-only {
    display: inline-block;
  }
  [role=banner] {
    height: 300px;
  }
  .article__category a,
  .article__category .u-location .c-pinboard__link,
  .u-location .article__category .c-pinboard__link {
    color: #fff !important;
    background-color: #000 !important;
  }
  pre,
  blockquote {
    border: none;
    page-break-inside: avoid;
  }
  .contentinfo__about a[href]:after {
    content: " (" attr(href) ")";
  }
}
