/* =========================================================
   LIMBEST – Knowledge page styles
   ========================================================= */

.c-red { color: var(--red); }
.c-blue { color: var(--blue); }

/* =========================================================
   Hero (light photo, dark text) + search box
   ========================================================= */
.k-hero {
  position: relative;
  display: flex;
  align-items: center;
  height: clamp(480px, 40vw, 560px);
  margin-top: calc(var(--header-h) * -1);
  padding-top: var(--header-h);
  overflow: hidden;
  background: #eef0f3 url("../images/knowledge-hero-bg.jpg") center / cover no-repeat;
}
/* White fade on the left so the dark text stays readable – adjust .9 / .7 if needed */
.k-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, .9) 0%, rgba(255, 255, 255, .7) 45%, rgba(255, 255, 255, 0) 80%);
}
.k-hero__inner { position: relative; z-index: 1; width: 100%; }
.k-hero__content { max-width: 680px; }
.k-hero__label { font-size: 13px; letter-spacing: 1px; line-height: 1.6; text-transform: uppercase; color: var(--red); }
.k-hero__rule { display: block; width: 48px; height: 2px; margin: 10px 0 24px; background: var(--red); }
.k-hero h1 { text-transform: uppercase; }
.k-hero__text { max-width: 520px; margin-top: 18px; color: var(--navy); }

.k-search {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 640px;
  margin-top: 28px;
  padding: 8px 8px 8px 18px;
  background: var(--white);
  border: 1px solid #c9ced6;
  border-radius: 3px;
  box-shadow: 0 6px 20px rgba(20, 36, 58, .1);
}
.k-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(38, 63, 123, .18); }
.k-search__icon {
  flex: none;
  width: 26px;
  height: 26px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555B64' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='7'/%3E%3Cpath d='M16 16l5 5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.k-search input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--navy);
}
.k-search input::placeholder { color: var(--muted, #687487); }
.k-search .btn { flex: none; border: 0; cursor: pointer; font-family: inherit; }

/* =========================================================
   Shared bits
   ========================================================= */
.k-section { padding: var(--space-normal) 0 0; }
.k-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .5px;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--red);
}
.k-title { font-size: 32px; line-height: 1.2; text-transform: uppercase; }
.k-sub { margin-top: 8px; font-size: 15px; }
.k-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.k-tag {
  display: inline-block;
  padding: 3px 8px;
  background: #f9dcdc;
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  line-height: 1.4;
  text-transform: uppercase;
}
.k-arrow {
  flex: none;
  width: 32px;
  height: 32px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23263F7B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='16' cy='16' r='14'/%3E%3Cpath d='M9 16h13M17 11l5 5-5 5'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .2s ease;
}

/* =========================================================
   Search results
   ========================================================= */
.k-results { padding: calc(var(--space-normal) * .8) 0 var(--space-main); scroll-margin-top: calc(var(--header-h) + 8px); }
.k-clear {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--blue);
  text-decoration: underline;
  cursor: pointer;
}
.k-results .k-grid { margin-top: 24px; }
.k-empty { margin-top: 24px; font-size: 16px; }
.k-empty a { color: var(--blue); text-decoration: underline; }

/* =========================================================
   Browse by Category
   ========================================================= */
.k-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); margin-top: 32px; }
.k-cat { display: block; border-bottom: 6px solid var(--red); transition: transform .2s ease, box-shadow .2s ease; }
.k-cat:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(20, 36, 58, .12); }
.k-cat:hover .k-arrow,
.k-card:hover .k-arrow { transform: translateX(3px); }
.k-cat img { width: 100%; aspect-ratio: 10 / 7; object-fit: cover; background: var(--white); }
.k-cat__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 18px; }
.k-cat h3 { font-size: 18px; line-height: 1.3; }
.k-cat p { margin: 14px 0 22px; font-size: 14px; line-height: 1.7; }

/* =========================================================
   Featured article
   ========================================================= */
.k-feature { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center; margin-top: 24px; }
.k-feature img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--white); }
.k-feature h3 { margin: 14px 0 12px; font-size: 28px; line-height: 1.3; color: var(--blue); }
.k-feature p { margin-bottom: 22px; font-size: 15px; line-height: 1.65; }

/* =========================================================
   Latest articles (also used by search results)
   ========================================================= */
.k-more { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--blue); }
.k-more::before {
  content: "";
  width: 20px;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='10' fill='%23263F7B'/%3E%3Cpath d='M8 6l4 4-4 4' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.k-more:hover { text-decoration: underline; }

.k-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px var(--gap); }
.k-latest .k-grid { margin-top: 24px; }
.k-card { display: block; border-bottom: 6px solid var(--red); transition: transform .2s ease, box-shadow .2s ease; }
.k-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(20, 36, 58, .12); }
.k-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--white); }
.k-card__body { padding: 14px 12px 18px; }
.k-card__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.k-card h3 { font-size: 19px; line-height: 1.3; color: var(--blue); }

