/* Add spacing between number and description in page-list */
.page-list .page-number {
  display: inline-block;
  min-width: 2.2em;
  text-align: right;
  margin-right: 1em;
}
/*===============
  global styles
===============*/

* {
  padding: 0;
  margin: 0;
  border: 0;
  outline: 0;
  background-color: inherit;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  box-shadow: none;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.5;
  color: var(--clr-fg);
  background-color: var(--clr-bg);
}

.light {
  --clr-bg: #fcfcfc;
  --clr-bg-alt: #fff;
  --clr-fg: #555;
  --clr-fg-alt: #444;
  --clr-primary: #2978b5;
  --shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
}

.dark {
  --clr-bg: #23283e;
  --clr-bg-alt: #2a2f4c;
  --clr-fg: #bdbddd;
  --clr-fg-alt: #cdcdff;
  --clr-primary: #90a0d9;
  --shadow: rgba(0, 0, 0, 0.16) 0px 10px 36px 0px,
    rgba(0, 0, 0, 0.06) 0px 0px 0px 1px;
}

::-moz-selection {
  background: var(--clr-primary);
  color: var(--clr-bg);
}

::-webkit-selection,
::selection {
  background: var(--clr-primary);
  color: var(--clr-bg);
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  color: var(--clr-fg-alt);
}

h1 {
  font-size: 2.5rem;
  margin-top: 30px;
  margin-bottom: 20px;
}

.article-body > h1:first-child {
  color: var(--clr-primary);
  font-size: 3rem;
}

h2 {
  font-size: 2rem;
  margin-top: 25px;
  margin-bottom: 5px;
}

h3 {
  font-size: 1.5rem;
  margin-top: 15px;
  margin-bottom: 5px;
}

h4 {
  font-size: 1.3rem;
  margin-top: 15px;
  margin-bottom: 5px;
}

a {
  text-decoration: none;
}

p {
  margin: 1em 0;
  line-height: 1.8em;
}

