/*
 * Book Buddy — public site design system.
 *
 * One stylesheet for every customer-facing page: courses, course detail,
 * checkout, pay, event application, ticket, product. Before this, each of
 * those pages carried its own <style> block with its own purple palette, so
 * the CMS pages looked nothing like bookbuddyacademy.com, which the WordPress
 * cards plugin already dresses in the brand.
 *
 * The tokens below are lifted verbatim from
 * wp-plugin/bookbuddy-connect/assets/bookbuddy.css so a card rendered by the
 * shortcode on the marketing site and a card rendered here are the same
 * object. Change a brand value there and change it here; nowhere else.
 *
 * Namespaced .bb- throughout. Bare element selectors are used only for page
 * furniture (body, headings, form controls) because these are our own whole
 * pages, not a widget dropped into someone else's theme.
 *
 * There is deliberately NO dark-scheme block, matching the plugin: these pages
 * are a fixed part of a light brand, and repainting them for the visitor's OS
 * setting made them stop matching the rest of the site.
 */

/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
  /* Brand */
  --bb-gold:     #F4B400;   /* caps, borders, button fill — never small text */
  --bb-gold-ink: #8A6508;   /* the same gold darkened until it is legible on white */
  --bb-navy:     #07273A;

  /* Roles */
  --bb-text:     #07273A;
  --bb-soft:     #47606F;
  --bb-mute:     #8A99A3;
  --bb-line:     #ECE7DD;
  --bb-card:     #FFFFFF;
  --bb-page:     #FAFAF8;   /* the site's own page colour */
  --bb-thumb-bg: #F2EFE9;
  --bb-sunk:     #F7F5F0;   /* inset panels: totals, amount payable */

  /* Semantic. Separate from the gold accent so "this went wrong" never has to
     borrow the brand colour to say so. */
  --bb-ok:       #2F6B4F;
  --bb-ok-bg:    #E6F1EA;
  --bb-warn:     #8A6508;
  --bb-warn-bg:  #FBF3DF;
  --bb-err:      #8A3B2E;
  --bb-err-bg:   #F6E7E4;
  --bb-scarce:   #B4552A;

  --bb-radius:    24px;
  --bb-radius-sm: 14px;
  --bb-radius-xs: 10px;

  --bb-shadow:    0 15px 40px rgba(7, 39, 58, .05);
  --bb-shadow-up: 0 30px 70px rgba(7, 39, 58, .12);

  --bb-font: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bb-page);
  color: var(--bb-text);
  font-family: var(--bb-font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--bb-navy);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
  text-wrap: balance;
}

a { color: var(--bb-gold-ink); }
a:hover { color: var(--bb-navy); }

img { max-width: 100%; }

:focus-visible {
  outline: 3px solid var(--bb-gold);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   Page furniture
   ========================================================================== */

.bb-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.1rem 2rem;
  background: var(--bb-card);
  border-bottom: 1px solid var(--bb-line);
}

.bb-brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--bb-navy);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -.02em;
  text-decoration: none;
}
.bb-brand i { color: var(--bb-gold); }
.bb-brand:hover { color: var(--bb-navy); }

.bb-navlinks {
  display: flex;
  align-items: center;
  gap: 1.7rem;
  flex-wrap: wrap;
}

.bb-navlinks a {
  color: var(--bb-soft);
  font-size: .93rem;
  font-weight: 500;
  text-decoration: none;
  transition: color .25s ease;
}
.bb-navlinks a:hover { color: var(--bb-navy); }

/* The one nav item that is an action, not a destination. */
.bb-navlinks a.bb-navcta {
  padding: .6rem 1.3rem;
  border-radius: var(--bb-radius-sm);
  background: var(--bb-gold);
  color: var(--bb-navy);
  font-weight: 700;
  transition: background .3s ease, color .3s ease;
}
.bb-navlinks a.bb-navcta:hover {
  background: var(--bb-navy);
  color: #FFFFFF;
}

