/* ==========================================================================
   Kaizene Healing Centre — Certificates page
   Builds on css/styles.css (tokens, header, footer, buttons, CTA, reveal).
   Layout grid comes from bootstrap-grid.min.css (row / col-* / g-*).
   ========================================================================== */

.page-certs {
  /* Muted brass accent, used sparingly for a framed, gallery feel */
  --gold: #B39662;
  --gold-light: #D9C49A;
  --gold-soft: #EFE7D6;
  --gold-deep: #7D5F33;          /* small text on ivory: ~5.4:1 */
  --mat: #FBF9F4;
}

.page-certs .row { --bs-gutter-x: clamp(24px, 4vw, 64px); }

/* Line icons */
.ct-arrow,
.ct-view svg,
.ct-seal-core svg,
.ct-lb-btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ct-arrow { width: 16px; height: 16px; transition: transform 0.4s var(--ease); }
.btn:hover .ct-arrow { transform: translateY(3px); }
.ct-honour-btn:hover .ct-arrow { transform: translateX(4px); }

/* Kicker: small caps label with a brass diamond */
.ct-kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.ct-kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
}
.ct-kicker--light { color: var(--gold-light); }
.ct-kicker--light::before { background: var(--gold-light); }

.ct-h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.1rem, 3.6vw, 3.1rem);
  line-height: 1.12;
  color: var(--forest);
  text-wrap: balance;
}
.ct-h2 em { font-style: normal; color: var(--sage-deep); }
.ct-h2--light { color: var(--ivory); }
.ct-h2--light em { color: var(--gold-light); }

/* ==========================================================================
   1. Hero
   ========================================================================== */

.ct-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: calc(var(--header-h) + clamp(20px, 3.5vw, 48px)) 0 clamp(48px, 6vw, 88px);
  background:
    radial-gradient(80% 70% at 100% 0%, rgba(239, 231, 214, 0.95), transparent 60%),
    radial-gradient(70% 60% at 0% 100%, rgba(220, 227, 215, 0.85), transparent 60%),
    var(--ivory);
}
.ct-glow {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  animation: ct-drift 18s ease-in-out infinite;
}
.ct-glow--a { width: 420px; height: 420px; top: 8%; right: 8%; background: var(--lavender); }
.ct-glow--b { width: 320px; height: 320px; bottom: -100px; left: 30%; background: var(--sage-soft); animation-delay: -9s; }
@keyframes ct-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-28px, 22px) scale(1.08); }
}

.ct-crumbs ol {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.ct-crumbs li + li::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 10px;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--gold);
}
.ct-crumbs a { transition: color 0.3s var(--ease); }
.ct-crumbs a:hover,
.ct-crumbs [aria-current] { color: var(--forest); }

.ct-title { font-size: clamp(2.5rem, 4.8vw, 4rem); line-height: 1.08; }
.ct-lede {
  max-width: 50ch;
  margin-top: 18px;
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--ink-muted);
}
.ct-hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

.ct-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 500px;
  margin: 36px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.ct-facts div { padding-right: 16px; }
.ct-facts div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.ct-facts dt {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  font-weight: 400;
  line-height: 1;
  color: var(--forest);
}
.ct-facts dd {
  margin: 8px 0 0;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Hero stagger */
.is-loaded .ct-hero .ct-kicker { transition-delay: 0.1s; }
.is-loaded .ct-hero .ct-title { transition-delay: 0.2s; }
.is-loaded .ct-hero .ct-lede { transition-delay: 0.3s; }
.is-loaded .ct-hero .ct-hero-actions { transition-delay: 0.4s; }
.is-loaded .ct-hero .ct-facts { transition-delay: 0.5s; }

/* Fanned stack of framed certificates */
.ct-fan {
  position: relative;
  width: min(100%, 540px);
  aspect-ratio: 1 / 0.9;
  margin-inline: auto;
}
.ct-fan-ring {
  position: absolute;
  inset: 2% 6%;
  border-radius: 50%;
  border: 1px dashed rgba(179, 150, 98, 0.55);
  animation: ct-spin 80s linear infinite;
}
.ct-fan-ring::after {
  content: "";
  position: absolute;
  top: 12%;
  left: 12%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
}
@keyframes ct-spin { to { transform: rotate(360deg); } }

.ct-fan-card {
  position: absolute;
  width: 68%;
  padding: 10px;
  background: var(--white);
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgba(179, 150, 98, 0.28),
    0 2px 4px rgba(38, 57, 46, 0.05),
    0 34px 60px -28px rgba(38, 57, 46, 0.5);
  transition: transform 1s var(--ease);
}
.ct-fan-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 3px;
}
.ct-fan-card--l { top: 4%; left: 0; transform: rotate(-9deg); }
.ct-fan-card--r { top: 8%; right: 0; transform: rotate(8deg); }
.ct-fan-card--c { top: 30%; left: 15%; width: 72%; transform: rotate(-1.5deg); }
.ct-fan:hover .ct-fan-card--l { transform: rotate(-12deg) translate(-12px, -6px); }
.ct-fan:hover .ct-fan-card--r { transform: rotate(11deg) translate(12px, -6px); }
.ct-fan:hover .ct-fan-card--c { transform: rotate(0deg) translateY(-6px); }