input {
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

table {
  margin: 1.5em 0;
  border-spacing: 4px;
}

td, th {
  border-radius: 2px;
  padding: 8px;
  
}
td {
  background: #f0f0f4;
}

th {
  background: #2978b5;
  color: white;
}


/* Style for content lists (bullets and ordered) */
.article-body ul {
  list-style-type: disc;
  margin-left: 2em;
  margin-bottom: 1em;
}

.article-body ol {
  list-style-type: decimal;
  margin-left: 2em;
  margin-bottom: 1em;
}

.article-body li {
  margin: 0.5em 0;
}

/* Table of Contents */
.table-of-contents {
  background: var(--clr-bg-alt);
  border-left: 4px solid var(--clr-primary);
  padding: 1.5em 2em;
  margin: 2em 0;
  border-radius: 8px;
}

.table-of-contents h2 {
  margin-top: 0;
  margin-bottom: 1em;
  color: var(--clr-primary);
  font-size: 1.2em;
}

.table-of-contents ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.table-of-contents li {
  margin: 0.6em 0;
  padding-left: 0;
}

.table-of-contents li.toc-h2 {
  margin-left: 2em;
  margin-top: 0.4em;
  font-size: 0.95em;
}

.table-of-contents li.toc-h3 {
  margin-left: 4em;
  margin-top: 0.4em;
  font-size: 0.9em;
}

.table-of-contents li.toc-h4 {
  margin-left: 6em;
  margin-top: 0.4em;
  font-size: 0.85em;
}

.table-of-contents li.toc-h5 {
  margin-left: 8em;
  margin-top: 0.4em;
  font-size: 0.8em;
}

.table-of-contents li.toc-h6 {
  margin-left: 10em;
  margin-top: 0.4em;
  font-size: 0.75em;
}

.table-of-contents a {
  color: var(--clr-fg);
  text-decoration: none;
  transition: color 0.2s ease;
}

.table-of-contents a:hover {
  color: var(--clr-primary);
}

/* Navigation and page lists have no bullets */
.nav__list,
.page-list,
.page-list li {
  list-style-type: none;
  margin-left: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5em auto;
  border-radius: 4px;
  box-shadow: var(--shadow);
}

button {
  cursor: pointer;
}

@media (max-width: 900px) {
  h1 {
    font-size: 2.6rem;
  }
}

/*===================
  buttons and links
===================*/

.link {
  color: var(--clr-primary);
  padding: 0 0 0.3em 0;
  position: relative;
}
.link:hover {
  color: var(--clr-primary);
}

.link::before {
  content: "";
  display: inline;
  width: 0%;
  height: 0.2em;
  position: absolute;
  bottom: 0;
  background-color: var(--clr-primary);
  transition: width 0.2s ease-in;
}

.link:hover::before,
.link:focus::before {
  width: 100%;
}

.link--nav {
  color: var(--clr-fg);
  text-transform: lowercase;
  font-weight: 500;
}

.link--icon {
  color: var(--clr-fg);
  font-size: 1.2rem;
}

.btn {
  display: block;
  padding: 0.8em 1.4em;
  font-weight: 500;
  font-size: 0.9rem;
  text-transform: lowercase;
  transition: transform 0.2s ease-in-out;
}

.btn--outline {
  color: var(--clr-primary);
  border: 2px solid var(--clr-primary);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn--outline:focus,
.btn--outline:hover {
  color: var(--clr-bg);
}

.btn--outline:before {
  content: "";
  position: absolute;
  background-color: var(--clr-primary);
  right: 100%;
  bottom: 0;
  left: 0;
  top: 0;
  z-index: -1;
  transition: right 0.2s ease-in-out;
}

.btn--outline:hover::before,
.btn--outline:focus::before {
  right: 0;
}

.btn--plain {
  text-transform: initial;
  background-color: var(--clr-bg-alt);
  box-shadow: rgba(0, 0, 0, 0.15) 0px 3px 3px 0px;
  border: 0;
}

.btn--plain:hover {
  transform: translateY(-4px);
}

.btn--icon {
  padding: 6px;
  font-size: 1.2rem;
}

.btn--icon:hover,
.btn--icon:focus {
  color: var(--clr-primary);
}

.btn--icon:active {
  transform: translateY(-5px);
}

/*========
  layout
========*/

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

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

.header {
  height: 5em;
  max-width: 1100px;
  width: 95%;
  margin: 0 auto;
  justify-content: space-between;
}

main {
  max-width: 1100px;
  width: 95%;
  margin: 0 auto;
}

.section {
  margin-top: 5em;
}

.section__title {
  text-align: center;
  margin-bottom: 1em;
  text-transform: uppercase;
}

.nav__list {
  margin-right: 1.5em;
  display: flex;
}

.nav__list-item {
  margin-left: 1.5em;
}

.nav__hamburger {
  display: none;
  width: 1em;
}

.about {
  flex-direction: column;
  margin-top: 3em;
}

.highlight {
  color: var(--clr-primary);
}

.about__role {
  margin-top: 1.2em;
}

.about__desc {
  font-size: 1rem;
  max-width: 600px;
}

.about__desc,
.about__contact {
  margin-top: 2.4em;
}

.about .link--icon {
  margin-right: 0.8em;
}

.about .btn--outline {
  margin-right: 1em;
}

.projects__grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18em, 1fr));
  grid-gap: 2em;
}

/* Page list styles (used for section lists and recent pages) */
.page-list {
  list-style: none;
  margin: 2rem 0;
  padding: 0;
}

.page-list li {
  margin-bottom: 0.1rem;
}

.page-list a {
  color: var(--clr-fg);
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  transition: background 0.18s ease, transform 0.12s ease;
}

/* Hover only applies when keyboard navigation is NOT active */
.page-list:not(.keyboard-nav-active) a:hover {
  background: var(--clr-primary);
  color: var(--clr-bg);
}

/* Highlighted state always applies (for keyboard navigation) */
.page-list a.highlighted {
  background: var(--clr-primary);
  color: var(--clr-bg);
}

.page-list .page-number {
  display: inline-block;
  min-width: 2.2em;
  text-align: right;
  margin-right: 0.9rem;
  font-weight: 700;
  color: var(--clr-fg-alt);
}

/* Hover number styling only when keyboard navigation is NOT active */
.page-list:not(.keyboard-nav-active) a:hover .page-number,
.page-list a.highlighted .page-number {
  color: var(--clr-bg);
}

/*==========
  tiles
==========*/

.tiles-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.tile {
  background: var(--clr-bg);
  border-radius: 15px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.tile a {
  display: block;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--clr-fg);
}

