:root {
  --color-black: #101010;
  --color-gray: #5c5c5c;
  --color-light-gray: #CBCBCB;
  --color-red: #FF2E00;
  --color-yellow: #FCE64D;
  --color-light-yellow: #FEF7C5;
  --color-dark-blue: #09367B;
  --color-blue: #1E88E5;
}

::selection {
  background: var(--color-yellow);
  color: var(--color-black);
}

::placeholder {
  color: var(--color-light-gray);
  opacity: 1;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd,
ul,
ol {
  margin: 0;
  padding: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
  margin-left: 0;
  list-style: none;
}

/* Set core root defaults */
html {
  scroll-behavior: smooth;
  font-size: 62.5%;
  background: #fff;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
  line-height: 1.5;
  font-size: clamp(1.25rem, 1.6vw, 1.6rem);
  font-weight: 400;
  color: var(--color-black);
  font-family: 'Hind', sans-serif;
}

a {
  color: var(--color-blue);
}

a:visited {
  color: var(--color-dark-blue);
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
}

a.button {
  display: inline-block;
  text-decoration: none;
  background: var(--color-yellow);
  color: var(--color-black);
  padding: 1rem 1.25rem;
  font-weight: bold;
  border-radius: 0.3rem;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
  -webkit-appearance: none;
}

button,
input[type=submit] {
  cursor: pointer;
}

/* Remove all animations and transitions for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


.screenreader-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.story-title {
  font-family: 'Caladea', 'Georgia', serif;
  font-size: clamp(4rem, 5.8vw, 5.8rem);
  font-weight: bold;
}

.story-input {
  width: 100%;
  border: 0;
  resize: none;
  font-family: 'Caladea', 'Georgia', serif;
}

.story-body {
  min-height: 300px;
  font-size: clamp(2rem, 2.5vw, 2.5rem);
}

.story-body * + *,
.story-body-readonly *:not(li) + *:not(li) {
  margin-top: 2.5rem;
}

.ql-editor ol li:not(.ql-direction-rtl), .ql-editor ul li:not(.ql-direction-rtl) {
  padding-left: 0;
}

.ql-editor ol,
.ql-editor ul,
.story-body-readonly ul,
.story-body-readonly ol {
  padding-left: 5rem;
}

.ql-editor li,
.story-body-readonly li {
  padding-left: 1rem;
}

.story-body blockquote {
  border-left: 2px solid var(--color-yellow);
  padding: 1rem;
  font-style: italic;
  margin-left: 1rem;
  color: var(--color-gray);
}

.story-body-readonly {
  font-family: 'Caladea', 'Georgia', serif;
  font-size: clamp(2rem, 2.5vw, 2.5rem);
}

.story-body:hover {
  cursor: text;
}

.story-title:focus,
.story-body:focus {
  outline: 0;
}

.global-wrapper {
  max-width: 90rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 5rem);
}

.global-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: clamp(3.2rem, 5.2vw, 5.2rem);
}

.global-header-logo-image {
  width: clamp(13rem, 15.7vw, 15.7rem);
}

.global-nav {
  font-size: clamp(1.5rem, 1.8vw, 1.8rem);
  align-items: center;
  display: flex;
}

.global-nav-list {
  display: flex;
  gap: clamp(1.7rem, 3.2vw, 3.2rem);
  align-items: center;
  position: relative;
}

.global-nav-list-item-cta,
.global-nav-list-item-cta .global-nav-list-item-link{
  background: var(--color-yellow);
  font-weight: bold;
  border: 0;
  border-radius: 10rem;
}

.global-nav-list-item-cta .global-nav-list-item-link {
  padding: 1.25rem 1.5rem 1rem 1.5rem;
}

.global-nav-list-item-link,
.global-nav-list-item-link:visited {
  color: var(--color-black);
  text-decoration: none;
}

.edit-url-notice-wrapper {
  background: var(--color-light-yellow);
  font-size: clamp(1.5rem, 1.9vw, 1.9rem);
  border-radius: .5rem;
  padding: 2.4rem 3.0rem;
  margin-bottom: 4.5rem;
}

.edit-url-notice-title {
  font-size: clamp(1.75rem, 2.1vw, 2.1rem);
  padding: 0;
  margin: 0;
}

.edit-url-notice-input {
  background: var(--color-black);
  color: #fff;
  font-size: clamp(1.5rem, 1.7vw, 1.7rem);
  border: 0;
  width: 100%;
  border-radius: .5rem;
  padding: .5rem 1rem;
  margin-top: 2.4rem;
}

.delete-button {
  border: 0;
  background: var(--color-red);
  opacity: 0.5;
  color: #fff;
  border-radius: .25rem;
  transition: opacity .25s;
  font-weight: bold;
}

.delete-button:hover {
  opacity: 1;
}

.grow-wrap {
  /* easy way to plop the elements on top of each other and have them both sized based on the tallest one's height */
  display: grid;
}

.grow-wrap::after {
  /* Note the weird space! Needed to preventy jumpy behavior */
  content: attr(data-replicated-value) " ";

  /* This is how textarea text behaves */
  white-space: pre-wrap;

  /* Hidden from view, clicks, and screen readers */
  visibility: hidden;
}

