/**
 * BridgeWorks — Annunci di lavoro
 * Allineato a home.css (palette verde salvia / terracotta / avorio).
 * Visitatori: body.home-landing.annunci-page
 * Candidati loggati: body.candidate-tools-page.annunci-page
 */

body.annunci-page {
  --bw-cream: var(--bianco, #fdfaf4);
  --bw-cream-deep: var(--carta, #ede8dc);
  --bw-blossom: var(--terracotta, #b87262);
  --bw-blossom-soft: rgba(184, 114, 98, 0.12);
  --bw-sage: var(--verde-m, #3d7260);
  --bw-sage-deep: var(--verde, #2a5c47);
  --bw-sage-soft: rgba(106, 171, 138, 0.18);
  --bw-ink: var(--nero, #1a1a18);
  --bw-ink-soft: var(--grigio, #6b6b60);
  --bw-white: #ffffff;
  --bw-line: rgba(42, 92, 71, 0.12);
  --bw-shadow-soft: var(--shadow-soft, 0 4px 20px rgba(26, 26, 24, 0.06));
  --bw-shadow-lift: var(--shadow-lift, 0 16px 40px rgba(26, 26, 24, 0.08));
  --bw-radius: var(--radius, 18px);
  --bw-radius-lg: var(--radius-lg, 22px);
  --bw-radius-pill: var(--radius-pill, 999px);
  --bw-ease: var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
  --bw-font: "DM Sans", system-ui, sans-serif;

  background: var(--bw-cream);
  color: var(--bw-ink);
  font-family: var(--bw-font);
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

body.home-landing.annunci-page {
  background: var(--bianco);
}

body.home-landing.annunci-page .annunci-filters,
body.home-landing.annunci-page .annunci-list,
body.home-landing.annunci-page > .container.annunci-container {
  padding-left: var(--home-gutter, 1.25rem);
  padding-right: var(--home-gutter, 1.25rem);
}

body.home-landing.annunci-page .annunci-container {
  max-width: var(--home-content-max, 1240px);
  margin: 0 auto;
  padding-left: 0;
  padding-right: 0;
}

body.home-landing.annunci-page .annunci-hero-inner.container {
  padding-left: 0;
  padding-right: 0;
}

body.annunci-page:not(.home-landing) .annunci-container {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* ——— Hero (visitatori) ——— */
body.home-landing.annunci-page .annunci-hero {
  position: relative;
  overflow: hidden;
  padding: 5.5rem var(--home-gutter, 1.25rem) 3rem;
  background: var(--verde);
  text-align: center;
}

body.home-landing.annunci-page .annunci-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto;
  padding: 0;
}

body.home-landing.annunci-page .annunci-hero-label {
  justify-content: center;
  color: var(--verde-l);
}

body.home-landing.annunci-page .annunci-hero-label::after {
  background: var(--verde-l);
}

body.home-landing.annunci-page .annunci-hero-title {
  font-family: "Playfair Display", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0 0 1rem;
  color: var(--avorio);
}

body.home-landing.annunci-page .annunci-hero-title em {
  font-style: italic;
  color: var(--terracotta-l);
}

body.home-landing.annunci-page .annunci-lead {
  max-width: 38rem;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: rgba(245, 240, 232, 0.72);
  font-weight: 400;
}

/* ——— Alert ——— */
.annunci-alert {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 1.15rem;
  margin: 1.25rem auto;
  background: rgba(184, 114, 98, 0.12);
  border: 1px solid rgba(184, 114, 98, 0.28);
  color: #7a3d32;
  border-radius: var(--bw-radius);
  font-weight: 500;
  font-size: 0.9375rem;
}

.annunci-alert svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* ——— Filtri ——— */
.annunci-filters {
  padding: 2rem 0 0.5rem;
}

body.home-landing.annunci-page .annunci-filters {
  padding-top: 2.25rem;
}

.annunci-form {
  background: var(--bw-white);
  border: 1px solid var(--bw-line);
  border-radius: var(--bw-radius-lg);
  box-shadow: var(--bw-shadow-soft);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 1rem;
  align-items: end;
}

.annunci-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.annunci-field label {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bw-ink-soft);
  margin-bottom: 0.45rem;
}

.annunci-field input,
.annunci-field select {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--bw-ink);
  background: var(--bw-cream-deep);
  border: 1px solid var(--bw-line);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  transition: border-color 0.2s var(--bw-ease), box-shadow 0.2s var(--bw-ease), background 0.2s var(--bw-ease);
}

.annunci-field input::placeholder {
  color: rgba(107, 107, 96, 0.55);
}

.annunci-field input:focus,
.annunci-field select:focus {
  outline: none;
  border-color: var(--verde-l, #6aab8a);
  background: var(--bw-white);
  box-shadow: 0 0 0 3px rgba(106, 171, 138, 0.18);
}

.annunci-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b6b60' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.95rem center;
  padding-right: 2.4rem;
}

.annunci-input-wrap {
  position: relative;
}

.annunci-input-wrap .annunci-input-icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--bw-sage);
  pointer-events: none;
}

.annunci-field--search input {
  padding-left: 2.6rem;
}

.annunci-actions-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.25rem;
}

/* ——— Bottoni ——— */
.annunci-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.78rem 1.4rem;
  border-radius: var(--bw-radius-pill);
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--bw-ease), background 0.2s var(--bw-ease),
              color 0.2s var(--bw-ease), border-color 0.2s var(--bw-ease);
}

.annunci-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.annunci-btn--primary {
  background: var(--verde, var(--bw-sage-deep));
  color: var(--avorio, #f5f0e8);
  border-color: var(--verde, var(--bw-sage-deep));
}

.annunci-btn--primary:hover {
  background: var(--verde-m, var(--bw-sage));
  border-color: var(--verde-m, var(--bw-sage));
  transform: translateY(-1px);
}

.annunci-btn--ghost {
  background: transparent;
  color: var(--bw-ink);
  border-color: var(--bw-line);
}

.annunci-btn--ghost:hover {
  background: var(--bw-cream-deep);
  border-color: var(--bw-sage);
  color: var(--bw-sage-deep);
}

.annunci-btn--apply {
  flex: 1;
  background: var(--terracotta, var(--bw-blossom));
  color: #fff;
  border-color: var(--terracotta, var(--bw-blossom));
}

.annunci-btn--apply:hover {
  background: var(--terracotta-l, #d49282);
  border-color: var(--terracotta-l, #d49282);
  transform: translateY(-1px);
}

.annunci-btn--apply svg {
  transition: transform 0.2s var(--bw-ease);
}

.annunci-btn--apply:hover svg {
  transform: translateX(3px);
}

.annunci-btn--save {
  background: var(--bw-white);
  color: var(--bw-ink-soft);
  border-color: var(--bw-line);
}

.annunci-btn--save:hover {
  color: var(--bw-blossom);
  border-color: var(--bw-blossom);
  background: var(--bw-blossom-soft);
}

/* ——— Lista ——— */
.annunci-list {
  padding: 1.75rem 0 4rem;
}

body.home-landing.annunci-page .annunci-list {
  padding-bottom: 2rem;
}

.annunci-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
  background: var(--bw-white);
  border: 1px solid var(--bw-line);
  border-radius: var(--bw-radius-pill);
  box-shadow: var(--bw-shadow-soft);
}

.annunci-count {
  color: var(--bw-ink-soft);
  font-size: 0.9375rem;
  font-weight: 500;
}

.annunci-count strong {
  display: inline-block;
  background: var(--bw-sage-soft);
  color: var(--bw-sage-deep);
  padding: 0.18rem 0.6rem;
  border-radius: var(--bw-radius-pill);
  margin-right: 0.45rem;
  font-weight: 700;
}

.annunci-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.35rem;
}

/* ——— Card ——— */
.annunci-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bw-white);
  border: 1px solid var(--bw-line);
  border-radius: var(--bw-radius-lg);
  box-shadow: var(--bw-shadow-soft);
  transition: transform 0.28s var(--bw-ease), box-shadow 0.28s var(--bw-ease), border-color 0.28s var(--bw-ease);
  overflow: hidden;
}

