/*
 * Homepage redesign (v1.2).
 * Direction-agnostic: only logical properties, works for RTL Persian and LTR English.
 */

.idsc-home {
  padding-bottom: 3rem;
  color: var(--h-ink);
}

/* ---------- Hero ---------- */
.idsc-h-hero {
  position: relative;
  padding-block: 1.25rem 0;
  background:
    radial-gradient(900px 420px at 85% -10%, rgb(86 72 216 / 0.1), transparent 70%),
    radial-gradient(700px 380px at 0% 30%, rgb(210 166 63 / 0.1), transparent 70%);
}

@media (min-width: 64rem) {
  .idsc-h-hero {
    padding-block-start: 1.75rem;
  }
}

.idsc-h-announce {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.6rem;
  padding-inline-start: 0.6rem;
  border: 1px solid var(--h-line);
  border-radius: 16px;
  background: rgb(255 255 255 / 0.85);
  box-shadow: var(--h-shadow);
  backdrop-filter: blur(8px);
}

.idsc-h-announce__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  padding: 0.35rem 0.7rem;
  border-radius: 10px;
  background: #fff4dc;
  color: #8a5a00;
  font-size: 0.75rem;
  font-weight: 900;
}

.idsc-h-announce__pulse {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #e0a21b;
  box-shadow: 0 0 0 0 rgb(224 162 27 / 0.6);
  animation: idsc-h-pulse 2s infinite;
}

@keyframes idsc-h-pulse {
  70% { box-shadow: 0 0 0 8px rgb(224 162 27 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(224 162 27 / 0); }
}

.idsc-h-announce__text {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--h-ink);
  font-size: 0.88rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.idsc-h-announce__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  background: var(--h-soft);
  color: var(--h-primary);
  font-size: 0.82rem;
  font-weight: 800;
}

@media (max-width: 47.99rem) {
  .idsc-h-announce {
    flex-wrap: wrap;
  }

  .idsc-h-announce__text {
    flex-basis: 100%;
    order: 3;
    white-space: normal;
  }
}

.idsc-h-hero__grid {
  display: grid;
  gap: 2.25rem;
  align-items: center;
  padding-block: 2.25rem 0.5rem;
}

@media (min-width: 64rem) {
  .idsc-h-hero__grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 3.5rem;
    padding-block-start: 3rem;
  }
}

.idsc-h-eyebrow {
  margin: 0 0 1rem;
  color: var(--h-secondary);
  font-size: 0.9rem;
  font-weight: 800;
}

