/* =========================================
   Header: push nav items to the right
   ========================================= */
.greedy-nav .visible-links {
  margin-left: auto;
  justify-content: flex-end;
}
/* ==========================================================================
   CUSTOM STYLES - Direct targeting (no wide class needed)
   ========================================================================== */

/* Target main container directly */
#main {
  max-width: 1300px !important;
  margin: 0 auto !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
}

/* Make the author photo larger */
.author__avatar {
  max-width: 220px !important;   /* default is ~200px */
  height: auto !important;       /* keep aspect ratio */
}

/* Target the page inner wrap directly */
.page__inner-wrap {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding-right: 10px !important;
}

/* Target content section directly */
.page__content {
  max-width: none !important;
  width: 100% !important;
  margin-right: 0 !important;
  padding-right: 5px !important;
}

/* Make masthead match the width */
.masthead__inner-wrap {
  max-width: 1300px !important;
  margin: 0 auto !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
}

/* Reduce sidebar width to give more space to content */
.sidebar {
  width: 200px !important;
  flex: 0 0 200px !important;
}

/* Ensure all content elements use full width */
.page__content > *,
.page__content p,
.page__content h1,
.page__content h2,
.page__content h3,
.page__content ul,
.page__content div {
  max-width: none !important;
  width: 100% !important;
}

/* Expand the sidebar author box so text doesn't get cut off */
.sidebar .author__content {
  max-width: 100% !important;   /* allow it to use full space */
  padding-right: 10px !important; /* add some breathing room on the right */
  word-wrap: break-word;        /* prevent text overflow */
}

/* ====== Fonts ====== */



/* Serif body text (Georgia) */
body {
  font-family: Georgia, Cambria, "Times New Roman", serif;
  line-height: 1.6;
  font-size: 17px;
}

/* Headings also in Georgia */
h1, h2, h3, h4, h5, h6,
.page__title {
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-weight: 600;   /* 600 gives strong emphasis, but not too bold */
  line-height: 1.3;   /* a bit more breathing room than sans-serif */
}


/* Override: Your name (the page title at top) */
.page__title {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 600;
  line-height: 1.2;
}

/* Override: Section titles (Working Papers, Work in Progress, Teaching) */
h2 {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 600;
}



/* Fix vertical alignment for nav links that contain <a> directly */
.masthead__menu-item a {
  display: inline-block;
  vertical-align: middle;
}

/* Links inside headings: keep underline, inherit color */
h2 a, h3 a, h4 a {
  color: inherit;        /* same color as the heading */
  text-decoration: underline; 
}

/* Inline links in body text: inherit color, no underline */
.page__content a {
  color: inherit;             /* same as surrounding text */
  text-decoration: none;      /* remove underline */
}

/* Exception: links inside h3 headings = inherit color, keep underline */
.page__content h3 a {
  color: inherit;
  text-decoration: underline;
}

/* Mobile: hide author social links (button + icons) */
@media (max-width: 860px) {
  .author__urls-wrapper,
  .author__urls {
    display: none !important;
  }
}

/* Full-justify body copy only (not headings) */
.page__content p,
.page__content li {
  text-align: justify;
  text-justify: inter-word;   /* helps in some browsers */
  hyphens: auto;              /* soft hyphenation for nicer breaks */
}

/* Keep headings, code, quotes left-aligned */
.page__content h1,
.page__content h2,
.page__content h3,
.page__content h4,
.page__content h5,
.page__content h6,
.page__content pre,
.page__content code,
.page__content blockquote {
  text-align: left;
}

/* Consistent, slightly smaller space before section headings */
.page__content h2 {
  margin-top: 4rem;     /* tweak to taste; smaller than a <br> line */
}

/* Theme-aware, adjustable strength */
:root { --rule-alpha: 35%; }   /* tweak to taste: 25–45% */

.page__content h2 {
  border-bottom: 1px solid color-mix(in srgb, currentColor var(--rule-alpha), transparent);
  padding-bottom: .3rem; margin-bottom: .8rem;
}

.page__content hr {
  height: 1px; border: 0;
  background: color-mix(in srgb, currentColor var(--rule-alpha), transparent);
  opacity: 1; margin: 1rem 0;
}

