/* Author pages (task 5948): the author archive and the "Authors" page (/author/).
   Loaded as a blocking stylesheet on these pages only (inc/enqueue-scripts.php, psm_author_css_needed()):
   the card is the first content block, above the fold — no layout shift.
   Base .psm-author styles are duplicated in style.css (Author card compact, 5948), keep in sync.

   .psm-author--full — top of the author page: photo 160px, name is the H1, role, post count, LinkedIn, public email, bio.
   Right of the photo: one column (name, role, chips stacked one per row), about as tall as the photo; bio below at full width.
   Same family as the TOC (5946) and FAQ (5947): #dadada frame, square corners, no shadows.
   Empty fields are not printed; the grid has no row-gap, so a missing row leaves no hole (each item owns its margins). */

/* === Base (duplicated in style.css, keep in sync) === */
.psm-author {
   display: grid;
   grid-template-columns: 160px minmax(0, 1fr);
   grid-template-areas:
      "photo name"
      "photo role"
      "photo meta"
      "bio   bio";
   grid-template-rows: auto auto 1fr auto;
   column-gap: 25px;
   margin: 0 0 40px;
   padding: 25px;
   border: 1px solid #dadada;
   border-radius: 0;
   font-family: 'Open Sans', sans-serif;
   color: #333;
}
/* No photo: the data takes the full width */
.psm-author--no-photo {
   grid-template-columns: minmax(0, 1fr);
   grid-template-areas: "name" "role" "meta" "bio";
}

/* Photo: square crop of any upload ratio */
.psm-author__photo {
   grid-area: photo;
   align-self: start;
   display: block;
   width: 160px;
   height: 160px;
   line-height: 0;
}
.psm-author__photo img {
   display: block;
   width: 100%;
   height: 100%;
   object-fit: cover;
}

/* Name: the page H1 in the full mode (Arimo 700, below the article H1 36/48: the card shares the screen with the bio) */
.psm-author__name {
   grid-area: name;
   margin: 0 0 2px;
   font-family: 'Arimo', sans-serif;
   font-weight: 700;
   font-size: 30px;
   line-height: 36px;
   color: #1c1c1c;
   overflow-wrap: anywhere;
}
.psm-author__name a {
   color: inherit;
}

/* Role: secondary line; #666 instead of the theme grey #a3a3a3 (2.5:1) to pass WCAG AA on white (5.7:1) */
.psm-author__role {
   grid-area: role;
   margin: 0;
   font-size: 14px;
   line-height: 20px;
   color: #666;
}

/* Chips: post count, LinkedIn, email — a column, one chip per row, each as wide as its content */
.psm-author__meta {
   grid-area: meta;
   align-self: start;
   display: flex;
   flex-direction: column;
   align-items: flex-start;
   gap: 5px;
   margin: 10px 0 0;
   padding: 0;
   list-style: none;
}
.psm-author__meta > li {
   display: flex;
   max-width: 100%;
   margin: 0;
}
.psm-author__chip {
   display: inline-flex;
   align-items: center;
   gap: 6px;
   min-width: 0;
   min-height: 28px;
   padding: 0 10px;
   box-sizing: border-box;
   border: 1px solid #dadada;
   border-radius: 0;
   font-size: 13px;
   line-height: 18px;
   font-weight: 600;
   color: #333;
   text-decoration: none;
   transition: color .15s, background-color .15s, border-color .15s;
}
.psm-author__chip svg {
   flex: none;
   width: 12px;
   height: 12px;
   fill: currentColor;
}
.psm-author__chip-text {
   min-width: 0;
   overflow-wrap: anywhere;
}
/* Envelope is an outline icon */
.psm-author__chip--email svg {
   fill: none;
   stroke: currentColor;
}
/* Post count: plain label, calm text */
.psm-author__chip--count {
   font-weight: 400;
}
/* LinkedIn: brand colour frame and icon */
.psm-author__chip--linkedin {
   border-color: #0A66C2;
   color: #0A66C2;
}
/* Mouse devices only, so a chip does not stay filled after a tap.
   Email: frame, text and icon turn orange, no fill (white on #E3591B is 3.7:1, too low for 13px text) */
@media (hover: hover) {
   .psm-author__chip--linkedin:hover {
      background-color: #0A66C2;
      color: #fff;
   }
   .psm-author__chip--email:hover {
      border-color: #E3591B;
      color: #E3591B;
   }
   .psm-author__name a:hover {
      color: #E3591B;
   }
}
.psm-author__chip:focus-visible,
.psm-author__name a:focus-visible,
.psm-author__photo:focus-visible {
   outline: 2px solid #1c1c1c;
   outline-offset: 2px;
}

/* Bio: full card width under the photo and the data, article-like text */
.psm-author__bio {
   grid-area: bio;
   margin-top: 20px;
   font-size: 15px;
   line-height: 26px;
   color: #333;
}
.psm-author__bio p {
   margin: 0 0 10px;
}
.psm-author__bio > :last-child {
   margin-bottom: 0;
}