.ct-seal {
  position: absolute;
  left: 2%;
  bottom: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: var(--forest);
  box-shadow: 0 0 0 6px var(--ivory), 0 22px 40px -18px rgba(38, 57, 46, 0.7);
}
.ct-seal-text {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: ct-spin 30s linear infinite;
}
.ct-seal-text text {
  font-family: var(--font-text);
  font-size: 9.6px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  fill: var(--gold-light);
}
.ct-seal-core {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(217, 196, 154, 0.5);
  color: var(--gold-light);
}
.ct-seal-core svg { width: 24px; height: 24px; }

/* ==========================================================================
   2. Honour spotlight
   ========================================================================== */

.ct-honour { padding-top: var(--section-y); }

.ct-honour-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(40px, 6vw, 84px) clamp(24px, 6vw, 84px);
  border-radius: var(--radius-lg);
  color: var(--ivory);
  background:
    radial-gradient(60% 80% at 0% 0%, rgba(179, 150, 98, 0.22), transparent 60%),
    radial-gradient(50% 70% at 100% 100%, rgba(168, 184, 160, 0.18), transparent 60%),
    var(--forest-deep);
}
/* Inner hairline frame */
.ct-honour-panel::before {
  content: "";
  position: absolute;
  inset: 14px;
  z-index: -1;
  border: 1px solid rgba(217, 196, 154, 0.22);
  border-radius: calc(var(--radius-lg) - 10px);
  pointer-events: none;
}

.ct-honour-frame {
  display: block;
  width: min(100%, 360px);
  margin-inline: auto;
  padding: 12px;
  border-radius: 6px;
  background: linear-gradient(145deg, #E3CF9F, #A98A53 45%, #D9C49A 70%, #96773F);
  box-shadow: 0 40px 70px -30px rgba(0, 0, 0, 0.65);
  transform: rotate(-2deg);
  transition: transform 0.8s var(--ease);
}
.ct-honour-frame:hover { transform: rotate(0deg) translateY(-6px); }
.ct-honour-mat {
  display: block;
  padding: clamp(14px, 2vw, 22px);
  background: var(--mat);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(125, 95, 51, 0.25), inset 0 2px 10px rgba(0, 0, 0, 0.12);
}
.ct-honour-mat img { width: 100%; height: auto; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.35); }
.ct-honour-frame:focus-visible { outline-color: var(--gold-light); outline-offset: 6px; }

.ct-honour-lede {
  max-width: 56ch;
  margin-top: 18px;
  font-size: 1.075rem;
  font-weight: 300;
  color: rgba(247, 245, 239, 0.78);
}
.ct-honour-lede strong { font-weight: 500; color: var(--ivory); }

.ct-quote {
  margin: 28px 0 0;
  padding: 4px 0 4px 22px;
  border-left: 1px solid var(--gold);
}
.ct-quote p {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.4;
  color: var(--ivory);
}
.ct-quote footer {
  margin-top: 10px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-light);
}
.ct-honour-btn { margin-top: 32px; }
.ct-honour :focus-visible { outline-color: var(--gold-light); }

/* ==========================================================================
   3. Collection
   ========================================================================== */

.ct-collection { padding-top: calc(var(--section-y) * 1.6); }

