@import url("style.css");

body {
  display: flex;
  font-family: sans-serif;
  margin: 0;
}

aside {
  width: 220px;
  background: var(--text-color);
  padding: 1rem;
  height: 100vh;
  position: sticky;
  top: 0;
}

aside h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

aside ul {
  list-style: none;
  padding: 0;
}

aside li {
  margin: 0.5rem 0;
}

aside a {
  text-decoration: none;
  color: var(--link-color);
  /* theme-aware link color */
  font-family: inherit;
  /* use the page font (Arial from style.css) */
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;

  display: block;
  /* full-row hit area */
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: transparent;

  transition: color 0.18s ease, background-color 0.18s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

/* Hover / focus (mouse + keyboard) */
aside a:hover,
aside a:focus {
  color: var(--link-hover);
  transform: translateX(3px);
  background-color: rgba(255, 255, 255, 0.04);
  /* subtle highlight in dark theme */
}



/* Current / active page link: visible accent without mixing colors */
aside a.current {
  font-weight: 700;
  color: var(--image-accentcolor);
  border-left: 3px solid var(--image-accentcolor);
  padding-left: calc(0.6rem - 3px);
  /* keep padding visually aligned after the border */
  background: transparent;
}

/* Keyboard focus visible but not noisy */
aside a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--link-color);
  /* uses theme-aware link color */
  border-radius: 6px;
}



main {
  flex: 1;
  padding: 2rem;
}

/* Top bar (menu + theme toggle) */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

/* Hide buttons on desktop by default */
#open-sidebar,
#close-sidebar {
  display: none;
}

/* Blog content */
/* Blog content inside main */
body.index {
  display: flex;
  flex-direction: column;
  /* stack header + blog vertically */
  font-family: sans-serif;
  margin: 0;
}


article p {
  margin-bottom: 1.5rem;
  /* more space between paragraphs */
  line-height: 1.3;
  /* easier to read */
}


/* --- Sidebar toggle --- */

/* Responsive Sidebar (for small screens) */
@media (max-width: 800px) {
  body {
    flex-direction: column;
  }

  aside {
    position: fixed;
    top: 0;
    left: -250px;
    width: 220px;
    height: 100vh;
    box-shadow: 4px 0 10px var(--shadow-color);
    transition: left 0.3s ease;
    z-index: 1000;
  }

  aside.active {
    left: 0;
  }

  #open-sidebar {
    display: inline-block;
    font-size: 1.5rem;
    background: none;
    color: var(--link-color);
    border: none;
    cursor: pointer;
  }

  #close-sidebar {
    display: block;
    font-size: 2rem;
    background: none;
    color: var(--link-color);
    border: none;
    cursor: pointer;
    position: absolute;
    top: 0.5rem;
    right: 1rem;
  }

  main {
    padding: 1rem;
  }
}

/* Paragraph spacing for readability */
article p {
  margin-bottom: 1.5rem;
  line-height: 1.5;
}


article a {
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease;
}

/* Subtle animated underline using ::after */
article a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0%;
  height: 2px;
  background-color: var(--link-hover);
  transition: width 0.3s ease;
  border-radius: 2px;
}
.article svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 900px;
  margin: 1.5rem auto;
}
article table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5em 0;
  font-size: 0.95em;
  border-radius: 8px;
  overflow: hidden;                /* clips the corners of inner cells */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
mjx-container[display="true"] {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}
article thead th {
  background: var(--accent, var(--shadow-color));   /* your Peccon purple as default */
  color: var(--text-color);
  font-weight: 600;
  text-align: left;
  padding: 0.65em 0.9em;
  letter-spacing: 0.02em;
}

article td {
  padding: 0.55em 0.9em;
  border-top: 1px solid var(--border, var(--text-color));
  vertical-align: top;
}

/* zebra striping for readability on wide tables */
article tbody tr:nth-child(even) {
  background: var(--row-alt, rgba(0, 0, 0, 0.025));
}

article tbody tr:hover {
  background: var(--row-hover, rgba(119, 41, 83, 0.06));
}
article a:hover {
  color: var(--link-hover);
}

article a:hover::after {
  width: 100%;
}

/* Optional: better contrast for visited links */
article a:visited {
  color: var(--image-accentcolor);
}