/* ==========================================================================
   C&C SRL High-Tech — settori.css
   Sector archive (/settori/) and single sector (/settori/<slug>/).

   Loaded after base.css, which owns the design tokens. Never hardcode a hex
   value here — always use the --cc-* custom properties.

   Contents
     1. Sector hero          .cc-settore-hero*
     2. Sticky tab bar       .cc-tabs, .cc-tabs__inner, .cc-tab
     3. Product grid         .cc-products, .cc-product*
     4. Sector cards         .cc-sectors, .cc-sector-card*  (archive grid;
                             the same component the homepage renders, see
                             CONTRACT §4 "Sector cards (home.css + settori.css)")
     5. Merceologici index   .cc-merceologici, .cc-merceologici__item,
                             .cc-merceologici__link, __group, __group-title,
                             __count, __current
     5b. Processi industriali .cc-processes, .cc-processes__item/__name/__text
     5c. Secondary sector    .cc-settore-back*, .cc-settore-intro,
                             .cc-settore-clients*
     6. Body / empty states  .cc-settore-content, .cc-settore-empty
     7. Responsive           1100px · 900px · 640px
   ========================================================================== */


/* ==========================================================================
   1. SECTOR HERO
   ========================================================================== */

.cc-settore-hero{
  position: relative;
  overflow: hidden;
  background: var(--cc-navy);
  color: var(--cc-on-navy-soft);
}

/* The giant outlined sector number, top right. Decorative, aria-hidden. */
.cc-settore-hero__num{
  position: absolute;
  top: -.06em;
  right: -.08em;
  z-index: 0;
  font-family: var(--cc-font-display);
  font-weight: 700;
  font-size: clamp(120px, 20vw, 220px);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--cc-navy-line);
  opacity: .55;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

@supports ((-webkit-text-stroke: 1px currentColor) or (text-stroke: 1px currentColor)){
  .cc-settore-hero__num{
    color: transparent;
    -webkit-text-stroke: 1px var(--cc-navy-line);
    opacity: .9;
  }
}

/* Faint yellow blueprint grid. */
.cc-settore-hero__grid{
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(252, 211, 77, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(252, 211, 77, .06) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}

.cc-settore-hero__inner{
  position: relative;
  z-index: 1;
  padding-top: 70px;
  padding-bottom: 56px;
}

.cc-settore-hero__eyebrow{
  margin: 0 0 18px;
  font-family: var(--cc-font-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cc-yellow);
}

.cc-settore-hero__title{
  margin: 0 0 18px;
  font-family: var(--cc-font-display);
  font-weight: 700;
  font-size: clamp(32px, 5.4vw, 60px);
  line-height: 1.02;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--cc-surface);
}

.cc-settore-hero__rule{
  display: block;
  width: 110px;
  height: 4px;
  margin: 0 0 22px;
  background: var(--cc-yellow);
}

.cc-settore-hero__text{
  max-width: 640px;
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--cc-on-navy-soft);
}

.cc-settore-hero__text > p{
  margin: 0 0 12px;
}

.cc-settore-hero__text > p:last-child{
  margin-bottom: 0;
}

.cc-settore-hero__text a{
  color: var(--cc-yellow);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cc-settore-hero__text a:hover,
.cc-settore-hero__text a:focus-visible{
  color: var(--cc-surface);
}


/* ==========================================================================
   2. STICKY TAB BAR
   Sits directly under the sticky header, hence top: var(--cc-header-h).
   The header uses z-index 50, so the bar stays just below it.
   ========================================================================== */

.cc-tabs{
  position: sticky;
  top: var(--cc-header-h);
  z-index: 40;
  background: var(--cc-surface);
  border-bottom: 1px solid var(--cc-border);
}

.cc-tabs__inner{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
}

.cc-tab{
  display: inline-flex;
  align-items: center;
  padding: 15px 13px;
  font-family: var(--cc-font-display);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: .8px;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--cc-text-muted);
  box-shadow: inset 0 -3px 0 transparent;
  transition:
    color .25s var(--cc-ease),
    box-shadow .25s var(--cc-ease);
}

.cc-tab:hover,
.cc-tab:focus-visible{
  color: var(--cc-navy);
  box-shadow: inset 0 -3px 0 var(--cc-border-str);
}

.cc-tab.is-active{
  color: var(--cc-navy);
  box-shadow: inset 0 -3px 0 var(--cc-yellow);
}

.cc-tab.is-active:hover,
.cc-tab.is-active:focus-visible{
  color: var(--cc-navy);
  box-shadow: inset 0 -3px 0 var(--cc-yellow);
}


/* ==========================================================================
   3. PRODUCT GRID
   ========================================================================== */