/* Mobile: photo + name/role side by side; chips under them at full width, one per row, tap height >= 32px; bio below */
@media (max-width: 575.98px) {
   .psm-author {
      grid-template-columns: 88px minmax(0, 1fr);
      grid-template-areas:
         "photo name"
         "photo role"
         "meta  meta"
         "bio   bio";
      grid-template-rows: auto 1fr auto auto;
      column-gap: 15px;
      padding: 15px;
   }
   .psm-author--no-photo {
      grid-template-columns: minmax(0, 1fr);
      grid-template-areas: "name" "role" "meta" "bio";
   }
   .psm-author__photo {
      width: 88px;
      height: 88px;
   }
   .psm-author__name {
      font-size: 24px;
      line-height: 30px;
   }
   .psm-author__meta {
      gap: 8px;
      margin-top: 15px;
   }
   .psm-author__chip {
      min-height: 32px;
   }
   .psm-author__bio {
      margin-top: 15px;
   }
}

@media (prefers-reduced-motion: reduce) {
   .psm-author__chip {
      transition: none;
   }
}
/* === Base end === */

/* Author page: section labels are divs, not headings (rule 5942); the look of the theme .block-title */
.psm-author-featured {
   margin: 0 0 30px;
}

/* Featured articles on mobile: horizontal CSS scroll-snap slider, no JS (swipe only, no autoplay).
   The row is the scroller; a card is 85% wide so the edge of the next one shows; snap to the card start.
   Keyboard: links inside stay in the tab order, a focused link is scrolled into view by the browser.
   Desktop keeps the 2x2 grid with excerpts, as in the main list. */
@media (max-width: 575.98px) {
   .psm-author-featured__list {
      flex-wrap: nowrap;
      overflow-x: auto;
      overscroll-behavior-x: contain;
      scroll-snap-type: x mandatory;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
   }
   /* The visible edge of the next card shows that the row scrolls; a scrollbar line would only add noise */
   .psm-author-featured__list::-webkit-scrollbar {
      display: none;
   }
   .psm-author-featured__list > .col-md-6 {
      flex: 0 0 85%;
      width: 85%;
      max-width: 85%;
      scroll-snap-align: start;
   }
   /* Slider card: image, category label, title, date; no excerpt, no author (the page is the author's) */
   .psm-author-featured__list .post-content > p,
   .psm-author-featured__list .post-author {
      display: none;
   }
   .psm-author-featured__list .post-title {
      font-size: 18px;
      line-height: 24px;
   }
}

/* === "Authors" page (/author/): list of author cards, .psm-author--list ===
   Grid: 2 columns on desktop, 1 on mobile; cards of a row share the height.
   Card: photo 80 left of name (H2 link), role and the publications chip; bio under them, cut to 3 lines. */
.psm-authors__list {
   display: grid;
   grid-template-columns: repeat(2, minmax(0, 1fr));
   gap: 30px;
   margin: 0 0 40px;
}
.psm-author--list {
   grid-template-columns: 80px minmax(0, 1fr);
   grid-template-rows: auto auto 1fr auto;
   column-gap: 15px;
   margin: 0;
   padding: 20px;
}
.psm-author--list.psm-author--no-photo {
   grid-template-columns: minmax(0, 1fr);
}
.psm-author--list .psm-author__photo {
   width: 80px;
   height: 80px;
}
.psm-author--list .psm-author__name {
   margin: 0 0 2px;
   font-size: 20px;
   line-height: 26px;
}
.psm-author--list .psm-author__meta {
   margin-top: 8px;
}
/* Bio: up to 3 lines; paragraphs run inline so the clamp counts lines across them */
.psm-author--list .psm-author__bio {
   display: -webkit-box;
   -webkit-box-orient: vertical;
   -webkit-line-clamp: 3;
   line-clamp: 3;
   overflow: hidden;
   margin-top: 15px;
   font-size: 14px;
   line-height: 22px;
}
.psm-author--list .psm-author__bio p {
   display: inline;
   margin: 0;
}

@media (max-width: 767.98px) {
   .psm-authors__list {
      grid-template-columns: minmax(0, 1fr);
      gap: 20px;
   }
}
@media (max-width: 575.98px) {
   .psm-author--list {
      grid-template-columns: 80px minmax(0, 1fr);
      grid-template-areas:
         "photo name"
         "photo role"
         "photo meta"
         "bio   bio";
      grid-template-rows: auto auto 1fr auto;
      padding: 15px;
   }
   .psm-author--list.psm-author--no-photo {
      grid-template-columns: minmax(0, 1fr);
      grid-template-areas: "name" "role" "meta" "bio";
   }
   .psm-author--list .psm-author__photo {
      width: 80px;
      height: 80px;
   }
   .psm-author--list .psm-author__name {
      font-size: 20px;
      line-height: 26px;
   }
   .psm-author--list .psm-author__meta {
      margin-top: 8px;
   }
   .psm-author--list .psm-author__chip {
      min-height: 28px;
   }
   .psm-author--list .psm-author__bio {
      margin-top: 15px;
   }
}
