/* =========================================================
   Nahdet Misr Learning — section library (v1.10.0)
   Loaded on the site and inside the block editor canvas.
   ========================================================= */
.nm-blocks-page,
.editor-styles-wrapper {
  --nm-navy: #1a2b4c;
  --nm-teal: #00a99d;
  --nm-teal-deep: #008f85;
  --nm-teal-soft: #e6f7f6;
  --nm-muted: #5c6478;
  --nm-border: #e2e6ee;
  --nm-grad: linear-gradient(90deg, #00a99d 0%, #1f5fae 100%);
  font-family: "DM Sans", system-ui, sans-serif;
  color: #1a2b4c;
}
html[dir="rtl"] .nm-blocks-page,
.rtl .editor-styles-wrapper { font-family: "Noto Sans Arabic", "DM Sans", sans-serif; }

/* Section spacing */
.nm-sec { padding: clamp(36px, 5vw, 64px) 16px; }
.nm-sec > * { margin-left: auto; margin-right: auto; }
.nm-sec .wp-block-heading { color: var(--nm-navy); line-height: 1.15; margin: 0 0 14px; }
html[dir="ltr"] .nm-sec h1.wp-block-heading,
html[dir="ltr"] .nm-sec h2.wp-block-heading,
.editor-styles-wrapper:not(.rtl) .nm-sec h1.wp-block-heading,
.editor-styles-wrapper:not(.rtl) .nm-sec h2.wp-block-heading {
  font-family: "Oswald", "DM Sans", sans-serif; font-weight: 700; text-transform: uppercase;
}
.nm-sec h1.wp-block-heading { font-size: clamp(2.2rem, 5vw, 3.8rem); }
.nm-sec h2.wp-block-heading { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.nm-sec h3.wp-block-heading { font-size: 1.15rem; }
.nm-sec p { color: var(--nm-muted); line-height: 1.7; }
.nm-eyebrow-teal { color: var(--nm-teal) !important; font-weight: 700; font-size: 0.8rem !important; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 6px !important; }
html[dir="rtl"] .nm-eyebrow-teal { letter-spacing: 0; }

/* Buttons: teal gradient pill; outline = secondary */
.nm-sec .wp-block-button__link {
  background: var(--nm-grad); color: #fff; border: 0; border-radius: 999px;
  padding: 12px 26px; font-weight: 700; text-decoration: none;
}
.nm-sec .wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent; color: var(--nm-navy); border: 2px solid var(--nm-navy);
}
.nm-sec .wp-block-buttons { gap: 12px; margin-top: 18px; }

/* Images */
.nm-sec .wp-block-image img { border-radius: 18px; width: 100%; height: auto; object-fit: cover; }

/* Hero */
.nm-sec-hero { background: linear-gradient(180deg, #eef2f8 0%, #fff 100%); }
.nm-sec-hero .wp-block-columns { align-items: center; }
.nm-sec-hero .wp-block-image img { aspect-ratio: 4 / 3; box-shadow: 0 12px 40px rgba(26, 43, 76, 0.12); }

/* Image + text 2:3 */
.nm-sec-split .wp-block-columns { align-items: center; gap: clamp(24px, 4vw, 56px); }
.nm-sec-split .wp-block-image img { aspect-ratio: 1 / 1; box-shadow: 0 12px 40px rgba(26, 43, 76, 0.12); }

/* Cards */
.nm-sec-cards .wp-block-column {
  background: #fff; border: 1px solid var(--nm-border); border-radius: 18px;
  padding: 0 0 18px; overflow: hidden; box-shadow: 0 8px 24px rgba(26, 43, 76, 0.06);
}
.nm-sec-cards .wp-block-column > *:not(.wp-block-image) { padding-inline: 20px; }
.nm-sec-cards .wp-block-image { margin: 0 0 14px; }
.nm-sec-cards .wp-block-image img { border-radius: 0; aspect-ratio: 16 / 10; }

/* Rows */
.nm-sec-rows .nm-row { align-items: center; padding: 16px 0; border-bottom: 1px solid var(--nm-border); margin: 0; }
.nm-sec-rows .nm-row .wp-block-image { margin: 0; }
.nm-sec-rows .nm-row .wp-block-image img { aspect-ratio: 4 / 3; border-radius: 12px; }
.nm-sec-rows .nm-row h3.wp-block-heading { margin: 0 0 4px; }
.nm-sec-rows .nm-row p { margin: 0; }
.nm-row-badge { color: var(--nm-navy) !important; font-weight: 700; text-align: end; }

/* Accordion */
.nm-sec-accordion .wp-block-details {
  border: 1px solid var(--nm-border); border-radius: 14px; padding: 14px 18px; margin: 0 0 12px; background: #fff;
}
.nm-sec-accordion .wp-block-details summary { cursor: pointer; font-weight: 700; color: var(--nm-navy); }
.nm-sec-accordion .wp-block-details p { margin: 10px 0 0; }

/* Gallery */
.nm-sec-gallery .wp-block-image img { aspect-ratio: 1 / 1; }

/* CTA band */
.nm-cta-box {
  background: var(--nm-navy); border-radius: 22px; padding: clamp(32px, 5vw, 56px); text-align: center;
}
.nm-cta-box .wp-block-heading { color: #fff !important; }
.nm-cta-box p { color: rgba(255, 255, 255, 0.82) !important; }
.nm-cta-box .wp-block-buttons { justify-content: center; }
.nm-cta-box .wp-block-button__link { background: #fff; color: var(--nm-navy); }
.nm-cta-box .wp-block-button.is-style-outline .wp-block-button__link { background: transparent; color: #fff; border-color: #fff; }

/* Get in touch */
.nm-sec-touch { position: relative; }
.nm-sec-touch .wp-block-image img { aspect-ratio: 21 / 9; }
.nm-touch-card {
  background: #fff; border-radius: 16px; padding: 20px 22px; max-width: 360px !important;
  box-shadow: 0 12px 32px rgba(8, 16, 32, 0.15); margin-top: -90px !important; margin-inline-end: 24px !important; margin-inline-start: auto !important;
  position: relative;
}

/* Sample form section */
.nm-sec-sample .wp-block-columns { align-items: center; gap: clamp(24px, 4vw, 48px); }

/* Dynamic blocks */
.nm-blk-wrap, .nm-blk-form { max-width: 1180px; margin: 24px auto; padding: 0 16px; }
.nm-blk-editor-preview { pointer-events: none; }
/* v1.11.3 — form previews inside the editor look like the site (site CSS isn't loaded there). */
.nm-blk-editor-preview .nm4-hp { display: none !important; }
.nm-blk-editor-preview .nm-contact-card { background: #fff; border: 1px solid var(--nm-border); border-radius: 18px; padding: 24px; }
.nm-blk-editor-preview .nm4-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.nm-blk-editor-preview .nm4-field--wide { grid-column: 1 / -1; }
.nm-blk-editor-preview .nm4-field label, .nm-blk-editor-preview .nm4-field legend { display: block; font-weight: 600; font-size: 0.9rem; color: var(--nm-navy); margin-bottom: 6px; }
.nm-blk-editor-preview input:not([type="checkbox"]):not([type="radio"]), .nm-blk-editor-preview select, .nm-blk-editor-preview textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--nm-border); border-radius: 10px; padding: 10px 12px; background: #fff; }
.nm-blk-editor-preview button[type="submit"] { display: block; width: 100%; margin-top: 16px; border: 0; border-radius: 999px; padding: 12px; background: var(--nm-grad); color: #fff; font-weight: 700; }

/* Block pages: full width, no default page header */
.nm-blocks-page { overflow-x: clip; }

/* =========================================================
   v1.11.0 — sections of the converted pages
   ========================================================= */
.nm-sec .nm-lead { font-size: 1.08rem; max-width: 62ch; }
/* v1.11.1 — a narrow lead directly in a section lines up with the title (not centred). */
.nm-sec > .nm-lead { margin-inline-start: max(0px, calc((100% - 1180px) / 2)) !important; margin-inline-end: auto !important; }
.nm-sec h1 strong, .nm-sec h2 strong {
  background: var(--nm-grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: inherit;
}
.nm-sec .nm-breadcrumb { font-size: 0.85rem; color: var(--nm-muted); margin-bottom: 14px; }
.nm-sec .nm-breadcrumb a { color: var(--nm-muted); text-decoration: none; }
.nm-sec-muted { background: #f5f7fa; }
.nm-link-teal a { color: var(--nm-teal-deep); font-weight: 700; text-decoration: none; }
.nm-link-teal a:hover { text-decoration: underline; }

/* Page header */
.nm-sec-pagehero { background: linear-gradient(180deg, #eef2f8 0%, #fff 100%); padding-top: clamp(28px, 4vw, 48px); }
.nm-sec-pagehero .wp-block-columns { align-items: end; }

/* Home: full-width photo hero (image = Styles → Background) */
.nm-sec-photohero { position: relative; padding-block: clamp(56px, 8vw, 110px); background-color: #fafaf8; background-position: center right !important; }
.nm-sec-photohero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(250,250,248,.97) 0%, rgba(250,250,248,.9) 34%, rgba(250,250,248,.35) 58%, rgba(250,250,248,0) 75%);
}
html[dir="rtl"] .nm-sec-photohero::before, .rtl .nm-sec-photohero::before { transform: scaleX(-1); }
.nm-sec-photohero > * { position: relative; z-index: 1; }

/* Stats strip */
.nm-sec-stats { background: #f5f7fa; border-block: 1px solid var(--nm-border); padding-block: 22px; }
.nm-sec-stats .wp-block-columns { margin: 0; }
.nm-sec-stats .wp-block-column { display: flex; align-items: center; gap: 10px; }
.nm-sec-stats p { margin: 0; }
.nm-stat-num { font-family: "Oswald", "DM Sans", sans-serif; font-weight: 700; font-size: 1.6rem !important; color: var(--nm-navy) !important; }
.nm-stat-label { font-weight: 700; font-size: 0.75rem !important; letter-spacing: 0.06em; text-transform: uppercase; color: var(--nm-navy) !important; }

/* Navy panel with image cards */
.nm-vision-box { background: var(--nm-navy); border-radius: 22px; padding: clamp(28px, 4vw, 48px); }
.nm-vision-box > .wp-block-columns:first-child h2 { color: #fff; font-size: clamp(1.35rem, 2.4vw, 1.85rem) !important; }
.nm-vision-box > .wp-block-columns:first-child p { color: rgba(255,255,255,.78); }
.nm-vision-box .wp-block-columns { gap: 16px; margin-bottom: 16px; }
.nm-vcard {
  position: relative; overflow: hidden; border-radius: 14px; min-height: 220px; padding: 18px;
  display: flex; flex-direction: column; justify-content: flex-end; background-color: #243556; background-size: cover; height: 100%;
}
.nm-vcard::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(10,20,40,.18) 0%, transparent 32%, rgba(10,20,40,.88) 100%); }
.nm-vcard > * { position: relative; z-index: 1; margin-inline: 0 !important; }
.nm-vcard h3.wp-block-heading { color: #fff; margin: 0 0 12px; }
.nm-vcard-tags { list-style: none; padding: 0; margin: 0 0 auto !important; padding-bottom: 40px; display: flex; flex-wrap: wrap; gap: 6px; }
.nm-vcard-tags li { background: rgba(255,255,255,.18); backdrop-filter: blur(6px); color: #fff; border-radius: 999px; padding: 4px 10px; font-size: 0.7rem; font-weight: 700; }
.nm-sec .nm-vcard-btn { margin-top: 0; }
.nm-sec .nm-vcard-btn .wp-block-button__link { background: #fff; color: var(--nm-navy); padding: 8px 14px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* Choose your path rows */
.nm-sec-paths .nm-row { border-bottom: 0; border-top: 1px solid var(--nm-border); }
.nm-sec-paths .nm-row:last-of-type { border-bottom: 1px solid var(--nm-border); }
.nm-sec-paths .nm-row .wp-block-image img { aspect-ratio: 4 / 3; border-radius: 10px; }
.nm-path-cat { color: var(--nm-teal) !important; font-weight: 800; font-size: 0.75rem !important; letter-spacing: 0.1em; text-transform: uppercase; }
.nm-sec-rows h3.wp-block-heading a { color: var(--nm-navy); text-decoration: none; }
.nm-sec-rows h3.wp-block-heading a:hover { color: var(--nm-teal-deep); }
.nm-sec .nm-more { margin-top: 18px; }
.nm-sec .nm-more .wp-block-button { width: 100%; }
.nm-sec .nm-more .wp-block-button__link { width: 100%; background: #f1f3f7; color: var(--nm-navy); border-radius: 12px; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; }

/* Get in touch over a photo */
.nm-touch-frame { position: relative; border-radius: 22px; overflow: hidden; min-height: 360px; padding: 28px; background-color: var(--nm-navy); background-size: cover; }
.nm-touch-frame > h2.wp-block-heading { color: #fff !important; text-shadow: 0 2px 12px rgba(0,0,0,.35); margin-inline: 0 !important; }
.nm-touch-frame .nm-touch-card { position: absolute; bottom: 24px; inset-inline-end: 24px; margin: 0 !important; }

/* Curriculum page hero: cover 2 : content 3 */
.nm-sec-linehero { background: linear-gradient(180deg, #eef2f8 0%, #fff 100%); }
.nm-sec-linehero .wp-block-image img { aspect-ratio: 3 / 4; }

/* Cards without images (features, partners, companions) */
.nm-sec-features .wp-block-column, .nm-sec-companions .wp-block-column { padding-top: 22px; }
.nm-feat-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--nm-teal-soft); color: var(--nm-teal) !important; font-size: 1.2rem; margin-inline: 20px !important; padding: 0 !important; }

/* Check list */
.nm-check-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.nm-check-list li { display: flex; gap: 10px; font-weight: 700; color: var(--nm-navy); }
.nm-check-list li::before { content: "✓"; color: var(--nm-teal); font-weight: 800; }

/* Timeline */
.nm-timeline-row .wp-block-column { border-top: 3px solid var(--nm-teal); padding-top: 14px; }
.nm-tl-year { color: var(--nm-teal) !important; font-size: 1.5rem !important; }

/* Contact */
.nm-contact-side { background: #f5f7fa; border-radius: 18px; padding: 24px; }
.nm-contact-side > * { margin-inline: 0 !important; }
.nm-contact-line { margin: 0 0 10px !important; }
.nm-contact-line a { color: var(--nm-navy); }
/* v1.11.2 — phone numbers and emails read left-to-right on Arabic pages too. */
.nm-sec a[href^="tel:"], .nm-sec a[href^="mailto:"] { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.nm-chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.nm-chips li { background: #fff; border: 1px solid var(--nm-border); border-radius: 999px; padding: 4px 12px; font-size: 0.82rem; font-weight: 700; color: var(--nm-navy); }

/* Newsletter box */
.nm-subscribe-box { background: var(--nm-teal-soft); border-radius: 22px; padding: clamp(24px, 4vw, 40px); }
.nm-subscribe-box .wp-block-columns { align-items: center; margin: 0; }

/* Smart sections and forms inside sections */
.nm-smart--breadcrumbs .nm-breadcrumb { margin: 0 0 12px; }
.nm-sec .nm-blk-form { margin: 0; padding: 0; }
.nm-sec-formbox .nm-blk-form { max-width: 860px; margin: 0 auto; }
.wp-block-group.alignfull, .nm-blocks-page > .wp-block-group { margin-block: 0; }

/* v1.11.4 — spacing and alignment fixes */
.nm-sec-pagehero { padding-bottom: clamp(20px, 3vw, 36px); }
.nm-sec-pagehero + .nm-sec, .nm-sec-pagehero + .nm-smart { padding-top: clamp(20px, 3vw, 36px); }
.nm-sec-pagehero + .nm-smart > section { padding-top: clamp(16px, 2vw, 28px); }
.nm-sec > .nm-blk-wrap, .nm-sec > .nm-blk-form { max-width: 1180px; margin-inline: auto !important; padding: 0; }
.nm-sec .nm-blk-wrap .nm-wrap { width: 100%; max-width: none; margin-inline: 0; }
.nm-sec .nm-blk-form .nm-contact-card { max-width: none; margin-inline: 0; }
.nm-row-badge { white-space: nowrap; }
.nm-sec-rows .nm-row > .wp-block-column:last-child { flex: 0 0 auto !important; min-width: 110px; }

@media (max-width: 781px) {
  .nm-touch-frame .nm-touch-card { position: relative; inset: auto; margin-top: 160px !important; }
  .nm-sec-photohero::before { background: rgba(250,250,248,.9); transform: none; }
  .nm-vcard { min-height: 200px; }
  .nm-sec-rows .nm-row .wp-block-column { flex-basis: auto !important; }
  .nm-row-badge { text-align: start; }
  .nm-touch-card { margin: -40px auto 0 !important; }
}
