/* ==========================================================================
   Legion Community landing page
   --------------------------------------------------------------------------
   Styles the markup in community.html, which is the body of one Invision
   Pages page shown inside the suite's own header and footer.

   It builds on what is already installed: the suite skin (legion-suite.css)
   supplies the --ln-* tokens and the look of buttons, rows and badges, and
   the navbar kit supplies the header. This file only lays the page out and
   trims the suite's widgets to fit it. Every rule is scoped to .lnc, so it
   cannot touch another page.

   Sections
     1  Tokens
     2  The top: headline, flock canvas, area links
     3  Section frame and headings
     4  Latest: forum topics and Legion Network News
     5  Forum directory
     6  Take part: clubs, open roles, awards
     7  Join band (guests only)
     8  The suite's widgets inside this page
     9  Phones and tablets
    10  Reduced motion
   ========================================================================== */

/* --------------------------------------------------------------------------
   1  Tokens. The --ln-* values come from the suite skin; the fallbacks are
      its dark values, used only if the skin is ever missing.
   -------------------------------------------------------------------------- */
.lnc {
  --lnc-bg: var(--ln-bg, #06080D);
  --lnc-text: var(--ln-text, #F3F6FB);
  --lnc-text-2: var(--ln-text-2, #A3AEC2);
  --lnc-text-3: var(--ln-text-3, #76829A);
  --lnc-line: var(--ln-line, #212A3B);
  --lnc-line-soft: var(--ln-line-soft, #161C29);
  --lnc-accent: var(--ln-accent, #08D0F8);
  --lnc-mono: var(--ln-mono, "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace);

  /* the flock */
  --lnc-fx-top: #19D6FB;
  --lnc-fx-bottom: #1A66F2;
  --lnc-fx-spark: #FFFFFF;
  --lnc-fx-alpha: 0.5;

  color: var(--lnc-text);
  padding-bottom: clamp(48px, 7vw, 96px);
}
html[data-ips-scheme-active="light"] .lnc,
html[data-ips-scheme="light"] .lnc {
  --lnc-fx-top: #0A8FD0;
  --lnc-fx-bottom: #1450D0;
  --lnc-fx-spark: #081020;
  --lnc-fx-alpha: 0.6;
}
html[data-ips-theme="3"] .lnc,
html[data-ips-theme="3"][data-ips-scheme-active] .lnc {
  --lnc-fx-top: #00F0FF;
  --lnc-fx-bottom: #2A55FF;
  --lnc-fx-spark: #FF4FD0;
  --lnc-fx-alpha: 0.54;
}

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

/* guests and members see different calls to action; the suite marks guests on <html> */
html[data-ips-guest] .lnc .lnc-for-member { display: none; }
html:not([data-ips-guest]) .lnc .lnc-for-guest { display: none; }

/* --------------------------------------------------------------------------
   2  The top
   -------------------------------------------------------------------------- */
.lnc-top {
  position: relative;
  padding-top: clamp(56px, 9vw, 132px);
  text-align: center;
}
.lnc-sky {
  position: absolute;
  top: 0;
  left: var(--lnc-bleed-left, 0px);
  width: var(--lnc-bleed-width, 100%);
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 100%);
}
.lnc--live .lnc-sky { opacity: 1; }

.lnc-hero {
  position: relative;
  z-index: 1;
  max-width: 940px;
  margin-inline: auto;
}
.lnc-kicker {
  margin: 0 0 22px;
  font-family: var(--lnc-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  color: var(--lnc-accent);
}
.lnc-title {
  margin: 0;
  font-size: clamp(2.75rem, 7.4vw, 6.25rem);
  font-weight: 600;
  line-height: 0.96;
  letter-spacing: -0.04em;
  color: var(--lnc-text);
  text-wrap: balance;
}
.lnc-lede {
  max-width: 34em;
  margin: clamp(20px, 2.4vw, 30px) auto 0;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.5;
  color: var(--lnc-text-2);
  text-wrap: pretty;
}
.lnc-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: clamp(26px, 3vw, 38px);
}
.lnc-cta .ipsButton { min-height: 46px; padding-inline: 22px; font-size: 0.9375rem; }

/* the six areas: one line across, each link under its own stretch of the line */
.lnc-doors {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: clamp(64px, 9vw, 128px);
  text-align: start;
}
.lnc-door {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 132px;
  padding: 20px 22px 26px 0;
  border-top: 1px solid var(--lnc-line);
  color: inherit;
  text-decoration: none;
  outline-offset: 4px;
}
.lnc-door__name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--lnc-text);
  transition: color 0.2s ease;
}
.lnc-door__name svg { flex: none; opacity: 0.55; }
.lnc-door__what {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--lnc-text-2);
  text-wrap: pretty;
}
.lnc-door:hover,
.lnc-door:focus-visible { text-decoration: none; }
.lnc-door:hover .lnc-door__name,
.lnc-door:focus-visible .lnc-door__name,
.lnc-door.is-chosen .lnc-door__name { color: var(--lnc-accent); }
/* without the flock (no WebGL, reduced motion, touch) the line itself answers */
.lnc-door:hover,
.lnc-door:focus-visible { border-top-color: var(--lnc-accent); }
.lnc--live .lnc-door.is-chosen { border-top-color: var(--lnc-line); }

/* --------------------------------------------------------------------------
   3  Section frame and headings
   -------------------------------------------------------------------------- */
.lnc-sec { margin-top: clamp(72px, 9vw, 128px); }
.lnc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--lnc-line);
}
.lnc-h2 {
  margin: 0;
  font-size: clamp(1.375rem, 2.2vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--lnc-text);
}
.lnc-more {
  flex: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--lnc-accent);
  text-decoration: none;
  white-space: nowrap;
}
.lnc-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.lnc-more::after { content: "\2192"; margin-inline-start: 6px; }

/* --------------------------------------------------------------------------
   4  Latest
   -------------------------------------------------------------------------- */
.lnc-latest {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

/* --------------------------------------------------------------------------
   5  Forum directory: every forum, one row per category
   -------------------------------------------------------------------------- */
.lnc-dir { margin: 0; padding: 0; list-style: none; }
.lnc-dir__row {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 8px clamp(24px, 4vw, 56px);
  padding: 24px 0;
  border-bottom: 1px solid var(--lnc-line-soft);
}
.lnc-dir__cat {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--lnc-text);
  text-decoration: none;
}
.lnc-dir__cat:hover { color: var(--lnc-accent); text-decoration: none; }
.lnc-dir__forums {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
  padding: 2px 0 0;
  list-style: none;
}
.lnc-dir__forums a {
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--lnc-text-2);
  text-decoration: none;
}
.lnc-dir__forums a:hover { color: var(--lnc-accent); text-decoration: underline; text-underline-offset: 3px; }