body.annunci-page:not(.candidate-tools-page) .annunci-card.tools-card .tools-card-top {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem 1.5rem 0;
  background: transparent;
  border-bottom: none;
}

body.annunci-page:not(.candidate-tools-page) .annunci-card.tools-card .tools-card-body {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  border-left: none;
}

body.annunci-page:not(.candidate-tools-page) .annunci-card.tools-card .tools-card-meta h3 {
  color: var(--bw-ink);
  font-family: "Playfair Display", serif;
  font-weight: 700;
}

body.annunci-page:not(.candidate-tools-page) .annunci-card.tools-card .tools-card-tagline {
  color: var(--bw-ink-soft);
}

body.annunci-page:not(.candidate-tools-page) .annunci-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(120deg, var(--verde-m, #3d7260) 0%, var(--verde-l, #6aab8a) 55%, var(--terracotta-l, #d49282) 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--bw-ease);
}

.annunci-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--bw-shadow-lift);
  border-color: rgba(42, 92, 71, 0.2);
}

.annunci-card:hover::before {
  transform: scaleX(1);
}

.annunci-card-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

body.annunci-page:not(.candidate-tools-page) .annunci-card.tools-card .annunci-card-head {
  margin-bottom: 0;
  width: 100%;
}

.annunci-logo {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(106, 171, 138, 0.12);
  color: var(--bw-sage-deep);
  border-radius: 14px;
  overflow: hidden;
}

