/* PediaMath programme pages (category archives). Loaded on archives only. */
.pm-hub-head { margin: 8px 0 28px; }
.pm-hub-head h1 { font-size: 34px; letter-spacing: -.025em; line-height: 1.12; margin: 0 0 10px; }
.pm-hub-desc { color: var(--ink2); max-width: 72ch; margin: 0 0 20px; font-size: 16.5px; }
.pm-hub-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: 0; max-width: 760px; }
.pm-hub-stats div { padding: 11px 18px; border-left: 1px solid var(--line); }
.pm-hub-stats div:first-child { border-left: 0; }
.pm-hub-stats dt { font-size: 12.5px; color: var(--ink2); }
.pm-hub-stats dd { margin: 0; font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }

html.js .pm-filter[data-pm-filter-box][hidden] { display: block; } /* shown from the first paint: no layout shift when the script runs */
.pm-filter { position: sticky; top: 64px; z-index: 5; background: var(--bg); padding: 10px 0 12px; margin: 0 0 8px; }
.pm-filter input { width: 100%; max-width: 520px; height: 44px; border: 1px solid var(--line); border-radius: 999px; padding: 0 18px 0 42px; font: inherit; font-size: 15px; color: var(--ink); background: var(--bg) no-repeat 15px 50% / 18px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='1.8'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21'/%3E%3C/svg%3E"); }
.pm-filter input:focus { outline: 2px solid var(--acc); outline-offset: 1px; border-color: transparent; }
.pm-filter-empty { color: var(--ink2); margin: 14px 0 0; }
.pm-ch[hidden], .pm-domain[hidden], .pm-filter[hidden] { display: none; }

.pm-track-title { font-size: 15px; letter-spacing: .07em; text-transform: uppercase; color: var(--acc-text); margin: 36px 0 0; padding-top: 18px; border-top: 2px solid var(--ink); }
.pm-domain { margin: 26px 0 0; }
.pm-domain-title { font-size: 21px; letter-spacing: -.015em; line-height: 1.25; margin: 0 0 10px; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
.pm-domain-title small { font-size: 13.5px; font-weight: 500; color: var(--ink2); letter-spacing: 0; white-space: nowrap; }
.pm-domain-note { color: var(--ink2); margin: -4px 0 12px; max-width: 72ch; }
.pm-chapters { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.pm-ch { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.pm-ch-main { display: grid; grid-template-columns: 30px 104px minmax(0, 1fr); align-items: center; gap: 14px; padding: 10px 6px 10px 0; text-decoration: none; min-width: 0; border-radius: 10px; }
.pm-ch-main:hover { background: var(--chip); }
.pm-ch-main:hover .pm-ch-title { text-decoration: underline; text-decoration-color: var(--acc); text-underline-offset: .18em; }
.pm-ch-n { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--ink2); }
.pm-cover--row { border-radius: 7px; background-size: 10px 10px; }
.pm-cover--row .pm-cover-text { display: none; }
.pm-cover--row use { transform: translate(24px, 13px) scale(.85); }
.pm-ch-text { min-width: 0; display: grid; gap: 2px; }
.pm-ch-title { font-weight: 600; font-size: 16px; line-height: 1.3; }
.pm-ch-sub { color: var(--ink2); font-size: 14px; line-height: 1.35; }
.pm-ch-tag { display: inline-block; vertical-align: 1px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; color: var(--ink2); }
.pm-ch-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; padding-right: 4px; }
.pm-ch-ex { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--acc); color: var(--ink); text-decoration: none; font-size: 13.5px; font-weight: 600; }
.pm-ch-ex::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--acc); }
.pm-ch-ex:hover { background: var(--acc); color: #fff; }
.pm-ch-ex:hover::before { background: #fff; }
.pm-ch-link { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; font-size: 13.5px; font-weight: 600; }
.pm-ch-link:hover { border-color: var(--ink); background: var(--chip); }
.pm-ch-link--pdf::before { content: ""; width: 9px; height: 11px; border: 1.5px solid currentColor; border-radius: 1px 4px 1px 1px; }
.pm-ch-link--course::before { content: ""; width: 10px; height: 8px; border: 1.5px solid currentColor; border-top-width: 2.5px; border-radius: 1px; }

/* Moroccan programme hubs (inc/maroc.php): rows without cover drawing, chapters still to come. */
.pm-chapters--ma .pm-ch-main { grid-template-columns: 30px minmax(0, 1fr); min-height: 56px; }
.pm-ch--ma.is-soon .pm-ch-title { font-weight: 500; color: var(--ink2); }
.pm-ch--ma .pm-ch-tag + .pm-ch-tag { margin-left: 2px; }
.pm-ch-soon { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1.5px dashed var(--line); color: var(--ink2); font-size: 13px; white-space: nowrap; }
.pm-ma-key { font-size: 14px; }
.pm-domain-title a { text-decoration: none; }
.pm-domain-title a:hover { text-decoration: underline; text-decoration-color: var(--acc); }
.pm-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.pm-tile { display: grid; gap: 2px; padding: 16px 18px; min-height: 104px; align-content: end; text-decoration: none; border: 1px solid var(--line); border-radius: 14px; background-color: var(--paper); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 16px 16px; transition: border-color .15s, transform .15s; }
.pm-tile:hover { border-color: var(--ink); transform: translateY(-1px); }
.pm-tile small { font-size: 12.5px; color: var(--ink2); }
.pm-tile b { font-size: 22px; letter-spacing: -.02em; }
.pm-tile span { font-size: 13.5px; color: var(--ink2); }
.pm-tile--alt { border-color: var(--acc); }
.pm-superieur { margin-top: 44px; }
.pm-jump ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; padding: 0; }
.pm-section + .pm-section { margin-top: 40px; }

@media (max-width: 640px) {
	.pm-hub-head h1 { font-size: 27px; }
	.pm-hub-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.pm-hub-stats div:nth-child(odd) { border-left: 0; }
	.pm-hub-stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
	.pm-filter { top: 56px; }
	.pm-ch { grid-template-columns: minmax(0, 1fr); gap: 0; padding-bottom: 10px; }
	.pm-ch-main { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 10px 0 8px; }
	.pm-ch-n { display: none; }
	.pm-cover--row use { transform: translate(14px, 8px) scale(.9); }
	.pm-ch-links { justify-content: flex-start; padding: 0 0 0 88px; }
	.pm-chapters--ma .pm-ch-main { grid-template-columns: minmax(0, 1fr); min-height: 0; }
	.pm-chapters--ma .pm-ch-links { padding-left: 0; }
	.pm-chapters--ma .pm-ch.is-soon { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding-bottom: 0; }
	.pm-ch-title { font-size: 15.5px; }
	.pm-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.pm-tile { min-height: 92px; padding: 14px; }
	.pm-tile b { font-size: 19px; }
}

/* PDF library (pdf-library.php) */
.pm-library .pm-jump { margin: 18px 0 8px; }
.pm-doc-group { margin-top: 28px; }
.pm-doc-group .pm-section-head h2 small { font-size: 13.5px; font-weight: 500; color: var(--ink2); margin-left: 6px; letter-spacing: 0; }
.pm-doc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.pm-doc-actions .pm-act { height: 34px; font-size: 13.5px; text-decoration: none; }