/* =========================================================
   FAQ (native <details>: no JavaScript needed)
   ========================================================= */
.k-faq { padding: var(--space-main) 0; }
.faq { max-width: 940px; margin: 32px auto 0; }
.faq-item { border-bottom: 1px solid #555B64; }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
  list-style: none;
  cursor: pointer;
  font-size: 17px;
  line-height: 1.4;
  color: #3a4048;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.faq-item summary::after {
  content: "";
  flex: none;
  width: 32px;
  height: 32px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%233B4856' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='16' cy='16' r='14'/%3E%3Cpath d='M10 16h12M16 10v12'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* Opened question turns red (brand colour) */
.faq-item[open] summary { font-weight: 600; color: var(--red); }
.faq-item[open] summary::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%233B4856' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='16' cy='16' r='14'/%3E%3Cpath d='M10 16h12'/%3E%3C/svg%3E");
}
.faq-answer { padding: 0 56px 26px 0; font-size: 15px; line-height: 1.7; }
.faq-answer p + p { margin-top: 14px; }
.faq-answer a { color: var(--blue); text-decoration: underline; }

/* =========================================================
   Responsive – Tablet (900px)
   ========================================================= */
@media (max-width: 900px) {
  .k-hero { height: auto; display: block; padding-top: calc(var(--header-h) + 48px); padding-bottom: 56px; }
  .k-hero::before { background: rgba(255, 255, 255, .78); }

  .k-title { font-size: 28px; }
  .k-cats { grid-template-columns: repeat(2, 1fr); gap: 32px var(--gap); }
  .k-feature { grid-template-columns: 1fr; gap: 24px; }
  .k-feature h3 { font-size: 24px; }
  .k-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================
   Responsive – Mobile (600px)
   ========================================================= */
@media (max-width: 600px) {
  .k-hero { padding-top: calc(var(--header-h) + 32px); padding-bottom: 44px; }
  .k-hero h1 { font-size: 28px; }
  .k-search { gap: 8px; padding: 6px 6px 6px 12px; }
  .k-search__icon { width: 22px; height: 22px; }
  .k-search input { height: 42px; font-size: 14px; }
  .k-search .btn { padding-left: 16px; padding-right: 16px; }

  .k-section { padding-top: 44px; }
  .k-title { font-size: 24px; }
  .k-cats { grid-template-columns: 1fr; gap: 28px; margin-top: 24px; }
  .k-grid { grid-template-columns: 1fr; }
  .k-feature h3 { font-size: 22px; }

  .k-faq { padding: 44px 0 60px; }
  .faq-item summary { padding: 18px 0; font-size: 15px; }
  .faq-item summary::after { width: 28px; height: 28px; }
  .faq-answer { padding-right: 0; font-size: 14px; }
}
/* =========================================================
   Swiss grid – Knowledge page (desktop only)
   12 columns, gutter = var(--gutter)
   ========================================================= */
@media (min-width: 901px) {

  /* ---- Hero: content cols 1-8, text 6 cols, search 7 cols ---- */
  .k-hero__inner {
    container-type: inline-size;
    --w: 100cqw;
    --col: calc((var(--w) - 11 * var(--gutter)) / 12);
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
  }
  .k-hero__content { grid-column: 1 / 9; max-width: none; }
  .k-hero__text {
    max-width: none;
    width: calc(var(--col) * 6 + var(--gutter) * 5);
  }
  .k-search {
    max-width: none;
    width: calc(var(--col) * 7 + var(--gutter) * 6);
  }

  /* ---- Browse by Category: title cols 1-6, subtitle cols 7-12, cards 3 cols each ---- */
  .k-browse > .container {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
    align-items: end;
  }
  .k-browse .k-title { grid-column: 1 / 7; grid-row: 1; }
  .k-browse .k-sub   { grid-column: 7 / 13; grid-row: 1; margin-top: 0; }
  .k-browse .k-cats  { grid-column: 1 / -1; grid-row: 2; column-gap: var(--gutter); }

  /* ---- Featured article: image cols 1-6, text cols 8-12 (col 7 empty) ---- */
  .k-feature {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
  }
  .k-feature > img      { grid-column: 1 / 7;  grid-row: 1; }
  .k-feature > :not(img){ grid-column: 8 / 13; grid-row: 1; }

  /* ---- Latest articles: 3 cards x 4 cols ---- */
  .k-grid { column-gap: var(--gutter); }

  /* ---- FAQ: title cols 1-4, questions cols 5-12, left aligned ---- */
  .k-faq > .container {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
    align-items: start;
  }
  .k-faq .k-title { grid-column: 1 / 5;  grid-row: 1; text-wrap: balance; }
  .k-faq .faq     { grid-column: 5 / 13; grid-row: 1; max-width: none; margin: 0; }
}