/* Center author sidebar content */
.author__avatar {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0 auto 1rem;
}

.author__avatar img {
  display: block;
  margin: 0 auto;
  max-width: 180px;
  float: none;
}

/* Center author name */
.author__name {
  text-align: center;
}

/* Bio: equal line width + clean edges */
.author__bio {
  text-align: justify;          /* equal line width */
  max-width: 240px;             /* controls line length */
  margin: 0 auto;
  hyphens: auto;                /* nicer word breaks */
}

/* Match social links block to bio width */
.author__urls-wrapper {
  max-width: 240px;
  margin: 0.5rem auto 0;
  text-align: left;
}

.author__urls-wrapper .btn {
  width: 100%;
  justify-content: center;
}

/* Align list with bio */
.author__urls {
  justify-content: flex-start;
  width: 100%;
}

.author__urls.social-icons {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
}

.author__urls.social-icons li,
.author__urls.social-icons li a {
  width: 100%;
}

.author__urls.social-icons li a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  justify-content: flex-start;
  line-height: 1.1;
}

/* Blog hub cards */
.post-card {
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.post-card h3 {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.post-card .post-meta {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.blog-category-grid {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  table-layout: fixed;
}

.blog-category-grid td {
  border: 1px solid #e5e7eb;
  padding: 0.5rem;
  font-size: 0.85rem;
  vertical-align: top;
  background: #fff;
}

.blog-category-grid tr:nth-child(odd) td {
  background: #fcfcfd;
}

.blog-category-grid td:hover {
  background: #f5f5f5;
}

.blog-category-grid .category-link {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: #111827;
  text-decoration: none;
  margin-bottom: 0.15rem;
}

.blog-category-grid .category-link:hover {
  text-decoration: underline;
}

.blog-category-grid .category-mini {
  margin: 0;
  font-size: 0.75rem;
  color: #6b7280;
}

.category-cell-empty {
  border: none;
  background: transparent;
}

.page-back-link {
  margin-bottom: 0.75rem;
}

.page-back-link .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1f2937;
  text-decoration: none;
}

.page-back-link .back-link:hover {
  text-decoration: underline;
}

.greedy-nav .visible-links {
  overflow: visible;
}

/* Navigation dropdown */
.masthead__menu-item.has-children {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.masthead__menu-item .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  z-index: 50;
  font-size: 0.85rem;
}

.masthead__menu-item .sub-menu a {
  display: block;
  padding: 0.4rem 0.65rem;
  color: inherit;
  white-space: nowrap;
}

.masthead__menu-item .sub-menu a:hover {
  background: #f3f4f6;
}

.masthead__menu-item.has-children:hover .sub-menu,
.masthead__menu-item.has-children:focus-within .sub-menu,
.masthead__menu-item.has-children.active .sub-menu {
  display: block;
}

.masthead__menu-item .menu-caret {
  margin-inline-start: 0.35rem;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.2);
  cursor: pointer;
  padding: 0;
  color: inherit;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.masthead__menu-item .menu-caret:hover,
.masthead__menu-item .menu-caret:focus-visible {
  background: #1f2937;
  color: #fff;
  border-color: #1f2937;
}

.masthead__menu-item .menu-caret:focus-visible {
  outline: 2px solid #1f2937;
  outline-offset: 2px;
}

.masthead__menu-item .menu-caret__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.masthead__menu-item.has-children:last-child .sub-menu {
  left: auto;
  right: 0;
}

.blog-category-section {
  border-top: 1px solid #e5e7eb;
  padding-top: 1.5rem;
  margin-top: 2rem;
}

.blog-category-header {
  margin-bottom: 0.75rem;
}

.category-description {
  margin: 0.25rem 0 0;
  color: #4b5563;
  font-size: 0.95rem;
}

.blog-category-section .post-card {
  margin-bottom: 0.85rem;
}

.blog-category-section h4 {
  margin: 0 0 0.2rem;
}

.empty-category-note {
  font-size: 0.9rem;
  color: #6b7280;
  font-style: italic;
}

.empty-category-page {
  font-size: 1rem;
  color: #4b5563;
  font-style: italic;
  border: 1px dashed #d1d5db;
  padding: 1rem;
  border-radius: 6px;
}


/* CV page typography tweaks */
.cv-page .page__content {
  font-size: 0.95rem;
  line-height: 1.55;
}

.cv-page .page__content h2 {
  font-size: 1.15rem;
  margin-top: 1.85rem;
}

.cv-page .page__content h3 {
  font-size: 1rem;
}

.cv-page .page__content ul {
  margin-bottom: 0.75rem;
}


.cv-page .page__inner-wrap {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.cv-page .page__content {
  max-width: none;
}

/* Home page width adjustments */

.home-page .archive {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}


.home-page .archive p,
.home-page .archive section {
  max-width: none;
}


.home-page .archive p {
  text-align: justify;
  hyphens: auto;
}

@media (min-width: 1024px) {
  .home-page .archive {
    width: calc(100% - 320px);
    padding-inline-end: 2rem;
  }
}

@media (max-width: 1024px) {
  .cv-page .page__inner-wrap {
    padding-inline: 1rem;
  }

  .home-page .archive {
    padding-inline: 1rem;
  }
  
  #main .sidebar {
    width: 100%;
    margin: 0 auto 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  #main .sidebar .author__avatar,
  #main .sidebar .author__content,
  #main .sidebar .author__urls-wrapper,
  #main .sidebar .btn,
  #main .sidebar .author__urls {
    display: none;
  }
}