.bb-hero {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3.4rem 1.5rem 2.4rem;
  text-align: center;
}
.bb-hero h1 { font-size: 2.4rem; }
.bb-hero p {
  margin: .9rem 0 0;
  color: var(--bb-soft);
  font-size: 1.02rem;
  line-height: 1.7;
}

/* Breadcrumb / back link above a detail page. */
.bb-crumb {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--bb-mute);
  font-size: .88rem;
  font-weight: 500;
  text-decoration: none;
}
.bb-crumb:hover { color: var(--bb-navy); }

.bb-wrap {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.5rem 4.5rem;
}
.bb-wrap-narrow { max-width: 38rem; }
.bb-wrap-mid    { max-width: 52rem; }

/* A page whose whole content is one card, vertically centred-ish. */
.bb-single { padding-top: 2.8rem; }

/* ==========================================================================
   Card
   ========================================================================== */

.bb-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bb-card);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-radius);
  overflow: hidden;
  box-shadow: var(--bb-shadow);
}

/* The gold cap along the top edge — the brand's signature on every card.
   Above the thumbnail rather than behind it, so a card with an image reads as
   the same component as one without. */
.bb-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 3;
  height: 5px;
  background: var(--bb-gold);
  transition: height .35s ease;
}

/* Only cards that are themselves a link should lift. A form card that lifted
   under the cursor would be restless while someone is typing in it. */
.bb-card-link {
  text-decoration: none;
  color: inherit;
  transition: transform .35s ease, box-shadow .35s ease;
}
.bb-card-link:hover {
  transform: translateY(-8px);
  box-shadow: var(--bb-shadow-up);
  color: inherit;
}
.bb-card-link:hover::before { height: 7px; }

/* Hover lift only where hovering is a real gesture. On touch it sticks after a
   tap and leaves one card raised for no reason. */
@media (hover: none) {
  .bb-card-link:hover { transform: none; box-shadow: var(--bb-shadow); }
}

.bb-card-head {
  padding: 2rem 2.1rem 0;
}

.bb-card-body {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  padding: 2rem 2.1rem 1.9rem;
  flex: 1;
}
.bb-card-head + .bb-card-body { padding-top: 1.3rem; }

/* Pushed to the bottom so footers line up across cards of unequal height. */
.bb-card-foot {
  margin-top: auto;
  padding-top: 1.4rem;
  border-top: 1px solid var(--bb-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .9rem;
  flex-wrap: wrap;
}

/* display:block because courses.php makes the thumbnail itself the link, and an
   inline <a> would ignore the aspect ratio. */
.bb-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--bb-thumb-bg);
  overflow: hidden;
}
.bb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.bb-thumb-none {
  aspect-ratio: 16 / 9;
  background: var(--bb-thumb-bg);
  display: grid;
  place-items: center;
  color: #C9C1B2;
  font-size: 2rem;
}

