/* Academic Pages Theme Match - Exactly aligned with original Jekyll SCSS */

:root {
  /* Light Theme Variables - Source: _default_light.scss */
  --global-base-color: #2f7f93;
  --global-bg-color: #ffffff;
  --global-text-color: #7a8288;
  --global-text-color-light: #7a8288;
  --global-border-color: #f2f3f3;
  --global-dark-border-color: #e2e2e2;
  --global-link-color: #52adc8;
  --global-link-color-hover: #1b4955;
  --global-masthead-link-color: #7a8288;
  --global-masthead-link-color-hover: #2f7f93;

  --masthead-height: 52px;
  --sidebar-width: 300px;
  --max-width: 1280px;
  --border-radius: 4px;

  /* Type Scale matching _themes.scss */
  --type-size-1: 2.441rem;
  --type-size-2: 1.953rem;
  --type-size-3: 1.563rem;
  --type-size-4: 1.25rem;
  --type-size-5: 1rem;
  --type-size-6: 0.75rem;
  --type-size-7: 0.6875rem;
  --type-size-8: 0.625rem;
}

[data-theme="dark"] {
  /* Dark Theme Variables - Source: _default_dark.scss */
  --global-base-color: #0ea1c5;
  --global-bg-color: #474747;
  --global-text-color: #ffffff;
  --global-text-color-light: #f3f3f3;
  --global-border-color: #7a8288;
  --global-dark-border-color: #575757;
  --global-link-color: #0ea1c5;
  --global-link-color-hover: #0a7ea3;
  --global-masthead-link-color: #ffffff;
  --global-masthead-link-color-hover: #0ea1c5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--global-text-color);
  background-color: var(--global-bg-color);
  transition: background-color 0.2s, color 0.2s;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 2em 0 0.5em;
  line-height: 1.2;
}

h1 {
  margin-top: 0;
  font-size: var(--type-size-3);
}

h2 {
  font-size: var(--type-size-4);
}

h3 {
  font-size: var(--type-size-5);
}

p {
  margin-bottom: 1.3em;
}

a {
  color: var(--global-link-color);
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

a:hover {
  text-decoration: underline;
  color: var(--global-link-color-hover);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1em;
}

/* Masthead - Match _masthead.scss */
.masthead {
  position: sticky;
  top: 0;
  width: 100%;
  height: var(--masthead-height);
  background: var(--global-bg-color);
  z-index: 20;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--global-border-color);
}

.masthead__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.site-title {
  font-weight: bold;
  font-size: 1.25rem;
  color: var(--global-masthead-link-color);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links li a {
  padding: 0.5rem 0;
  margin: 0 0.75rem;
  color: var(--global-masthead-link-color);
  font-weight: bold;
  position: relative;
  font-size: 0.95rem;
  text-decoration: none !important;
}

.nav-links li a:hover {
  text-decoration: none;
  color: var(--global-masthead-link-color-hover);
}

.nav-links li a:after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 4px;
  background: var(--global-base-color);
  width: 100%;
  transition: transform 0.2s ease-in-out;
  transform: scaleX(0);
}

.nav-links li a:hover:after,
.nav-links li a.active:after {
  transform: scaleX(1);
}

.nav-links li a.active {
  color: var(--global-masthead-link-color-hover);
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--global-masthead-link-color);
  padding: 0.5rem 0;
  margin: 0 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
}

.theme-toggle:hover {
  color: var(--global-masthead-link-color-hover);
  background: none;
}

/* Layout Grid - Match _sidebar.scss & _page.scss */
.initial-content {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 3rem;
  margin-top: 2rem;
  padding-bottom: 4rem;
  align-items: start;
}

@media screen and (min-width: 1024px) {
  .sidebar {
    position: sticky;
    top: calc(var(--masthead-height) + 1.5rem);
    width: var(--sidebar-width);
    height: auto;
    max-height: calc(100vh - var(--masthead-height) - 4rem);
    overflow-y: auto;
    padding-right: 0.5em;
  }
}

/* Sidebar Styling - Exactly matching _sidebar.scss */
.author__avatar {
  margin-bottom: 15px;
  display: flex;
  justify-content: left;
}

.author__avatar img {
  max-width: 150px;
  width: 150px;
  height: 150px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  padding: 5px;
  border: 1px solid var(--global-border-color);
  background: var(--global-bg-color);
}

.author__content {
  margin-bottom: 20px;
}

.author__name {
  margin: 10px 0;
  font-size: 1.25rem;
  font-weight: bold;
}