.ct-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: clamp(32px, 4vw, 52px);
}
.ct-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 10px 0 22px;
  border: 1px solid rgba(51, 75, 61, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.ct-chip span {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--gold-soft);
  font-size: 0.7rem;
  letter-spacing: 0;
  color: var(--gold-deep);
  transition: inherit;
}
.ct-chip:hover { color: var(--forest); border-color: var(--forest); }
.ct-chip.is-active { background: var(--forest); border-color: var(--forest); color: var(--ivory); }
.ct-chip.is-active span { background: rgba(247, 245, 239, 0.16); color: var(--ivory); }

.ct-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 2.4vw, 32px);
}
.ct-item[hidden] { display: none; }
.ct-item.is-entering { animation: ct-in 0.7s var(--ease) both; animation-delay: var(--i, 0s); }
@keyframes ct-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.ct-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 12px 12px 24px;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-soft);
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
.ct-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 0 1px rgba(179, 150, 98, 0.45), 0 30px 60px -30px rgba(38, 57, 46, 0.45);
}

/* Museum mat with a brass hairline */
.ct-frame {
  --pad: clamp(18px, 2.2vw, 28px);
  position: relative;
  display: block;
  aspect-ratio: 5 / 4;
  border-radius: calc(var(--radius) - 10px);
  background: linear-gradient(160deg, var(--mat), #EFE9DC);
  overflow: hidden;
}
.ct-frame::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(179, 150, 98, 0.4);
  border-radius: calc(var(--radius) - 16px);
  pointer-events: none;
}
.ct-frame img {
  position: absolute;
  inset: var(--pad);
  width: calc(100% - var(--pad) * 2);
  height: calc(100% - var(--pad) * 2);
  object-fit: contain;
  filter: drop-shadow(0 12px 14px rgba(38, 57, 46, 0.22));
  transition: transform 0.9s var(--ease);
}
.ct-card:hover .ct-frame img { transform: scale(1.04); }

.ct-view {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--ivory);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.ct-view svg { width: 16px; height: 16px; }
.ct-card:hover .ct-view,
.ct-card:focus-visible .ct-view { opacity: 1; transform: none; }

.ct-meta { display: flex; flex-direction: column; gap: 6px; padding: 20px 12px 0; }
.ct-tag {
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.ct-name {
  font-family: var(--font-display);
  font-size: 1.28rem;
  line-height: 1.25;
  color: var(--forest);
  text-wrap: balance;
}
.ct-issuer { font-size: 0.9rem; font-weight: 300; line-height: 1.5; color: var(--ink-muted); }

/* ==========================================================================
   4. Learning journey
   ========================================================================== */

.ct-journey { padding-block: calc(var(--section-y) * 1.4); }

.ct-timeline {
  --year-h: 40px;
  --gap: 14px;
  --dot: 14px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}
.ct-timeline::before {
  content: "";
  position: absolute;
  top: calc(var(--year-h) + var(--gap) + var(--dot) / 2);
  left: calc(100% / 14);
  right: calc(100% / 14);
  height: 1px;
  background: linear-gradient(90deg, var(--sage), var(--gold));
}
.ct-timeline li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.ct-tl-year {
  height: var(--year-h);
  margin-bottom: var(--gap);
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: var(--year-h);
  color: var(--forest);
}
.ct-tl-dot {
  position: relative;
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: var(--ivory);
  box-shadow: 0 0 0 1px var(--sage-deep), inset 0 0 0 3px var(--ivory), inset 0 0 0 8px var(--sage);
}
.ct-tl-dot--gold { box-shadow: 0 0 0 1px var(--gold-deep), inset 0 0 0 3px var(--ivory), inset 0 0 0 8px var(--gold); }
.ct-timeline p {
  max-width: 18ch;
  margin-top: 16px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink-muted);
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.ct-lb {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ivory);
  overflow: hidden;
}
.ct-lb::backdrop {
  background: rgba(20, 30, 24, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ct-lb[open] { animation: ct-lb-in 0.45s var(--ease); }
@keyframes ct-lb-in { from { opacity: 0; } to { opacity: 1; } }

.ct-lb-inner {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  padding: clamp(14px, 2.5vw, 28px) clamp(16px, 7vw, 110px) clamp(18px, 3vw, 32px);
}
.ct-lb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ct-lb-count {
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  color: var(--gold-light);
}

.ct-lb-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 0;
}
.ct-lb-figure img {
  max-width: min(100%, 1100px);
  max-height: calc(100dvh - 230px);
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.ct-lb-figure img.is-swapping { opacity: 0; transform: scale(0.98); }
.ct-lb-figure figcaption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 60ch;
  text-align: center;
}
.ct-lb-tag {
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-light);
}
.ct-lb-title { font-family: var(--font-display); font-size: clamp(1.2rem, 2vw, 1.55rem); line-height: 1.3; }
.ct-lb-issuer { font-size: 0.9rem; font-weight: 300; color: rgba(247, 245, 239, 0.7); }

