/*
 * MARK: Transitions
 * Keeps transitions from happening on page load
 */

body {
  --transition-duration-15: 0s;
  --transition-duration-30: 0s;
  transition: all var(--transition-duration-15) ease;
}

body.enable-transitions {
  --transition-duration-15: 0.15s;
  --transition-duration-30: 0.30s;
}

/* 
 * MARK: Colors
 */

:root {
  --blue-color:rgb(0, 99, 247);
  --grey-color: #878F99;
  --dark-color: #212329;
  --light-grey-color: #F2F2F2;
  --beige-color: #F1F0EC;
  --beige-dark-color: #D9D6CE;

  --accent-color: rgb(0, 99, 247);
  --accent-color-opposite: #FFFFFF;

  --background-color: #FFFFFF;
  --background-color-0: #FFFFFF00;

  --foreground-color: #212329;
  --foreground-color-5: #2123290D;
  --foreground-color-15: #21232926;
  --foreground-color-25: #21232940;
  --foreground-color-33: #21232954;
  --foreground-color-50: #21232980;
}

/* @media (prefers-color-scheme: dark) {
  :root {
    --blue-color: rgb(0, 99, 247);
    --grey-color: #878F99;
    --dark-color: #212329;
    --beige-color: #F1F0EC;
    --beige-dark-color: #D9D6CE;
  
    --accent-color: rgb(0, 99, 247);
    --accent-color-opposite: #212329;
  
    --background-color: #212329;
    --background-color-0: #21232900;
  
    --foreground-color: #FFFFFF;
    --foreground-color-5: #FFFFFF0D;
    --foreground-color-15: #FFFFFF26;
    --foreground-color-25: #FFFFFF40;
    --foreground-color-33: #FFFFFF54;
    --foreground-color-50: #FFFFFF80;
  }
} */

::selection {
  background: var(--accent-color);
  color: var(--accent-color-opposite);
}

.muted {
  color: var(--grey-color);
}

/* 
 * MARK: Typography
 */

.sans, body, article .sans p, 
             article .sans ol, 
             article .sans ul {
  font-family: "Inter", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-variation-settings:
    "slnt" 0;

  font-size: 1.4rem;
  line-height: 1.4;
}

.serif {
  font-family: "Crimson Pro", serif;
  font-optical-sizing: auto;
  font-weight: 300;
  font-style: normal;

  font-size: 1.8rem;
  line-height: 1.25;
}

.serif-headline {
  font-family: 'PP Editorial Old', serif;
  font-weight: normal;
}

.mono {
  font-family: "Unica One", mono;
  font-weight: 400;
  font-style: normal;
  text-transform: uppercase;
}

code {
  background-color: #f4f4f4;
  border-radius: 4px;
  color: #333;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
  padding: 2px 4px;
}

pre code {
  display: block;
  background-color: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
  overflow-x: auto;
  line-height: 1.4;
}

b,
strong,
.strong {
  font-weight: bold;
}

.italic {
  font-style: italic;
}

.underline {
  text-decoration: underline;
}

html {
  font-size: 62.5%;
}

body {
  font-size: 14px;
  font-size: 1.4rem;

  color: var(--foreground-color);
  background: var(--background-color);
}

p,
h2, h3, h4 {
  margin: 0;
  margin-bottom: 1.2rem;
}

.no-margin {
  margin: 0;
}

a:not(.no-link-style) {
  color: var(--foreground-color);
  text-decoration: underline;
  transition: color 0.15s ease;
}

a:not(.no-link-style):hover {
  color: var(--accent-color);
}

a.no-link-style {
  color: var(--foreground-color);
  text-decoration: none;
}

a.no-underline {
  text-decoration: none;
}

a[disabled] {
  opacity: 0.5;
  pointer-events: none;
  text-decoration: none;
}

.bold {
  font-weight: bold;
}

.small {
  font-size: 1.2rem;
}

.text-right {
  text-align: right;
}

@media (max-width: 760px) {
  .text-center_sm {
    text-align: center;
  }
}

article .sans ul,
article .sans ol {
  padding-left: 0;
  margin-left: 0;
}

/* 
 * MARK: Layout
 */

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

@media (max-width: 760px) {
  .static_sm {
    position: static;
  }
}

.hide {
  display: none;
}

.block {
  display: block;
}

.flex {
  display: flex;
}

.justify-space {
  justify-content: space-between;
}

.justify-space-around {
  justify-content: space-around;
}

.justify-stretch {
  justify-content: stretch;
}

@media (max-width: 760px) {
  .justify-space_sm {
    justify-content: space-between;
  }
}

.align-start {
  align-items: start;
}

.align-center {
  align-items: center;
}

.align-end {
  align-items: end;
}

.flex-equal > * {
  flex-basis: 0;
  flex-grow: 1;
  flex-shrink: 1;
}

