/*
Theme Name: Plugin Audits
Theme URI: https://pluginaudits.com
Author: Plugin Audits
Author URI: https://pluginaudits.com
Description: Presentatiethema voor Plugin Audits. Toont technische scanrapporten van WordPress-plugins (permissions, externe verbindingen, REST/AJAX, findings, versiegeschiedenis). Bevat GEEN scanlogica: alle data komt uitsluitend via de datacontractfuncties (wpi_get_plugin, wpi_get_report, ...) van de "Plugin Audits Inspector"-plugin. Zie datacontract-inspector-theme.md.
Version: 0.1.0
Requires at least: 6.4
Requires PHP: 8.2
Tested up to: 6.7
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: plugin-audits-theme
*/

/*
 * Visueel systeem gebaseerd op STuff/mok-pt.png (de gekozen ontwerprichting,
 * sectie 27): rustig, technisch, geloofwaardig, lichte achtergrond, heldere
 * kaartstructuur. Eén bestand, geen build-stap (sectie 23.4).
 */

:root {
	--wpi-blue: #1d4ed8;
	--wpi-blue-dark: #0f172a;
	--wpi-text: #0f172a;
	--wpi-text-muted: #64748b;
	--wpi-bg: #ffffff;
	--wpi-bg-alt: #f8fafc;
	--wpi-border: #e2e8f0;
	--wpi-radius: 10px;
	--wpi-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 1px rgba(15, 23, 42, 0.04);

	--wpi-info-fg: #475569;
	--wpi-info-bg: #f1f5f9;
	--wpi-low-fg: #15803d;
	--wpi-low-bg: #dcfce7;
	--wpi-medium-fg: #b45309;
	--wpi-medium-bg: #fef3c7;
	--wpi-high-fg: #b91c1c;
	--wpi-high-bg: #fee2e2;
	--wpi-critical-fg: #ffffff;
	--wpi-critical-bg: #b91c1c;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--wpi-bg);
	color: var(--wpi-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.5;
}

a { color: var(--wpi-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

.wpi-container {
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 24px;
}

.screen-reader-text {
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* ---------------------------------------------------------------------
 * Header
 * ------------------------------------------------------------------- */
.wpi-header {
	border-bottom: 1px solid var(--wpi-border);
	background: var(--wpi-bg);
}
.wpi-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 24px;
	max-width: 1180px;
	margin: 0 auto;
}
.wpi-logo {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 700;
	font-size: 1.1rem;
	color: var(--wpi-text);
}
.wpi-logo__mark {
	display: inline-flex;
	width: 28px; height: 28px;
	align-items: center;
	justify-content: center;
	background: var(--wpi-blue);
	color: #fff;
	border-radius: 6px;
	font-size: 0.9rem;
}
.wpi-nav {
	display: flex;
	gap: 24px;
	list-style: none;
	margin: 0; padding: 0;
}
.wpi-nav a {
	color: var(--wpi-text);
	font-size: 0.95rem;
}
.wpi-header__cta {
	display: flex;
	align-items: center;
	gap: 12px;
}

/* ---------------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------------- */
.wpi-btn {
	display: inline-block;
	padding: 10px 20px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.95rem;
	border: 1px solid transparent;
	cursor: pointer;
}
.wpi-btn:hover { text-decoration: none; }
.wpi-btn--primary {
	background: var(--wpi-blue-dark);
	color: #fff;
}
.wpi-btn--primary:hover { background: #1e293b; }
.wpi-btn--outline {
	background: #fff;
	color: var(--wpi-text);
	border-color: var(--wpi-border);
}
.wpi-btn--outline:hover { border-color: var(--wpi-blue); }
.wpi-btn--block { display: block; width: 100%; text-align: center; }
.wpi-btn--small { padding: 6px 14px; font-size: 0.85rem; }

/* ---------------------------------------------------------------------
 * Hero
 * ------------------------------------------------------------------- */
.wpi-hero {
	text-align: center;
	padding: 72px 24px 48px;
}
.wpi-hero h1 {
	font-size: clamp(1.8rem, 3.2vw, 2.6rem);
	line-height: 1.2;
	margin: 0 0 20px;
}
.wpi-hero h1 .wpi-highlight { color: var(--wpi-blue); }
.wpi-hero__subtitle {
	max-width: 620px;
	margin: 0 auto 32px;
	color: var(--wpi-text-muted);
	font-size: 1.05rem;
}
.wpi-hero__actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
	margin-top: 20px;
}

.wpi-search-form {
	max-width: 640px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 10px;
	background: #fff;
	border: 1px solid var(--wpi-border);
	border-radius: 10px;
	padding: 12px 18px;
	box-shadow: var(--wpi-shadow);
}
.wpi-search-form__input {
	flex: 1;
	border: 0;
	outline: 0;
	font-size: 1rem;
}
.wpi-search-form__submit { border: 0; background: none; }

/* ---------------------------------------------------------------------
 * Feature cards / stat tiles (shared grid pattern)
 * ------------------------------------------------------------------- */
.wpi-grid {
	display: grid;
	gap: 20px;
	margin: 40px 0;
}
.wpi-grid--4 { grid-template-columns: repeat(4, 1fr); }
.wpi-grid--3 { grid-template-columns: repeat(3, 1fr); }
.wpi-grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
	.wpi-grid--4, .wpi-grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	.wpi-grid--4, .wpi-grid--3, .wpi-grid--2 { grid-template-columns: 1fr; }
}

.wpi-feature {
	border: 1px solid var(--wpi-border);
	border-radius: var(--wpi-radius);
	padding: 22px;
	background: #fff;
}
.wpi-feature__icon {
	display: inline-flex;
	width: 40px; height: 40px;
	align-items: center;
	justify-content: center;
	background: #eff6ff;
	color: var(--wpi-blue);
	border-radius: 8px;
	font-size: 1.1rem;
	margin-bottom: 14px;
}
.wpi-feature h3 { margin: 0 0 8px; font-size: 1.05rem; }
.wpi-feature p { margin: 0; color: var(--wpi-text-muted); font-size: 0.92rem; }

/* ---------------------------------------------------------------------
 * Plugin cards
 * ------------------------------------------------------------------- */
.wpi-card {
	border: 1px solid var(--wpi-border);
	border-radius: var(--wpi-radius);
	padding: 20px;
	background: #fff;
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.wpi-card__header {
	display: flex;
	align-items: center;
	gap: 12px;
}
.wpi-card__icon {
	display: inline-flex;
	width: 44px; height: 44px;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	background: var(--wpi-blue);
	color: #fff;
	font-weight: 700;
	flex-shrink: 0;
}
.wpi-card__title { margin: 0; font-size: 1.05rem; }
.wpi-card__developer { margin: 2px 0 0; color: var(--wpi-text-muted); font-size: 0.85rem; }
.wpi-card__meta {
	display: flex;
	gap: 24px;
	margin: 0;
}
.wpi-card__meta dt { font-size: 0.75rem; color: var(--wpi-text-muted); margin: 0; }
.wpi-card__meta dd { font-size: 0.9rem; margin: 2px 0 0; }
.wpi-card__risk {
	display: flex;
	align-items: center;
	gap: 8px;
}
.wpi-card__risk-label { color: var(--wpi-text-muted); font-size: 0.85rem; }

/* ---------------------------------------------------------------------
 * Risk badges (sectie 15)
 * ------------------------------------------------------------------- */
.wpi-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 700;
	line-height: 1.4; /* root-cause fix: zonder dit erft de badge de globale body line-height (1.5), wat op elke plek waar hij naast een label staat (kaarten, Overview-tiles) een merkbaar te hoge regelbox — dus lucht — om de badge geeft. */
	text-transform: uppercase;
	letter-spacing: 0.02em;
}
.wpi-risk--info { color: var(--wpi-info-fg); background: var(--wpi-info-bg); }
.wpi-risk--low { color: var(--wpi-low-fg); background: var(--wpi-low-bg); }
.wpi-risk--medium { color: var(--wpi-medium-fg); background: var(--wpi-medium-bg); }
.wpi-risk--high { color: var(--wpi-high-fg); background: var(--wpi-high-bg); }
.wpi-risk--critical { color: var(--wpi-critical-fg); background: var(--wpi-critical-bg); }
/* Bewust visueel anders dan .wpi-risk--info (stippellijn i.p.v. effen achtergrond): "nog niet geanalyseerd" is geen oordeel, dus mag er niet hetzelfde uitzien als een oordeel. */
.wpi-risk--not-analyzed { color: var(--wpi-text-muted); background: transparent; border: 1px dashed var(--wpi-border); }

/* ---------------------------------------------------------------------
 * "How it works" band
 * ------------------------------------------------------------------- */
.wpi-band {
	background: var(--wpi-bg-alt);
	padding: 56px 24px;
	text-align: center;
}
.wpi-band h2 { margin: 0 0 36px; font-size: 1.6rem; }
.wpi-steps {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
	max-width: 1000px;
	margin: 0 auto;
}
@media (max-width: 800px) { .wpi-steps { grid-template-columns: repeat(2, 1fr); } }
.wpi-step__number {
	display: inline-flex;
	width: 32px; height: 32px;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--wpi-blue);
	color: #fff;
	font-weight: 700;
	margin-bottom: 12px;
}
.wpi-step h3 { margin: 0 0 6px; font-size: 0.98rem; }
.wpi-step p { margin: 0; color: var(--wpi-text-muted); font-size: 0.88rem; }

/* ---------------------------------------------------------------------
 * Closing promise band (sectie 33)
 * ------------------------------------------------------------------- */
.wpi-promise {
	background: var(--wpi-blue-dark);
	color: #fff;
	padding: 48px 24px;
}
.wpi-promise__inner {
	max-width: 1180px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 32px;
	flex-wrap: wrap;
}
.wpi-promise h2 { margin: 0; font-size: 1.4rem; line-height: 1.35; }
.wpi-promise h2 .wpi-highlight { color: #93c5fd; }
.wpi-promise ul {
	list-style: none;
	margin: 0; padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	font-size: 0.95rem;
	color: #cbd5e1;
}

/* ---------------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------------- */
.wpi-footer {
	background: var(--wpi-blue-dark);
	color: #94a3b8;
	padding: 48px 24px 24px;
	font-size: 0.88rem;
}
.wpi-footer__inner {
	max-width: 1180px;
	margin: 0 auto;
}
.wpi-footer a { color: #cbd5e1; }
.wpi-footer__bottom {
	border-top: 1px solid #1e293b;
	margin-top: 32px;
	padding-top: 20px;
	text-align: center;
	font-size: 0.82rem;
}

/* ---------------------------------------------------------------------
 * Plugin detail page
 * ------------------------------------------------------------------- */
.wpi-detail-header {
	border-bottom: 1px solid var(--wpi-border);
	padding: 32px 0;
}
.wpi-detail-header__top {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}
.wpi-detail-header h1 { margin: 0; font-size: 1.5rem; }
.wpi-detail-header__meta {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
	margin-top: 12px;
	color: var(--wpi-text-muted);
	font-size: 0.9rem;
}
.wpi-disclaimer {
	background: var(--wpi-bg-alt);
	border: 1px solid var(--wpi-border);
	border-radius: var(--wpi-radius);
	padding: 14px 18px;
	font-size: 0.85rem;
	color: var(--wpi-text-muted);
	margin: 20px 0;
}

.wpi-detail-layout {
	display: grid;
	grid-template-columns: 240px 1fr;
	gap: 40px;
	padding: 32px 0 64px;
	align-items: start;
}
@media (max-width: 800px) {
	.wpi-detail-layout { grid-template-columns: 1fr; }
}
.wpi-tabs-nav {
	position: sticky;
	top: 24px;
	list-style: none;
	margin: 0; padding: 0;
	border: 1px solid var(--wpi-border);
	border-radius: var(--wpi-radius);
	overflow: hidden;
}
.wpi-tabs-nav a {
	display: block;
	padding: 12px 16px;
	color: var(--wpi-text);
	border-bottom: 1px solid var(--wpi-border);
	font-size: 0.9rem;
}
.wpi-tabs-nav li:last-child a { border-bottom: 0; }
.wpi-tabs-nav a:hover { background: var(--wpi-bg-alt); text-decoration: none; }
.wpi-tabs-nav a.is-active { background: #eff6ff; color: var(--wpi-blue); font-weight: 600; }

.wpi-tab-section {
	border-bottom: 1px solid var(--wpi-border);
	padding: 32px 0;
	scroll-margin-top: 24px;
}
.wpi-tab-section:last-child {
	border-bottom: 0;
	/*
	 * Dit is de ECHTE, gerichte fix voor de anchor-scroll-bug (een klik op een
	 * sectie die daarna te weinig ruimte eronder had, sprong naar de volgende
	 * sectie omdat de browser niet verder kon scrollen). De vorige aanpak gaf
	 * ELKE sectie min-height:60vh — dat loste het scroll-probleem op, maar
	 * dwong ook korte secties (bijv. Activation Behaviour) tot kunstmatige
	 * witruimte, wat de "open ruimtes"-klacht was. Door in plaats daarvan
	 * alleen de LAATSTE sectie extra ruimte ONDER zijn eigen inhoud te geven,
	 * krijgt de hele paginastapel voldoende scrolbare hoogte om óók de
	 * secties vlak vóór het einde (REST API, Activation Behaviour) bovenaan
	 * het scherm te kunnen zetten — zonder dat een sectie er zelf lucht bij krijgt.
	 */
	padding-bottom: 45vh;
}
.wpi-tab-section h2 { margin: 0 0 20px; font-size: 1.2rem; }

.wpi-stat-tiles {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin: 20px 0;
}
@media (max-width: 700px) { .wpi-stat-tiles { grid-template-columns: 1fr; } }
.wpi-stat-tile {
	border: 1px solid var(--wpi-border);
	border-radius: var(--wpi-radius);
	padding: 16px;
}
.wpi-stat-tile__label { color: var(--wpi-text-muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; }
/*
 * line-height: 1 is de daadwerkelijke fix voor de "te veel lucht tussen label
 * en badge"-klacht: bij font-size 1.3rem + de globale body line-height (1.5)
 * ontstaat een ~31px hoge regelbox rond een badge die zelf maar ~20px hoog is
 * — dat extra verschil IS de onbedoelde witruimte. Geldt voor elke tile die
 * hier een badge in toont (Overview-categorieën), niet alleen kale getallen
 * (REST API-tellingen, Version Changes) — vandaar één algemene fix hier i.p.v.
 * per template.
 */
.wpi-stat-tile__value { font-size: 1.3rem; font-weight: 700; line-height: 1; margin-top: 6px; }

.wpi-callout {
	border: 1px solid var(--wpi-medium-bg);
	background: #fffbeb;
	border-radius: var(--wpi-radius);
	padding: 16px 18px;
	margin: 20px 0;
}
.wpi-callout h3 { margin: 0 0 10px; font-size: 0.95rem; }
.wpi-callout ul { margin: 0; padding-left: 18px; }
.wpi-callout li { margin-bottom: 6px; }

.wpi-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.wpi-table th, .wpi-table td {
	text-align: left;
	padding: 10px 12px;
	border-bottom: 1px solid var(--wpi-border);
	font-size: 0.9rem;
}
.wpi-table th { color: var(--wpi-text-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }
.wpi-table code { background: var(--wpi-bg-alt); padding: 2px 6px; border-radius: 4px; font-size: 0.85rem; }

.wpi-pagination {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 16px 0 8px;
	flex-wrap: wrap;
}
.wpi-pagination__info { color: var(--wpi-text-muted); font-size: 0.85rem; }
.wpi-pagination__links { display: flex; gap: 8px; }

.wpi-checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; }
@media (max-width: 600px) { .wpi-checklist { grid-template-columns: 1fr; } }
.wpi-checklist li { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; }
/*
 * Bewust een tekstsymbool (✓/—) i.p.v. alleen een gekleurde stip: een stip in
 * bijna-witte kleur (voorheen var(--wpi-border), #e2e8f0) was op een lichte
 * achtergrond nauwelijks te onderscheiden van de "yes"-stip — leek zo alsof
 * alle items hetzelfde toonden. Tekst is ondubbelzinnig, ook kleurenblind-veilig.
 */
.wpi-checklist__dot {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px; height: 20px;
	border-radius: 50%;
	flex-shrink: 0;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1;
}
.wpi-checklist__dot--yes { background: var(--wpi-low-bg); color: var(--wpi-low-fg); }
.wpi-checklist__dot--no { background: var(--wpi-bg-alt); color: var(--wpi-text-muted); border: 1px solid var(--wpi-border); }
.wpi-checklist li.is-inactive { color: var(--wpi-text-muted); }

/* Native <details>/<summary> voor lange lijsten (bijv. 300+ capabilities) — geen JS nodig. */
details summary {
	cursor: pointer;
	color: var(--wpi-blue);
	font-weight: 600;
	font-size: 0.9rem;
	margin: 12px 0;
	padding: 8px 0;
}
details[open] summary { margin-bottom: 16px; }

.wpi-locked {
	border: 1px dashed var(--wpi-border);
	border-radius: var(--wpi-radius);
	padding: 28px;
	text-align: center;
	background: var(--wpi-bg-alt);
}
.wpi-locked p { color: var(--wpi-text-muted); margin: 8px 0 16px; }

.wpi-empty-state { color: var(--wpi-text-muted); font-style: italic; }