.grow-wrap > textarea {
  /* You could leave this, but after a user resizes, then it ruins the auto sizing */
  resize: none;

  /* Firefox shows scrollbar on growth, you can hide like this. */
  overflow: hidden;
}

.grow-wrap > textarea,
.grow-wrap::after {
  /* Identical styling required!! */
  font-family: 'Caladea', 'Georgia', serif;
  font-size: clamp(4rem, 5.8vw, 5.8rem);
  font-weight: bold;
  padding: 0;

  /* Place on top of each other */
  grid-area: 1 / 1 / 2 / 2;
}

.ql-container {
  font-family: 'Caladea', 'Georgia', serif;
  font-size: clamp(2rem, 2.5vw, 2.5rem);
}

.ql-editor {
  overflow-y: visible;
}

.ql-toolbar.ql-snow {
  margin-top: 2rem;
}

.ql-bubble .ql-editor {
  padding: 0;
}

.ql-editor > *:first-child, .ql-editor *:not(li) + *:not(li) {
  margin-bottom: 2rem !important;
}

.ql-toolbar.ql-snow .ql-formats {
  margin-right: clamp(1rem, 1.5vw, 1.5rem);
}

[data-editor-untouched] {
  color: var(--color-light-gray);
}

/**********************************************************
 * Home specific styles
 *********************************************************/

.home-recent-stories-title {
  font-size: clamp(1.75rem, 2vw, 2rem);
  margin: clamp(5rem, 7vw, 7rem) 0 2.5rem;
}

.article-list {
  display: flex;
  flex-direction: column;
}

.article-list-item {
  border-top: 1px solid var(--color-light-gray);
  padding: 2.5rem 0;
}

.article-list-item:last-child {
  border-bottom: 1px solid var(--color-light-gray);
}

.article-list-item-wrapper {
  position: relative;
  height: 100%;
}

.article-list-item-link-wrapper,
.article-list-item-link-wrapper:visited {
  color: inherit;
  text-decoration: none;
}

.article-list-item-title {
  font-family: 'Caladea', 'Georgia', serif;
  font-size: clamp(2.5rem, 3vw, 3rem);
}

.article-list-item-content-wrapper {
  font-family: 'Caladea', 'Georgia', serif;
  font-size: clamp(1.75rem, 2vw, 2rem);
}

.article-list-item-content-wrapper * + * {
  margin-top: 1.5rem;
}

.article-list-item-read-more {
  margin-top: 2rem;
}

.global-footer {
  display: grid;
  gap: 1rem;
  margin-top: 5rem;
}

.btn-container a.kofi-button {
  font-size: 1.2rem !important;
}

.kofi-button span.kofitext {
  color: var(--color-black) !important;
}


.global-header a:not([data-editor-nav-button],.global-header-logo){
  display: inline-block;
}

.global-header .global-nav-list-item:nth-of-type(1n) a:not([data-editor-nav-button],.global-header-logo) {
  transition-delay: 0s;
}

.global-header .global-nav-list-item:nth-of-type(2n) a:not([data-editor-nav-button],.global-header-logo) {
  transition-delay: .05s;
}

.global-header .global-nav-list-item:nth-of-type(3n) a:not([data-editor-nav-button],.global-header-logo) {
  transition-delay: .1s;
}

.home-recent-stories-wrapper {
  transition-delay: .15s !important;
}

.global-footer {
  transition-delay: .2s;
}

.global-header a:not([data-editor-nav-button],.global-header-logo),
.global-footer,
.home-recent-stories-wrapper {
  opacity: 1;
  transform: translateY(0);
  transition: 0.1s opacity ease-out, 0.1s transform ease-out;
}

.edit-mode-enabled .global-header a:not([data-editor-nav-button],.global-header-logo),
.edit-mode-enabled .global-footer,
.edit-mode-enabled .home-recent-stories-wrapper {
  transform: translateY(5px);
  opacity: 0;
  pointer-events: none;
}

[data-editor-nav-button] {
  position: absolute;
  right: 0;
  opacity: 0;
  transform: translateY(-5px);
  transition: 0.1s opacity 0.3s ease-in, 0.1s transform 0.3s ease-in;
}

.edit-mode-enabled [data-editor-nav-button] {
  opacity: 1;
  transform: translateY(0px);
}

.edit-mode-disabled [data-editor-nav-button] {
  transition-delay: 0s !important;
}

[data-editor-nav-button].click-through {
  pointer-events: none;
}

[data-editor-nav-button].hide {
  display: none;
}

@media (max-width: 500px) {
  [data-editor-nav-button] {
    position: fixed !important;
    left: 0;
    bottom: 0;
    width: 100%;
    z-index: 999;
  }
  
  .global-nav-list-item-link.global-nav-list-item-link-publish-button {
    display: inline;
    width: 100%;
    text-align: center;
    padding: 2rem 2rem 1.5rem 2rem;
    border-radius: 0;
  }
  .global-footer {
    /* take into account the big publish button */
    padding-bottom: 5rem;
  }
}
