/* ======================================================
   NIPIOGNOSI – TOOLS / ROLES PREMIUM FINAL
   Brand colors + Dark mode + RTL + WCAG
====================================================== */

:root {
  --nipio-ocean: #00506a;
  --nipio-midnight: #00394e;
  --nipio-amber: #fcd250;
  --nipio-gold: #e8b346;
  --nipio-teal: #82cfcd;
  --nipio-deep-teal: #48b5b4;

  --roles-bg: #f4fbfb;
  --roles-surface: #ffffff;
  --roles-text: #00394e;
  --roles-muted: #475569;
  --roles-border: rgba(0, 80, 106, 0.16);
  --roles-shadow: 0 18px 50px rgba(0, 57, 78, 0.10);
  --roles-shadow-hover: 0 28px 80px rgba(0, 57, 78, 0.18);
}

html.dark,
body.dark,
html[data-theme="dark"],
body[data-theme="dark"],
.nipiognosi-dark,
.dark-mode {
  --roles-bg: #061f2a;
  --roles-surface: #0b3342;
  --roles-text: #f8fafc;
  --roles-muted: #d6e2e8;
  --roles-border: rgba(130, 207, 205, 0.26);
  --roles-shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
  --roles-shadow-hover: 0 28px 90px rgba(0, 0, 0, 0.46);
}

/* Full page/background fix */
body:has(.nipio-roles) {
  background: var(--roles-bg) !important;
}

body:has(.nipio-roles) .site,
body:has(.nipio-roles) #page,
body:has(.nipio-roles) #content,
body:has(.nipio-roles) .site-content,
body:has(.nipio-roles) .entry-content,
body:has(.nipio-roles) .elementor,
body:has(.nipio-roles) .elementor-section,
body:has(.nipio-roles) .elementor-container,
body:has(.nipio-roles) .elementor-widget-wrap,
body:has(.nipio-roles) .elementor-widget-container {
  background: var(--roles-bg) !important;
}

/* ======================================================
   SECTION
====================================================== */

.nipio-roles {
  padding: 100px 0 130px;
  background:
    radial-gradient(circle at top center, rgba(130, 207, 205, 0.14), transparent 38%),
    var(--roles-bg);
  color: var(--roles-text);
}

/* ======================================================
   GRID
====================================================== */

.nipio-roles-grid {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;

  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;

  list-style: none;
}

/* ======================================================
   CARD
====================================================== */

.nipio-role-card {
  background: var(--roles-surface);
  border-radius: 24px;
  padding: 28px 22px 24px;

  border: 1px solid var(--roles-border);
  box-shadow: var(--roles-shadow);

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  min-height: 310px;

  transition: transform 0.25s ease,
              box-shadow 0.25s ease,
              border-color 0.25s ease;
}

.nipio-role-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--roles-shadow-hover);
  border-color: var(--nipio-teal);
}

.nipio-role-card:focus-within {
  border-color: var(--nipio-teal);
  box-shadow: 0 0 0 3px rgba(130, 207, 205, 0.24), var(--roles-shadow);
}

/* ======================================================
   ICON
====================================================== */

.nipio-role-icon {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--nipio-ocean), var(--nipio-deep-teal));

  display: flex;
  align-items: center;
  justify-content: center;

  margin: 0 auto 16px;
}

.nipio-role-icon svg {
  width: 26px;
  height: 26px;
  fill: #ffffff;
  stroke: #ffffff;
}

/* ======================================================
   CONTENT
====================================================== */

.nipio-role-content {
  text-align: center;
}

.nipio-role-content h3 {
  font-size: 16px;
  font-weight: 750;
  margin-bottom: 8px;
  color: var(--roles-text);
}

.nipio-role-desc {
  font-size: 14px;
  color: var(--roles-muted);
  margin-bottom: 12px;
  line-height: 1.55;
}

/* ======================================================
   BULLETS
====================================================== */

.nipio-role-content ul {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  text-align: left;
}

.nipio-role-content li {
  font-size: 13px;
  color: var(--roles-muted);
  margin-bottom: 6px;
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}

.nipio-role-content li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--nipio-amber);
}

/* ======================================================
   BUTTON
====================================================== */

.nipio-role-btn {
  margin-top: auto;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;

  background: linear-gradient(135deg, var(--nipio-ocean), var(--nipio-deep-teal));
  color: #ffffff;
  text-decoration: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  transition: transform 0.2s ease,
              box-shadow 0.2s ease,
              filter 0.2s ease;
}

.nipio-role-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow: 0 14px 34px rgba(0, 80, 106, 0.28);
}

.nipio-role-btn:focus-visible {
  outline: 3px solid var(--nipio-amber);
  outline-offset: 3px;
}

/* ======================================================
   RTL SUPPORT
====================================================== */

[dir="rtl"] .nipio-roles {
  direction: rtl;
}

[dir="rtl"] .nipio-role-content {
  text-align: right;
}

[dir="rtl"] .nipio-role-content ul {
  text-align: right;
}

[dir="rtl"] .nipio-role-content li {
  padding-left: 0;
  padding-right: 14px;
}

[dir="rtl"] .nipio-role-content li::before {
  left: auto;
  right: 0;
}

/* ======================================================
   I18N SAFE
====================================================== */

.nipio-roles,
.nipio-roles * {
  overflow-wrap: anywhere;
}

/* ======================================================
   RESPONSIVE
====================================================== */

@media (max-width: 1200px) {
  .nipio-roles-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .nipio-roles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .nipio-roles {
    padding: 80px 0 100px;
  }

  .nipio-roles-grid {
    grid-template-columns: 1fr;
    padding: 0 18px;
  }
}

/* ======================================================
   REDUCED MOTION
====================================================== */

@media (prefers-reduced-motion: reduce) {
  .nipio-role-card,
  .nipio-role-btn {
    transition: none !important;
  }

  .nipio-role-card:hover,
  .nipio-role-btn:hover {
    transform: none !important;
  }
}