/* =========================
   Readletics · global.css
   Shared design tokens, base, header, utilities
   ========================= */

@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:ital,wght@0,400;0,700&display=swap');

/* --- Design tokens (match dashboard) --- */
:root{
  --mint-50:#E8F5E9;   /* header row bg */
  --mint-500:#4CAF50;  /* accent */
  --mint-700:#065f46;  /* dark mint text */
  --line-mint:#22c55e; /* thin divider */

  --bg-gray:#f3f4f6;   /* page background */
  --ink:#0f172a;       /* primary text */
  --ink-2:#64748b;     /* secondary */
  --line:#e5e7eb;      /* borders */

  --card:#ffffff;
  --shadow:0 6px 18px rgba(15,23,42,.06);
  --shadow-lg:0 14px 30px rgba(15,23,42,.10);
  --ring:rgba(16,185,129,.35);

  --radius-xl:20px;
  --radius-lg:14px;
  --radius:12px;

  --container:970px;
  --gap:16px;
}

/* --- Base / reset --- */
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{


    margin: 0;
    min-height: 100svh;              /* full viewport, safe on mobile */
    display: flex;
    flex-direction: column;
    background:var(--bg-gray);
    color:var(--ink);
    font:400 16px/1.45 system-ui,-apple-system,Segoe UI,Roboto,"Helvetica Neue",Arial;

}

main {
  flex: 1; /* takes all remaining space between header and footer */
}

img{ max-width:100%; height:auto; display:block; }
a{ color:inherit; }
button,input,select,textarea{ font:inherit; }

/* --- Layout helpers --- */
.container{ max-width:var(--container); margin:0 auto; padding:0 20px; }
.page{ max-width:var(--container); margin:0 auto; padding:0 20px 64px; }

/* --- Title row (mint like on the dashboard) --- */
.page__head{
  background:var(--mint-50);
  padding:32px 20px 26px;
  text-align:center;
  margin:0 -20px 18px;            /* full-bleed under top nav */
  border-bottom:3px solid var(--line-mint);
}
.title{
  margin:0; font-weight:800; letter-spacing:-.2px;
  font-size:clamp(28px,4vw,40px); color:var(--mint-700);
}

.title-wrap h1{
  margin:0;
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing:-0.02em;
}

.title-wrap {

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: #f8fcfa;
    border-bottom: 1px solid #d0e8df;
    min-height: 40px;
    padding: 1em;
    border-radius: 12px;
    margin-bottom: 20px;
}

.subtitle{
  margin:6px 0 0;
  color:#667185;
  font-size: 14.5px;
}

/* --- Header / Appbar (top white bar with mint underline) --- */
.appbar{
  background:#fff;
  border-bottom:3px solid var(--line-mint);
}
.appbar__inner{
  max-width:var(--container); margin:0 auto; padding:14px 20px;
  display:flex; align-items:center; justify-content:space-between;
}
.appbar__brand{ display:flex; align-items:baseline; gap:8px; }
.brand__title{ margin:0; font-weight:800; font-size:22px; }
.brand__subtitle{ margin:0; color:var(--ink-2); font-size:13px; }

.appbar__nav{ display:flex; gap:18px; }
.appbar__nav a{
  text-decoration:none; color:var(--ink-2); font-weight:700;
}
.appbar__nav a[aria-current="page"],
.appbar__nav a:hover{ color:var(--mint-700); }

.appbar__actions{ display:flex; align-items:center; gap:12px; }
.avatar{ width:36px; height:36px; border-radius:50%; overflow:hidden; }
.avatar img{ width:100%; height:100%; object-fit:cover; }

/* (Optional) simple dropdown shell to style your existing .menu */
.menu{
  position:absolute; right:0; margin-top:8px; min-width:180px;
  background:#fff; border:1px solid var(--line); border-radius:12px;
  box-shadow:var(--shadow); padding:6px; display:none;
}
.menu[aria-hidden="false"]{ display:block; }
.menu__item{
  display:flex; align-items:center; gap:8px;
  width:100%; background:none; border:0; text-align:left;
  padding:8px 10px; border-radius:10px; cursor:pointer;
}
.menu__item:hover{ background:rgba(16,185,129,.08); }

