/* ---- articleSearch.css ---- */

#searchBarArticles {
   color: var(--colorText1);
   background-color: var(--colorBackground2);
   border: solid 2px var(--colorBackground3);
   border-radius: 0.5rem;
   padding: 0 0.8rem;
   width: 100%;
   height: 3.7rem;
   box-sizing: border-box;
   font-size: 1rem;
   font-family: 'paragraph';

   &:focus {
      border-color: var(--colorText4);
      outline: none;
   }

   &:focus::placeholder {
      color: transparent;
   }
}

#searchResults {
   display: flex;
   flex-direction: column;
   columns: 1;

   * {
      margin: 0;
   }

   .searchResult {
      margin: 1rem 0;
      display: none;

      a {
         text-decoration: none !important;
      }

      &:hover h3 {
         text-decoration: underline !important;
      }
   }

   .noArticlesFound {
      margin-top: 1rem;
   }
}


/* ---- articlesLatest.css ---- */

#latestArticles {
   display: inline-grid;
   gap: 0.25rem;

   * {
      margin: 0;
      text-decoration: none;
   }

   time {
      color: var(--colorText3);
   }

   a {
      display: flex;
      gap: 0.5rem;
      width: fit-content;

      p {
         color: var(--colorText1);
      }

      &:hover p {
         text-decoration: underline;
      }
   }
}

@media (max-width: 30rem) {

   #latestArticles {
      a {
         p {
            color: var(--colorText2) !important;
         }

         time {
            display: none;
         }
      }
   }
}


/* ---- articleTags.css ---- */

.tagsSection {
   display: grid;
   grid-template-columns: 1fr 1fr;
   gap: 1rem;

   .tagItem {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 0.3rem;
      height: 3rem;

      background-color: var(--colorBackground2);
      border-radius: 0.5rem;
      padding: 0.4rem 1rem;

      svg {
         width: 2rem;
         height: auto;
         stroke-width: 0.075rem;
      }
   }
}


@media (max-width: 35rem) {
   .tagsSection {
      grid-template-columns: 1fr;
   }
}


/* ---- contactCards.css ---- */

#contactCards {
   margin-top: 1.25rem;
   display: grid;
   grid-template-columns: 1fr 1fr;
   gap: 1rem;

   .contactCard {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      gap: 0.25rem;
      padding: 1.5rem;
      border-radius: var(--globalBorderRadius);
      overflow: hidden;
      user-select: none;

      * {
         margin: 0;
      }

      &:hover {
         cursor: pointer;

         h2 {
            text-decoration: underline;
         }
      }

      .divCardTitle {
         display: flex;
         gap: 0.25rem;

         svg {
            width: 1.7rem;
            height: auto;
            stroke: var(--colorText1);
         }
      }

      button {
         display: none;
      }
   }
}

@media (max-width: 35rem) {
   #contactCards {
      grid-template-columns: 1fr;
   }
}

.contactCardPopup {
   z-index: 9999;
   display: none;
   position: fixed;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   border-radius: var(--globalBorderRadius);

   display: flex;
   flex-direction: column;
   align-items: center;
   text-align: center;
   gap: 1.5rem;
   padding: 2rem;
   width: 22rem;
   word-wrap: break-word;
   backdrop-filter: blur(0.2rem);

   * {
      margin: 0;
   }

   img {
      width: 15rem;
      height: auto;
   }

   .qrText {
      color: var(--colorText4);
      max-width: 90%;
      line-height: 1.3;
   }

   .qrCode {

      width: auto;
      height: 10rem;

      .code {
         fill: var(--colorText1);
      }

      .background {
         fill: none;
      }
   }
}


@media (max-width: 35rem) {
   .popup {
      width: 90% !important;
      padding: 1rem 1% !important;

      img {
         width: 10rem;
      }
   }
}


/* ---- footer.css ---- */

footer {
   display: flex;
   align-items: center;
   justify-content: space-between;
   margin-top: 1.5rem;
   margin-bottom: 1.5rem;

   * {
      color: var(--colorText4) !important;
      gap: 0.5rem;
   }

   div {
      display: flex;

      p {
         margin: 0;
      }
   }
}

#themeControl {
   translate: 0 2px;
   display: flex;

   button {
      padding: 0;
      border: none;
      background: none;

      svg {
         width: 1.2rem;
         height: fit-content;
         stroke-width: 0.09rem;
         stroke: var(--colorText4);
         translate: 0 -0.05rem;

         &:hover {
            cursor: pointer;
         }
      }
   }
}


