/* ------------------------------------------------------------------
   Site overrides ("quiet refresh"), loaded after beautifuljekyll.css.
   Keeps the Beautiful Jekyll layout; changes type, color, and spacing.
   ------------------------------------------------------------------ */

:root {
  --body-font: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --header-font: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mid-col: #6b7078;
  --rule-col: #e6e8eb;
  --chip-col: #f1f3f5;
  --chip-text-col: #4a5058;
}

/* --- Type --- */

body {
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 768px) {
  body { font-size: 1.125rem; }
}
p {
  line-height: 1.6;
  margin: 1.25rem 0;
}
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-wrap: balance;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.0625rem; }
h1, h2, h3, h4 { margin-top: 2rem; margin-bottom: 0.75rem; }
h2 + p, h3 + p, h4 + p { margin-top: 0.5rem; }

main a,
.blog-post a,
.post-entry a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: rgba(42, 90, 140, 0.55);
}
main a:hover,
main a:focus {
  text-decoration-color: currentColor;
}

blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--rule-col);
  color: #555a60;
  font-style: italic;
}
blockquote p { margin: 0.75rem 0; }

hr {
  border-top: 1px solid var(--rule-col);
  margin: 2.5rem 0;
}

code {
  color: var(--text-col);
  background-color: var(--chip-col);
  font-size: 0.875em;
}

img { border-radius: 4px; }

::selection {
  color: var(--page-col);
  background-color: var(--link-col);
}

/* --- Measure: keep body text near 65–70 characters --- */

@media (min-width: 1200px) {
  main .col-xl-8,
  header .col-xl-8 {
    flex: 0 0 auto;
    width: 100%;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
  }
}

/* --- Navbar --- */

.navbar-custom {
  border-bottom: 1px solid var(--navbar-border-col);
}
@media (min-width: 1200px) {
  .navbar-custom {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
  .intro-header { margin-top: 6.5rem; }
  .intro-header.big-img { margin-top: 4.25rem; }
}

.navbar-custom .navbar-brand {
  font-weight: 700;
  font-size: 1.0625rem;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  letter-spacing: -0.005em;
}
.navbar-custom .navbar-brand .brand-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.navbar-custom .navbar-nav .nav-item {
  text-transform: none;
  font-size: 0.9375rem;
  letter-spacing: 0;
}
.navbar-custom .navbar-nav .nav-link {
  font-weight: 600;
  color: var(--mid-col);
}
.navbar-custom .navbar-nav .nav-link:hover,
.navbar-custom .navbar-nav .nav-link:focus {
  color: var(--text-col);
}
/* Small chevron instead of Bootstrap's solid triangle */
.navbar-custom .dropdown-toggle::after {
  content: "";
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  margin-left: 0.4em;
  vertical-align: 0.15em;
  border-top: 0;
  border-left: 0;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.7;
}
.navbar-custom .nav-item.dropdown .dropdown-menu {
  border: 1px solid var(--navbar-border-col);
  border-radius: 6px;
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
@media (min-width: 1200px) {
  .navbar-custom .nav-item.dropdown:hover { background: transparent; }
  /* Open the menu on hover as well as click */
  .navbar-custom .nav-item.dropdown:hover .dropdown-menu { display: block; }
  .navbar-custom .nav-item.dropdown .dropdown-menu .dropdown-item:first-child {
    border-bottom: 1px solid var(--rule-col);
  }
  .navbar-custom .nav-item.dropdown .dropdown-menu { text-align: left; margin-top: 0.25rem; }
  .navbar-custom .nav-item.dropdown .dropdown-menu .dropdown-item { border: 0; }
  .navbar-custom .nav-item.dropdown .dropdown-menu .dropdown-item:first-child { border: 0; }
}
.navbar-custom .nav-item.dropdown.show { background: transparent; }
.navbar-custom .nav-item.dropdown .dropdown-menu .dropdown-item {
  padding: 0.5rem 0.875rem;
  font-size: 0.9375rem;
}
.navbar-custom .nav-item.dropdown .dropdown-menu .dropdown-item:hover,
.navbar-custom .nav-item.dropdown .dropdown-menu .dropdown-item:focus {
  background-color: var(--chip-col);
  color: var(--text-col);
}

/* --- Page and post headers --- */

.intro-header {
  margin-bottom: 1.5rem;
}
.intro-header .page-heading {
  text-align: left;
}
.intro-header .page-heading h1,
.intro-header .post-heading h1 {
  font-size: 2rem;
}
@media (min-width: 768px) {
  .intro-header .page-heading h1,
  .intro-header .post-heading h1 {
    font-size: 2.375rem;
  }
}
@media (min-width: 1200px) {
  .intro-header .page-heading h1,
  .intro-header .post-heading h1 {
    font-size: 2.5rem;
  }
}
.intro-header .page-heading .page-subheading,
.intro-header .post-heading .post-subheading {
  font-family: var(--header-font);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.35;
  color: var(--mid-col);
  margin: 0.5rem 0 0;
}
.intro-header .post-heading .post-subheading {
  margin-bottom: 0.75rem;
}
.intro-header .page-heading hr.small {
  margin-left: 0;
  max-width: 3rem;
  border-width: 2px;
  border-color: var(--rule-col);
}
.post-heading .post-meta,
.post-preview .post-meta {
  font-family: var(--header-font);
  font-style: normal;
  font-size: 0.875rem;
  color: var(--mid-col);
  margin: 0.5rem 0 0;
}
.post-heading .post-meta {
  display: block;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule-col);
}

/* --- Post previews (blog feed) --- */

.post-preview {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule-col);
}
@media (min-width: 768px) {
  .post-preview { padding: 1.75rem 0; }
}
.post-preview .post-title,
.post-preview .post-title {
  font-size: 1.375rem;
  margin: 0 0 0.125rem;
}
@media (min-width: 768px) {
  .post-preview .post-title { font-size: 1.5rem; }
}
.post-preview .post-subtitle {
  font-family: var(--header-font);
  font-weight: 400;
  font-size: 1.0625rem;
  color: var(--mid-col);
  margin: 0 0 0.25rem;
}
.post-preview .post-meta {
  margin: 0.25rem 0 0.75rem;
}
.post-preview .post-entry {
  font-size: 1rem;
  line-height: 1.6;
}
.post-preview .post-read-more {
  font-family: var(--header-font);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--link-col);
  text-decoration: none;
  white-space: nowrap;
  margin-left: 0.25rem;
}
.post-preview .post-read-more::after {
  content: " \2192";
}
.post-preview a:hover .post-title,
.post-preview a:focus .post-title {
  color: var(--link-col);
}