/* --- Focus / utilities --- */
:focus-visible{ outline:none; box-shadow:0 0 0 3px var(--ring); }
.muted{ color:var(--ink-2); }
.badge{
  display:inline-block; padding:4px 10px; border-radius:999px;
  background:#fff; color:var(--mint-700);
  border:1px solid rgba(16,185,129,.25); font-size:12px; font-weight:800;
  box-shadow:0 6px 14px rgba(15,23,42,.08);
}
.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

.site-tagline {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;

  background-color: #f8fcfa;
  border-bottom: 1px solid #d0e8df;
  min-height: 145px;

  padding: 1em;
  border-radius: 12px; /* 👈 makes the corners round */
}


.site-tagline h1 {
  font-size: 2.4em;
  margin: 0;
  color: #2c3e50;
}

.site-tagline p {
  font-size: 1.3em;
  color: #4CAF50;
  margin-top: 0.3em;
  font-style: italic;
}


.icon {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  margin-bottom: 4px;
  margin-right: 6px; /* ✅ adds spacing between icon and number */

}


.mascot-section{ display:flex; gap:1px; align-items:center; }

.mascot-bubble{
  margin-top:0px;
  margin-bottom: 100px;
  position:relative;
  max-width:400px;
  background:#fff;
  border:2px solid #000;
  border-radius:30px;
  padding:0 22px;
  font-size:17px;
  font-family:'Comic Neue','Comic Sans MS',cursive;
  line-height:1.5;
  color:#000;
  box-shadow:4px 4px 0 rgba(0,0,0,.2);
}


/* ---- Mascot + comic bubble ---- */

.comic-panel{
  /* let it fill the left side */
  flex: 1 1 600px;                  /* grow, shrink, preferred width */
  display:block;                    /* not inline-block */
  width:auto;                       /* remove fit-content */
  box-sizing:border-box;            /* include border/padding in width */
  border:3px solid #000;
  padding:12px;
  background:#fdf3de;
  box-shadow:2px 2px 0 #000;
  border-radius:5px;
}

.comic-image{
  display:block;
  max-width:100%;
  height:auto;
}


/* ---- User mini card (right) ---- */
.user-info{
  background: var(--mint-50);
  border:2px solid #d0e6fa; /* keep blue edge from your design */
  border-radius:12px; padding:1rem; max-width:300px;
  box-shadow:0 4px 8px rgba(0,0,0,.1); font-family:'Helvetica Neue',sans-serif;
  display:none;
}