.annunci-logo svg {
  width: 24px;
  height: 24px;
}

.annunci-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.annunci-card-title {
  flex: 1;
  min-width: 0;
}

.annunci-card-title h3 {
  margin: 0 0 0.3rem;
  font-family: "Playfair Display", serif;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--bw-ink);
}

.annunci-company {
  font-size: 0.9375rem;
  color: var(--bw-ink-soft);
  font-weight: 500;
}

.annunci-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.annunci-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--bw-ink-soft);
  font-weight: 400;
}

.annunci-meta-item svg {
  width: 16px;
  height: 16px;
  color: var(--bw-sage);
  flex-shrink: 0;
}

.annunci-description {
  color: var(--bw-ink-soft);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0 0 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.annunci-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.15rem;
}

.annunci-tag {
  display: inline-block;
  padding: 0.32rem 0.75rem;
  background: rgba(106, 171, 138, 0.14);
  color: var(--bw-sage-deep);
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--bw-radius-pill);
}

.annunci-tag--more {
  background: var(--bw-cream-deep);
  color: var(--bw-ink-soft);
}

.annunci-card-actions {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
  margin-top: auto;
}

.annunci-card-actions .annunci-btn--save {
  flex-shrink: 0;
  padding: 0.78rem 1rem;
}

.annunci-card-actions .annunci-btn--save span {
  display: none;
}

/* ——— Empty ——— */
.annunci-empty {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--bw-white);
  border: 1px dashed var(--bw-line);
  border-radius: var(--bw-radius-lg);
}

.annunci-empty-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bw-sage-soft);
  color: var(--bw-sage-deep);
}

.annunci-empty-icon svg {
  width: 34px;
  height: 34px;
}

.annunci-empty h3 {
  font-family: "Playfair Display", serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--bw-ink);
}

.annunci-empty p {
  color: var(--bw-ink-soft);
  max-width: 460px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
  font-size: 0.9375rem;
}

/* ——— Responsive ——— */
@media (max-width: 900px) {
  .annunci-form {
    grid-template-columns: 1fr 1fr;
  }

  .annunci-field--search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  body.home-landing.annunci-page .annunci-hero {
    padding: 5rem var(--home-inset, 1.25rem) 2.5rem;
  }

  .annunci-form {
    grid-template-columns: 1fr;
    padding: 1.25rem;
  }

  .annunci-actions-row {
    flex-direction: column;
  }

  .annunci-actions-row .annunci-btn {
    width: 100%;
  }

  .annunci-stats {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    border-radius: var(--bw-radius);
    padding: 1rem;
  }

  .annunci-grid {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }

  body.annunci-page:not(.candidate-tools-page) .annunci-card.tools-card .tools-card-top {
    padding: 1.25rem 1.25rem 0;
  }

  body.annunci-page:not(.candidate-tools-page) .annunci-card.tools-card .tools-card-body {
    padding: 0 1.25rem 1.25rem;
  }

  .annunci-card-actions .annunci-btn--apply {
    flex: 1 1 100%;
  }

  .annunci-card-actions .annunci-btn--save {
    flex: 1 1 100%;
    padding: 0.7rem 1rem;
  }

  .annunci-card-actions .annunci-btn--save span {
    display: inline;
  }
}

@media (prefers-reduced-motion: reduce) {
  .annunci-card,
  .annunci-card::before,
  .annunci-btn,
  .annunci-btn--apply svg {
    transition: none !important;
  }
}
