/* ============================================================
   FEES PAGE — tuition table + calculator
   ============================================================ */

body[data-page="fees"] .fees-hero {
  padding-block: clamp(2.25rem, 4.5vw, 3.5rem) !important;
}
body[data-page="fees"] .fees-hero h1 {
  color: var(--brand-navy-deep) !important;
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 4vw, 3.2rem);
  max-width: 22ch;
  line-height: 1.1;
}
body[data-page="fees"] .fees-hero .lede {
  margin-top: 0.85rem;
  max-width: 52ch;
  color: rgba(0, 0, 0, 0.72);
  line-height: 1.6;
}

body[data-page="fees"] .fees-section {
  padding-block: clamp(1.25rem, 3vw, 2rem) clamp(1.5rem, 3vw, 2.5rem) !important;
}

body[data-page="fees"] .fees-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: start;
}

/* Main content panel */
body[data-page="fees"] .fees-panel {
  display: grid;
  gap: 1.25rem;
}
body[data-page="fees"] .fees-panel__block {
  padding: clamp(1.35rem, 2.5vw, 1.85rem);
  border-radius: 16px;
  background: linear-gradient(165deg, #0B1730 0%, #162447 58%, #1a2f55 100%);
  border: 1px solid rgba(201, 168, 76, 0.34);
  box-shadow:
    0 18px 42px rgba(11, 23, 48, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
body[data-page="fees"] .fees-panel__title {
  margin: 0 0 1rem;
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  font-weight: 600;
  color: #c9ab65 !important;
  letter-spacing: -0.01em;
}
body[data-page="fees"] .fees-panel__block h3 {
  margin: 0 0 0.85rem;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: #ffffff !important;
}
body[data-page="fees"] .fees-panel__block p,
body[data-page="fees"] .fees-panel__block li {
  color: rgba(255, 255, 255, 0.82) !important;
  line-height: 1.65;
}
body[data-page="fees"] .fees-panel__block .list-clean {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
body[data-page="fees"] .fees-panel__block .list-clean li {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(201, 168, 76, 0.16);
}
body[data-page="fees"] .fees-panel__block .list-clean strong {
  color: #e9ddb8 !important;
  font-weight: 600;
}

/* Tuition table */
body[data-page="fees"] .fees-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
  border: 1px solid rgba(201, 168, 76, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
body[data-page="fees"] .fee-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}
body[data-page="fees"] .fee-table thead th {
  padding: 0.95rem 1.1rem;
  text-align: start;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0B1730 !important;
  background: linear-gradient(180deg, #e9ddb8 0%, #c9ab65 100%) !important;
  border-bottom: 1px solid rgba(11, 23, 48, 0.12);
}
body[data-page="fees"] .fee-table tbody td {
  padding: 0.9rem 1.1rem;
  text-align: start;
  color: rgba(255, 255, 255, 0.88) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent !important;
  transition: background 0.2s ease, color 0.2s ease;
}
body[data-page="fees"] .fee-table tbody tr:hover td {
  background: rgba(201, 168, 76, 0.1) !important;
  color: #ffffff !important;
}
body[data-page="fees"] .fee-table tbody tr:last-child td {
  border-bottom: 0;
}
body[data-page="fees"] .fee-table tbody td:first-child {
  color: #e9ddb8 !important;
  font-weight: 600;
}
body[data-page="fees"] .fee-table tbody td:last-child {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #ffffff !important;
}

/* Calculator */
body[data-page="fees"] .fees-aside {
  position: sticky;
  top: calc(var(--header-h, 72px) + 1rem);
}
body[data-page="fees"] .fee-calc {
  position: relative;
  overflow: hidden;
  padding: clamp(1.35rem, 2.5vw, 1.75rem);
  border-radius: 18px;
  display: grid;
  gap: 1rem;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(201, 168, 76, 0.18), transparent 55%),
    linear-gradient(165deg, #0B1730 0%, #14213D 52%, #1f3a73 100%);
  border: 1px solid rgba(201, 168, 76, 0.38);
  box-shadow:
    0 22px 48px rgba(11, 23, 48, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
body[data-page="fees"] .fee-calc::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #c9ab65, #e9ddb8, transparent);
}
body[data-page="fees"] .fee-calc__title {
  margin: 0;
  color: #ffffff !important;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
body[data-page="fees"] .fee-calc label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72) !important;
}
body[data-page="fees"] .fee-calc select {
  padding: 0.72rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(201, 168, 76, 0.28);
  background: rgba(255, 255, 255, 0.96);
  color: var(--brand-navy-deep);
  font: inherit;
  box-shadow: 0 4px 14px rgba(11, 23, 48, 0.12);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
body[data-page="fees"] .fee-calc select:focus {
  outline: none;
  border-color: #c9ab65;
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.28);
}
body[data-page="fees"] .fee-calc__result {
  margin-top: 0.25rem;
  padding: 1rem 1.05rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(201, 168, 76, 0.22);
}
body[data-page="fees"] .fee-calc__result-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.68) !important;
}
body[data-page="fees"] .fee-calc__out {
  margin-top: 0.35rem;
  font-family: var(--font-serif);
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  font-weight: 600;
  font-style: normal;
  line-height: 1.1;
  color: #e9ddb8 !important;
  font-variant-numeric: tabular-nums;
}
body[data-page="fees"] .fee-calc .btn--gold {
  width: 100%;
  justify-content: center;
  margin-top: 0.25rem;
}

@media (max-width: 900px) {
  body[data-page="fees"] .fees-layout {
    grid-template-columns: 1fr;
  }
  body[data-page="fees"] .fees-aside {
    position: static;
  }
}

/* Year cell — name + detail stacked (fixes Arabic “روضة (٣ / سنوات)” wrap) */
body[data-page="fees"] .fee-year {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  line-height: 1.3;
}
html[dir="rtl"] body[data-page="fees"] .fee-year {
  align-items: flex-start;
}
body[data-page="fees"] .fee-year__name {
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
}
body[data-page="fees"] .fee-year__meta {
  display: block;
  font-size: 0.78em;
  font-weight: 500;
  opacity: 0.78;
  white-space: nowrap;
}

/* Phone — card rows (EN + AR), no cramped horizontal table */
@media (max-width: 640px) {
  body[data-page="fees"] .fees-panel__block {
    padding: 1.1rem 0.95rem;
    border-radius: 14px;
  }

  body[data-page="fees"] .fees-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body[data-page="fees"] .fee-table,
  body[data-page="fees"] .fee-table thead,
  body[data-page="fees"] .fee-table tbody,
  body[data-page="fees"] .fee-table tr,
  body[data-page="fees"] .fee-table th,
  body[data-page="fees"] .fee-table td {
    display: block;
    width: 100%;
  }

  body[data-page="fees"] .fee-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }

  body[data-page="fees"] .fee-table tbody {
    display: grid;
    gap: 0.65rem;
  }

  body[data-page="fees"] .fee-table tbody tr {
    padding: 0.85rem 0.95rem;
    border-radius: 12px;
    border: 1px solid rgba(201, 168, 76, 0.22);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  body[data-page="fees"] .fee-table tbody tr:hover td {
    background: transparent !important;
  }

  body[data-page="fees"] .fee-table tbody td {
    padding: 0.45rem 0;
    border-bottom: 0;
    display: grid;
    grid-template-columns: minmax(5.5rem, 34%) 1fr;
    gap: 0.65rem;
    align-items: center;
  }

  body[data-page="fees"] .fee-table tbody td + td {
    margin-top: 0.35rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  body[data-page="fees"] .fee-table tbody td::before {
    content: attr(data-label);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
    color: rgba(233, 221, 184, 0.72) !important;
    line-height: 1.25;
    display: flex;
    align-items: center;
    align-self: center;
  }

  html[dir="rtl"] body[data-page="fees"] .fee-table tbody td::before {
    letter-spacing: 0.04em;
    text-transform: none;
  }

  body[data-page="fees"] .fee-table tbody td:first-child {
    font-size: 1rem;
  }

  body[data-page="fees"] .fee-table tbody td:last-child {
    font-size: 1.05rem;
  }

  body[data-page="fees"] .fee-year__name {
    white-space: normal;
  }

  body[data-page="fees"] .fee-calc {
    padding: 1.2rem 1rem;
  }

  body[data-page="fees"] .fee-calc label {
    letter-spacing: 0.04em;
  }

  html[dir="rtl"] body[data-page="fees"] .fee-calc label {
    letter-spacing: 0.02em;
    text-transform: none;
  }
}