@media (max-width: 25rem) {
   #themeControl {
      display: none;
   }
}


/* ---- header.css ---- */

header {
   display: flex;
   align-items: center;
   justify-content: space-between;
   margin-top: 1.5rem;
   margin-bottom: 2rem;

   * {
      color: var(--colorText1);

      p {
         margin: 0;
      }
   }

   #siteTitle {
      font-size: 1.25rem;
      font-family: 'heading';
   }

   nav {
      display: flex;
      gap: 1.25rem;

      a {
         display: flex;
         align-items: center;
         gap: 0.25rem;

         &:first-child {
            display: none;
         }

         svg {
            stroke-width: 0.09rem;
         }
      }
   }
}

#isHome {
   #siteTitle {
      visibility: hidden;
   }
}


/* ---- headerMobile.css ---- */

@media (max-width: 35rem) {

   header {
      width: 100%;
      justify-content: center;
      margin: 1rem 0;
      margin-bottom: 2rem;

      #siteTitle {
         display: none;
      }

      nav {
         justify-content: space-around;
         width: 100%;
         gap: 3vw;

         a {
            background-color: var(--colorBackground2);
            padding: 0.5rem;
            border-radius: 99rem;
            width: 100%;
            justify-content: center;

            p {
               display: none;
            }

            &:first-child {
               display: flex;
            }
         }
      }
   }
}


/* ---- headingAnchor.css ---- */

.headingAnchor {
   visibility: hidden;
   color: var(--colorText4);
}

h1:hover a,
h2:hover a,
h3:hover a,
h4:hover a,
h5:hover a,
h6:hover a,
h7:hover a,
h8:hover a,
h9:hover a {
   visibility: visible;
   text-decoration: none;
}

/* https://discourse.gohugo.io/t/adding-anchor-next-to-headers/1726/9 */


/* ---- list.css ---- */

.sectionHeaderArticles {
   display: flex;
   justify-content: space-between;

   .divButtons {
      display: flex;
      gap: 1rem;

      .itemButton {
         display: flex;
         align-items: center;
         gap: 0.25rem;

         * {
            margin: 0;
         }

         svg {
            width: 1.3rem;
            height: auto;
            stroke-width: 0.11rem;
         }
      }
   }
}

.sectionArticles {
   display: grid;
   margin-top: -1.5rem;
   gap: 2.5rem;

   * {
      margin: 0;
   }

   .year {
      display: grid;
      gap: 1.5rem;
   }

   .article {
      a {
         text-decoration: none;
         display: grid;

         &:hover h3 {
            text-decoration: underline;
         }

         .meta {
            color: var(--colorText4);
         }
      }
   }
}


/* ---- postHeading.css ---- */

#headingArticle {
   border-bottom: dotted 3px var(--colorBorder);
   margin-bottom: 2rem;
   padding-bottom: 1rem;

   * {
      margin: 0;
   }

   details {
      transition: ease 300ms;
      border-radius: var(--globalBorderRadius);
      user-select: none;

      h3 {
         margin-bottom: 0.25rem;
      }

      summary {
         list-style-type: none;
         cursor: pointer;

         #headingMetadata {
            .icon {
               translate: 0 5px;
               stroke-width: 0.1rem;
            }
         }
      }

      .detailsContainer {
         display: grid;
         grid-template-columns: auto auto;
         justify-content: space-between;
      }
   }

   details[open] {
      padding: 1.5rem;
      padding-top: 0.75rem;
      margin-top: 0.5rem;
      margin-bottom: 1rem;
      background-color: var(--colorBackground2);

      summary {
         margin-bottom: 1.5rem;
      }

      #headingMetadata {
         color: var(--colorText2);

         .icon {
            translate: 0 5px;
            stroke-width: 0.1rem;
         }
      }
   }
}

#headingTags {
   display: flex;
   flex-direction: column;
   align-items: end;
   justify-content: end;
   width: fit-content;

   h3 {
      width: 100%;
   }

   a {
      display: flex;
      gap: 0.25rem;

      svg {
         translate: 0 0.15rem;
         stroke-width: 0.1rem;
      }
   }
}

@media (max-width: 35rem) {
   .detailsContainer {
      grid-template-columns: 1fr !important;
      gap: 1.5rem;

      #headingTags {
         align-items: start !important;
      }
   }
}

#headingMetadata,
summary::marker {
   color: var(--colorText4);
}


/* ---- redirectPrompt.css ---- */