/* --------------------------------------------------------------------------
   6  Take part
   -------------------------------------------------------------------------- */
.lnc-part {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

/* --------------------------------------------------------------------------
   7  Join band
   -------------------------------------------------------------------------- */
.lnc-join {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px 48px;
  align-items: center;
  padding-top: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--lnc-line);
}
.lnc-join__title {
  margin: 0;
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--lnc-text);
}
.lnc-join__text {
  max-width: 38em;
  margin: 14px 0 0;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--lnc-text-2);
}
.lnc-join__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.lnc-join__actions .ipsButton { min-height: 46px; padding-inline: 22px; font-size: 0.9375rem; }

/* --------------------------------------------------------------------------
   8  The suite's widgets inside this page.
      Each widget arrives as a boxed panel with its own title. Here the
      section heading above it does that job, so the box and title go and
      the rows sit directly on the page, divided by hairlines.
   -------------------------------------------------------------------------- */
.lnc .lnc-slot .ipsWidget,
.lnc .lnc-slot .ipsBox {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
}
.lnc .lnc-slot .ipsWidget__header { display: none; }
.lnc .lnc-slot .ipsWidget__content { padding: 0; background: none; }
.lnc .lnc-slot i-data { display: block; }
.lnc .lnc-slot .ipsData {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  list-style: none;
}
.lnc .lnc-slot .ipsData__item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 4px 28px;
  margin: 0;
  padding: 22px 0;
  border: 0;
  border-bottom: 1px solid var(--lnc-line-soft);
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.lnc .lnc-slot .ipsData__item::before,
.lnc .lnc-slot .ipsData__item::after { content: none; }
.lnc .lnc-slot .ipsData__content {
  grid-column: 1;
  grid-row: 1;
  display: block;
  min-width: 0;
  padding: 0;
}
.lnc .lnc-slot .ipsData__main { display: block; padding: 0; }

