/* ==========================================================================
   MILEX — CATEGORY DETAIL (template T3)
   A stack of alternating content blocks: a light grey band holding a fixed
   image column on the left and title / paragraph / chips / CTA on the right.

   Pages using this template load tokens → base → components → this file.
   They must NOT load home.css or category.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Block stack
   -------------------------------------------------------------------------- */

.s-blocks { padding-bottom: var(--space-section); }

.s-blocks__list {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* --------------------------------------------------------------------------
   2. Block
   -------------------------------------------------------------------------- */

.c-block {
  display: grid;
  grid-template-columns: 410px 1fr;
  column-gap: 72px;
  align-items: start;
  padding: 36px;
  background: var(--paper-grey);
}

/* The slot, not the photograph, sets the size — every block image is the same
   4:3 box whatever the source file's proportions are. */
.c-block__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.c-block__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.c-block__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.c-block__title {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 700;
  line-height: var(--lh);
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--ink);
}

.c-block__text {
  margin-top: 18px;
  max-width: 700px;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   3. Chips
   -------------------------------------------------------------------------- */

.c-block__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

/* Chips are controls rather than running text, so they opt out of the
   universal 1.7 line-height — at 1.7 they stand 55px tall against the
   reference's 44px. */
.c-chip {
  display: inline-block;
  padding: 14px 22px;
  background: var(--milex-blue-100);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.2;
  transition: background var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
}

.c-chip:hover,
.c-chip:focus-visible {
  background: var(--milex-blue);
  color: var(--paper);
}

/* A chip whose model page has not been built yet. The renderer emits it as a
   <span>, not an <a>, so it is already unclickable and out of the tab order —
   these rules only make that visible and cancel the link affordance. The range
   on offer still reads correctly; it simply cannot lead to a 404. */
.c-chip[data-pending] {
  opacity: .75;
  cursor: default;
}

.c-chip[data-pending]:hover {
  background: var(--milex-blue-100);
  color: var(--ink);
}

.c-block__cta { margin-top: 32px; }

/* Same treatment as a pending chip, applied to the VIŠE button. The renderer
   emits a <span>, so it is already unclickable and out of the tab order; these
   rules cancel the hover affordance and mark it visually. */
.c-btn[data-pending] {
  opacity: .75;
  cursor: default;
}

.c-btn[data-pending]:hover { background: var(--milex-blue); }

/* --------------------------------------------------------------------------
   4. Unknown category
   -------------------------------------------------------------------------- */

.c-notfound {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
  padding: 48px 36px;
  background: var(--paper-grey);
}

.c-notfound p { max-width: 60ch; }

/* --------------------------------------------------------------------------
   5. No-JavaScript fallback
   The blocks are JS-rendered, so this carries the category name and the
   sub-routes for crawlers and scriptless visitors.
   -------------------------------------------------------------------------- */

.c-nojs {
  padding: 40px var(--gutter);
  background: var(--paper-grey);
}

.c-nojs h1 {
  font-family: var(--font-display);
  font-size: var(--fs-h1-page-fluid);
  margin-bottom: 12px;
}

.c-nojs ul {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 16px;
  list-style: none;
}

.c-nojs a {
  font-weight: 600;
  color: var(--milex-blue);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   6. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1119px) {
  .c-block {
    grid-template-columns: 340px 1fr;
    column-gap: 48px;
  }
}

/* Stack: image on top at full band width, text beneath. */
@media (max-width: 991px) {
  .c-block {
    grid-template-columns: 1fr;
    row-gap: 28px;
    padding: 24px;
  }

  .c-block__media { aspect-ratio: 16 / 9; }

  .s-blocks__list { gap: 36px; }
}

@media (max-width: 767px) {
  .c-block__title { font-size: 18px; }

  /* Two even columns so long chip labels stop shrinking to ragged widths. */
  .c-block__chips {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .c-chip {
    text-align: center;
    padding: 13px 12px;
    font-size: 14px;
  }

  .c-block__cta { width: 100%; }
}

@media (max-width: 479px) {
  .c-block { padding: 20px; }
  .c-block__chips { grid-template-columns: 1fr; }
}
