/*
Theme Name: IT Waarschuwing
Theme URI: https://itwaarschuwing.nl
Author: Hekkelman I.T.
Author URI: https://hekkelman-it.nl
Description: Nieuwsthema voor IT-waarschuwingen en cyberflitsen. Overzichtelijk nieuwsoverzicht, urgentie-badges (laag/middel/hoog/kritiek), kritieke-waarschuwingsbalk en volledige REST API-ondersteuning voor geautomatiseerd publiceren.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: itwaarschuwing
Tags: news, blog, one-column, custom-logo, custom-menu, featured-images, translation-ready
*/

/* =========================================================
   Basis & variabelen
   ========================================================= */
:root {
  --itw-bg: #f4f6fa;
  --itw-surface: #ffffff;
  --itw-ink: #0f172a;
  --itw-ink-soft: #475569;
  --itw-ink-faint: #94a3b8;
  --itw-line: #e2e8f0;
  --itw-accent: #dc2626;
  --itw-accent-dark: #b91c1c;
  --itw-link: #1d4ed8;
  --itw-header: #0f172a;
  --itw-header-ink: #f8fafc;
  --itw-radius: 12px;
  --itw-shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 16px rgba(15, 23, 42, .06);
  --itw-shadow-hover: 0 4px 12px rgba(15, 23, 42, .12), 0 12px 32px rgba(15, 23, 42, .10);
  /* Urgentiekleuren */
  --itw-laag: #16a34a;
  --itw-middel: #ca8a04;
  --itw-hoog: #ea580c;
  --itw-kritiek: #dc2626;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--itw-bg);
  color: var(--itw-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; }

a { color: var(--itw-link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--itw-accent-dark); }

h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  color: var(--itw-ink);
  margin: 0 0 .5em;
  font-weight: 700;
  letter-spacing: -0.01em;
}

:focus-visible {
  outline: 3px solid var(--itw-link);
  outline-offset: 2px;
  border-radius: 4px;
}

.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden;
  padding: 0; position: absolute; word-wrap: normal !important;
}
.screen-reader-text:focus {
  background: var(--itw-surface); clip: auto !important; clip-path: none;
  color: var(--itw-ink); display: block; font-size: .95rem; font-weight: 700;
  height: auto; left: 8px; line-height: normal; padding: 12px 20px;
  text-decoration: none; top: 8px; width: auto; z-index: 100000;
  box-shadow: var(--itw-shadow);
}

.itw-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =========================================================
   Kritieke-waarschuwingsbalk
   ========================================================= */
.itw-alertbar {
  background: linear-gradient(90deg, var(--itw-accent-dark), var(--itw-accent));
  color: #fff;
  font-size: .95rem;
}
.itw-alertbar .itw-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.itw-alertbar__label {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .8rem;
}
.itw-alertbar__label svg { width: 16px; height: 16px; }
.itw-alertbar a {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.itw-alertbar a:hover { color: #fecaca; }

/* =========================================================
   Header
   ========================================================= */
.itw-header {
  background: var(--itw-header);
  color: var(--itw-header-ink);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .35);
}
.itw-header .itw-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}
.itw-branding {
  display: flex;
  align-items: center;
  gap: 12px;
}
.itw-branding__logo img { display: block; max-height: 44px; width: auto; }
.itw-branding__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--itw-accent);
  color: #fff;
  flex-shrink: 0;
}
.itw-branding__icon svg { width: 22px; height: 22px; }
.itw-branding__text { display: flex; flex-direction: column; }
.itw-branding__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.itw-branding__title a { color: var(--itw-header-ink); text-decoration: none; }
.itw-branding__title a:hover { color: #fca5a5; }
.itw-branding__tagline {
  margin: 0;
  font-size: .78rem;
  color: #94a3b8;
  line-height: 1.3;
}

/* Navigatie */
.itw-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.itw-nav a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
}
.itw-nav a:hover,
.itw-nav .current-menu-item > a,
.itw-nav .current_page_item > a {
  color: #fff;
  background: rgba(255, 255, 255, .10);
}
.itw-nav__toggle { display: none; }

