/* =========================================================
   Site styles (global, shared across all pages)
   ========================================================= */

/* Base / utilities */
body {
  color: var(--text);
}

#studio-confirm-overlay[hidden] { 
  display: none !important; 
}

/* Generic card */
.card {
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  background: var(--surface-2);
}

/* ===========================================
   Section spacing system (GLOBAL)
   =========================================== */

.section-pad {
  padding-top: clamp(2.5rem, 6vw, 4rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

/* Tight sections (hero follow-ups, lists) */
.section-pad-sm {
  padding-top: 2rem;
  padding-bottom: 2.5rem;
}

/* Large marketing sections */
.section-pad-lg {
  padding-top: 4.5rem;
  padding-bottom: 6rem;
}

/* Buttons, nav highlights */
.btn-primary {
  background-color: var(--brand);
  border-color: var(--brand);
}

/* Brand helpers */
.text-brand   { color: var(--brand) !important; }
.bg-brand     { background-color: var(--brand) !important; }
.border-brand { border-color: var(--brand) !important; }

/* Footer (dark secondary surface)
   Old tokens: --surface-secondary, --text-on-secondary, --muted-on-secondary
   Now mapped to dark surface + text-on-dark tokens.
*/
footer.footer-secondary {
  background-color: var(--surface-dark) !important;
  color: var(--text-on-dark);
}
footer.footer-secondary a {
  color: var(--text-on-dark);
}

/* Footer brand alignment */
.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;   /* center horizontally */
  gap: 1rem;
  text-align: center;
}
/* Mobile: stack logo above text */
@media (max-width: 576px) {
  .footer-brand {
    flex-direction: column;
  }
}
.footer-brand .footer-brief { flex: 1 1 auto; min-width: 0; }
.footer-brand .footer-logo  { flex: 0 0 auto; }

/* Footer logo size (tokens control final size) */
.footer-logo {
  height: clamp(var(--logo-footer-min), var(--logo-footer-fluid), var(--logo-footer-max));
  width: auto;
  display: inline-block;
}

/* Social icon pills (used site-wide, on dark footer) */
.social-pill {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  border-radius:999px;
  background: rgba(255,255,255,.10);
  color: var(--text-on-dark);
  text-decoration:none;
  transition: transform .15s ease,
              background-color .15s ease,
              color .15s ease;
}
.social-pill:hover {
  background: rgba(255,255,255,.18);
  color: var(--brand);
  transform: translateY(-1px);
}

/* =========================================================
   Navbar + dropdown (responsive + hover-open desktop)
   ========================================================= */

/* Logo sizing (you already use these tokens) */
.brand-logo--nav {
  height: clamp(var(--logo-nav-min, 44px),
                var(--logo-nav-fluid, 6vw),
                var(--logo-nav-max, 80px));
  width: auto;
  display: block;
}

/* Make nav links feel consistent */
.navbar .nav-link {
  font-weight: 500;
}

/* Active link */
.navbar .nav-link.active {
  color: var(--brand) !important;
  font-weight: 600;
}

/* Dropdown base */
.navbar .dropdown { position: relative; }

/* Dropdown menu: clean card look */
.navbar .dropdown-menu {
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  padding: .35rem;
  min-width: 240px;
}

/* Dropdown items: better tap target + truncation safety */
.navbar .dropdown-item {
  border-radius: 10px;
  padding: .55rem .75rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Text-only placeholder row */
.navbar .dropdown-item-text {
  padding: .55rem .75rem;
}

/* Hover/focus states */
.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
  background: rgba(15, 23, 42, 0.05);
}

/* =========================
   Mobile / collapsed behavior
   ========================= */
@media (max-width: 991.98px) {
  /* Give the opened collapse some breathing room */
  .navbar-nav {
    padding-top: .5rem;
    padding-bottom: .75rem;
    gap: .15rem;
  }

  /* Larger tap targets on mobile */
  .navbar .nav-link {
    padding-top: .6rem;
    padding-bottom: .6rem;
  }

  /* IMPORTANT:
     In collapsed mode, dropdown should behave like a normal block list,
     not a floating popper menu. */
  .navbar .dropdown-menu {
    position: static !important;
    transform: none !important;
    width: 100%;
    min-width: 0;
    margin-top: .25rem;
    box-shadow: none;
    border-radius: 12px;
  }

  /* Slightly tighter items in collapse */
  .navbar .dropdown-item {
    padding: .55rem .75rem;
  }
}

/* =========================
   Desktop behavior (hover-open)
   ========================= */
@media (min-width: 992px) {
  /* Remove hover gap */
  .navbar .dropdown-menu {
    margin-top: 0;          /* <- important */
  }

  /* Position directly under the toggle (no gap) */
  .navbar .dropdown > .dropdown-menu {
    left: 0;
    right: auto;
    top: 100%;              /* <- important */
    transform: none !important;
  }

  /* Invisible "hover bridge" so slow mouse movement doesn't close it */
  .navbar .dropdown > .dropdown-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -12px;
    height: 12px;
  }

  /* Open on hover (still works on click) */
  .navbar .dropdown:hover > .dropdown-menu {
    display: block;
  }
}