/* --- Tags as chips --- */

.blog-tags {
  font-size: 0.8125rem;
  margin: 1.5rem 0;
}
.blog-tags > span { display: none; }
.blog-tags .list-inline-item { margin-right: 0.375rem; }
.blog-tags a {
  display: inline-block;
  background: var(--chip-col);
  color: var(--chip-text-col);
  border: 0;
  border-radius: 4px;
  padding: 0.125rem 0.5rem;
  margin-right: 0.25rem;
  opacity: 1;
  text-decoration: none;
}
.blog-tags a:hover,
.blog-tags a:focus {
  background: #e3e7eb;
  color: var(--text-col);
  border: 0;
}
.post-preview .blog-tags { margin: 0.75rem 0 0; }
@media (min-width: 768px) {
  .post-preview .blog-tags { margin-top: 0.75rem; }
}

/* --- Pagination --- */

.pagination .page-item .page-link {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  font-size: 0.9375rem;
  border: 1px solid var(--rule-col);
  border-radius: 6px;
  color: var(--text-col);
}
.pagination .page-item .page-link:hover,
.pagination .page-item .page-link:focus {
  background-color: var(--chip-col);
  border-color: var(--rule-col);
  color: var(--text-col);
}

/* --- Tables --- */

table tr,
table tr th,
table tr td {
  border-color: var(--rule-col);
}
table tr:nth-child(2n) { background-color: #fafbfc; }

/* --- Footer --- */

footer {
  border-top: 1px solid var(--rule-col);
  margin-top: 4rem;
  padding: 2rem 0;
}
footer .copyright,
footer .theme-by {
  font-family: var(--header-font);
  font-size: 0.875rem;
}
footer .footer-links { margin-bottom: 1.25rem; }
footer .footer-links .fa-inverse { color: #fff; }

/* --- Front page --- */

.home-intro {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}
.home-photo {
  flex: 0 0 auto;
  width: 9.5rem;
  height: 9.5rem;
  border-radius: 50%;
  object-fit: cover;
  margin-top: 0.5rem;
}
.home-intro-text { min-width: 0; }
.home-intro h1 { margin-top: 0.25rem; }
.home-intro p { margin-top: 0.75rem; }
@media (max-width: 767px) {
  .home-intro { flex-direction: column; gap: 1rem; }
  .home-photo { width: 6.5rem; height: 6.5rem; margin-top: 0; }
}

.home-recent { margin-top: 3rem; }
.home-recent-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule-col);
}
.home-recent-head h2 {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid-col);
}
.home-recent-head a {
  font-family: var(--header-font);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
}
.home-recent .post-preview { padding: 1.25rem 0; }
.home-recent .post-preview:last-child { border-bottom: 0; }
.home-recent .post-title {
  font-size: 1.25rem;
  margin: 0 0 0.125rem;
}
@media (min-width: 768px) {
  .home-recent .post-title { font-size: 1.375rem; }
}
.home-recent .post-subtitle { font-size: 1rem; }
.home-recent .post-entry { font-size: 0.9375rem; }