.idsc-h-hero__title {
  margin: 0;
  max-width: 18ch;
  color: var(--h-ink);
  font-size: clamp(2.1rem, 4.4vw, 3.6rem);
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

html[lang="en"] .idsc-h-hero__title {
  max-width: 15ch;
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.idsc-h-hero__lead {
  max-width: 38rem;
  margin: 1.25rem 0 0;
  color: var(--h-muted);
  font-size: clamp(1rem, 1.3vw, 1.12rem);
  line-height: 1.9;
}

html[lang="en"] .idsc-h-hero__lead {
  line-height: 1.65;
}

.idsc-h-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.idsc-h-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 2.25rem 0 0;
  border: 1px solid var(--h-line);
  border-radius: 20px;
  background: rgb(255 255 255 / 0.8);
  overflow: hidden;
}

@media (min-width: 40rem) {
  .idsc-h-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.idsc-h-stats__item {
  padding: 0.95rem 1rem;
  border-inline-end: 1px solid var(--h-line);
  border-block-end: 1px solid var(--h-line);
}

@media (min-width: 40rem) {
  .idsc-h-stats__item {
    border-block-end: 0;
  }

  .idsc-h-stats__item:last-child {
    border-inline-end: 0;
  }
}

@media (max-width: 39.99rem) {
  .idsc-h-stats__item:nth-child(2n) {
    border-inline-end: 0;
  }

  .idsc-h-stats__item:nth-last-child(-n + 2) {
    border-block-end: 0;
  }
}

.idsc-h-stats dt {
  color: var(--h-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.idsc-h-stats dd {
  margin: 0.25rem 0 0;
  color: var(--h-primary);
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 900;
  line-height: 1.1;
}

.idsc-h-stats dd span {
  margin-inline-start: 0.1rem;
  color: var(--h-gold);
  font-size: 0.8em;
}

.idsc-h-hero__media {
  min-width: 0;
}

/* ---------- Services ---------- */
.idsc-h-services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.idsc-h-service {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  height: 100%;
  padding: 1rem 1.1rem;
  border: 1px solid var(--h-line);
  border-radius: 20px;
  background: var(--h-surface);
  box-shadow: var(--h-shadow);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.idsc-h-service:hover {
  border-color: rgb(86 72 216 / 0.4);
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgb(19 32 92 / 0.1);
}

.idsc-h-service__icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, rgb(35 57 157 / 0.08), rgb(210 166 63 / 0.16));
  color: var(--h-primary);
}

.idsc-h-service__icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.idsc-h-service__body {
  display: grid;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}

.idsc-h-service__title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--h-ink);
  font-size: 0.98rem;
  font-weight: 900;
}

.idsc-h-service__badge {
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: #fff1f2;
  color: #be123c;
  font-size: 0.68rem;
  font-weight: 800;
}

.idsc-h-service__desc {
  color: var(--h-muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

.idsc-h-service__go {
  color: #b6bfdd;
  transition: color 0.2s ease;
}

.idsc-h-service:hover .idsc-h-service__go {
  color: var(--h-secondary);
}

/* ---------- News hub ---------- */
.idsc-h-news__grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 64rem) {
  .idsc-h-news__grid {
    grid-template-columns: minmax(0, 2.15fr) minmax(0, 1fr);
    align-items: start;
  }
}

.idsc-h-news__main {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 48rem) {
  .idsc-h-news__main {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: start;
  }
}

.idsc-h-feature {
  overflow: hidden;
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius);
  background: var(--h-surface);
  box-shadow: var(--h-shadow);
}

.idsc-h-feature__media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--h-soft);
}

.idsc-h-feature__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.idsc-h-feature:hover .idsc-h-feature__media img {
  transform: scale(1.03);
}

.idsc-h-feature__body {
  display: grid;
  gap: 0.75rem;
  justify-items: start;
  padding: 1.25rem 1.35rem 1.4rem;
}

.idsc-h-feature__title {
  margin: 0;
  font-size: clamp(1.15rem, 1.7vw, 1.4rem);
  font-weight: 900;
  line-height: 1.55;
}

html[lang="en"] .idsc-h-feature__title {
  line-height: 1.3;
}

.idsc-h-feature__title a:hover,
.idsc-h-list__title a:hover {
  color: var(--h-secondary);
}

.idsc-h-feature__excerpt {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--h-muted);
  font-size: 0.9rem;
  line-height: 1.85;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.idsc-h-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.idsc-h-list__item {
  display: grid;
  grid-template-columns: 6.25rem minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
  padding: 0.7rem;
  border: 1px solid var(--h-line);
  border-radius: 18px;
  background: var(--h-surface);
}

.idsc-h-list__thumb {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: var(--h-soft);
}