.author__pronouns {
  margin: 10px 0;
  color: var(--global-text-color-light);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.author__bio {
  margin: 10px 0 20px;
  font-size: 0.75rem;
  line-height: 1.5;
}

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

.author__urls li {
  margin-bottom: 5px;
  font-size: 1rem;
}

.author__urls a {
  color: inherit;
  text-decoration: none;
}

.author__urls a:hover {
  text-decoration: underline;
}

.author__urls i {
  width: 20px;
  margin-right: 5px;
  color: var(--global-text-color-light);
}

.icon-pad-right {
  margin-right: 5px;
}

/* Page Content - Match _page.scss */
.page__content h1 {
  margin-top: 0;
  font-size: var(--type-size-3);
  border-bottom: 1px solid var(--global-border-color);
  padding-bottom: 0.5rem;
}

.page__content h2 {
  margin-top: 2em;
  padding-bottom: 0.5rem;
  font-size: var(--type-size-4);
  border-bottom: 1px solid var(--global-border-color);
}

.page__content a {
  text-decoration: underline;
}

.page__content p,
.page__content li {
  font-size: var(--type-size-5);
  margin-bottom: 1.5em;
  /* Increased spacing */
}

/* Item cards - Match _archive.scss */
.archive__item {
  margin-bottom: 2em;
  border-bottom: 1px solid var(--global-border-color);
  padding-bottom: 1em;
}

.archive__item-title {
  margin-top: 0;
  margin-bottom: 0.25em;
  font-size: 1.25rem;
  font-weight: bold;
}

.archive__item-title a {
  color: inherit;
  text-decoration: underline;
}

.archive__item-title a:hover {
  text-decoration: underline;
}

.archive__item-content {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
}

.archive__item-teaser {
  flex: 0 0 300px;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.archive__item-teaser img {
  width: 100%;
  transition: all 0.2s ease-in-out;
}

.archive__item:hover .archive__item-teaser img {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
}

.archive__item-body {
  flex: 1;
}

.archive__item-excerpt {
  font-size: var(--type-size-6);
  margin-top: 0;
  margin-bottom: 10px;
}

.archive__subtitle {
  margin: 3em 0 1em;
  padding-bottom: 0.5em;
  font-size: var(--type-size-4);
  color: var(--global-text-color-light);
  border-bottom: 1px solid var(--global-border-color);
}

.tags {
  margin-top: 10px;
}

.tag {
  display: inline-block;
  margin-right: 8px;
  margin-bottom: 5px;
  padding: 2px 8px;
  background-color: var(--global-border-color);
  color: var(--global-text-color);
  border-radius: var(--border-radius);
  font-size: 0.7rem;
}

.links {
  margin-top: 15px;
}

.links a {
  margin-right: 15px;
  font-size: 0.9rem;
}

.authors {
  font-size: 0.95rem;
  margin-bottom: 5px;
  color: var(--global-text-color);
}

.venue {
  font-size: 0.85rem;
  font-style: italic;
  margin-bottom: 5px;
  color: var(--global-text-color-light);
}

/* Grid view items */
.grid__wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2em;
}

/* Footer matching _footer.scss */
.page__footer {
  padding: 3em 0;
  background-color: var(--global-bg-color);
  border-top: 1px solid var(--global-dark-border-color);
  color: var(--global-text-color-light);
  text-align: center;
  font-size: 0.75rem;
  margin-top: 3em;
}

.page__footer a {
  color: inherit;
  font-weight: bold;
}

/* Responsiveness */
@media screen and (max-width: 1023px) {
  .initial-content {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 0 auto;
    padding: 1em;
  }

  .sidebar {
    border-bottom: 1px solid var(--global-border-color);
    margin-bottom: 2em;
    padding-bottom: 2em;
    text-align: center;
  }

  .author__avatar {
    justify-content: center;
  }

  .author__avatar img {
    max-width: 150px;
    width: 150px;
    height: 150px;
  }
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--global-border-color);
  color: var(--global-text-color);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.2rem;
}

@media screen and (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--masthead-height);
    left: 0;
    right: 0;
    background: var(--global-bg-color);
    padding: 1em;
    border-bottom: 1px solid var(--global-border-color);
    z-index: 100;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links li {
    width: 100%;
    border-bottom: 1px solid var(--global-border-color);
  }

  .nav-links li a {
    margin: 0;
    padding: 10px 0;
    width: 100%;
    display: block;
  }
}