.itw-header-search form {
  display: flex;
  align-items: center;
}
.itw-header-search input[type="search"] {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  border-radius: 8px 0 0 8px;
  padding: 8px 12px;
  font-size: .9rem;
  width: 170px;
  border-right: 0;
}
.itw-header-search input[type="search"]::placeholder { color: #94a3b8; }
.itw-header-search button {
  background: var(--itw-accent);
  border: 1px solid var(--itw-accent);
  color: #fff;
  border-radius: 0 8px 8px 0;
  padding: 8px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.itw-header-search button:hover { background: var(--itw-accent-dark); }
.itw-header-search button svg { width: 16px; height: 16px; }

/* =========================================================
   Content-layout
   ========================================================= */
.itw-main { padding: 40px 0 64px; }

.itw-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.itw-section-head h1,
.itw-section-head h2 {
  margin: 0;
  font-size: 1.5rem;
}
.itw-section-head .itw-feedlink {
  font-size: .875rem;
  color: var(--itw-ink-soft);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.itw-section-head .itw-feedlink:hover { color: var(--itw-accent-dark); }
.itw-section-head .itw-feedlink svg { width: 14px; height: 14px; }

/* Uitgelicht bericht (nieuwste) */
.itw-featured {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 0;
  background: var(--itw-surface);
  border: 1px solid var(--itw-line);
  border-radius: var(--itw-radius);
  overflow: hidden;
  box-shadow: var(--itw-shadow);
  margin-bottom: 40px;
}
.itw-featured__body {
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  min-width: 0;
}
.itw-featured__title { font-size: 1.75rem; margin: 0; }
.itw-featured__title a { color: var(--itw-ink); text-decoration: none; }
.itw-featured__title a:hover { color: var(--itw-accent-dark); }
.itw-featured__excerpt { margin: 0; color: var(--itw-ink-soft); }
.itw-featured__thumb {
  min-height: 260px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  position: relative;
}
.itw-featured__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.itw-featured__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #334155;
}
.itw-featured__thumb--placeholder svg { width: 96px; height: 96px; }

/* Nieuwsgrid */
.itw-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.itw-card {
  background: var(--itw-surface);
  border: 1px solid var(--itw-line);
  border-radius: var(--itw-radius);
  overflow: hidden;
  box-shadow: var(--itw-shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow .18s ease, transform .18s ease;
}
.itw-card:hover {
  box-shadow: var(--itw-shadow-hover);
  transform: translateY(-2px);
}
.itw-card__thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  display: block;
  position: relative;
  overflow: hidden;
}
.itw-card__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.itw-card__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}
.itw-card__thumb--placeholder svg { width: 48px; height: 48px; }
.itw-card__body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
}
.itw-card__title {
  font-size: 1.08rem;
  margin: 0;
  line-height: 1.35;
}
.itw-card__title a { color: var(--itw-ink); text-decoration: none; }
.itw-card__title a:hover { color: var(--itw-accent-dark); }
.itw-card__excerpt {
  margin: 0;
  color: var(--itw-ink-soft);
  font-size: .92rem;
  flex-grow: 1;
}

/* Meta-regel & badges */
.itw-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: .8rem;
  color: var(--itw-ink-faint);
}
.itw-meta time { font-weight: 600; color: var(--itw-ink-soft); }
.itw-meta a { color: var(--itw-ink-soft); text-decoration: none; }
.itw-meta a:hover { color: var(--itw-accent-dark); }

.itw-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #fff;
  background: var(--itw-ink-faint);
  text-decoration: none !important;
}
.itw-badge::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
}
a.itw-badge:hover { filter: brightness(1.12); color: #fff; }
.itw-badge--laag    { background: var(--itw-laag); }
.itw-badge--middel  { background: var(--itw-middel); }
.itw-badge--hoog    { background: var(--itw-hoog); }
.itw-badge--kritiek { background: var(--itw-kritiek); }

/* =========================================================
   Paginering
   ========================================================= */
.itw-pagination { margin-top: 40px; }
.itw-pagination .nav-links {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.itw-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--itw-surface);
  border: 1px solid var(--itw-line);
  color: var(--itw-ink);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
}
.itw-pagination .page-numbers:hover { border-color: var(--itw-accent); color: var(--itw-accent-dark); }
.itw-pagination .page-numbers.current {
  background: var(--itw-header);
  border-color: var(--itw-header);
  color: #fff;
}
.itw-pagination .page-numbers.dots { border: 0; background: transparent; }

/* =========================================================
   Enkel bericht / pagina
   ========================================================= */
.itw-article {
  background: var(--itw-surface);
  border: 1px solid var(--itw-line);
  border-radius: var(--itw-radius);
  box-shadow: var(--itw-shadow);
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 48px 48px;
}
.itw-article__header { margin-bottom: 24px; }
.itw-article__title { font-size: 2rem; margin: 10px 0 12px; }
.itw-article__thumb { margin: 0 0 28px; }
.itw-article__thumb img { border-radius: 10px; display: block; }