.tile-title {
  color: var(--clr-primary);
  margin: 0.5rem 0;
  font-size: 1.3rem;
}

.tile-content {
  color: var(--clr-fg-alt);
  font-size: 0.9rem;
  line-height: 1.5;
}

.tile-content p {
  margin: 0.5rem 0;
}

@media (max-width: 768px) {
  .tiles-container {
    grid-template-columns: 1fr;
  }
}

.project {
  padding: 2em;
  margin: 0 auto;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s linear;
}

.project:hover {
  transform: translateY(-7px);
}

.project__description {
  margin-top: 1em;
}

.project__stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 1.2em 0;
}

.project__stack-item {
  margin: 0.5em;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--clr-fg-alt);
}

.project .link--icon {
  margin-left: 0.5em;
}

.skills__list {
  max-width: 450px;
  width: 95%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.skills__list-item {
  margin: 0.5em;
}

.contact {
  flex-direction: column;
}

.footer {
  padding: 3em 0;
  margin-top: 4em;
  text-align: center;
}

.footer__link {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--clr-fg);
}

.scroll-top {
  display: none;
  position: fixed;
  bottom: 1em;
  right: 2em;
  background-color: transparent;
  font-size: 1.8rem;
  transition: transform 0.2s ease-in-out;
}

@media (max-width: 600px) {
  .header {
    height: 6em;
  }

  .section {
    margin-top: 4em;
  }

  .nav__list {
    flex-direction: column;
    padding: 4em 0;
    position: absolute;
    right: 0;
    left: 0;
    top: 5em;
    background-color: var(--clr-bg);
    width: 0;
    overflow: hidden;
    transition: width 0.2s ease-in-out;
  }

  .display-nav-list {
    width: 100%;
  }

  .nav__list-item {
    margin: 0.5em 0;
  }

  .nav__hamburger {
    display: flex;
    margin-left: 0.8em;
  }

  .about {
    align-items: flex-start;
    margin-top: 2em;
  }

  .footer {
    padding: 2em;
    margin-top: 3em;
  }

  .scroll-container {
    display: none;
  }
}

/*==================
  search overlay
==================*/

.search-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}

.search-overlay.active {
  display: flex;
}

.search-box {
  background-color: var(--clr-bg-alt);
  border-radius: 8px;
  box-shadow: var(--shadow);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#search-input {
  width: 100%;
  padding: 1.2em;
  font-size: 1.1rem;
  border: none;
  border-bottom: 2px solid var(--clr-primary);
  background-color: var(--clr-bg-alt);
  color: var(--clr-fg);
}

.search-results {
  flex: 1;
  overflow-y: auto;
  max-height: 60vh;
}

.search-results-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.search-results-list li {
  border-bottom: 1px solid var(--clr-bg);
}

.search-results-list li a {
  display: block;
  padding: 1em 1.2em;
  color: var(--clr-fg);
  text-decoration: none;
  transition: background-color 0.2s;
}

.search-results-list li a:hover,
.search-results-list li.selected a {
  background-color: var(--clr-primary);
  color: var(--clr-bg);
}

.search-results-list li a:hover .result-snippet,
.search-results-list li.selected a .result-snippet {
  color: var(--clr-bg);
  opacity: 0.9;
}

.search-results-list li a:hover mark,
.search-results-list li.selected a mark {
  background-color: rgba(255, 255, 255, 0.3);
  color: var(--clr-bg);
}

.result-title {
  font-weight: 500;
  font-size: 1.05em;
  margin-bottom: 0.3em;
}

.result-snippet {
  font-size: 0.85em;
  color: var(--clr-fg-alt);
  line-height: 1.4;
  opacity: 0.8;
}

.result-snippet mark {
  background-color: rgba(41, 120, 181, 0.2);
  color: inherit;
  padding: 0.1em 0.2em;
  border-radius: 2px;
}

.result-type {
  font-size: 0.8em;
  color: var(--clr-fg-alt);
  margin-left: 0.5em;
  opacity: 0.7;
}

.search-no-results {
  padding: 2em;
  text-align: center;
  color: var(--clr-fg-alt);
}

.search-hint {
  padding: 0.8em 1.2em;
  font-size: 0.85rem;
  color: var(--clr-fg-alt);
  background-color: var(--clr-bg);
  border-top: 1px solid var(--clr-bg);
  text-align: center;
}