/* pictures sit to the right; a row with no picture is text only */
.lnc .lnc-slot .ipsData__image {
  grid-column: 2;
  grid-row: 1;
  width: 152px;
  height: auto;
  aspect-ratio: 16 / 10;
  margin: 2px 0 0;
  padding: 0;
  border-radius: var(--ln-r-md, 10px);
  overflow: hidden;
  background: var(--ln-elev, #0E121B);
}
.lnc .lnc-slot .ipsData__image:not(:has(img)) { display: none; }
.lnc .lnc-slot .ipsData__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lnc .lnc-slot .ipsData__category {
  margin: 0 0 6px;
  font-family: var(--lnc-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.lnc .lnc-slot .ipsData__category a { position: relative; z-index: 2; color: var(--lnc-text-3); text-decoration: none; }
.lnc .lnc-slot .ipsData__category a:hover { color: var(--lnc-accent); }
.lnc .lnc-slot .ipsData__title { display: block; margin: 0; }
.lnc .lnc-slot .ipsData__title h4,
.lnc .lnc-slot h4.ipsData__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.012em;
  text-wrap: pretty;
}
.lnc .lnc-slot .ipsData__title a { color: var(--lnc-text); text-decoration: none; }
.lnc .lnc-slot .ipsData__item:hover .ipsData__title a { color: var(--lnc-accent); }
.lnc .lnc-slot .ipsData__title .ipsBadges:empty,
.lnc .lnc-slot .ipsData__title .ipsIndicator { display: none; }
.lnc .lnc-slot .ipsData__meta {
  margin: 6px 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--lnc-text-3);
}
.lnc .lnc-slot .ipsData__meta a { color: var(--lnc-text-2); }
.lnc .lnc-slot .ipsData__desc {
  display: none;
  margin: 10px 0 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--lnc-text-2);
}
/* the reply and view counts, and the second copy of the author, are left to the destination page */
.lnc .lnc-slot--topics .ipsData__extra,
.lnc .lnc-slot--news .ipsData__extra,
.lnc .lnc-slot--roles .ipsData__extra { display: none; }