.idsc-h-list__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.idsc-h-list__body {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.idsc-h-list__badge {
  color: var(--h-secondary);
  font-size: 0.72rem;
  font-weight: 800;
}

.idsc-h-list__title {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.6;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

html[lang="en"] .idsc-h-list__title {
  line-height: 1.4;
}

.idsc-h-events {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius);
  background: linear-gradient(180deg, #fff, var(--h-soft));
  box-shadow: var(--h-shadow);
}

.idsc-h-events__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.idsc-h-events__head h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 900;
}

.idsc-h-events__head a {
  color: var(--h-secondary);
  font-size: 0.82rem;
  font-weight: 800;
}

.idsc-h-events__list {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.idsc-h-event {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  padding: 0.6rem;
  border-radius: 16px;
  background: var(--h-surface);
  border: 1px solid var(--h-line);
  transition: border-color 0.2s ease;
}

.idsc-h-event:hover {
  border-color: rgb(86 72 216 / 0.4);
}

.idsc-h-event__date {
  display: grid;
  place-items: center;
  align-content: center;
  width: 3.6rem;
  height: 3.8rem;
  flex-shrink: 0;
  border-radius: 14px;
  background: linear-gradient(160deg, var(--h-primary), var(--h-secondary));
  color: #fff;
  line-height: 1.1;
}

.idsc-h-event__date strong {
  font-size: 1.35rem;
  font-weight: 900;
}

.idsc-h-event__date span {
  font-size: 0.7rem;
  font-weight: 700;
  opacity: 0.85;
}

.idsc-h-event__body {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.idsc-h-event__title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.55;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.idsc-h-event__place {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--h-muted);
  font-size: 0.75rem;
}

.idsc-h-events__empty {
  margin: 0;
  padding: 1.5rem 0.5rem;
  color: var(--h-muted);
  font-size: 0.88rem;
  text-align: center;
}

.idsc-h-events__cta {
  width: 100%;
}

/* ---------- Membership band ---------- */
.idsc-h-member__shell {
  position: relative;
  display: grid;
  gap: 2rem;
  overflow: hidden;
  padding: 2rem 1.5rem;
  border-radius: 32px;
  background:
    radial-gradient(600px 300px at 100% 0%, rgb(255 217 141 / 0.18), transparent 70%),
    linear-gradient(135deg, #131f6b 0%, #23399d 55%, #4b3fc4 100%);
  color: #fff;
  box-shadow: 0 30px 70px rgb(19 31 107 / 0.25);
}

@media (min-width: 64rem) {
  .idsc-h-member__shell {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: 3rem;
    padding: 3rem;
  }
}

.idsc-h-member__title {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  font-weight: 900;
  line-height: 1.35;
}

html[lang="en"] .idsc-h-member__title {
  line-height: 1.15;
}

.idsc-h-member__lead {
  margin: 1rem 0 0;
  color: rgb(255 255 255 / 0.78);
  line-height: 1.9;
}

.idsc-h-member__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.idsc-h-member__benefits {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 40rem) {
  .idsc-h-member__benefits {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.idsc-h-benefit {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 18px;
  background: rgb(255 255 255 / 0.07);
}

.idsc-h-benefit__icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgb(255 217 141 / 0.16);
  color: #ffd98d;
}

.idsc-h-benefit__icon svg {
  width: 1.3rem;
  height: 1.3rem;
}

.idsc-h-benefit strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 900;
}

.idsc-h-benefit > span:last-child > span {
  display: block;
  margin-top: 0.25rem;
  color: rgb(255 255 255 / 0.7);
  font-size: 0.82rem;
  line-height: 1.7;
}

/* ---------- EXCIDA ---------- */
.idsc-h-excida__shell {
  display: grid;
  gap: 1.5rem;
  padding: 1.75rem;
  border: 1px solid #f1e3bf;
  border-radius: var(--h-radius);
  background: linear-gradient(135deg, #fffaf0, #ffffff 60%);
  box-shadow: var(--h-shadow);
}

@media (min-width: 64rem) {
  .idsc-h-excida__shell.has-banner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    padding: 2.25rem;
  }
}

.idsc-h-excida__text {
  max-width: 40rem;
  margin: 0.6rem 0 0;
  color: var(--h-muted);
  line-height: 1.85;
}

.idsc-h-excida__list {
  display: grid;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.idsc-h-excida__list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--h-line);
  border-radius: 14px;
  background: #fff;
}

.idsc-h-excida__list a:hover {
  border-color: var(--h-gold);
}

.idsc-h-excida__item-title {
  font-size: 0.9rem;
  font-weight: 800;
}

.idsc-h-excida__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.idsc-h-excida__banner img {
  width: 100%;
  border-radius: 18px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* ---------- Existing sections harmonised with the new rhythm ---------- */
.idsc-home > .idsc-home-ad-slot {
  margin-top: 3rem;
}

.idsc-home > section.pt-14,
.idsc-home > section.pt-10 {
  padding-top: 4rem;
}

/* Committees & associations: horizontal carousels with arrow controls. */
.idsc-home .idsc-specialty-strip {
  scroll-snap-type: x mandatory;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
  padding-inline: 4px;
}

.idsc-home .idsc-specialty-card {
  flex: 0 0 168px;
}

.idsc-strip-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.idsc-strip-nav__btn {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--h-line);
  border-radius: 10px;
  background: #fff;
  color: var(--h-primary);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.idsc-strip-nav__btn:hover {
  border-color: var(--h-secondary);
  background: var(--h-soft);
}

.idsc-strip-nav__btn svg {
  width: 1rem;
  height: 1rem;
}

.idsc-strip-nav__btn.is-prev svg {
  transform: scaleX(-1);
}

[dir="rtl"] .idsc-strip-nav__btn.is-prev svg {
  transform: none;
}

.idsc-strip-nav__btn[disabled] {
  opacity: 0.35;
  cursor: default;
}

/* Logged-in dashboard snapshot keeps its own design; give it the same spacing. */
.idsc-home > section.pt-6 {
  padding-top: 3.25rem;
}

/* Mixed-direction titles should align with the page, not their own script. */
.idsc-h-feature__title[dir="auto"],
.idsc-h-list__title[dir="auto"],
.idsc-h-event__title[dir="auto"],
.idsc-h-feature__excerpt[dir="auto"] {
  text-align: start;
}

/* ---------- Signed-in member box ---------- */
.idsc-h-member__user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.idsc-h-member__user img {
  width: 4rem;
  height: 4rem;
  border: 3px solid rgb(255 255 255 / 0.25);
  border-radius: 50%;
  object-fit: cover;
  background: rgb(255 255 255 / 0.1);
}

.idsc-h-member__note {
  margin: 1rem 0 0;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.1);
  color: #ffe2a8;
  font-size: 0.8rem;
}

.idsc-h-member__tiles {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 40rem) {
  .idsc-h-member__tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.idsc-h-tile {
  display: grid;
  gap: 0.3rem;
  height: 100%;
  padding: 1rem;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 18px;
  background: rgb(255 255 255 / 0.07);
  color: #fff;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.idsc-h-tile:hover {
  border-color: rgb(255 217 141 / 0.5);
  background: rgb(255 255 255 / 0.12);
}

.idsc-h-tile__label {
  margin-top: 0.35rem;
  color: rgb(255 255 255 / 0.7);
  font-size: 0.78rem;
  font-weight: 700;
}

.idsc-h-tile__value {
  font-size: 1.15rem;
  font-weight: 900;
}

.idsc-h-tile.is-good .idsc-h-tile__value {
  color: #86efac;
}

.idsc-h-tile.is-warn .idsc-h-tile__value {
  color: #fcd34d;
}

.idsc-h-tile.is-accent .idsc-h-tile__value {
  color: #ffd98d;
}

.idsc-h-tile__meta {
  color: rgb(255 255 255 / 0.66);
  font-size: 0.78rem;
  line-height: 1.6;
}

.idsc-h-tile__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.35rem;
  color: #ffd98d;
  font-size: 0.8rem;
  font-weight: 800;
}

/* Long English association names need a third line. */
html[lang="en"] .idsc-home .idsc-specialty-card__title {
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

html[lang="en"] .idsc-home .idsc-specialty-card {
  flex-basis: 184px;
}
