/**
 * @company MG Technologies
 * @author Manu Mahesh
 * @date 07 Nov 2026
 * @updatedOn 13 Nov 2026 - logo tile, "Why buy from" strip, Popular / Newest rows
 * MG: Author page (/author/{slug}) and authors list (/authors). Loaded after mg-catalog.css.
 * No Bootstrap. Uses the --mg-* tokens from styleV2.css.
 */

.mg-visually-hidden{ position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* ================= Avatar (initials) ================= */
.mg-author__avatar{
  flex:0 0 auto; width:104px; height:104px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--mg-font-display); font-size:36px; font-weight:700; letter-spacing:.5px; color:#fff;
  box-shadow:0 0 0 4px var(--mg-bg-white), var(--mg-shadow-sm);
}
.mg-author__avatar--sm{ width:52px; height:52px; font-size:18px; box-shadow:none; }
/* Uploaded logo: rounded white tile, logo fitted inside (logos are rarely round) */
.mg-author__avatar--logo{ border-radius:22px; background:#fff; border:1px solid var(--mg-border); padding:12px; overflow:hidden; }
.mg-author__avatar--logo img{ display:block; width:100%; height:100%; object-fit:contain; }
.mg-author__avatar--sm.mg-author__avatar--logo{ border-radius:12px; padding:6px; }
.mg-tone-brand{ background:linear-gradient(135deg, var(--mg-brand), var(--mg-primary)); }
.mg-tone-0{ background:linear-gradient(135deg, #2563EB, #1D4ED8); }
.mg-tone-1{ background:linear-gradient(135deg, #7C3AED, #6D28D9); }
.mg-tone-2{ background:linear-gradient(135deg, #DB2777, #BE185D); }
.mg-tone-3{ background:linear-gradient(135deg, #EA580C, #C2410C); }
.mg-tone-4{ background:linear-gradient(135deg, #0D9488, #0F766E); }
.mg-tone-5{ background:linear-gradient(135deg, #475569, #334155); }

/* ================= Profile header ================= */
.mg-author__hero{
  display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:28px; align-items:start;
  background:var(--mg-bg-white); border:1px solid var(--mg-border); border-radius:var(--mg-radius-lg);
  padding:28px; margin-bottom:18px;
}
.mg-author__type{
  display:inline-flex; align-items:center; gap:5px; margin:2px 0 8px; padding:3px 10px; border-radius:999px;
  font-size:12px; font-weight:700; letter-spacing:.3px; text-transform:uppercase;
  background:var(--mg-badge-bg); color:var(--mg-badge-ink);
}
.mg-author__type svg{ width:12px; height:12px; }
.mg-author__type--author, .mg-author__type--store{ background:var(--mg-primary-soft); color:#14532D; }
.mg-author__name{
  font-family:var(--mg-font-display); font-size:30px; line-height:1.2; font-weight:700;
  margin:0 0 10px; color:var(--mg-ink); letter-spacing:-.3px; overflow-wrap:anywhere;
}
.mg-author__meta{ list-style:none; margin:0 0 14px; padding:0; display:flex; flex-wrap:wrap; gap:8px 18px; font-size:14px; color:var(--mg-ink-soft); }
.mg-author__meta li{ display:inline-flex; align-items:center; gap:6px; }
.mg-author__meta svg{ width:16px; height:16px; color:var(--mg-ink-faint); }
.mg-author__meta a{ color:var(--mg-primary-dark); text-decoration:none; font-weight:600; }
.mg-author__meta a:hover{ text-decoration:underline; }
.mg-author__bio{ max-width:760px; font-size:15px; line-height:1.7; color:var(--mg-ink-soft); overflow-wrap:anywhere; }

.mg-author__stats{ display:flex; gap:10px; margin:0; }
.mg-author__stats > div{
  min-width:112px; padding:14px 16px; border-radius:var(--mg-radius-md); background:var(--mg-bg-hero);
  border:1px solid var(--mg-border); text-align:center;
}
.mg-author__stats dt{ font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--mg-ink-faint); margin:0 0 6px; }
.mg-author__stats dd{ margin:0; font-family:var(--mg-font-display); font-size:24px; font-weight:700; color:var(--mg-ink); line-height:1.1; }
.mg-author__stat-rating{ display:flex; flex-direction:column; align-items:center; gap:4px; }
.mg-author__stat-rating span{ font-size:22px; }
.mg-author__stat-rating .mg-stars{ order:2; }
.mg-author__stat-rating small{ order:3; font-family:var(--mg-font-body); font-size:12px; font-weight:500; color:var(--mg-ink-faint); }

/* Stars (same as the product page) */
.mg-author .mg-stars{ display:inline-flex; gap:1px; vertical-align:middle; }
.mg-author .mg-stars__star svg{ width:15px; height:15px; fill:#E5E7EB; display:block; }
.mg-author .mg-stars__star.mg-is-on svg{ fill:#F5A524; }
.mg-author .mg-stars__star.mg-is-half svg{ fill:#F5A524; opacity:.55; }

/* ================= Bundle offer ================= */
.mg-author__bundle{
  display:flex; align-items:center; gap:12px; margin:0 0 18px; padding:12px 16px;
  border-radius:var(--mg-radius-md); background:var(--mg-primary-soft); color:#14532D; font-size:14.5px;
}
.mg-author__bundle svg{ flex:0 0 22px; width:22px; height:22px; }
.mg-author__bundle p{ margin:0; }
.mg-author__bundle-title{ font-weight:700; margin-right:4px; }

/* ================= Why buy from MG Technologies (store page) ================= */
.mg-author__perks{ margin:0 0 18px; padding:20px 22px; background:var(--mg-bg-white); border:1px solid var(--mg-border); border-radius:var(--mg-radius-lg); }
.mg-author__perks-title{ font-family:var(--mg-font-display); font-size:18px; margin:0 0 14px; color:var(--mg-ink); }
.mg-author__perk-list{ list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:16px; }
.mg-author__perk{ display:flex; align-items:flex-start; gap:12px; font-size:13.5px; line-height:1.55; color:var(--mg-ink-soft); }
.mg-author__perk strong{ display:block; font-size:14.5px; color:var(--mg-ink); margin-bottom:2px; }
.mg-author__perk a{ color:var(--mg-primary-dark); font-weight:600; text-decoration:none; white-space:nowrap; }
.mg-author__perk a:hover{ text-decoration:underline; }
.mg-author__perk-icon{ flex:0 0 40px; width:40px; height:40px; border-radius:12px; display:flex; align-items:center; justify-content:center; background:var(--mg-primary-soft); color:var(--mg-primary); }
.mg-author__perk-icon svg{ width:20px; height:20px; }

/* ================= Popular / Newest rows ================= */
.mg-author__row{ margin:0 0 30px; }
.mg-author__row .mg-author__section-head{ margin-bottom:12px; align-items:center; }
a.mg-author__row-link, a.mg-author__row-link:visited, a.mg-author__row-link:focus{
  display:inline-flex; align-items:center; gap:4px; font-size:14px; font-weight:700; color:var(--mg-primary-dark) !important; text-decoration:none !important;
}
a.mg-author__row-link:hover{ text-decoration:underline !important; }
.mg-author__row-link svg{ width:16px; height:16px; }
.mg-author .mg-author__row-grid{ grid-template-columns:repeat(4, minmax(0,1fr)); }
.mg-author__all-title{ font-family:var(--mg-font-display); font-size:22px; margin:8px 0 14px; color:var(--mg-ink); }

/* ================= Category tabs ================= */
.mg-author__tabs{ display:flex; gap:8px; margin:0 0 20px; overflow-x:auto; padding-bottom:2px; scrollbar-width:thin; }
a.mg-author__tab, a.mg-author__tab:visited, a.mg-author__tab:focus{
  flex:0 0 auto; display:inline-flex; align-items:center; gap:6px; padding:8px 14px; border-radius:999px;
  border:1px solid var(--mg-border); background:var(--mg-bg-white); color:var(--mg-ink-soft);
  font-size:14px; font-weight:600; text-decoration:none; white-space:nowrap;
}
a.mg-author__tab:hover{ border-color:var(--mg-primary); color:var(--mg-ink) !important; text-decoration:none !important; }
.mg-author__tab em{ font-style:normal; font-size:12px; font-weight:700; color:var(--mg-ink-faint); }
/* Colours locked: the old global a:hover / a:focus / a:visited styles win otherwise */
a.mg-author__tab.mg-is-current, a.mg-author__tab.mg-is-current:visited, a.mg-author__tab.mg-is-current:hover, a.mg-author__tab.mg-is-current:focus{ background:var(--mg-ink); border-color:var(--mg-ink); color:#fff !important; }
a.mg-author__tab.mg-is-current em{ color:rgba(255,255,255,.7); }

/* ================= Reviews ================= */
.mg-author__reviews{ margin-top:48px; }
.mg-author__section-head{ display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:8px 16px; margin-bottom:16px; }
.mg-author__section-head h2{ font-family:var(--mg-font-display); font-size:22px; margin:0; color:var(--mg-ink); }
.mg-author__section-head p{ margin:0; display:inline-flex; align-items:center; gap:6px; font-size:14px; color:var(--mg-ink-soft); }
.mg-author__review-grid{ display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:14px; }
.mg-author__review{
  margin:0; display:flex; flex-direction:column; gap:10px; padding:18px;
  background:var(--mg-bg-white); border:1px solid var(--mg-border); border-radius:var(--mg-radius-md);
}
.mg-author__review-top{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.mg-author__review time{ font-size:12px; color:var(--mg-ink-faint); }
.mg-author__review blockquote{ margin:0; padding:0; border:none; flex:1 1 auto; font-size:14px; line-height:1.6; color:var(--mg-ink); overflow-wrap:anywhere; }
.mg-author__review figcaption{ font-size:13px; color:var(--mg-ink-soft); line-height:1.5; }
.mg-author__review figcaption strong{ color:var(--mg-ink); }
.mg-author__review figcaption a{ color:var(--mg-primary-dark); text-decoration:none; }
.mg-author__review figcaption a:hover{ text-decoration:underline; }

/* ================= Become an author ================= */
.mg-author__cta{
  display:flex; align-items:center; justify-content:space-between; gap:16px 24px; flex-wrap:wrap;
  margin-top:48px; padding:24px 28px; border-radius:var(--mg-radius-lg);
  background:var(--mg-ink); color:#fff;
}
.mg-author__cta h2{ font-family:var(--mg-font-display); font-size:20px; margin:0 0 4px; color:#fff; }
.mg-author__cta p{ margin:0; font-size:14.5px; color:rgba(255,255,255,.75); }
a.mg-author__cta-btn, a.mg-author__cta-btn:visited, a.mg-author__cta-btn:hover, a.mg-author__cta-btn:focus{
  display:inline-block; padding:11px 20px; border-radius:var(--mg-radius-sm); background:var(--mg-primary);
  color:#fff !important; font-weight:700; font-size:14.5px; text-decoration:none !important; white-space:nowrap;
}
a.mg-author__cta-btn:hover{ background:var(--mg-primary-dark); }

/* ================= Authors list ================= */
.mg-authors__header{ display:flex; align-items:flex-end; justify-content:space-between; gap:16px 24px; flex-wrap:wrap; margin-bottom:22px; }
.mg-authors__header .mg-catalog__intro{ margin:0; }
.mg-authors__search{ width:300px; max-width:100%; }
.mg-authors__search svg{ position:absolute; top:11px; right:12px; width:17px; height:17px; color:var(--mg-ink-faint); pointer-events:none; }
.mg-authors__grid{ list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:14px; }
.mg-authors__card[hidden]{ display:none; }
.mg-authors__card a{
  display:flex; align-items:center; gap:14px; height:100%; padding:16px 18px;
  background:var(--mg-bg-white); border:1px solid var(--mg-border); border-radius:var(--mg-radius-md);
  color:var(--mg-ink); text-decoration:none; transition:border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.mg-authors__card a:hover{ border-color:var(--mg-primary); box-shadow:var(--mg-shadow-sm); transform:translateY(-1px); text-decoration:none; }
.mg-authors__info{ display:flex; flex-direction:column; gap:2px; min-width:0; flex:1 1 auto; }
.mg-authors__info strong{ font-size:15.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mg-authors__type{ font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; color:var(--mg-ink-faint); }
.mg-authors__counts{ font-size:13.5px; color:var(--mg-ink-soft); }
.mg-authors__arrow{ flex:0 0 18px; width:18px; height:18px; color:var(--mg-ink-faint); }
.mg-authors__none{ margin:24px 0 0; text-align:center; color:var(--mg-ink-soft); }

/* ================= Responsive ================= */
@media (max-width:1100px){
  .mg-author__hero{ grid-template-columns:auto minmax(0,1fr); }
  .mg-author__stats{ grid-column:1 / -1; }
  .mg-author__review-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
  .mg-authors__grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
  .mg-author__perk-list{ grid-template-columns:repeat(2, minmax(0,1fr)); }
  .mg-author .mg-author__row-grid{ grid-template-columns:repeat(3, minmax(0,1fr)); }
}
@media (min-width:641px) and (max-width:1100px){
  /* 3 per row on tablets */
  .mg-author .mg-author__row-grid > :nth-child(4){ display:none; }
}
@media (max-width:640px){
  .mg-author__hero{ grid-template-columns:minmax(0,1fr); gap:16px; padding:20px; text-align:center; justify-items:center; }
  .mg-author__hero .mg-author__avatar{ width:84px; height:84px; font-size:30px; }
  .mg-author__name{ font-size:24px; }
  .mg-author__meta{ justify-content:center; }
  .mg-author__stats{ width:100%; }
  .mg-author__stats > div{ flex:1 1 0; min-width:0; padding:12px 8px; }
  .mg-author__stats dd{ font-size:20px; }
  .mg-author__stat-rating span{ font-size:19px; }
  .mg-author__bundle{ align-items:flex-start; font-size:14px; }
  .mg-author__review-grid{ grid-template-columns:minmax(0,1fr); }
  .mg-author__cta{ padding:20px; }
  .mg-authors__grid{ grid-template-columns:minmax(0,1fr); }
  .mg-authors__search{ width:100%; }
  .mg-author__perks{ padding:18px 16px; }
  .mg-author__perk-list{ grid-template-columns:minmax(0,1fr); gap:14px; }
  /* Rows scroll sideways on phones: about 1.2 cards visible, so it's clear there is more */
  .mg-author .mg-author__row-grid{ display:grid; grid-auto-flow:column; grid-template-columns:none; grid-auto-columns:80%; overflow-x:auto; scroll-snap-type:x mandatory; padding-bottom:6px; }
  .mg-author .mg-author__row-grid > *{ scroll-snap-align:start; }
  .mg-author__all-title{ font-size:19px; }
}