.cc-products{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.cc-product{
  display: flex;
  flex-direction: column;
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  transition:
    transform .3s var(--cc-ease),
    box-shadow .3s var(--cc-ease),
    border-color .3s var(--cc-ease);
}

.cc-product:hover{
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(14, 34, 64, .12);
  border-color: var(--cc-border-str);
}

.cc-product__media{
  display: block;
  height: 190px;
  background-color: var(--cc-border);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.cc-product__body{
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
}

.cc-product__label{
  font-family: var(--cc-font-display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--cc-navy);
}

.cc-product__tag{
  font-family: var(--cc-font-mono);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--cc-orange);
}


/* ==========================================================================
   4. SECTOR CARDS (archive grid — same component as the homepage)
   ========================================================================== */

.cc-sectors{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.cc-sector-card{
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  color: var(--cc-navy);
  transition:
    transform .3s var(--cc-ease),
    box-shadow .3s var(--cc-ease),
    border-color .3s var(--cc-ease);
}

.cc-sector-card:hover,
.cc-sector-card:focus-visible{
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(14, 34, 64, .12);
  border-color: var(--cc-navy);
  color: var(--cc-navy);
}

.cc-sector-card__media{
  display: block;
  height: 190px;
  background-color: var(--cc-border);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transition: transform .6s var(--cc-ease);
}

.cc-sector-card:hover .cc-sector-card__media,
.cc-sector-card:focus-visible .cc-sector-card__media{
  transform: scale(1.05);
}

.cc-sector-card__body{
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
}

.cc-sector-card__num{
  font-family: var(--cc-font-mono);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 1.5px;
  color: var(--cc-orange);
}

.cc-sector-card__row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cc-sector-card__name{
  font-family: var(--cc-font-display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--cc-navy);
}

.cc-sector-card__arrow{
  flex: none;
  font-size: 18px;
  line-height: 1;
  color: var(--cc-orange);
  transition: transform .25s var(--cc-ease);
}

.cc-sector-card__text{
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
  color: var(--cc-text-muted);
}

.cc-sector-card:hover .cc-sector-card__arrow,
.cc-sector-card:focus-visible .cc-sector-card__arrow{
  transform: translateX(4px);
}


/* ==========================================================================
   5. MERCEOLOGICI INDEX
   The 34 settori merceologici of the company profile. Thirty-four photo cards
   would be a wall, so each entry is a label cell on a hairline grid.
   Entries that map to a published ccsrl_settore post are links and carry the
   yellow left rule; the others are plain text.

   The hairlines are drawn by the cells (right + bottom) and closed by the
   container (top + left) rather than by a 1px gap over a filled background:
   34 entries never fill the last row, and a gap-based grid would paint the
   two leftover tracks as a grey slab.
   ========================================================================== */

.cc-merceologici{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--cc-border);
  border-left: 1px solid var(--cc-border);
}

.cc-merceologici__item{
  display: flex;
  background: var(--cc-surface);
  border-right: 1px solid var(--cc-border);
  border-bottom: 1px solid var(--cc-border);
}

/* One padded box per cell — a link or a plain span — so rows keep an even
   height and a link is clickable across its whole cell. */
.cc-merceologici__item > a,
.cc-merceologici__item > span{
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-height: 62px;
  padding: 14px 16px;
  font-family: var(--cc-font-display);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: .6px;
  text-transform: uppercase;
  overflow-wrap: break-word;
  color: var(--cc-text-muted);
}

.cc-merceologici__link{
  position: relative;
  color: var(--cc-navy);
  box-shadow: inset 3px 0 0 var(--cc-yellow);
  transition:
    background-color .25s var(--cc-ease),
    box-shadow .25s var(--cc-ease),
    color .25s var(--cc-ease);
}

.cc-merceologici__link:hover,
.cc-merceologici__link:focus-visible{
  background: var(--cc-bg);
  box-shadow: inset 5px 0 0 var(--cc-orange);
  color: var(--cc-navy);
}

/* The cells touch, so the default outset focus ring would be overlapped by
   the neighbouring cell: draw it inside and lift the cell above its siblings. */
.cc-merceologici__link:focus-visible{
  z-index: 1;
  outline-offset: -2px;
}

/* Two groups, industries and services, each with a small label heading. */
.cc-merceologici__group + .cc-merceologici__group{
  margin-top: 44px;
}

.cc-merceologici__group-title{
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-family: var(--cc-font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cc-orange);
}

.cc-merceologici__count{
  padding: 2px 8px;
  border: 1px solid var(--cc-border);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--cc-text-muted);
}

/* The sector being viewed, on its own page: marked, not a link. */
.cc-merceologici__item > .cc-merceologici__current{
  background: var(--cc-navy);
  color: var(--cc-surface);
  box-shadow: inset 3px 0 0 var(--cc-yellow);
}


/* ==========================================================================
   5b. PROCESSI INDUSTRIALI  (V1 p.7-9, on /settori/ under the index)
   Hairline cards like the index cells, closed by the container.
   ========================================================================== */

.cc-processes{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--cc-border);
  border-left: 1px solid var(--cc-border);
}

.cc-processes__item{
  padding: 22px 22px 24px;
  background: var(--cc-surface);
  border-right: 1px solid var(--cc-border);
  border-bottom: 1px solid var(--cc-border);
}

