/* ==========================================================================
   Knowledge Hub redesign — hero, category cards, latest updates
   ========================================================================== */

/* Beats the site-wide "underline every link" accessibility rule in
   Shared/Layout.html, which has higher selector specificity than a
   plain class rule would. */
#hub-hero a,
#hub-explore a,
#hub-updates a {
  text-decoration: none !important;
}

.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;
}

.hub-hero {
  background: linear-gradient(135deg, var(--color-purple-bg) 0%, #eef2ff 45%, var(--color-orange-bg) 100%);
  padding: 60px 20px 50px;
  overflow-x: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

.hub-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}

.hub-hero-inner > div {
  min-width: 0;
}

.hub-hero-eyebrow {
  color: var(--color-orange);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.hub-hero-title {
  font-family: var(--font-heading);
  color: var(--color-purple-dark);
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 14px;
}

.hub-hero-subtitle {
  color: var(--color-text-body);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 0 26px;
}

.hub-search-bar {
  display: flex;
  gap: 0;
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  max-width: 520px;
  width: 100%;
  box-sizing: border-box;
}

.hub-search-bar input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  background: transparent;
}

.hub-search-bar button {
  border: none;
  background: var(--color-orange);
  color: var(--color-white);
  font-weight: 700;
  padding: 0 26px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease;
}

.hub-search-bar button:hover {
  background: var(--color-orange-dark);
}

.hub-popular-searches {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hub-popular-searches span.label {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.hub-search-pill {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  color: var(--color-purple-dark);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hub-search-pill:hover {
  background: var(--color-purple);
  color: var(--color-white);
  border-color: var(--color-purple);
}

/* --- Decorative illustration --- */
.hub-illustration {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 280px;
}

/* Soft blurred glow behind the scene, echoing the out-of-focus background
   of a real product photo so the books/plant read as the sharp foreground */
.hub-illustration-glow {
  position: absolute;
  top: 6%;
  left: 8%;
  right: 2%;
  bottom: 8%;
  background: radial-gradient(ellipse at 55% 45%, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 68%);
  filter: blur(18px);
  z-index: 0;
  pointer-events: none;
}

.hub-note {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: 'Caveat', cursive;
  font-size: 1.3rem;
  color: var(--color-purple-dark);
  text-align: right;
  line-height: 1.25;
  transform: rotate(-4deg);
  max-width: 160px;
  z-index: 2;
}

.hub-note-underline {
  display: block;
  width: 72px;
  height: 10px;
  margin: 4px 0 0 auto;
  border-bottom: 3px solid var(--color-orange);
  border-radius: 50%;
  transform: rotate(-4deg);
}

.hub-scene {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

/* Soft grounding shadow under pot + books together, like a tabletop surface */
.hub-scene::after {
  content: '';
  position: absolute;
  left: 2%;
  right: 6%;
  bottom: -6px;
  height: 14px;
  background: rgba(20, 15, 50, 0.18);
  border-radius: 50%;
  filter: blur(7px);
  z-index: -1;
}

.hub-book-stack {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  gap: 3px;
  width: 220px;
  padding: 12px 6px 4px;
}

.hub-book {
  position: relative;
  height: 40px;
  border-radius: 3px 2px 2px 3px;
  display: flex;
  align-items: center;
  padding: 0 16px 0 18px;
  color: var(--color-white);
  font-weight: 800;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  width: 100%;
  box-shadow:
    0 4px 6px rgba(20, 15, 50, 0.25),
    inset 0 -3px 5px rgba(0, 0, 0, 0.16);
}

/* Angled "top" face of the book — the cue that we're looking down at a
   stack rather than at flat vertical bars */
.hub-book-top {
  position: absolute;
  top: -7px;
  left: 0;
  right: 9px;
  height: 9px;
  border-radius: 3px 2px 0 0;
  clip-path: polygon(2.5% 100%, 100% 100%, 97% 0%, 0% 0%);
}

.hub-book-title {
  position: relative;
  z-index: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
}

/* Page-edge stripe at the right end of each book */
.hub-book-pages {
  position: absolute;
  top: 3px;
  bottom: 3px;
  right: 3px;
  width: 9px;
  border-radius: 0 1px 1px 0;
  background: repeating-linear-gradient(
    to bottom,
    #f8f3e6 0px, #f8f3e6 2px,
    #e2d9c2 2px, #e2d9c2 3px
  );
  box-shadow: inset 1px 0 1px rgba(0, 0, 0, 0.12);
}

/* Small ribbon bookmark on the top book */
.hub-book-bookmark {
  position: absolute;
  top: -16px;
  left: 26px;
  width: 10px;
  height: 20px;
  background: var(--color-orange-dark);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
  z-index: 2;
}

/* Book colors — front face + a lighter shade for the angled top face,
   matching a navy / teal / maroon / green stack */
.hub-book-labour {
  background: linear-gradient(165deg, #2c3c78 0%, #1c2650 100%);
}
.hub-book-labour .hub-book-top {
  background: linear-gradient(120deg, #4a5da3 0%, #37457f 100%);
}

.hub-book-compliance {
  background: linear-gradient(165deg, #128a85 0%, #0b6763 100%);
}
.hub-book-compliance .hub-book-top {
  background: linear-gradient(120deg, #1ea9a2 0%, #148f89 100%);
}

.hub-book-acts {
  background: linear-gradient(165deg, #a13a4c 0%, #7c2836 100%);
}
.hub-book-acts .hub-book-top {
  background: linear-gradient(120deg, #c34f63 0%, #a13a4c 100%);
}

.hub-book-notifications {
  background: linear-gradient(165deg, #2f7a4e 0%, #205937 100%);
}
.hub-book-notifications .hub-book-top {
  background: linear-gradient(120deg, #46986a 0%, #327451 100%);
}

.hub-pot {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 60px;
  height: 82px;
  flex-shrink: 0;
}

.hub-pot-leaf {
  position: absolute;
  z-index: 1;
  border-radius: 0 100% 0 100%;
}

.hub-pot-leaf.leaf-1 {
  width: 34px;
  height: 34px;
  left: 2px;
  bottom: 34px;
  background: linear-gradient(135deg, #3d9a63 0%, #2a7248 100%);
  transform: rotate(-18deg);
}

.hub-pot-leaf.leaf-2 {
  width: 34px;
  height: 34px;
  right: 2px;
  bottom: 34px;
  background: linear-gradient(135deg, #52b378 0%, #3a9760 100%);
  transform: rotate(18deg) scaleX(-1);
}

.hub-pot-leaf.leaf-3 {
  width: 22px;
  height: 24px;
  left: 19px;
  bottom: 52px;
  background: linear-gradient(135deg, #6bc98d 0%, #4fac72 100%);
  transform: rotate(-2deg);
}

.hub-pot-rim {
  position: relative;
  z-index: 2;
  width: 50px;
  height: 10px;
  margin: 0 auto;
  background: linear-gradient(180deg, #e08a4d 0%, #c96b30 100%);
  border-radius: 6px 6px 0 0;
}

.hub-pot-base {
  position: relative;
  z-index: 2;
  width: 44px;
  height: 30px;
  margin: -2px auto 0;
  background: linear-gradient(165deg, #e07a3f 0%, #b95a28 100%);
  border-radius: 3px 3px 12px 12px;
  box-shadow: 0 3px 5px rgba(20, 15, 50, 0.2);
}

/* --- Explore section --- */
.hub-explore {
  padding: 60px 20px;
  background: var(--color-white);
}

.hub-explore-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.hub-section-title {
  margin-bottom: 34px;
}

.hub-section-title h2 {
  font-family: var(--font-heading);
  color: var(--color-purple-dark);
  font-size: 1.9rem;
  font-weight: 800;
  margin: 0 0 6px;
}

.hub-section-title p {
  color: var(--color-text-muted);
  margin: 0;
}

.hub-card-grid {
  display: grid;
  gap: 22px;
}

.hub-card-grid.primary {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 22px;
}

.hub-card-grid.secondary {
  grid-template-columns: repeat(4, 1fr);
}

.hub-card {
  display: block;
  position: relative;
  border-radius: var(--radius-lg);
  padding: 26px;
  text-decoration: none !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
  min-height: 160px;
}

.hub-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.hub-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--color-white);
  margin-bottom: 16px;
}

.hub-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-purple-dark);
  margin: 0 0 6px;
}

.hub-card p {
  color: var(--color-text-body);
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0 0 30px;
}

.hub-card-arrow {
  position: absolute;
  right: 22px;
  bottom: 22px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  font-size: 0.85rem;
}

.hub-card.active {
  box-shadow: var(--shadow-hover);
  outline: 2px solid var(--color-purple);
  outline-offset: 2px;
}

/* Card color variants */
.hub-card-1 { background: var(--color-purple-bg); }
.hub-card-1 .hub-card-icon, .hub-card-1 .hub-card-arrow { background: var(--color-purple); }

.hub-card-2 { background: var(--color-orange-bg); }
.hub-card-2 .hub-card-icon, .hub-card-2 .hub-card-arrow { background: var(--color-orange); }

.hub-card-3 { background: #e5f6ee; }
.hub-card-3 .hub-card-icon, .hub-card-3 .hub-card-arrow { background: #1f8a5f; }

.hub-card-4 { background: #e8f0fe; }
.hub-card-4 .hub-card-icon, .hub-card-4 .hub-card-arrow { background: #2f6fed; }

.hub-card-5 { background: #fde9ee; }
.hub-card-5 .hub-card-icon, .hub-card-5 .hub-card-arrow { background: #e6416a; }

.hub-card-6 { background: #f1eafd; }
.hub-card-6 .hub-card-icon, .hub-card-6 .hub-card-arrow { background: #7c4fd1; }

.hub-card-7 { background: #eaf7e2; }
.hub-card-7 .hub-card-icon, .hub-card-7 .hub-card-arrow { background: #5b9e2f; }

/* --- Latest Updates --- */
.hub-updates {
  padding: 50px 20px 70px;
  background: var(--color-bg-light);
}

.hub-updates-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.hub-updates-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--color-orange);
  padding-bottom: 12px;
}

.hub-updates-header h2 {
  font-family: var(--font-heading);
  color: var(--color-purple-dark);
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
}

.hub-updates-header a {
  color: var(--color-orange);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none !important;
}

.hub-updates-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.hub-update-item {
  display: flex;
  gap: 16px;
  align-items: center;
  min-width: 0;
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.hub-update-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.hub-update-date {
  flex-shrink: 0;
  width: 54px;
  text-align: center;
  color: var(--color-purple-dark);
}

.hub-update-date .day {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1;
}

.hub-update-date .month {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.hub-update-body {
  flex: 1;
  min-width: 0;
}

.hub-update-body .title {
  color: var(--color-purple-dark);
  font-weight: 700;
  font-size: 0.92rem;
  margin: 0 0 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-update-body .desc {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-update-item i.fa-arrow-right {
  color: var(--color-orange);
  flex-shrink: 0;
}

.hub-updates-empty {
  color: var(--color-text-muted);
  padding: 20px 0;
}

/* --- Responsive --- */
@media (max-width: 992px) {
  .hub-hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hub-hero-subtitle { margin-left: auto; margin-right: auto; }
  .hub-search-bar { margin: 0 auto; }
  .hub-popular-searches { justify-content: center; }
  .hub-illustration { margin-top: 20px; }
  .hub-card-grid.primary,
  .hub-card-grid.secondary {
    grid-template-columns: repeat(2, 1fr);
  }
  .hub-updates-list { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .hub-hero-title { font-size: 2rem; }
  .hub-card-grid.primary,
  .hub-card-grid.secondary {
    grid-template-columns: 1fr;
  }
}
