/* Removed Google Fonts import - not used anywhere in the code */

@font-face {
  font-family: "Harding";
  src: url("assets/HardingText-Regular-Web.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-harding: "Harding", -apple-system, BlinkMacSystemFont, sans-serif;
  --color-bg: #23272e;
  --nord-dark0: #2e3440;
  --nord-dark1: #3b4252;
  --nord-dark2: #434c5e;
  --nord-dark3: #4c566a;
  --nord-polar1: #3b4252;
  --nord-light0: #d8dee9;
  --nord-light1: #e5e9f0;
  --nord-light2: #eceff4;
  --nord-snow2: #eceff4;
  --nord-frost0: #8fbcbb;
  --nord-frost1: #88c0d0;
  --nord-frost2: #81a1c1;
  --nord-frost3: #5e81ac;
  --nord-aurora-green: #a3be8c;
  --nord-acc0: #bf616a;
  --nord-acc1: #d08770;
  --nord-acc2: #ebcb8b;
  --nord-acc3: #a3be8c;
  --nord-acc4: #b48ead;
  --pu-orange-white: #e77500;
  --pu-orange-dark: #f58025;
}

/* Auto-hiding scrollbar implementation */

/* Hide scrollbar by default */
::-webkit-scrollbar {
  width: 0px;
  background: transparent;
  transition: width 0.3s ease;
}

/* Show scrollbar on hover or when scrolling */
html:hover::-webkit-scrollbar,
html.scrolling::-webkit-scrollbar {
  width: 9px;
  background-color: var(--color-bg);
  -webkit-border-radius: 100px;
}

/* Scrollbar thumb styling */
::-webkit-scrollbar-thumb {
  background: var(--nord-frost3);
  -webkit-border-radius: 100px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Show scrollbar thumb on hover or when scrolling */
html:hover::-webkit-scrollbar-thumb,
html.scrolling::-webkit-scrollbar-thumb {
  opacity: 1;
}

/* Active scrollbar color */
::-webkit-scrollbar-thumb:active {
  background: var(--nord-frost2);
}

/* Firefox - auto-hide scrollbar */
html {
  scrollbar-width: none;
  transition: scrollbar-width 0.3s ease;
}

html:hover,
html.scrolling {
  scrollbar-width: thin;
  scrollbar-color: var(--nord-frost3) var(--color-bg);
}

html,
body {
  padding: 0;
  margin: 0;
  font-family: var(--font-harding);
  font-size: clamp(16px, 1.5vw, 18px); /* Reduced desktop max size */
  overflow-x: hidden;
  background-color: var(--color-bg);
  color: #ddddda;
}

.light {
  background-color: whitesmoke;
  color: rgba(0, 0, 0, 0.8);
}

.alternate {
  font-size: clamp(0.9rem, 1.2vw, 1.1rem);
  font-weight: 200;
  background-color: var(--color-bg);
  color: #ddddda;
}

.container {
  min-height: 100vh;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

main {
  height: 100%;
  width: 100%;
  max-width: 1300px;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  margin: 0 auto;
}

footer {
  width: 100%;
  height: 100px;
  border-top: 1px solid var(--nord-dark1);
  display: flex;
  justify-content: center;
  align-items: center;
}

footer img {
  margin-left: 0.5rem;
}

footer a {
  display: flex;
  justify-content: center;
  align-items: center;
}

a {
  text-decoration: none;
  color: var(--nord-frost2);
  cursor: pointer;
  transition: 0.2s ease;
}

a:hover {
  text-decoration: underline;
  cursor: pointer;
  color: var(--nord-frost1);
}

@keyframes shiftup {
  from {
    transform: translateY(0px);
  }
  to {
    transform: translateY(-10px);
  }
}

@keyframes shiftleft {
  from {
    transform: translateX(0px);
  }
  to {
    transform: translateX(-10px);
  }
}

.back {
  text-decoration: none;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  margin: 1rem 1rem 0 0rem;
}

.back:hover {
  text-decoration: none;
  cursor: pointer;
}

.back span {
  display: inline-block;
  /* transition: 0.2s ease; */
  /* transition-property: all; */
}

.back:hover > span {
  animation: shiftleft 0.5s forwards;
}

.falink:hover > .fa {
  animation: shiftup 0.4s forwards;
  color: var(--nord-frost1);
}

.customtitle {
  display: block;
  line-height: 1.5;
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin: 0;
  padding: 0;
}

.links-container {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

@media (max-width: 768px) {
  .links-container {
    margin-left: 0 !important;
    padding-left: 0 !important;
    padding: 0 !important;
    justify-content: center !important;
  }
}

.leftalign {
  text-align: left;
}

h3 {
  font-weight: normal;
  display: inline;
}

.altp {
  display: inline;
  font-weight: 200;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  line-height: 1.5;
  margin-bottom: 0; /* this doesn't actually get ignored */
}

.altp a {
  color: var(--nord-frost2);
}

code {
  background: var(--nord-dark1);
  border-radius: 5px;
  padding: 0.75rem;
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  font-family:
    Menlo,
    Monaco,
    Lucida Console,
    Liberation Mono,
    DejaVu Sans Mono,
    Bitstream Vera Sans Mono,
    Courier New,
    monospace;
}

.row {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-width: 60%;
}

.column {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.column .title {
  margin: 1rem;
}

.column p:first-of-type {
  margin-top: 2rem;
}

.column p {
  margin: 1rem 0;
  line-height: 1.7em;
  font-weight: 200;
  font-size: clamp(0.8rem, 1.5vw, 1.2rem);
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.fullwidth {
  width: 100%;
}

.fullheight {
  height: 100%;
}

.card {
  margin: 0.5rem 0;
  padding: 1rem;
  width: 100%;
  text-align: left;
  border-radius: 0.5rem;
  border: 2px solid transparent;
  transition: all 0.2s linear;
}

.card:hover {
  color: var(--pu-orange-dark);
  background-color: var(--nord-dark2);
  /* border: 2px solid var(--nord-dark3); */
  box-shadow: 0px 4px 25px 5px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}

.card h3 {
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  font-weight: normal;
}

.card p {
  margin: 0.5rem;
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  line-height: 1.5;
  display: inline;
  font-weight: 200;
}

.logo {
  height: 1em;
}

.fullpage {
  margin: auto;
  margin-top: 1rem;
  text-align: left;
  align-items: center;
  width: 100%;
  max-width: 900px;
  padding: 0 1rem;
  box-sizing: border-box;
  overflow-wrap: break-word;
}

.small {
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  margin: 0.5rem 1.3rem !important;
}

hr {
  height: 1.5px;
  border: none;
  width: 90%;
  margin-right: 7.5%;
  color: #4c566a;
  background-color: #4c566a;
}

/* Desktop and widescreen - keep photo side-by-side with content */
@media (min-width: 769px) {
  .about-header {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: left !important;
    flex-wrap: nowrap !important;
  }

  .about-title-links {
    align-items: flex-start !important;
    text-align: left !important;
  }

  .about-title-links .customtitle {
    text-align: left !important;
    margin-left: 0.65rem !important;
  }

  .about-title-links .links-container {
    margin-left: -0.25rem !important;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0.5rem;
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* About page mobile improvements */
  .about-header {
    flex-direction: column !important;
    text-align: center !important;
    gap: 1.5rem !important;
    flex-wrap: wrap !important;
  }

  .about-title-links {
    align-items: center !important;
    text-align: center !important;
    width: 100%;
    padding-left: 0 !important;
    margin-left: 0 !important;
  }

  .about-title-links .customtitle {
    text-align: center !important;
  }

  main {
    padding: 0.5rem;
    width: 100%;
    max-width: 100%;
  }

  .fullpage {
    padding: 0 0.75rem;
    margin-top: 0.5rem;
    width: calc(100% - 1.5rem);
    max-width: calc(100vw - 1.5rem);
  }

  .column {
    padding: 0.5rem;
    width: 100%;
    max-width: 100%;
  }

  .column p {
    font-size: clamp(1rem, 4vw, 1.4rem);
    line-height: 1.6em;
    margin: 0.75rem 0;
    width: 100%;
    max-width: 100%;
    word-break: break-word;
    hyphens: auto;
  }

  .card {
    margin: 0.75rem 0;
    padding: 1rem;
    width: calc(100% - 2rem);
    box-sizing: border-box;
  }

  .card h3 {
    font-size: clamp(1.1rem, 4.5vw, 1.5rem);
    margin-bottom: 0.5rem;
    word-wrap: break-word;
  }

  .card p {
    font-size: clamp(1rem, 4vw, 1.4rem);
    line-height: 1.5em;
    word-wrap: break-word;
  }

  .customtitle {
    font-size: clamp(1.8rem, 7vw, 2.5rem);
    line-height: 1.3;
    margin-bottom: 0.5rem !important;
    margin-left: 0.75rem !important;
    word-wrap: break-word;
  }

  .altp {
    font-size: clamp(1rem, 4vw, 1.4rem);
  }

  /* Better touch targets for mobile */
  .falink {
    min-height: clamp(44px, 8vw, 52px) !important;
    min-width: clamp(44px, 8vw, 52px) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    font-size: clamp(1.2em, 3vw, 1.5em) !important;
    flex-shrink: 0 !important;
  }

  /* Improve spacing for mobile navigation */
  .row {
    margin-left: 0 !important;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
  }

  /* Better mobile link styling */
  a {
    touch-action: manipulation;
    word-wrap: break-word;
  }

  /* Prevent any horizontal overflow */
  * {
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0.5rem;
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
  }

  main {
    padding: 0.5rem;
    width: 100%;
    max-width: 100%;
  }

  .fullpage {
    padding: 0 0.5rem;
    margin-top: 0.25rem;
    width: calc(100% - 1rem);
    max-width: calc(100vw - 1rem);
  }

  .column {
    padding: 0.25rem;
    width: 100%;
    max-width: 100%;
  }

  .column p {
    font-size: clamp(0.9rem, 5vw, 1.3rem);
    line-height: 1.7em;
    margin: 1rem 0;
    width: 100%;
    max-width: 100%;
    word-break: break-word;
    hyphens: auto;
  }

  .card {
    margin: 1rem 0;
    padding: 0.75rem;
    width: calc(100% - 1.5rem);
    box-sizing: border-box;
  }

  .card h3 {
    font-size: clamp(1rem, 5.5vw, 1.4rem);
    margin-bottom: 0.75rem;
    word-wrap: break-word;
  }

  .card p {
    font-size: clamp(0.9rem, 5vw, 1.3rem);
    line-height: 1.6em;
    word-wrap: break-word;
  }

  .customtitle {
    font-size: clamp(1.5rem, 8vw, 2.2rem);
    line-height: 1.2;
    margin-bottom: 0.75rem !important;
    margin-left: 0.5rem !important;
    word-wrap: break-word;
  }

  /* Enhanced touch targets for small screens */
  .falink {
    min-height: clamp(40px, 7vw, 48px) !important;
    min-width: clamp(40px, 7vw, 48px) !important;
    margin: 0 !important;
    font-size: clamp(1.1em, 2.5vw, 1.3em) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }

  /* About page specific improvements */
  .about-header {
    flex-direction: column !important;
    text-align: center !important;
    gap: 2rem !important;
  }

  .about-title-links {
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
  }

  .about-title-links .customtitle {
    text-align: center !important;
  }

  /* Better spacing for very small screens */
  .row {
    margin-left: 0 !important;
    margin-top: 0.5rem !important;
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
  }

  /* Improve readability */
  .altp {
    font-size: clamp(0.9rem, 5vw, 1.3rem);
    line-height: 1.6;
    word-wrap: break-word;
  }

  /* Better footer spacing */
  footer {
    height: clamp(60px, 12vw, 80px);
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Prevent any horizontal overflow on small screens */
  * {
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* Posts & blog styling */
.posts-header {
  margin-bottom: 1.5rem;
}

.posts-header h1 {
  margin: 0 0 0.5rem 0;
}

.posts-header p {
  margin: 0;
  font-size: clamp(0.9rem, 1.6vw, 1.1rem);
  color: var(--nord-light0);
}

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.post-card {
  padding: 0.5rem 0.75rem 0.4rem;
  border-radius: 0.6rem;
  background-color: var(--nord-dark1);
  border: 1px solid var(--nord-dark3);
  transition:
    background-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.post-card:hover {
  background-color: var(--nord-dark2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

.post-card-title {
  display: inline-block;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 500;
  color: var(--nord-light2);
  text-decoration: none;
}

.post-card-title:hover {
  text-decoration: underline;
}

.post-card-meta {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--nord-light0);
}

.post-card-summary {
  margin-top: 0.2rem;
  font-size: clamp(0.6rem, 0.75vw, 0.75rem);
  line-height: 1.3;
}

.post-content {
  margin-top: 1.5rem;
  line-height: 1.8;
}

.post-content h2,
.post-content h3 {
  margin-top: 1.6rem;
  margin-bottom: 0.5rem;
}

.post-content p {
  margin: 0.75rem 0;
}

.post-content code {
  font-size: 0.9em;
}