.cc-processes__name{
  margin: 0 0 8px;
  font-family: var(--cc-font-display);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  letter-spacing: .5px;
  text-transform: uppercase;
  overflow-wrap: break-word;
  color: var(--cc-navy);
}

.cc-processes__text{
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--cc-text-muted);
}


/* ==========================================================================
   5c. SECONDARY SECTOR PAGE
   No tab bar (it lists the main sectors): a slim bar back to the index; the
   sector's own text, when there is one, and the clients of the profile.
   ========================================================================== */

.cc-settore-back{
  background: var(--cc-surface);
  border-bottom: 1px solid var(--cc-border);
}

.cc-settore-back__link{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  font-family: var(--cc-font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--cc-navy);
}

.cc-settore-back__link::before{
  content: "\2190";
  color: var(--cc-orange);
}

.cc-settore-back__link:hover,
.cc-settore-back__link:focus-visible{
  color: var(--cc-orange);
}

.cc-settore-intro{
  max-width: 760px;
  margin: 0 0 40px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--cc-text);
}

.cc-settore-intro:last-child{
  margin-bottom: 0;
}

.cc-settore-clients{
  margin-top: 8px;
}

.cc-settore-body .cc-products + .cc-settore-clients,
.cc-settore-content + .cc-settore-clients{
  margin-top: 48px;
}

.cc-settore-clients__title{
  margin: 0 0 16px;
  font-family: var(--cc-font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cc-orange);
}

.cc-settore-clients__list{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cc-settore-clients__list li{
  padding-left: 14px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--cc-text);
  box-shadow: inset 3px 0 0 var(--cc-yellow);
}


/* ==========================================================================
   6. BODY COPY / EMPTY STATE
   ========================================================================== */

.cc-settore-content{
  max-width: 760px;
  margin: 48px 0 0;
  font-size: 16px;
  line-height: 1.75;
  color: var(--cc-text-muted);
}

.cc-settore-content > *:first-child{
  margin-top: 0;
}

.cc-settore-content > *:last-child{
  margin-bottom: 0;
}

.cc-settore-empty{
  margin: 0;
  font-size: 16px;
  color: var(--cc-text-muted);
}


/* ==========================================================================
   7. RESPONSIVE
   ========================================================================== */

@media (max-width: 1100px){

  .cc-settore-hero__inner{
    padding-top: 56px;
    padding-bottom: 44px;
  }

  .cc-settore-hero__text{ font-size: 17px; }

  .cc-tab{
    padding: 14px 10px;
    font-size: 14px;
    letter-spacing: .5px;
  }

  .cc-products,
  .cc-sectors{ gap: 18px; }

  .cc-product__media{ height: 170px; }
  .cc-sector-card__media{ height: 180px; }

  .cc-merceologici{ grid-template-columns: repeat(3, 1fr); }

  .cc-processes{ grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px){

  .cc-settore-hero__inner{
    padding-top: 48px;
    padding-bottom: 40px;
  }

  .cc-settore-hero__rule{ margin-bottom: 18px; }

  /* The tab bar scrolls horizontally instead of wrapping. */
  .cc-tabs__inner{
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .cc-tabs__inner::-webkit-scrollbar{
    width: 0;
    height: 0;
    display: none;
  }

  .cc-tab{
    flex: none;
    scroll-snap-align: center;
    padding: 14px 12px;
  }

  .cc-products,
  .cc-sectors{
    grid-template-columns: repeat(2, 1fr);
  }

  .cc-product__label{ font-size: 18px; }
  .cc-sector-card__name{ font-size: 18px; }

  .cc-merceologici{ grid-template-columns: repeat(2, 1fr); }

  .cc-settore-content{ margin-top: 36px; }
}

@media (max-width: 640px){

  .cc-settore-hero__num{ right: -.12em; }

  .cc-settore-hero__inner{
    padding-top: 40px;
    padding-bottom: 34px;
  }

  .cc-settore-hero__eyebrow{
    margin-bottom: 14px;
    font-size: 11px;
    letter-spacing: 2px;
  }

  .cc-settore-hero__text{ font-size: 16px; }

  .cc-tab{
    padding: 13px 11px;
    font-size: 13px;
  }

  .cc-products,
  .cc-sectors{
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .cc-product__media{ height: 200px; }
  .cc-sector-card__media{ height: 200px; }

  .cc-product__body{ padding: 14px 16px; }
  .cc-sector-card__body{ padding: 16px; }

  .cc-merceologici{ grid-template-columns: 1fr; }

  .cc-merceologici__item > a,
  .cc-merceologici__item > span{
    min-height: 54px;
    padding: 13px 14px;
    font-size: 12.5px;
  }

  .cc-processes{ grid-template-columns: 1fr; }

  .cc-processes__item{ padding: 18px 16px 20px; }

  .cc-settore-intro{
    margin-bottom: 28px;
    font-size: 16px;
  }

  .cc-settore-clients__list{ grid-template-columns: 1fr; }

  .cc-settore-content{
    margin-top: 28px;
    font-size: 15px;
  }
}
