/* Article tables, phone first (inc/tables.php). Loaded only on pages with a table. */

.wow-tc { margin: 32px 0; }
.wow-tc ol,
.wow-tc ul,
.wow-tc dl { margin: 0; padding: 0; list-style: none; }
.wow-tc p { margin: 0; }
.wow-tc a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* "At a glance" title from the caption */
.wow-tc .wow-tc__title { margin: 0 0 12px; color: var(--wow-black); font-size: 20px; font-weight: 700; line-height: 1.25; text-align: left; }
.wow-tc__kicker { display: block; margin-bottom: 2px; color: var(--wow-red-ink); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.wow-tc__note { margin-top: 8px !important; color: var(--wow-muted); font-size: 13px; }

/* Shared parts */
.wow-tc__item { position: relative; margin: 0 0 12px; padding: 16px; border: 1px solid var(--wow-line); border-radius: 12px; background: #fff; }
.wow-tc__num { color: var(--wow-red); font-size: 28px; font-weight: 700; line-height: 1; letter-spacing: -.04em; }
.wow-tc__name { font-size: 17px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.wow-tc__name a { text-decoration-color: var(--wow-red); }
.wow-tc__rating { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 2px 10px; border-radius: var(--wow-radius-pill); background: var(--wow-black); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; }
.wow-tc__rating .wow-icon { fill: currentcolor; }
.wow-tc__cap { display: block; color: var(--wow-muted); font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.wow-tc__val { display: block; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.wow-tc__best { margin: 12px 0; padding: 10px 12px; border-radius: 8px; background: var(--wow-bg); }
.wow-tc__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wow-tc__chip { display: inline-flex; align-items: flex-start; gap: 6px; max-width: 100%; padding: 5px 12px; border: 1px solid var(--wow-line); border-radius: 16px; background: #fff; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.wow-tc__chip .wow-icon { flex: none; margin-top: 2px; color: var(--wow-red); }
.wow-tc__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.wow-tc__grid .wow-tc__best { grid-column: 1 / -1; margin: 0; }
.wow-tc__chips + .wow-tc__open { margin-top: 10px; }

/* More details: a tap on phones, always open on laptops */
.wow-tc__more { margin-top: 12px; border-top: 1px solid var(--wow-line); }
.wow-tc__more summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; font-size: 14px; font-weight: 600; cursor: pointer; list-style: none; }
.wow-tc__more summary::-webkit-details-marker { display: none; }
.wow-tc__more summary .wow-icon { transition: transform var(--wow-fast) var(--wow-ease); }
.wow-tc__more[open] summary .wow-icon { transform: rotate(180deg); }
.wow-tc__extra { display: grid; gap: 10px; padding-bottom: 2px; }

/* Group labels inside a list ("Primary schools (boys)") */
.wow-tc .wow-tc__group { margin: 20px 0 10px; font-size: 16px; font-weight: 700; }
.wow-tc .wow-tc__group:first-child { margin-top: 0; }
.wow-tc .wow-tc__group-row th { position: static; padding: 9px 14px; background: var(--wow-grey); color: var(--wow-black); font-weight: 700; text-align: left; }

/* Ranked rows and photo cards */
.wow-tc--ranked .wow-tc__item,
.wow-tc--photo .wow-tc__item { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 10px; align-content: start; }
.wow-tc--ranked .wow-tc__item > :not(.wow-tc__num),
.wow-tc--photo .wow-tc__item > :not(.wow-tc__num):not(.wow-tc__media) { grid-column: 2; }
.wow-tc--ranked .wow-tc__best,
.wow-tc--ranked .wow-tc__facts { grid-column: 1 / -1 !important; }

/* Lists in A to Z order carry no numbers */
.wow-tc--nonum.wow-tc--ranked .wow-tc__item { grid-template-columns: minmax(0, 1fr); }
.wow-tc--nonum.wow-tc--ranked .wow-tc__item > * { grid-column: 1 !important; }

/* Photo cards */
.wow-tc--photo .wow-tc__item { grid-template-columns: minmax(0, 1fr); padding: 0; overflow: hidden; }
.wow-tc--photo .wow-tc__item > * { grid-column: 1 !important; }
.wow-tc--photo .wow-tc__head,
.wow-tc--photo .wow-tc__best,
.wow-tc--photo .wow-tc__facts { margin-inline: 16px; }
.wow-tc--photo .wow-tc__head { margin-top: 14px; }
.wow-tc--photo .wow-tc__facts { margin-bottom: 16px; }
.wow-tc__media { position: relative; aspect-ratio: 5 / 3; background: var(--wow-black); }
.wow-tc__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wow-tc__media .wow-tc__num { position: absolute; bottom: 10px; left: 14px; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .45); }
.wow-tc__media--none { aspect-ratio: 5 / 1.2; }

/* Spec sheet */
.wow-tc--spec .wow-tc__item { padding: 0; overflow: hidden; }
.wow-tc__panel { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--wow-black); color: #fff; }
.wow-tc__panel .wow-tc__name a { color: #fff; }
.wow-tc__panel .wow-tc__rating { background: var(--wow-red); }
.wow-tc--spec .wow-tc__body { padding: 14px 16px 16px; }

/* Key facts */
.wow-tc--facts .wow-tc__dl { padding: 4px 16px; border: 1px solid var(--wow-line); border-radius: 12px; background: #fff; }
.wow-tc__row { padding: 10px 0; border-bottom: 1px solid var(--wow-grey); }
.wow-tc__row:last-child { border-bottom: 0; }
.wow-tc__row dt { color: var(--wow-muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.wow-tc__row dd { margin: 2px 0 0; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }

/* Steps */
.wow-tc__steps { border: 1px solid var(--wow-line); border-radius: 12px; background: #fff; }
.wow-tc__step { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 16px; }
.wow-tc__step + .wow-tc__step { border-top: 1px solid var(--wow-grey); }
.wow-tc__dot { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--wow-black); color: #fff; font-size: 14px; font-weight: 700; }
.wow-tc__fee { display: inline-block; margin: 6px 0 4px; padding: 2px 10px; border-radius: 14px; background: var(--wow-black); color: #fff; font-size: 13px; font-weight: 600; line-height: 1.4; }
.wow-tc__step .wow-tc__grid { margin-top: 8px; grid-template-columns: minmax(0, 1fr); }

/* Price grid, comparison and plain: real tables */
.wow-tc__scroll { overflow-x: auto; border: 1px solid var(--wow-line); border-radius: 12px; background: #fff; }
.wow-tc table { width: 100%; margin: 0; border: 0; border-collapse: separate; border-spacing: 0; font-size: 15px; }
.wow-tc th { padding: 11px 14px; border: 0; background: var(--wow-black); color: #fff; font-weight: 600; line-height: 1.3; text-align: left; vertical-align: bottom; }
.wow-tc td { padding: 11px 14px; border: 0; border-top: 1px solid var(--wow-grey); background: #fff; line-height: 1.45; vertical-align: top; }
.wow-tc td:first-child { font-weight: 600; }
.wow-tc .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.wow-tc--prices th:first-child,
.wow-tc--prices td:first-child,
.wow-tc--plain th:first-child,
.wow-tc--plain td:first-child { position: sticky; left: 0; z-index: 1; }
.wow-tc--prices td:first-child,
.wow-tc--plain td:first-child { box-shadow: 1px 0 0 var(--wow-line); }
.wow-tc__sub { display: none; color: var(--wow-muted); font-size: 13px; font-weight: 400; }
.wow-tc--own { overflow-x: auto; }
.wow-tc--own figcaption { margin-top: 8px; color: var(--wow-muted); font-size: 13px; text-align: left; }

@media (max-width: 639px) {
	/* Price grid: the short text column sits under the name instead. */
	.wow-tc--prices .wow-tc__fold { display: none; }
	.wow-tc--prices .wow-tc__sub { display: block; }
	.wow-tc--prices table { font-size: 14px; }
	.wow-tc--prices th,
	.wow-tc--prices td { padding: 10px 12px; }

	/* Comparison: one labelled card per option. */
	.wow-tc--compare .wow-tc__scroll { overflow: visible; border: 0; background: none; }
	.wow-tc--compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
	.wow-tc--compare table,
	.wow-tc--compare tbody,
	.wow-tc--compare tr,
	.wow-tc--compare td { display: block; width: 100%; }
	.wow-tc--compare tr { margin-bottom: 12px; padding: 14px 16px; border: 1px solid var(--wow-line); border-radius: 12px; background: #fff; }
	.wow-tc--compare td { padding: 6px 0; border: 0; text-align: left; white-space: normal; }
	.wow-tc--compare td::before { content: attr(data-label); display: block; color: var(--wow-muted); font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
	.wow-tc--compare td:first-child { padding-top: 0; font-size: 17px; }
	.wow-tc--compare td:first-child::before { content: none; }
	.wow-tc--compare tr.wow-tc__group-row { margin: 20px 0 10px; padding: 0; border: 0; background: none; }
	.wow-tc--compare tr.wow-tc__group-row th { display: block; padding: 0; background: none; font-size: 16px; }
}

@media (min-width: 640px) {
	.wow-tc--facts .wow-tc__row { display: grid; grid-template-columns: minmax(0, 34%) minmax(0, 1fr); gap: 16px; }
	.wow-tc--facts .wow-tc__row dd { margin: 0; }
	.wow-tc__step .wow-tc__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
	/* Laptops: nothing folds, and every row or card is as tall as the tallest. */
	.wow-tc__more { margin-top: 10px; padding-top: 10px; }
	.wow-tc__more summary { display: none; }
	.wow-tc__list { display: grid; grid-auto-rows: 1fr; gap: 12px; }
	.wow-tc__list .wow-tc__item { margin: 0; }

	/* Ranked rows: number | name and rating | best for | facts */
	.wow-tc--ranked .wow-tc__item { grid-template-columns: 48px minmax(0, 1.5fr) minmax(0, 1.4fr) minmax(0, 1.6fr); column-gap: 18px; align-items: start; padding: 14px 16px; }
	.wow-tc--ranked .wow-tc__item > .wow-tc__head { grid-column: 2; }
	.wow-tc--ranked .wow-tc__best { grid-column: 3 !important; margin: 0; }
	.wow-tc--ranked .wow-tc__facts { grid-column: 4 !important; }
	.wow-tc--ranked .wow-tc__item:not(:has(.wow-tc__best)) .wow-tc__facts { grid-column: 3 / -1 !important; }
	.wow-tc--ranked .wow-tc__more { margin-top: 8px; padding-top: 0; border: 0; }

	.wow-tc--nonum.wow-tc--ranked .wow-tc__item { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.4fr) minmax(0, 1.6fr); }
	.wow-tc--nonum.wow-tc--ranked .wow-tc__item > .wow-tc__head { grid-column: 1 !important; }
	.wow-tc--nonum.wow-tc--ranked .wow-tc__best { grid-column: 2 !important; }
	.wow-tc--nonum.wow-tc--ranked .wow-tc__facts { grid-column: 3 !important; }
	.wow-tc--nonum.wow-tc--ranked .wow-tc__item:not(:has(.wow-tc__best)) .wow-tc__facts { grid-column: 2 / -1 !important; }

	/* Spec sheet: black panel left, the facts in a grid */
	.wow-tc--spec .wow-tc__item { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); }
	.wow-tc--spec .wow-tc__panel { flex-direction: column; align-items: flex-start; justify-content: flex-start; padding: 18px; }
	.wow-tc--spec .wow-tc__body { padding: 16px 18px; }
	.wow-tc--spec .wow-tc__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; }

	/* Photo cards: two across */
	.wow-tc--photo .wow-tc__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }

	/* Real tables: comfortable cells, no pinned column needed when it fits */
	.wow-tc table { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
	.wow-tc__more summary .wow-icon { transition: none; }
}