.itw-article__content { font-size: 1.05rem; }
.itw-article__content > *:first-child { margin-top: 0; }
.itw-article__content h2 { font-size: 1.4rem; margin-top: 1.6em; }
.itw-article__content h3 { font-size: 1.15rem; margin-top: 1.4em; }
.itw-article__content p { margin: 0 0 1.1em; }
.itw-article__content ul,
.itw-article__content ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.itw-article__content blockquote {
  margin: 1.4em 0;
  padding: 12px 20px;
  border-left: 4px solid var(--itw-accent);
  background: #fef2f2;
  border-radius: 0 8px 8px 0;
  color: var(--itw-ink-soft);
}
.itw-article__content code {
  background: #f1f5f9;
  border: 1px solid var(--itw-line);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: .9em;
  font-family: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, monospace;
}
.itw-article__content pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 18px 22px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: .9rem;
  line-height: 1.55;
}
.itw-article__content pre code { background: transparent; border: 0; padding: 0; color: inherit; }
.itw-article__content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.4em;
  font-size: .95rem;
}
.itw-article__content th,
.itw-article__content td {
  border: 1px solid var(--itw-line);
  padding: 8px 12px;
  text-align: left;
}
.itw-article__content th { background: #f8fafc; }
.itw-article__content img { border-radius: 8px; }
.itw-article__content .wp-block-image { margin: 1.4em 0; }

.itw-article__footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--itw-line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: .875rem;
  color: var(--itw-ink-soft);
}
.itw-tag {
  display: inline-block;
  background: #f1f5f9;
  border: 1px solid var(--itw-line);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: .8rem;
  color: var(--itw-ink-soft);
  text-decoration: none;
}
.itw-tag:hover { border-color: var(--itw-accent); color: var(--itw-accent-dark); }

/* Gerelateerde berichten */
.itw-related { max-width: 820px; margin: 40px auto 0; }
.itw-related h2 { font-size: 1.25rem; margin-bottom: 16px; }
.itw-related .itw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Navigatie vorige/volgende */
.itw-postnav {
  max-width: 820px;
  margin: 28px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.itw-postnav a {
  flex: 1;
  background: var(--itw-surface);
  border: 1px solid var(--itw-line);
  border-radius: 10px;
  padding: 14px 18px;
  text-decoration: none;
  color: var(--itw-ink);
  font-size: .9rem;
  box-shadow: var(--itw-shadow);
}
.itw-postnav a:hover { border-color: var(--itw-accent); }
.itw-postnav__label {
  display: block;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--itw-ink-faint);
  font-weight: 700;
  margin-bottom: 2px;
}
.itw-postnav--next { text-align: right; }

/* =========================================================
   Zoeken & 404
   ========================================================= */
.itw-searchform {
  display: flex;
  max-width: 560px;
  margin: 0 0 32px;
}
.itw-searchform input[type="search"] {
  flex: 1;
  border: 1px solid var(--itw-line);
  border-radius: 10px 0 0 10px;
  padding: 12px 16px;
  font: inherit;
  border-right: 0;
  background: var(--itw-surface);
}
.itw-searchform button {
  background: var(--itw-accent);
  border: 1px solid var(--itw-accent);
  color: #fff;
  border-radius: 0 10px 10px 0;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.itw-searchform button:hover { background: var(--itw-accent-dark); }
.itw-searchform button svg { width: 16px; height: 16px; }

.itw-empty {
  background: var(--itw-surface);
  border: 1px dashed var(--itw-line);
  border-radius: var(--itw-radius);
  padding: 48px 32px;
  text-align: center;
  color: var(--itw-ink-soft);
}

/* =========================================================
   Footer
   ========================================================= */
.itw-footer {
  background: var(--itw-header);
  color: #94a3b8;
  margin-top: 64px;
  font-size: .9rem;
}
.itw-footer a { color: #cbd5e1; text-decoration: none; }
.itw-footer a:hover { color: #fff; text-decoration: underline; }
.itw-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 28px 0;
}
.itw-footer__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

/* =========================================================
   Responsief
   ========================================================= */
@media (max-width: 900px) {
  .itw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .itw-featured { grid-template-columns: 1fr; }
  .itw-featured__thumb { min-height: 200px; order: -1; }
  .itw-featured__body { padding: 24px; }
  .itw-featured__title { font-size: 1.4rem; }
  .itw-article { padding: 28px 24px 32px; }
}

@media (max-width: 640px) {
  .itw-grid { grid-template-columns: 1fr; }
  .itw-related .itw-grid { grid-template-columns: 1fr; }
  .itw-header .itw-container { justify-content: center; }
  .itw-header-search { width: 100%; }
  .itw-header-search form { width: 100%; }
  .itw-header-search input[type="search"] { width: 100%; }
  .itw-article__title { font-size: 1.5rem; }
  .itw-postnav { flex-direction: column; }
  .itw-postnav--next { text-align: left; }
}

/* =========================================================
   WordPress-kernklassen (uitlijning e.d.)
   ========================================================= */
.alignleft { float: left; margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignwide, .alignfull { max-width: 100%; }
.wp-caption { max-width: 100%; }
.wp-caption-text {
  font-size: .85rem;
  color: var(--itw-ink-faint);
  text-align: center;
  margin-top: 6px;
}
.sticky {}
.bypostauthor {}
.gallery-caption {}
