/* ===========================
   static/css/extra.css
   =========================== */

/* ---------------------------------
   Link styling: modern & accessible
   --------------------------------- */

/* Baseline: no underline globally (UI chrome stays clean) */
a {
  text-decoration: none;
  text-underline-offset: 2px;
  text-decoration-skip-ink: auto;
}

/* Link colors inside readable content (beat theme rules) */
.post__content a,
.post__content a:visited,
.post .post-content a,
.page .post-content a,
.widget .widget__content a,
.about-bio .bio-text a {
  color: #1a73e8 !important;          /* pleasant blue */
  text-decoration: none;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
  text-decoration-skip-ink: auto;
}

.post__content a:hover,
.post .post-content a:hover,
.page .post-content a:hover,
.widget .widget__content a:hover,
.about-bio .bio-text a:hover {
  color: #1257a0 !important;          /* darker hover */
  text-decoration: underline;
}

/* Optional distinct visited color (keep accessible contrast) */
.post__content a:visited,
.post .post-content a:visited,
.page .post-content a:visited,
.widget .widget__content a:visited,
.about-bio .bio-text a:visited {
  color: #5a2ca0 !important;          /* purple-ish visited */
}

/* Hover/focus: underline everywhere as an extra cue */
a:hover,
a:focus,
a:focus-visible {
  text-decoration: underline;
}

/* UI elements that should NOT look like inline links */
.post-title a,                 /* post titles */
.menu a,                       /* nav menu */
.btn, .btn a,                  /* buttons/pills */
.widget-taglist__link,         /* tag list chips */
.bio-avatar-link,              /* linked avatar image */
.pagination a {                /* pagination controls */
  text-decoration: none !important;
}

/* Optional: visited links are visibly distinct in content */
.post .post-content a:visited,
.page .post-content a:visited,
.widget .widget__content a:visited,
.about-bio .bio-text a:visited {
  color: #5a2ca0; /* tweak to your palette; maintain contrast */
}

/* ---------------------------------
   Sidebar bio widget (avatar + wrap)
   ---------------------------------- 
   Markup (custom widget partial):
   <div class="widget widget-bio">
     <h4 class="widget__title">About</h4>
     <div class="widget__content">
       <div class="bio-wrap">
         <a class="bio-avatar-link" href="/about/">
           <img class="bio-avatar" ...>
         </a>
         <div class="bio-text">...</div>
       </div>
       <p class="more"><a class="link-more" href="/about/">Read more →</a></p>
     </div>
   </div>
*/
.widget-bio .bio-wrap { 
  display: block !important;        /* ensure floats can wrap even if parent uses flex */
}

.widget-bio .bio-avatar {
  float: left;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin: 2px 12px 6px 0;           /* space to right/bottom */
  shape-outside: circle(50%);       /* nicer wrap on modern browsers */
}

.widget-bio .bio-avatar-link {
  float: left;                      /* keep the wrap with the image */
  display: block;
  text-decoration: none !important; /* no underline around the image */
}