.throbberContainer {
   display: flex;
   align-items: center;
   gap: 1rem;
   margin-top: 2rem;

   * {
      margin: 0;
   }
}

.throbber {
   border: 0.4rem solid var(--colorBackground2);
   border-top: 0.4rem solid var(--colorText4);
   border-radius: 50%;
   width: 1.5rem;
   height: 1.5rem;
   animation: spin 1s linear infinite;
}

@keyframes spin {
   0% {
      transform: rotate(0deg);
   }

   100% {
      transform: rotate(360deg);
   }
}


/* ---- special.css ---- */

/* global vars */
:root {
   --globalBorderRadius: 1rem;
}

/* special */
.noMargin {
   margin: 0;
}

.flex {
   display: flex;
}

.spacer {
   border: none;
   margin: 0;
   margin-bottom: 1rem;
}

.borderDotted {
   border: dotted 3px var(--colorBorder);
   border-style: none none dotted;
}


/* ---- styles.css ---- */

* {
   margin: 0;
   padding: 0;
   text-decoration: none;
}

body {
   display: flex;
   flex-direction: column;

   min-height: 100vh;
   max-width: 45rem;
   margin: 0 auto;
   padding: 0 5%;

   font-family: 'paragraph';
   line-height: 1.8;
   color: var(--colorText2);
   background-color: var(--colorBackground1);

   main {
      flex: auto;
   }
}

/* text */
p {
   margin-top: 0;
   margin-bottom: 0.75rem;
   color: var(--colorText2);
}

a {
   color: var(--colorText1);

   &:hover {
      text-decoration: underline;
   }
}

ul {
   padding-left: 1.5rem;

   li {
      margin: 0.5rem 0;
   }
}

h1,
h2,
h3,
h4,
h5,
h6,
h7,
h8,
h9 {
   margin-top: 1.5rem;
   margin-bottom: 0.75rem;
   font-family: 'heading';
   line-height: 1.4;
   color: var(--colorText1);
}

#pageTitle {
   margin-top: 0;
   margin-bottom: 0.5rem;
}

h1 {
   /* fix h1 section */
   font-size: 2rem;
}

::selection {
   color: var(--colorBackground1);
   background: var(--colorText1);
}


/* elements */

hr {
   border: dotted 3px var(--colorBorder);
   border-style: none none dotted;
   margin: 2.5rem auto;
}

img {
   max-width: 100%;
   height: auto;
   border-radius: var(--globalBorderRadius);
}

blockquote {
   border-left: 3px solid var(--colorText1);
   padding-left: 15px;
   margin-left: 0px;
   margin: 2rem 0;
}

code {
   background-color: var(--colorBackground2);
   color: var(--colorText2);
   font-family: monospace;
   padding: 5px;
   border-radius: 5px;
}

th,
td {
   color: var(--colorText1);
   text-align: left;
   padding-right: 1rem;
}

table {
   width: 100%;
}

.markdownTableScroll {
   overflow: auto;

   table {
      margin: 1rem 0;
      border-collapse: collapse;
      white-space: nowrap;
   }
}


/* fonts */

@font-face {
   font-family: 'heading';
   src:
      url('/fonts/ubuntu-bold.woff2') format('woff2'),
      url('/fonts/ubuntu-bold.woff') format('woff');
   font-weight: 600;
   font-style: normal;
}

@font-face {
   font-family: 'paragraph';
   src:
      url('/fonts/ubuntu-regular.woff2') format('woff2'),
      url('/fonts/ubuntu-regular.woff') format('woff');
   font-weight: 400;
   font-style: normal;
}


/* ---- themes.css ---- */

:root,
.themeDark {
   --colorBackground1: rgb(20, 20, 20);
   --colorBackground2: rgb(40, 40, 40);
   --colorBackground3: rgb(55, 55, 55);

   --colorText1: rgb(220, 220, 220);
   --colorText2: rgb(190, 190, 190);
   --colorText3: rgb(160, 160, 160);
   --colorText4: rgb(130, 130, 130);

   --colorBorder: rgb(220, 220, 220);
}

.themeLight {
   --colorBackground1: rgb(240, 240, 240);
   --colorBackground2: rgb(255, 255, 255);
   --colorBackground3: rgb(220, 220, 220);

   --colorText1: rgb(40, 40, 40);
   --colorText2: rgb(70, 70, 70);
   --colorText3: rgb(100, 100, 100);
   --colorText4: rgb(130, 130, 130);

   --colorBorder: rgb(150, 150, 150);
}