/* .author__avatar img {
  border: 1.5px solid color-mix(in srgb, currentColor var(--rule-alpha), transparent);
} */

/* Use the same adaptive hairline under the top nav/header */
:root { --rule-alpha: 35%; } /* keep or tweak to taste */

/* First, neutralize any default borders/shadows to avoid double lines */
.masthead,
.greedy-nav {
  border-bottom: none;
  box-shadow: none;
}

/* Then draw one clean line on the outer header */
.masthead {
  border-bottom: 1px solid color-mix(in srgb, currentColor var(--rule-alpha), transparent);
}



details.abstract { margin: .5rem 0 1rem; }


/* Make the gap before Abstract consistent, regardless of the previous element */
.page__content h2:has(+ details.abstract),
.page__content h3:has(+ details.abstract),
.page__content h4:has(+ details.abstract),
.page__content p:has(+ details.abstract),
.page__content ul:has(+ details.abstract),
.page__content .paper-meta:has(+ details.abstract) {
  margin-bottom: .6rem;   /* pick your preferred gap */
}

/* Prevent margin-collapsing from re-introducing variation */
.page__content details.abstract {
  margin-top: 0;
  padding-top: .6rem;      /* creates the visible space */
  border-top: 0.01px solid transparent; /* also prevents collapsing */
}

/* One rule to normalize the gap before every Abstract */
.page__content * + details.abstract {
  margin-top: 0;            /* avoid margin-collapsing surprises */
  padding-top: .6rem;       /* ← adjust this number to taste */
  border-top: 0.01px solid transparent; /* prevents collapsing on some browsers */
}

/* (Optional) tidy the first child inside details */
.page__content details.abstract > *:first-child { margin-top: 0; }

/* Always show the sun/moon toggle */
.mode-toggle { display: inline-flex !important; }

/* Center the author card on small screens */
@media (max-width: 540px) {
  /* The Minimal Mistakes author block */
  .h-card.p-author { 
    text-align: center;                 /* center text */
    display: grid;                      /* easy centering for children */
    justify-items: center;              /* center children horizontally */
  }
  .h-card.p-author .author__avatar {
    float: none;                        /* cancel float */
    margin: 0 auto .5rem;               /* center image */
  }
  .h-card.p-author .author__content,
  .h-card.p-author .author__bio,
  .h-card.p-author .author__name {
    text-align: center;
  }
  .h-card.p-author .author__urls-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;            /* center social icons row if shown */
  }
}

/* === Uniform Abstract toggles (works on iOS/Android/desktop) === */
details.abstract > summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;         /* remove default list bullet */
  -webkit-appearance: none; /* Safari */
  appearance: none;
}

/* hide native markers everywhere */
details.abstract > summary::-webkit-details-marker { display: none; }
details.abstract > summary::marker { content: ""; }

/* draw our own arrow (CSS triangle) */
details.abstract > summary::before {
  content: "";
  display: inline-block;
  width: 0; height: 0;
  margin-right: .4rem;
  transform: translateY(1px);
  border-style: solid;
  /* closed state: right-pointing */
  border-width: 6px 0 6px 9px;
  border-color: transparent transparent transparent currentColor;
}

/* open state: down-pointing */
details.abstract[open] > summary::before {
  border-width: 9px 6px 0 6px;
  border-color: currentColor transparent transparent transparent;
}

/* optional: tidy spacing inside the block */
details.abstract > *:first-child { margin-top: 0; }


/* Tighten space between header and first content (author box) on mobile */
@media (max-width: 540px) {
  /* shrink the header's vertical padding a bit */
  .masthead__inner-wrap { padding-top: .35rem !important; padding-bottom: .35rem !important; }

  /* remove extra offset the theme adds before the page content */
  .initial-content { margin-top: 0 !important; padding-top: 0 !important; }

  /* trim the top padding of the page wrapper */
  .page__inner-wrap { padding-top: .5rem !important; }

  /* the first block after the header (often the author card) */
  #main > *:first-child { margin-top: .5rem !important; }

  /* ensure the author sidebar/card itself doesn't add a big top margin */
  .sidebar { margin-top: .25rem !important; }
}