.widget-bio .bio-text {
  clear: none !important;
  margin-top: 0.2rem;
  /* Keep the widget compact while preserving links */
  display: -webkit-box;
  -webkit-line-clamp: 3;            /* show ~3 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Clear the float after the bio block */
.widget-bio .bio-wrap::after {
  content: "";
  display: table;
  clear: both;
}

/* Compact “Read more →” link (underline comes from content-link rules above) */
.widget-bio .more { margin: .35rem 0 0 0; }

/* Hide any legacy button or HR if still present in older markup */
.btn-read-more { display: none !important; }
.widget-bio .widget-separator,
.widget-disclaimer .widget-separator { display: none; }

/* -----------------------------
   About page bio (no avatar)
   ----------------------------- 
   Markup (shortcode): <div class="about-bio"> ... </div>
*/
.about-bio {
  display: block;
  margin-bottom: 1rem;              /* gap before the first paragraph after the bio */
}

/* Hide the avatar on the About page to avoid duplication with sidebar image */
.about-bio .bio-avatar { display: none !important; }
.about-bio .bio-text { clear: none !important; }
.about-bio::after { content: ""; display: table; clear: both; }

/* ---------------------------------------------------
   Home/section post list styling (Mainroad selectors)
   --------------------------------------------------- */
.posts-list .post-title {
  font-size: 1.6rem !important;
  font-weight: 800 !important;
  line-height: 1.25;
  margin: 0 0 .25rem !important;
}

.posts-list .post-title a {
  color: #0d1a2d !important;        /* dark navy */
}
.posts-list .post-title a:hover { text-decoration: underline !important; }

/* Accent shape before each list title (pick one: ◆ ▸ ■ ●) */
.posts-list .post-title a::before {
  content: "◆";
  display: inline-block;
  color: #2b7cff;                   /* accent */
  font-size: .95rem;
  margin-right: .5rem;
  transform: translateY(-1px);
}

/* Date + tags smaller, gray, italic under the title.
   Mainroad may use .post-meta OR .post__meta depending on version. */
.posts-list .post-meta,
.posts-list .post__meta {
  font-style: italic;
  color: #6a6f77 !important;
  font-size: .9rem;
  margin: 0 0 .75rem !important;
}
.posts-list .post-meta a,
.posts-list .post__meta a { color: inherit; }
.posts-list .post-meta a:hover,
.posts-list .post__meta a:hover { text-decoration: underline; }

/* ---------------------------------------
   Post delimiters & spacing between posts
   --------------------------------------- */

/* Neutralize any theme border to avoid doubling */
.posts-list .post { border-top: none !important; }

/* Space above each post */
.posts-list .post {
  margin-top: 1.25rem;
  padding-top: 0;
}

/* Simple 1px gray line above every post except the first */
.posts-list .post:not(:first-child) { padding-top: 1rem; }
.posts-list .post:not(:first-child)::before {
  content: "";
  display: block;
  height: 1px;
  background: #e4e4e4;              /* same gray used for widget separators */
  margin: 0 0 1rem 0;               /* space under the line */
}

/* ---------------------------------------------------
   Thumbnails that replace the diamond (inline, 96x96)
   --------------------------------------------------- */
/* Float a 96×96 thumbnail before the title; title+meta flow to the right.
   Summary clears below the image so it starts on a new line. */
.posts-list .post.post--has-title-thumb .post-title-thumb {
  float: left;
  width: 96px;
  height: 96px;
  margin: 0 12px 8px 0;    /* space to the right & below */
  text-decoration: none !important;
}
.posts-list .post.post--has-title-thumb .post-title-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 6px;      /* optional rounding */
}

/* Title + meta block sits to the right; overflow hidden avoids awkward wraps */
.posts-list .post.post--has-title-thumb .post-header-text {
  overflow: hidden;
}

/* Start the summary (and read-more) below the bottom of the image */
.posts-list .post.post--has-title-thumb .post-summary,
.posts-list .post.post--has-title-thumb .read-more,
.posts-list .post.post--has-title-thumb p.read-more {
  clear: both;
}

/* Hide the diamond only when a thumbnail is present */
.posts-list .post.post--has-title-thumb .post-title a::before {
  content: none !important;
}

/* Optional: nudge title alignment when thumb exists */
.posts-list .post.post--has-title-thumb .post-title { margin-top: 0; }

/* Responsive: stack on small screens (thumbnail above title) */
@media (max-width: 520px) {
  .posts-list .post.post--has-title-thumb .post-title-thumb {
    float: none;
    display: block;
    margin: 0 0 8px 0;
    width: 100%;
    height: auto; /* keep aspect ratio when full width */
    max-width: 320px; /* cap size */
  }
  .posts-list .post.post--has-title-thumb .post-summary,
  .posts-list .post.post--has-title-thumb .read-more,
  .posts-list .post.post--has-title-thumb p.read-more {
    clear: none;
  }
}

/* More space between summary and Read more button */
.posts-list .post .post-summary {
  margin-bottom: 0.9rem;            /* adjust to taste */
}

/* Nudge the paragraph that immediately follows the summary */
.posts-list .post .post-summary + p {
  margin-top: 0.4rem;               /* extra gap above the button */
}

/* If a 96x96 thumb is floated, ensure the button also clears the image */
.posts-list .post.post--has-title-thumb .post-summary + p {
  clear: both;
}

pre {
  margin-bottom: 2rem;
}
.highlight {
  margin-bottom: 2rem;
}

/* Force white text on visited tag buttons with higher specificity */
.widget-taglist__link.widget__link.btn:visited {
    color: white !important;
}

/* Also target all states to be sure */
.widget-taglist__link.widget__link.btn,
.widget-taglist__link.widget__link.btn:link,
.widget-taglist__link.widget__link.btn:visited {
    color: white !important;
}

/* Keep hover as theme default */
.widget-taglist__link.widget__link.btn:hover {
    /* Theme handles this */
}

.share {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 1.25rem 0;
}

.share__label {
  color: #666;
  font-size: 0.95rem;
}

.share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  background: #f2f2f2;
  color: #333;
  text-decoration: none;
  font-weight: 700;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  border: 1px solid #e2e2e2;
  cursor: pointer;
  line-height: 1;
}

.share__btn:hover {
  background: #e9e9e9;
}

.share__btn--native {
  padding: 0 .75rem;
  width: auto;
  height: 2.1rem;
  border-radius: 999px;
}
