/*
  Boating Hub page — Figma node 18626:19487. Two new reusable pieces:

  1. .content-filter — the white/grey overlap panel that replaces the
     Product Selector on this page (css/style.css's .product-selector is
     a link grid; this is a single-select filter with a Clear action, so
     it gets its own generic component rather than overloading that one).
     Sits in the same .section-transition overlay slot the Product
     Selector uses on Insurance (css/section-transition.css) — same wave
     + overlap mechanics, different content.

  2. .article-grid / .article-card — the 3-column article listing below
     the hero. Generic names (not "boating-hub-*") since any future
     listing page (e.g. a filtered Magazine or Claims Philosophy index)
     can reuse both pieces as-is.
*/

/* ---- Content filter (hero/section-transition overlap panel) ---- */

.content-filter {
  padding-inline: var(--page-gutter);
}

.content-filter__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3xl); /* 32px */
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 30px var(--space-2xl);
  box-sizing: border-box;
  background: var(--colour-grey-101);
  border: 1px solid var(--colour-light-grey);
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.content-filter__heading {
  margin: 0;
  font-family: var(--font-primary);
  font-weight: 600;
  /* Fluid 24px (mobile) → 36px (desktop) — same ramp as .product-selector__heading. */
  font-size: clamp(24px, 18.74px + 1.348vw, 36px);
  line-height: clamp(30px, 23.42px + 1.685vw, 45px);
  text-align: center;
  color: var(--colour-header-grey);
}

.content-filter__heading-accent {
  color: #14849d;
}

.content-filter__tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-l); /* 16px */
  list-style: none;
  margin: 0;
  padding: 0;
}

.content-filter__tile {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  padding: var(--space-m) var(--space-xl) var(--space-m) var(--space-m);
  background: var(--colour-white);
  border: none;
  border-radius: 4px;
  font-family: var(--font-primary);
  cursor: pointer;
}

.content-filter__tile:hover,
.content-filter__tile:focus-visible {
  background: var(--colour-grey-200);
}

.content-filter__tile:focus-visible {
  outline: 2px solid var(--colour-brand-teal);
  outline-offset: 2px;
}

/* Selected state — mirrors the tab/accordion active treatment used
   elsewhere on the site (solid brand teal, white text). */
.content-filter__tile.is-active {
  background: var(--colour-brand-teal);
}

.content-filter__tile.is-active:hover,
.content-filter__tile.is-active:focus-visible {
  background: var(--colour-brand-teal);
}

.content-filter__tile.is-active .content-filter__tile-label {
  color: var(--colour-white);
}

.content-filter__tile.is-active .content-filter__tile-icon {
  background-color: var(--colour-white);
}

.content-filter__tile-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--space-s);
  background-color: rgba(0, 0, 0, 0.02);
}

/* Category glyph painted via mask so a single asset can recolour between
   the default teal and the selected state's white — same technique as
   the breadcrumb separator in css/page-hero.css. */
.content-filter__tile-icon {
  position: relative;
}

.content-filter__tile-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background-color: var(--colour-brand-teal);
  mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
}

.content-filter__tile.is-active .content-filter__tile-icon::before {
  background-color: var(--colour-brand-teal);
}

/* One modifier per category glyph — a relative url() inside a custom
   property set from inline HTML resolves against the STYLESHEET that
   reads it (this file, one level down in css/), not the HTML document
   that declared it, so the mask source has to live here rather than
   travel in via a --tile-icon custom property. */
.content-filter__tile-icon--learn::before {
  mask-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj4KICA8cGF0aCBkPSJNNCAxOS4yQTIuMiAyLjIgMCAwIDEgNi4yIDE3SDIwIi8+CiAgPHBhdGggZD0iTTYuMiAzSDIwdjE4SDYuMkEyLjIgMi4yIDAgMCAxIDQgMTguOFY1LjJBMi4yIDIuMiAwIDAgMSA2LjIgM3oiLz4KPC9zdmc+Cg==');
  -webkit-mask-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj4KICA8cGF0aCBkPSJNNCAxOS4yQTIuMiAyLjIgMCAwIDEgNi4yIDE3SDIwIi8+CiAgPHBhdGggZD0iTTYuMiAzSDIwdjE4SDYuMkEyLjIgMi4yIDAgMCAxIDQgMTguOFY1LjJBMi4yIDIuMiAwIDAgMSA2LjIgM3oiLz4KPC9zdmc+Cg==');
}

.content-filter__tile-icon--explore::before {
  mask-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4LjUiLz4KICA8cGF0aCBkPSJtMTUuNiA4LjQtMi4zIDUuMy01LjMgMi4zIDIuMy01LjN6Ii8+Cjwvc3ZnPgo=');
  -webkit-mask-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4LjUiLz4KICA8cGF0aCBkPSJtMTUuNiA4LjQtMi4zIDUuMy01LjMgMi4zIDIuMy01LjN6Ii8+Cjwvc3ZnPgo=');
}