.ct-lb-btn {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(247, 245, 239, 0.3);
  color: var(--ivory);
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.ct-lb-btn svg { width: 20px; height: 20px; }
.ct-lb-btn:hover { background: rgba(247, 245, 239, 0.12); border-color: var(--ivory); }
.ct-lb-btn:focus-visible { outline-color: var(--gold-light); }
.ct-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.ct-lb-prev { left: clamp(12px, 2.5vw, 36px); }
.ct-lb-next { right: clamp(12px, 2.5vw, 36px); }

html.lb-open { overflow: hidden; }

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

@media (max-width: 1100px) {
  .ct-timeline { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 40px; }
  .ct-timeline::before { display: none; }
}

@media (max-width: 991.98px) {
  .ct-hero .col-lg-6:first-child { text-align: center; }
  .ct-crumbs ol,
  .ct-hero-actions { justify-content: center; }
  .ct-lede { margin-inline: auto; }
  .ct-facts { margin-inline: auto; text-align: left; }
  .ct-fan { width: min(100%, 480px); }

  .ct-honour-panel .col-lg-7 { text-align: center; }
  .ct-honour-lede { margin-inline: auto; }
  .ct-quote { max-width: 46ch; margin-inline: auto; padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--gold); }
}

@media (max-width: 960px) {
  .ct-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .ct-timeline {
    grid-template-columns: 1fr;
    row-gap: 0;
    max-width: 420px;
    margin-inline: auto;
  }
  .ct-timeline::before {
    display: block;
    top: 22px;
    bottom: 22px;
    left: calc(64px + 18px + var(--dot) / 2);
    right: auto;
    width: 1px;
    height: auto;
    background: linear-gradient(180deg, var(--sage), var(--gold));
  }
  .ct-timeline li {
    display: grid;
    grid-template-columns: 64px var(--dot) 1fr;
    column-gap: 18px;
    align-items: center;
    padding: 10px 0;
    text-align: left;
  }
  .ct-tl-year { height: auto; margin: 0; font-size: 1.4rem; line-height: 1.2; text-align: right; }
  .ct-timeline p { max-width: none; margin: 0; }
}

@media (max-width: 640px) {
  .ct-title { font-size: clamp(2.2rem, 10vw, 2.7rem); }
  .ct-hero-actions .btn { width: 100%; }
  .ct-facts div { padding-right: 8px; }
  .ct-facts div + div { padding-left: 12px; }
  .ct-facts dd { font-size: 0.6rem; letter-spacing: 0.12em; }
  .ct-fan { aspect-ratio: 1 / 0.95; }
  .ct-seal { width: 96px; height: 96px; box-shadow: 0 0 0 4px var(--ivory), 0 16px 30px -14px rgba(38, 57, 46, 0.7); }
  .ct-seal-core { width: 42px; height: 42px; }
  .ct-seal-core svg { width: 20px; height: 20px; }

  .ct-honour .container { padding-inline: 12px; }
  .ct-honour-panel { border-radius: var(--radius); }
  .ct-honour-panel::before { inset: 8px; border-radius: calc(var(--radius) - 6px); }
  .ct-honour-btn { width: 100%; }

  .ct-filters { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter) 6px; scrollbar-width: none; }
  .ct-filters::-webkit-scrollbar { display: none; }
  .ct-chip { flex-shrink: 0; }

  .ct-grid { grid-template-columns: 1fr; }

  .ct-lb-inner { padding: 14px 14px 90px; }
  .ct-lb-figure img { max-height: calc(100dvh - 300px); }
  .ct-lb-nav { top: auto; bottom: 22px; transform: none; }
  .ct-lb-prev { left: calc(50% - 62px); }
  .ct-lb-next { right: calc(50% - 62px); }
}

@media (prefers-reduced-motion: reduce) {
  .ct-fan-ring, .ct-seal-text, .ct-glow { animation: none; }
}