/* Event date chip, top-right, clear of the gold cap. */
.bb-date {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 3.4rem;
  padding: .5rem .4rem .55rem;
  border-radius: var(--bb-radius-sm);
  background: var(--bb-navy);
  color: #FFFFFF;
  line-height: 1;
}
.bb-date-d { font-size: 1.35rem; font-weight: 800; }
.bb-date-m {
  margin-top: .2rem;
  color: var(--bb-gold);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ==========================================================================
   Card content
   ========================================================================== */

.bb-tag {
  /* inline-block so a tag also works outside a flex container, which is where
     the product page puts it. align-self still applies inside .bb-tags. */
  display: inline-block;
  align-self: flex-start;
  padding: .5rem 1.05rem;
  border: 1px solid var(--bb-gold);
  border-radius: 999px;
  background: transparent;
  color: var(--bb-gold-ink);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1.2;
}
.bb-tag-solid {
  border-color: transparent;
  background: var(--bb-ok-bg);
  color: var(--bb-ok);
}

.bb-tags { display: flex; flex-wrap: wrap; gap: .5rem; }

.bb-title { margin: .3rem 0 0; font-size: 1.5rem; }
.bb-title-lg { font-size: 1.75rem; }

.bb-desc {
  margin: 0;
  color: var(--bb-soft);
  font-size: .98rem;
  line-height: 1.75;
}

.bb-meta {
  margin: 0;
  color: var(--bb-mute);
  font-size: .88rem;
  line-height: 1.5;
}
.bb-meta-row { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.bb-meta-row span { display: inline-flex; align-items: center; gap: .4rem; }
.bb-meta i { color: var(--bb-gold-ink); }

.bb-price {
  color: var(--bb-navy);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.bb-price-lg { font-size: 2rem; }

.bb-period { color: var(--bb-mute); font-size: .85rem; font-weight: 600; }

.bb-scarce { margin: 0; color: var(--bb-scarce); font-size: .85rem; font-weight: 600; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.bb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .85rem 1.7rem;
  border: 0;
  border-radius: var(--bb-radius-sm);
  background: var(--bb-gold);
  color: var(--bb-navy);
  font-family: inherit;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .3s ease, color .3s ease;
}
.bb-btn:hover,
.bb-btn:focus-visible {
  background: var(--bb-navy);
  color: #FFFFFF;
}

.bb-btn-lg { padding: 1.05rem 2rem; font-size: 1rem; }
.bb-btn-block { width: 100%; }

.bb-btn-ghost {
  background: transparent;
  border: 1px solid var(--bb-line);
  color: var(--bb-navy);
}
.bb-btn-ghost:hover { background: var(--bb-navy); border-color: var(--bb-navy); color: #FFFFFF; }

.bb-btn-off,
.bb-btn-off:hover,
.bb-btn:disabled,
.bb-btn:disabled:hover {
  background: #EDEAE3;
  color: var(--bb-mute);
  cursor: default;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.bb-form { display: flex; flex-direction: column; gap: 1.25rem; }

.bb-field { display: flex; flex-direction: column; gap: .45rem; }

.bb-row { display: flex; gap: 1.1rem; }
.bb-row > .bb-field { flex: 1; min-width: 0; }

label, .bb-label {
  color: var(--bb-navy);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .01em;
}

.bb-req { color: var(--bb-scarce); }

input[type="text"], input[type="email"], input[type="tel"],
input[type="password"], input[type="number"], input[type="date"],
select, textarea {
  width: 100%;
  padding: .8rem 1rem;
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-radius-xs);
  background: var(--bb-card);
  color: var(--bb-text);
  font-family: inherit;
  font-size: .95rem;
  line-height: 1.5;
  transition: border-color .2s ease, box-shadow .2s ease;
}

input::placeholder, textarea::placeholder { color: var(--bb-mute); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--bb-gold);
  box-shadow: 0 0 0 3px rgba(244, 180, 0, .18);
}

textarea { resize: vertical; min-height: 6rem; }

select {
  appearance: none;
  padding-right: 2.6rem;
  /* Chevron drawn as a background image so the control keeps our border and
     radius instead of the browser's. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2347606F' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: .72rem;
}

.bb-hint { color: var(--bb-mute); font-size: .8rem; line-height: 1.5; }

/* ==========================================================================
   Notices
   ========================================================================== */

.bb-note {
  padding: .95rem 1.15rem;
  border-left: 4px solid var(--bb-gold);
  border-radius: var(--bb-radius-xs);
  background: var(--bb-warn-bg);
  color: var(--bb-warn);
  font-size: .9rem;
  line-height: 1.6;
}
.bb-note strong { color: inherit; }
.bb-note a { color: inherit; font-weight: 700; }

.bb-note-ok  { border-left-color: var(--bb-ok);  background: var(--bb-ok-bg);  color: var(--bb-ok); }
.bb-note-err { border-left-color: var(--bb-err); background: var(--bb-err-bg); color: var(--bb-err); }
.bb-note-info {
  border-left-color: var(--bb-navy);
  background: var(--bb-sunk);
  color: var(--bb-soft);
}
.bb-note ul { margin: .4rem 0 0; padding-left: 1.1rem; }

/* ==========================================================================
   Sunken panels — amount payable, order totals
   ========================================================================== */

.bb-sum {
  padding: 1.3rem 1.5rem;
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-radius-sm);
  background: var(--bb-sunk);
}

.bb-sum-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .35rem 0;
  color: var(--bb-soft);
  font-size: .92rem;
}
.bb-sum-line > :last-child { font-variant-numeric: tabular-nums; }

.bb-sum-total {
  margin-top: .7rem;
  padding-top: .9rem;
  border-top: 1px solid var(--bb-line);
  color: var(--bb-navy);
  font-size: 1.05rem;
  font-weight: 700;
}
.bb-sum-total > :last-child { font-size: 1.35rem; }

/* The single "Amount payable — PKR 10,000" bar on the pay page. */
.bb-amount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.15rem 1.5rem;
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-radius-sm);
  background: var(--bb-sunk);
}
.bb-amount-label {
  color: var(--bb-soft);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* ==========================================================================
   Grids, lists, empty states
   ========================================================================== */

.bb-grid {
  display: grid;
  gap: 2.2rem;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
@media (min-width: 560px) {
  .bb-cols-2, .bb-cols-3, .bb-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .bb-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bb-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Detail page: content beside a sticky buy panel. */
.bb-split {
  display: grid;
  gap: 2.2rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 900px) {
  .bb-split { grid-template-columns: minmax(0, 1fr) 22rem; }
  .bb-split-aside { position: sticky; top: 1.5rem; }
}

.bb-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .1rem; }

.bb-list-item {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--bb-line);
  font-size: .95rem;
}
.bb-list-item:last-child { border-bottom: 0; }
.bb-list-item i { color: var(--bb-gold-ink); width: 1rem; text-align: center; }
.bb-list-num {
  flex: none;
  width: 1.75rem; height: 1.75rem;
  border-radius: 50%;
  background: var(--bb-sunk);
  color: var(--bb-soft);
  display: grid; place-items: center;
  font-size: .78rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.bb-empty {
  padding: 3.5rem 1.5rem;
  border: 1px dashed var(--bb-line);
  border-radius: var(--bb-radius);
  background: var(--bb-card);
  color: var(--bb-soft);
  text-align: center;
  font-size: .98rem;
}
.bb-empty i { display: block; margin-bottom: .9rem; color: #D6CFC0; font-size: 2rem; }

.bb-secure {
  margin: 0;
  color: var(--bb-mute);
  font-size: .8rem;
  text-align: center;
}
.bb-secure i { color: var(--bb-gold-ink); }

/* Wide content must scroll inside its own box, never the page. */
.bb-scroll { overflow-x: auto; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 600px) {
  .bb-nav        { padding: .9rem 1.2rem; gap: .9rem; }
  .bb-navlinks   { gap: 1.1rem; font-size: .88rem; }
  .bb-hero       { padding: 2.4rem 1.2rem 1.8rem; }
  .bb-hero h1    { font-size: 1.8rem; }
  .bb-wrap       { padding: 0 1.1rem 3rem; }
  .bb-card-head  { padding: 1.6rem 1.4rem 0; }
  .bb-card-body  { padding: 1.6rem 1.4rem 1.5rem; }
  .bb-title      { font-size: 1.3rem; }
  .bb-title-lg   { font-size: 1.45rem; }
  .bb-row        { flex-direction: column; gap: 1.25rem; }
  .bb-grid       { gap: 1.6rem; }
  .bb-btn        { width: 100%; }
  .bb-card-foot  { flex-direction: column; align-items: stretch; }
  .bb-card-foot .bb-price { text-align: center; }
}