/* topics: the newest one leads */
.lnc .lnc-slot--topics .ipsData__item:first-child { padding-top: 28px; padding-bottom: 28px; }
.lnc .lnc-slot--topics .ipsData__item:first-child .ipsData__image { width: 248px; }
.lnc .lnc-slot--topics .ipsData__item:first-child .ipsData__title h4 {
  font-size: clamp(1.375rem, 2vw, 1.625rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
}
.lnc .lnc-slot--topics .ipsData__item:first-child .ipsData__desc,
.lnc .lnc-slot--news .ipsData__item:first-child .ipsData__desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

/* news: a narrow column, so the first article's picture goes above its title */
.lnc .lnc-slot--news .ipsData__item { grid-template-columns: minmax(0, 1fr); }
.lnc .lnc-slot--news .ipsData__image { display: none; }
.lnc .lnc-slot--news .ipsData__item:first-child .ipsData__image:has(img) {
  display: block;
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  aspect-ratio: 1200 / 630;
  margin: 6px 0 14px;
}
.lnc .lnc-slot--news .ipsData__item:first-child .ipsData__content { grid-row: 2; }

/* clubs: icon, name, kind */
.lnc .lnc-slot--clubs .ipsData__item {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0 16px;
  padding: 16px 0;
}
.lnc .lnc-slot--clubs .ipsData__image,
.lnc .lnc-slot--clubs .ipsData__image:not(:has(img)) {
  display: block;
  grid-column: 1;
  width: 44px;
  aspect-ratio: 1;
  margin: 0;
  border-radius: 50%;
}
.lnc .lnc-slot--clubs .ipsData__image .ipsUserPhoto { display: block; width: 100%; height: 100%; border-radius: 50%; }
.lnc .lnc-slot--clubs .ipsData__content { grid-column: 2; }
/* the line under a club's name ends in its member count, which says little while clubs are new */
.lnc .lnc-slot--clubs .ipsData__meta { display: none; }

/* open roles: a plain list of titles, each one a link */
.lnc .lnc-slot--roles .ipsData__item { grid-template-columns: minmax(0, 1fr); padding: 16px 0; }
.lnc .lnc-slot--roles .ipsData__item .ipsData__title a::after {
  content: "\2192";
  margin-inline-start: 8px;
  color: var(--lnc-text-3);
  transition: margin 0.2s ease, color 0.2s ease;
}
.lnc .lnc-slot--roles .ipsData__item:hover .ipsData__title a::after { margin-inline-start: 12px; color: var(--lnc-accent); }

/* awards: name, phase, closing date, and the suite's own button */
.lnc .lnc-slot--awards .ipsData__item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 16px 0;
}
.lnc .lnc-slot--awards .ipsData__icon { display: none; }
.lnc .lnc-slot--awards .ipsData__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.lnc .lnc-slot--awards .ipsData__extra { grid-column: 2; grid-row: 1; position: relative; z-index: 2; padding: 0; }

/* a widget with nothing to show says so quietly */
.lnc .lnc-slot .ipsEmptyMessage,
.lnc .lnc-slot .ipsWidget__content > p {
  margin: 0;
  padding: 22px 0;
  border-bottom: 1px solid var(--lnc-line-soft);
  font-size: 0.9375rem;
  color: var(--lnc-text-3);
  text-align: start;
}

/* --------------------------------------------------------------------------
   9  Phones and tablets
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .lnc-doors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lnc-door { min-height: 0; }
}
@media (max-width: 900px) {
  .lnc-latest { grid-template-columns: minmax(0, 1fr); }
  .lnc-part { grid-template-columns: minmax(0, 1fr); gap: 56px; }
  .lnc-dir__row { grid-template-columns: minmax(0, 1fr); padding: 20px 0; }
  .lnc-join { grid-template-columns: minmax(0, 1fr); }
  .lnc .lnc-slot--news .ipsData__item:first-child .ipsData__image:has(img) { max-width: 520px; }
}
@media (max-width: 640px) {
  .lnc-top { padding-top: 48px; text-align: start; }
  .lnc-hero { margin-inline: 0; }
  .lnc-lede { margin-inline: 0; }
  .lnc-cta { justify-content: flex-start; }
  .lnc-cta .ipsButton { flex: 1 1 auto; }
  .lnc-doors { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 56px; column-gap: 20px; }
  .lnc-door { padding: 16px 0 20px; }
  .lnc-door__what { font-size: 0.8125rem; }
  .lnc .lnc-slot .ipsData__item { gap: 4px 16px; }
  .lnc .lnc-slot--topics .ipsData__image { width: 96px; }
  .lnc .lnc-slot--topics .ipsData__item:first-child { grid-template-columns: minmax(0, 1fr); }
  .lnc .lnc-slot--topics .ipsData__item:first-child .ipsData__image {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    margin: 0 0 14px;
  }
  .lnc .lnc-slot--topics .ipsData__item:first-child .ipsData__content { grid-row: 2; }
  .lnc-join__actions .ipsButton { flex: 1 1 auto; }
}

/* --------------------------------------------------------------------------
  10  Reduced motion: the script draws one still frame; nothing here moves
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .lnc-sky,
  .lnc-door__name,
  .lnc .lnc-slot--roles .ipsData__item .ipsData__title a::after { transition: none; }
}