/* --- Search overlay --- */

#beautifuljekyll-search-overlay {
  background: rgba(20, 22, 26, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  text-align: left;
  padding: 1rem;
  overflow-y: auto;
}
#beautifuljekyll-search-overlay .search-panel {
  position: relative;
  max-width: 40rem;
  margin: 8vh auto 0;
  background: var(--page-col);
  border-radius: 10px;
  box-shadow: 0 24px 64px -24px rgba(0, 0, 0, 0.5);
  padding: 1rem 1.25rem 1.25rem;
}
@media (max-width: 767px) {
  #beautifuljekyll-search-overlay { padding: 0.5rem; }
  #beautifuljekyll-search-overlay .search-panel { margin-top: 0.5rem; padding: 0.75rem 1rem 1rem; }
}
#nav-search-exit {
  position: absolute;
  top: 1.15rem;
  right: 1.25rem;
  margin: 0;
  width: 2rem;
  height: 2rem;
  line-height: 2rem;
  text-align: center;
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--mid-col);
  border-radius: 50%;
}
#nav-search-exit:hover,
#nav-search-exit:focus-visible {
  color: var(--text-col);
  background: var(--chip-col);
  outline: none;
}
#nav-search-input {
  width: 100%;
  text-align: left;
  font-family: var(--header-font);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text-col);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule-col);
  border-radius: 0;
  padding: 0.5rem 2.5rem 0.75rem 0;
  transition: none;
}
#nav-search-input:focus {
  background: transparent;
  box-shadow: none;
  border-bottom-color: var(--link-col);
}
#nav-search-input::placeholder { color: var(--mid-col); font-weight: 400; }
#nav-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-status {
  font-family: var(--header-font);
  font-size: 0.8125rem;
  color: var(--mid-col);
  margin: 0.75rem 0 0;
  min-height: 1.25rem;
}
#search-results-container {
  margin: 0.25rem 0 0;
  font-size: 1rem;
  color: var(--text-col);
  max-height: min(60vh, 34rem);
  overflow-y: auto;
  text-align: left;
}
#search-results-container li { border-top: 1px solid var(--rule-col); }
#search-results-container li:first-child { border-top: 0; }
#search-results-container a {
  display: block;
  padding: 0.875rem 0.5rem;
  margin: 0 -0.5rem;
  color: var(--text-col);
  text-decoration: none;
  border-radius: 6px;
}
#search-results-container a:hover,
#search-results-container a:focus,
#search-results-container li.active a {
  background: var(--chip-col);
  color: var(--text-col);
  text-decoration: none;
  outline: none;
}
#search-results-container .search-title {
  display: block;
  font-family: var(--header-font);
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.3;
}
#search-results-container .search-subtitle {
  display: block;
  font-family: var(--header-font);
  font-size: 0.9375rem;
  color: var(--mid-col);
  margin-top: 0.125rem;
}
#search-results-container .search-meta {
  display: block;
  font-family: var(--header-font);
  font-size: 0.75rem;
  color: var(--mid-col);
  margin-top: 0.25rem;
}
#search-results-container .search-snippet {
  display: block;
  font-family: var(--body-font);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #4a5058;
  margin-top: 0.375rem;
}
#search-results-container mark {
  background: #fff3b0;
  color: inherit;
  padding: 0 0.1em;
  border-radius: 2px;
}