.user-stats{
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.user-stats > div{
  flex: 1 1 0;
  min-width: 70px;       /* prevents squeezing on small screens */
  text-align: center;
  line-height: 1.25;
  white-space: nowrap;    /* keep icon + number on one line */
}

/* make sure both stay inline */
.user-stats .icon{
  display: inline-block;
  width: 24px;
  height: 24px;
  margin: 0 6px 0 0;      /* space before the number */
  vertical-align: middle;
}
.user-stats strong{
  display: inline;        /* override any block rule elsewhere */
  vertical-align: middle;
}


.reader-header{
  display:flex; align-items:center; justify-content:flex-end; gap:12px;
  width:240px; margin-bottom:16px;
}

.profile-reader-name{ font-size:1.2rem; font-weight:bold; text-decoration:underline; color:#1e3a8a; }
.profile-reader-avatar{ width:48px; height:48px; border-radius:50%; border:2px solid #1e3a8a; background:#fff; }
.profile-reader-stats{ display:flex; gap:20px; margin-top:6px; }

.actions .btn{ white-space:nowrap }


/* Base button */
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  height: 44px;
  width: 100%;
  border-radius: 9999px; /* pill shape */
  font-weight: 700;
  letter-spacing: .02em;
  transition: background .15s ease, transform .02s ease, box-shadow .15s ease;
  margin-top: 10px;
  color: var(--btn-ink, #fff);
  background: var(--btn, #2e9f4c);
  box-shadow: 0 6px 16px rgba(46, 159, 76, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.btn:hover {
  background: var(--btn-hover, #278b42);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Color variants */
.btn-green {
  --btn: #2e9f4c;
  --btn-hover: #278b42;
  --btn-ink: #fff;
}

/*
.btn-red {
  --btn: #dc2626;
  --btn-hover: #b91c1c;
  --btn-ink: #fff;
}
*/

.btn-red {
  --btn: #fff5f5;
  --btn-hover: #ffeaea;
  --btn-ink: #b42318;
  border: 1px solid #f0cccc;
  box-shadow: none;
}


.btn-blue {
  --btn: #2563eb;         /* main blue */
  --btn-hover: #1d4ed8;   /* darker hover blue */
  --btn-ink: #ffffff;     /* white text */
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
}


/* Size variants */
.btn-small {
  height: 38px;
  font-size: 14px;
  padding: 0 18px;
  min-width: 50px;
}

.btn-medium {
  height: 55px !important;
  font-size: 20px;
  padding: 0 28px;
}

/* Use this when you DON'T want full width */
.btn-inline {
  width: fit-content;      /* shrink to content */
  display: block;          /* so margin auto can center it */
  margin: 14px auto 0;     /* center + top spacing */
  padding: 0 24px;         /* a bit wider since it's not full-width */
}


/* Optional container-centered helper */
.btn-center {
  text-align: center;
}


#user-section{
  display:grid;
  grid-template-columns: 1fr 270px;
  gap:20px;
  width:100%;
  max-width:1100px;
  margin:10px auto;
  padding:10px;
}

.star {
  font-family: Arial, sans-serif;
  margin-right: 2px;
  position: relative;
  display: inline-block;
}

.star.half::before {
  content: "★";
  color: inherit;  /* inherit from variant */
  position: absolute;
  left: 0;
  width: 50%;
  overflow: hidden;
}
/* Big yellow stars */
.star.big-yellow {
  font-size: 18px;
  color: gold;
}

/* Small black stars */
.star.small-black {
  font-size: 13px;
  color: black;
}

.star.empty,
.star.half { color: #d0d0d0; }            /* force the base gray */
.star.half::before {
  content: "★";
  color: currentColor;                    /* use the element’s own color, not parent */
  position: absolute;
  left: 0; width: 50%; overflow: hidden;
}

.site-footer {
  background: #f8f9fa;
  border-top: 1px solid #e0e0e0;
  padding: 16px;
  text-align: center;
  font-size: 14px;
  color: #555;
  margin-top: 40px;
  flex: 0 0 auto;

}

.site-footer a {
  color: #007bff;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* =========================================================================
   Full-bleed breadcrumbs (span viewport width), content stays aligned
   ========================================================================= */
   /* Constrained page content (unchanged) */
 main.container{
   max-width: var(--container, 960px);
   margin: 0 auto;
   padding: 0 20px;
   box-sizing: border-box;
 }




 /* Breadcrumbs INSIDE the container */
 nav.breadcrumbs-accent{
   position: relative;
   display: flex;
   align-items: center;
   flex-wrap: wrap;
   gap: .4rem;
   padding: .75rem 0;
   margin: 0 0 0;
   font-size: .95rem;
   color: var(--muted, #6b7280);

   /* --- FULL-BLEED BACKGROUND using box-shadow bleed --- */
   /* Paint a light bar that visually spans the viewport */

   --bleed: 100vmax;

   border-bottom: 1px solid var(--stroke, rgba(0,0,0,.08)); /* thin rule under content width */
 }



 /* Links */
 nav.breadcrumbs-accent a{
   color: var(--accent, #0a8f5b);
   text-decoration: none;
   font-weight: 500;
 }
 nav.breadcrumbs-accent a:hover{ text-decoration: underline; }
 nav.breadcrumbs-accent .sep{ color: var(--muted, #6b7280); }
 nav.breadcrumbs-accent .current{ font-weight: 700; color: var(--ink, #0f172a); }

 /* Clean up any legacy constraint */
 main nav{ width:auto; max-width:none; margin:0; display:block; }

 body{
   align-items: stretch !important;  /* ensure 100% width for flex items */
 }

 /* Belt & suspenders: make key sections span the row */
 header#main-header,
 nav.breadcrumbs-accent,
 main.container,
 footer.site-footer{
   align-self: stretch;
   width: 100%;
 }


 .reader-item {
   padding: 12px 0;
   border-bottom: 1px solid #eee;
 }

 .reader-row {
   display: flex;
   align-items: flex-start;
   gap: 12px;
 }


 .avatar-wrap {
   --size: 52px;
   position: relative;
   width: var(--size);
   height: var(--size);
   border-radius: 50%;
   flex-shrink: 0;
   display: flex;
   align-items: center;
   justify-content: center;
   z-index: 0; /* make sure pseudo sits behind */
 }


 /* Create the belt color “shadow” on the right */
/*
 .avatar-wrap::before {
   content: "";
   position: absolute;
   inset: 0;
   border-radius: 50%;
   background: var(--belt-color, #ccc);
   transform: translateX(4px);
   z-index: -1;
 }
*/
 .reader-avatar {
   width: 100%;
   height: 100%;
   border-radius: 50%;
   object-fit: cover;
   background: #fff;
   border: 2px solid #0a1a40; /* dark outline ring */
   position: relative;
   z-index: 1;
 }


 .reader-main {
   flex: 1;
   min-width: 0;
 }

 .reader-name-line {
   display: flex;
   flex-wrap: wrap;
   align-items: baseline;
   gap: 6px;
   margin-bottom: 4px;
 }

 .reader-name {
   font-size: 0.95rem;
   font-weight: 600;
   color: #111;
   line-height: 1.3;
   text-decoration: underline;
 }

 .reader-belt-inline {
   font-size: 0.8rem;
   font-weight: 600;
   line-height: 1.3;
 }

 /* Brain Power card */
 .brainpower-box {
   background: #f7f9fc;
   border-radius: 10px;
   padding: 8px 10px;
   margin: 6px 0 10px;
   border: 1px solid rgba(0,0,0,0.05);
 }

 .brainpower-header {
   font-size: 0.8rem;
   font-weight: 600;
   color: #333;
   margin-bottom: 6px;
 }

 .belt-progress-bar {
   width: 100%;
   height: 6px;
   border-radius: 3px;
   background: #e9ecf1;
   overflow: hidden;
 }

 .belt-progress-fill {
   height: 100%;
   border-radius: 3px;
   transition: width .3s ease;
 }

 .belt-progress-numbers {
   font-size: 0.75rem;
   line-height: 1.4;
   color: #000;
   margin-top: 5px;
 }

 .belt-progress-numbers .belt-goal {
   margin-left: 6px;
   color: #444;
   font-size: 0.75rem;
 }

 /* Stat row under the box */
 .reader-stats {
   display: flex;
   flex-wrap: wrap;
   gap: 16px;
   font-size: 0.8rem;
   line-height: 1;
   color: #000;
 }

 .stat-block {
   display: flex;
   align-items: center;
   gap: 4px;
 }

 .stat-icon {
   width: 18px;
   height: 18px;
   display: block;
 }

 .bp-label {
   font-size: 0.7rem;
   color: #666;
   margin-left: 2px;
   position: relative;
   top: 2px; /* nudge label slightly lower */
 }


 .reader-name-line {
   display: flex;
   align-items: flex-start;
   flex-wrap: wrap;
   gap: 4px;
 }

 .reader-name-with-belt {
   display: flex;
   align-items: center;
   gap: 6px;
   font-weight: 600;
 }

 .belt-icon {
   height: 20px;
   width: auto;
   display: inline-block;
   vertical-align: middle;
 }

 .belt-icon-small {
   height: 16px;
   margin-left: 4px;
 }

 .brainpower-box .belt-progress-numbers {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   gap: 4px;
   font-size: 13px;
   line-height: 1.3;
 }

 .belt-goal {
   display: inline-flex;
   align-items: center;
   gap: 4px;
 }

 .belt-goal .arrow {
   color: #444;
   font-weight: 500;
   line-height: 1;
 }

 .section-divider {
   border: none;
   border-top: 1px solid #e5e7eb;
   margin: 1rem 0;
 }