.spacer {
  flex-basis: 0;
  flex-grow: 1;
  flex-shrink: 1;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-col_sm {
  flex-direction: row;
}

@media (max-width: 760px) {
  .flex-col_sm {
    flex-direction: column;
    align-items: stretch;
  }

  .flex-row_sm {
    flex-direction: row;
  }

  .order-first_sm {
    order: -1;
  }

  .order-second_sm {
    order: 2;
  }

  .order-third_sm {
    order: 3;
  }

  .align-center_sm {
    align-items: center;
  }
}

.grow {
  flex-grow: 1;
}

.justify-between {
  justify-content: space-between;
}

.gap-0 {
  gap: 0;
}

.gap-1 {
  gap: 1em;
}

.gap-2 {
  gap: 2em;
}

.gap-4 {
  gap: 4em;
}

.gap-16px {
  gap: 16px;
}

.gap-32px {
  gap: 32px;
}

.gap-5px {
  gap: 5px;
}

.gap-1rem {
  gap: 1rem;
}

.gap-2rem {
  gap: 2rem;
}

@media (max-width: 760px) {
  .gap-0_sm {
    gap: 0;
  }
}

.space-6 {
  width: 6px;
  height: 6px;
}

.space-12 {
  width: 12px;
  height: 12px;
}

.space-24 {
  width: 24px;
  height: 24px;
}

.space-48 {
  width: 48px;
  height: 48px;
}

.space-72 {
  width: 72px;
  height: 72px;
}

@media (max-width: 760px) {
  .space-72 {
    width: 56px;
    height: 56px;
  }

  .block_sm {
    display: block;
  }
}

@media (max-width: 760px) {
  .hide_sm {
    display: none;
  }
}

@media (min-width: 761px) {
  .hide_lg {
    display: none;
  }
}

/* 
 * MARK: Elements
 */

hr {
  background: none;
  border: none;

  border-top: 1px solid var(--foreground-color-15);
}

input.rounded,
textarea.rounded,
button.rounded,
a.rounded {
  -webkit-appearance: none;
  display: block;
  /* box-sizing: border-box; */
  text-decoration: none;
  border: none;
  margin: 0;
  background: var(--beige-color);
  color: var(--foreground-color);
  border-radius: 8px;
  padding: 10px;

  font-size: 14px;
  line-height: 16px;
}

button.rounded,
input[type="checkbox"],
a.rounded {
  padding: 10px 15px;
  font-weight: 500;

  transition: background-color 0.15s ease,
              color 0.15s ease;
}

.rounded.large {
  font-size: 1.6rem;
  line-height: 1.8rem;
  padding: 1.4rem 1.8rem;
}

.rounded.primary {
  background: var(--accent-color-opposite);
  color: var(--accent-color);
}


button.rounded:hover,
input[type="checkbox"]:hover,
a.rounded:hover {
  background: var(--accent-color);
  color: var(--accent-color-opposite);
}

input[type="checkbox"].rounded {
  position: relative;
  cursor: pointer;
}

input[type="checkbox"].rounded:checked::after {
  content: "\2713"; /* Unicode checkmark character */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.4rem;
  color: var(--foreground-color);
}


/**
 * MARK: Shared 
 */

/* .spined {
  display: flex;
} */

.spine {
  padding: 60px 25px 25px 25px;
  /* border-right: 1px solid var(--foreground-color); */

  height: 100vh;
  position: fixed;
  z-index: 1000;
}

@media (max-width: 760px) {
  .spine {
    padding: 15px;
    border-bottom: 1px solid var(--foreground-color);
    margin-bottom: 1.2rem;

    height: unset;
    position: unset;
    /* z-index: unset; */

    position: relative;
  }

  .spine.show {
    position: fixed;
    left: 0;
    width: 100vw;
  }
}

.spine p {
  margin: 0;
  padding: 0;
}

.spine .spacey {
  font-size: 1.8rem;
  line-height: 1.6;
  letter-spacing: 0.3rem;
}

.spine .close-button {
  display: none;
}

.spine-collapsed {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 2.0rem;
}

.spine-collapsed p {
  white-space: nowrap;
  writing-mode: vertical-rl;
  text-orientation: sideways;
}

@media (max-width: 760px) {
  .spine-collapsed {
    flex-direction: row;
    justify-content: space-between;
  }

  .spine-collapsed p {
    white-space: unset;
    writing-mode: unset;
    text-orientation: unset;
  }
}

.spine-overlay {
  pointer-events: none;
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 320px;

  border-right: 1px solid var(--foreground-color);

  transition: all var(--transition-duration-30) ease;
}

.spine.show .spine-overlay {
  right: calc(-320px + 80px);
  pointer-events: auto;
}

@media (max-width: 760px) {
  .spine-overlay {
    pointer-events: auto;
    cursor: pointer;
    position: absolute;
    top: unset;
    bottom: -1px;
    left: 0;
    right: 0;
    width: auto;
    padding-bottom: 50px; /* Avoid being able to click links */
    z-index: 1000;

    border-right: none;
    border-bottom: 1px solid var(--foreground-color);

    opacity: 0;
  }

  .spine.show .spine-overlay {
    cursor: auto;
    right: 0;
    top: 0;
    bottom: auto;
    padding-bottom: 0;
    opacity: 1;
  }

  .spine.show .bg-overlay {
    /* background: rgba(0,0,0,0.1); */
    background-color: rgba(255,255,255,1);
    background-image: 
      linear-gradient(45deg, 
        black 0px,
        black 1px,
        transparent 1px
        /*transparent 3px*/
      );
    background-size: 4px 4px;

    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 250;
  }

  .spine.show .close-button {
    display: block;
  }
}

.spine-overlay-contents {
  opacity: 0;

  width: 100%;
  height: 100%;
  background-color: var(--background-color);

  transition: opacity var(--transition-duration-30) ease;

  padding: 60px 25px 25px 25px;
}

.spine.show .spine-overlay > .spine-overlay-contents {
  opacity: 1;
}

@media (max-width: 760px) {
  .spine-overlay-contents {
    padding: 15px;
  }
}

.spine-overlay-contents .page-link {
  color: var(--grey-color);
  transition: color var(--transition-duration-15) ease;
}

.spine-overlay-contents .page-link:hover {
  color: var(--foreground-color);
}

.spine-overlay-contents #featured {
  border: 1px solid var(--beige-dark-color);
  border-radius: 1.2rem;
  font-size: 1.2rem;
  padding: 1.6rem;
}