/* ---------------------------------------------------------------------------------------------- */

/* Pill ghost button for staff/auth */
.btn-ghost {
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  padding:.45rem .9rem;
  border-radius:999px;
  border:1px solid var(--border-subtle);
  background: #ffffff;
  color:#0f172a;
  box-shadow:0 1px 2px rgba(0,0,0,.04);
  transition:transform .15s ease,
             color .15s ease,
             border-color .15s ease,
             box-shadow .15s ease;
  text-decoration:none;
}
.btn-ghost:hover {
  color:var(--brand);
  border-color:var(--brand);
  transform:translateY(-1px);
  box-shadow:0 6px 14px rgba(0,0,0,.06);
}
.btn-ghost svg { flex:0 0 auto; }

/* Studio layout */
.studio-shell { min-height: calc(100vh - var(--nav-height, 0px)); }
.studio-main  { flex: 1; }

/* Bio typography (public view) */
.prose { line-height: 1.6; }
.prose h2 { font-size:1.25rem; margin:1rem 0 .5rem }
.prose h3 { font-size:1.1rem;  margin:.9rem 0 .4rem }
.prose p  { margin:.6rem 0 }
.prose ul,
.prose ol { padding-left:1.2rem; margin:.6rem 0 }
.prose blockquote {
  border-left:4px solid #ddd;
  padding-left:.8rem;
  color:#666;
  margin:.8rem 0;
}
.prose a { text-decoration: underline }

/* Classes TinyMCE applies */
.lh-tight   { line-height:1.2 }
.lh-normal  { line-height:1.6 }
.lh-relaxed { line-height:1.9 }
.fs-sm      { font-size:0.9rem }
.fs-lg      { font-size:1.125rem }
.fs-xl      { font-size:1.25rem }
.lead       { font-size:1.125rem; line-height:1.9 }
.bio-narrow { max-width:60ch }

/* Fixed box that text wraps around (only when rendered) */
.cover-float {
  float: right;
  width: var(--cover-w, 480px);
  height: var(--cover-h, 320px);
  margin: 0 0 1rem 1.25rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  background: var(--surface-2);
}
.cover-float img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Edit page preview box matches the same size */
.cover-preview-wrap { display: grid; gap: .5rem; }
.cover-frame {
  width: var(--cover-w, 480px);
  height: var(--cover-h, 320px);
  border: 1px dashed var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
}
.cover-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Stack on small screens */
@media (max-width: 900px) {
  .cover-float {
    float: none;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    margin: 0 0 1rem 0;
  }
}

/* ------------------------------------------------------------------ */
/* Global confirm dialog (used in Studio area)                        */
/* ------------------------------------------------------------------ */

.confirm-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1080;
}

.confirm-overlay[hidden] {
  display: none !important;
}

.confirm-dialog {
  min-width: 260px;
  max-width: 420px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.35);
  padding: 1.5rem 1.75rem;
}

.confirm-dialog p {
  margin: 0;
}

/* Global text alignment for content */
p {
  text-align: inherit;
}
/* Justify long-form content ONLY */
.prose,
.content-body,
.ck-content {
  text-align: justify;
  text-justify: inter-word;
}

.prose p,
.content-body p,
.ck-content p {
  text-align: inherit;
}

/* ===========================================
   GLOBAL FORM ERROR STYLING (ESL-wide)
   =========================================== */

.errorlist {
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--danger); /* Bootstrap's danger red */
}

.errorlist li {
  color: var(--danger); /* Bootstrap's danger red */
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0;
}

/* If template renders errors inside <div> instead of <ul> */
.form-error,
.field-error {
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 500;
}

/* =========================
   Navbar polish
   ========================= */

.brand-logo--nav{
  height: 70px;
  width: auto;
  display: block;
}

.navbar .nav-link{
  font-weight: 500;
}

.navbar .nav-link.active{
  font-weight: 700;
}

.btn-ghost{
  border: 1px solid rgba(0,0,0,.10);
  background: #fff;
  color: #111;
  border-radius: 999px;
  padding: .45rem .95rem;
}
.btn-ghost:hover{
  background: rgba(0,0,0,.04);
}

/* =========================
   Footer style
   ========================= */

.footer-secondary{
  background: #0b2a1f; /* adjust to your ESL green */
  color: rgba(255,255,255,.92);
}

.footer-logo{
  height: 70px;
  width: auto;
}

.footer-brief{
  max-width: 720px;
  margin: auto;
  line-height: 1.45;
  color: rgba(255,255,255,.85);
}

.footer-social .social-pill{
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.92);
}
.footer-social .social-pill:hover{
  background: rgba(255,255,255,.10);
}
