/* ============================================================
   public-shell.css — shared chrome for public pages (header, breadcrumb,
   footer, dock, toast, buttons, tokens). Derived 1:1 from the approved
   trainer-profile mockup / index design; used by the public trainer
   profile and the public article page.
   ============================================================ */
/* ================= 1. DESIGN TOKENS (100% MATCH WITH index.html) ================= */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-50: #f0f7ff;
  --accent-yellow: #f59e0b;
  --accent-green: #10b981;
  --accent-red: #dc2626; --accent-red-strong: #dc2626; --accent-green-text: #047857; --accent-amber-text: #b45309;
  --accent-purple: #7c3aed;
  --accent-pink: #ec4899;

  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --border: #e2e8f0;
  --border-light: #edf2f7;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-subtle: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-float: 0 12px 28px -6px rgba(37, 99, 235, 0.18);
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-hover: 0 10px 24px rgba(15, 23, 42, 0.10);
}

*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%; max-width: 100vw; overflow-x: clip;
  background-color: var(--bg-app); color: var(--text-main);
  font-family: 'Plus Jakarta Sans', sans-serif; line-height: 1.45; -webkit-font-smoothing: antialiased;
}

/* No more bottom app dock — nothing to reserve space for on mobile. */

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

p, h1, h2, h3, h4, h5, h6, span, strong, a {
  overflow-wrap: break-word; word-break: break-word;
}

.container {
  width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; min-width: 0;
}

/* Top Reading Progress */
#topProgressBar {
  position: fixed; top: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, #2563eb, #7c3aed, #fbbf24);
  width: 0%; z-index: 3000; transition: width 0.1s linear;
}

/* ================= 2. NATIVE APP HEADER ================= */
.app-header {
  position: sticky; top: 0; z-index: 1000;
  border-bottom: 1px solid var(--border); padding: 10px 0; width: 100%;
}
/* Frosted-glass background moved to ::before — see home.css for why
   backdrop-filter can't live directly on .app-header (it would hijack
   `position: fixed` on the header search panel nested inside it). */
.app-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.app-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }

.header-brand-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
.header-back-btn {
  width: 34px; height: 34px; border-radius: 50%; background: #f1f5f9;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: var(--text-main); flex-shrink: 0;
}
.header-back-btn:active { transform: scale(0.92); }
.header-back-btn { display: none !important; }

.app-brand-lockup {
  display: flex; align-items: center; gap: 8px; font-size: 1.25rem; font-weight: 800; color: #0f172a;
  letter-spacing: -0.03em; white-space: nowrap;
}
.app-brand-icon {
  width: 28px; height: 28px; border-radius: 8px; position: relative;
  background: linear-gradient(135deg, #38bdf8 0%, #ec4899 50%, #2563eb 100%); flex-shrink: 0;
}
.app-brand-icon::after {
  content: "H";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 13px; font-family: inherit; line-height: 1;
}
.brand-hola { color: #2563eb; }
.brand-rest { color: #0f172a; }

.desktop-nav-links { display: none; align-items: center; gap: 20px; list-style: none; }
.desktop-nav-links a { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); transition: var(--transition); }
.desktop-nav-links a:hover, .desktop-nav-links a.active { color: var(--primary); }
@media (min-width: 860px) { .desktop-nav-links { display: flex; } }

.app-header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.header-icon-btn {
  width: 36px; height: 36px; border-radius: 50%; background: #f1f5f9;
  display: flex; align-items: center; justify-content: center; color: var(--text-main);
  font-size: 1.1rem; transition: var(--transition); position: relative;
}
.header-icon-btn:active { transform: scale(0.92); }
.header-user-avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--primary); cursor: pointer;
}

/* Breadcrumbs */
.breadcrumb-bar {
  display: flex; align-items: center; gap: 6px; padding: 12px 0 6px;
  font-size: 0.78rem; color: var(--text-subtle); font-weight: 600;
  width: 100%; overflow-x: auto; scrollbar-width: none; white-space: nowrap;
}
.breadcrumb-bar::-webkit-scrollbar { display: none; }
.breadcrumb-bar a { color: var(--text-muted); }
.breadcrumb-bar a:hover { color: var(--primary); }
.breadcrumb-bar span.active-crumb { color: var(--text-main); font-weight: 700; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 8px 16px; border-radius: var(--radius-md);
  font-size: 0.85rem; font-weight: 700; transition: var(--transition); cursor: pointer; white-space: nowrap;
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(37,99,235,0.28); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { border: 1px solid var(--border); color: var(--text-main); background: #fff; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-yellow { background: var(--accent-yellow); color: #0f172a; font-weight: 800; }
.btn-yellow:hover { background: #d97706; }

/* ================= 12. RICH FOOTER ================= */
.app-footer-wrapper {
  border-top: 1px solid var(--border); padding: 30px 0 24px; font-size: 0.82rem; color: var(--text-muted); margin-top: 24px;
  width: 100%; min-width: 0;
}
.footer-columns-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 20px; margin-bottom: 24px;
}
.footer-links-col h4 { font-size: 0.84rem; font-weight: 800; color: #0f172a; margin-bottom: 10px; }
.footer-links-col ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.footer-links-col a { color: var(--text-muted); font-size: 0.76rem; transition: var(--transition); }
.footer-links-col a:hover { color: var(--primary); }


/* Toast */
#toastMessage {
  position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%) translateY(20px);
  background: #0f172a; color: #fff; padding: 9px 18px; border-radius: var(--radius-full);
  font-size: 0.82rem; font-weight: 600; box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  display: flex; align-items: center; gap: 8px; z-index: 6000; opacity: 0;
  pointer-events: none; transition: var(--transition); white-space: nowrap;
}
#toastMessage.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

/* ================= Shell additions (accessibility, states, shared bits) ================= */
.notif-dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; background: var(--accent-red); border-radius: 50%; border: 1.5px solid #fff; }
.footer-social-icons { display: flex; gap: 8px; margin: 12px 0; }
.social-circle-btn { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.85rem; }
.social-circle-btn.linkedin { background: #0a66c2; }
.social-circle-btn.instagram { background: linear-gradient(45deg, #f09433, #dc2743, #bc1888); }
.social-circle-btn.youtube { background: #ff0000; }
.social-circle-btn.x-twitter { background: #000000; }

/* Keyboard users get a clear ring; mouse users don't get one on click. */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 6500; background: #0f172a; color: #fff;
  padding: 9px 16px; border-radius: 10px; font-size: 0.8rem; font-weight: 700;
}
.skip-link:focus { left: 8px; }
.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;
}

/* Toast variants (JS sets the icon + .error) */
#toastMessage.error { background: #7f1d1d; }
#toastMessage i { flex-shrink: 0; color: var(--accent-green-text, #047857); }
#toastMessage.error i { color: #fca5a5; }
#toastMessage { max-width: calc(100vw - 32px); white-space: normal; text-align: left; }

/* Header dropdown: keep it above the sticky action bar and off-screen edges */
.profile-dropdown { max-width: calc(100vw - 24px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* The `hidden` attribute must always win over component display rules (inline-flex etc.). */
[hidden] { display: none !important; }