.spine-overlay-contents #featured .serif {
  font-family: 'PP Editorial Old', serif;
  font-weight: normal;
  font-size: 2.4rem;
  line-height: 2.8rem;
}

/* Pages (home, feed, experiments, membership) */

.spined .page {
  width: calc(100% - 80px);
  margin-left: 80px;
  padding: 50px;
}

.spined .page .fullwidth {
  margin: 0 -50px;
}

@media (max-width: 760px) {
  .spined .page {
    width: 100%;
    margin-left: 0px;
    padding: 15px;
  }
  
  .spined .page .fullwidth {
    margin: 0;
  }
}

.spined .page h1 {
  font-family: 'PP Editorial Old', serif;
  font-weight: normal;
  font-size: 8.0rem;
  line-height: 7.7rem;
}

@media (max-width: 760px) { 
  .spined .page h1 {
    font-size: 6.0rem;
    line-height: 5.5rem;
  }
}

.spined .page .main {
  max-width: 600px;
}

/* Articles */

.spined .article h1 {
  font-family: 'PP Editorial Old', serif;
  font-weight: normal;
  /* text-transform: uppercase; */
  font-size: 8.0rem;
  line-height: 7.7rem;
}

@media (max-width: 760px) { 
  .spined .article h1 {
    font-size: 6.0rem;
    line-height: 5.5rem;
  }
}

/* Videos & embeds */

.image-container {
  display: flex;
  gap: 1.2rem;
}

.image-container img {
  max-width: 100%;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  max-width: 100%;
}

.video-container iframe,
.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Like & comment buttons */

.like-button .icon use, 
.comment-button .icon use { 
  fill: transparent; 
  stroke: var(--foreground-color); 
  stroke-width: 1px; 
}

.like-button, 
.comment-button {
  --red-color: #FF3C3C;
  --red-color-faded: #FF3C3C26;
  --red-color-lessfaded: #FF3C3C40;
}

.like-button, 
.comment-button {
  position: relative;

  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.5rem 0.9rem;
  padding-left: 0.7rem;
  margin-left: -0.7rem;
  color: var(--foreground-color);
  border-radius: 20px;

  display: flex;
  align-items: center;
  gap: 0.6rem;

  transition: all 0.15s ease;
}

.like-button .icon use, 
.comment-button .icon use {
  transition: all 0.15s ease;
}

.like-button:hover {
  background-color: var(--red-color-faded);
  color: var(--red-color);
}

.like-button:active {
  background-color: var(--red-color-lessfaded);
}

.like-button:hover .icon use {
  stroke: var(--red-color);
}

.comment-button:hover {
  background-color: var(--light-grey-color);
  color: var(--foreground-color);
}

.comment-button:hover .icon use {
  stroke: var(--foreground-color);
}

.like-button.selected {
  color: var(--red-color);
}

.like-button.selected .icon use {
  stroke: var(--red-color);
  fill: var(--red-color);
}

.like-button:not(.selected) .label-selected {
  display: none;
}

.like-button.selected .label-not-selected {
  display: none;
}