.content-filter__tile-icon--magazine::before {
  mask-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj4KICA8cmVjdCB4PSIzLjUiIHk9IjQiIHdpZHRoPSIxNyIgaGVpZ2h0PSIxNiIgcng9IjIiLz4KICA8cGF0aCBkPSJNNyA4LjVoNi41Ii8+CiAgPHBhdGggZD0iTTcgMTJoMTAiLz4KICA8cGF0aCBkPSJNNyAxNS41aDEwIi8+Cjwvc3ZnPgo=');
  -webkit-mask-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj4KICA8cmVjdCB4PSIzLjUiIHk9IjQiIHdpZHRoPSIxNyIgaGVpZ2h0PSIxNiIgcng9IjIiLz4KICA8cGF0aCBkPSJNNyA4LjVoNi41Ii8+CiAgPHBhdGggZD0iTTcgMTJoMTAiLz4KICA8cGF0aCBkPSJNNyAxNS41aDEwIi8+Cjwvc3ZnPgo=');
}

.content-filter__tile-label {
  font-weight: 600;
  font-size: 18px;
  line-height: 25.2px;
  color: var(--colour-header-grey);
  white-space: nowrap;
}

/* Clear action — distinct grey fill/no icon-box treatment, matches Figma's
   "Clear Filter" tile exactly (own colour, no teal accent). Disabled
   until a filter is actually selected. */
.content-filter__clear {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  height: 72px;
  padding: var(--space-m) var(--space-xl);
  background: var(--colour-grey-200);
  border: none;
  border-radius: 4px;
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 18px;
  line-height: 25.2px;
  color: var(--colour-header-grey);
  cursor: pointer;
}

.content-filter__clear:disabled {
  color: var(--colour-mid-grey);
  cursor: default;
}

.content-filter__clear-icon {
  width: 12px;
  height: 12px;
  background-color: var(--colour-mid-grey);
  mask: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjEuNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj4KICA8cGF0aCBkPSJNMyA5LjVhOSA5IDAgMSAxIDEuNjQgNy4zNiIvPgogIDxwYXRoIGQ9Ik0zIDQuNXY1aDUiLz4KPC9zdmc+Cg==') center / contain no-repeat;
  -webkit-mask: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjEuNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj4KICA8cGF0aCBkPSJNMyA5LjVhOSA5IDAgMSAxIDEuNjQgNy4zNiIvPgogIDxwYXRoIGQ9Ik0zIDQuNXY1aDUiLz4KPC9zdmc+Cg==') center / contain no-repeat;
}

@media (max-width: 767px) {
  .content-filter__panel {
    gap: var(--space-2xl);
    padding: var(--space-2xl) var(--space-l);
    border-radius: var(--space-s);
  }

  .content-filter__tiles {
    width: 100%;
  }

  .content-filter__tile,
  .content-filter__clear {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* ---- Article grid ---- */

.article-grid {
  background: var(--colour-grey-101);
      padding-top: var(--space-section-xxs);
    padding-bottom: var(--space-section-s);
}

.article-grid__inner {
  /* Shared container pattern (see css/variables.css) — matches
     .card-grid__inner, the exact container the Related Articles section
     uses for these same .article-card cards. Was `max-width: 1280px` with
     no padding, which is the CONTENT width with no gutter added on top of
     it — below 1280px the cards sat flush (or near-flush) against the
     viewport edges. --page-container-outer already bakes the gutter into
     the max-width, so the CONTENT box still resolves to exactly 1280px on
     desktop (unchanged) while gaining the same side gutter as Related
     Articles at every width below it. */
  max-width: var(--page-container-outer);
  padding-inline: var(--page-gutter);
  margin: 0 auto;
  box-sizing: border-box;
}

.article-grid__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2xl); /* 24px, matches Figma's own row/column gap */
  list-style: none;
  margin: 0;
  padding: 0;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--colour-white);
  border: 1px solid var(--colour-grey-200);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
}

.article-card__image {
  aspect-ratio: 411 / 230;
  overflow: hidden;
}

.article-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl); /* 24px */
  padding: var(--space-5xl) var(--space-4xl); /* 42px 40px */
}

.article-card__meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-s); /* 8px */
}

.article-card__date {
  margin: 0;
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 16px;
  line-height: 19.2px;
  color: #117a90; /* Figma's own value — distinct from --colour-brand-teal, same convention as css/home.css */
}

.article-card__title {
  margin: 0;
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 24px;
  line-height: 28.8px;
  color: var(--colour-header-grey);
}

.article-card__excerpt {
  margin: 0;
  font-family: var(--font-secondary);
  font-weight: 400;
  font-size: 16px;
  line-height: 25.6px;
  color: var(--colour-body-grey);
}

.article-card__divider {
  border: none;
  border-top: 1px solid var(--colour-grey-200);
  margin: 0;
  width: 100%;
}

.article-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.article-card__tag {
  padding: var(--space-2xs) var(--space-m); /* 4px 12px */
  background: var(--colour-grey-101);
  border-radius: var(--space-2xs);
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 14px;
  line-height: 19.5px;
  letter-spacing: 0.42px;
  color: var(--colour-mid-grey);
}

.article-grid__cta {
  display: flex;
  justify-content: center;
  margin-top: var(--space-4xl); /* 40px */
}

@media (max-width: 1023px) {
  .article-grid__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .article-grid {
    padding-block: var(--space-section-xxs); /* 64px */
  }

  .article-grid__list {
    grid-template-columns: 1fr;
  }

  .article-card__body {
    padding: var(--space-3xl) var(--space-2xl); /* 32px 24px */
  }
}
