/*
 * omsmidden.nl: aanpassingen bovenop Twenty Eleven (style.css).
 * 1. Wat WordPress via de Customizer zette (linkkleur, verborgen sitetitel).
 * 2. Een lichte modernisering: lettertype, witruimte, vlak menu, rustiger zijbalk.
 *    De opbouw (kopafbeelding, menu, inhoud, zijbalk rechts) blijft die van het origineel.
 * 3. Donkere modus: volgt de instelling van het apparaat (prefers-color-scheme).
 *    Kleuren lopen via de variabelen hieronder; onderaan staan ze voor donker.
 */

:root {
  --rood: #d10a10;
  --rood-donker: #a8080d;
  --tekst: #1f1f1f;
  --zacht: #5f5f5f;
  --lijn: #e3e3e3;
  --vlak: #f6f6f5;
  --achtergrond: #ecebe8;
  --menu: #1f1f1f;
  --pagina: #fff;
  --veld: #fafafa;
  --link: var(--rood);
  --link-hover: var(--rood-donker);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ── 1. Uit de WordPress-instellingen ───────────────────────────────────────── */
#site-title,
#site-description {
  position: absolute;
  clip-path: inset(50%);
}

a,
#site-title a:hover,
.entry-title a:hover,
.entry-title a:focus {
  color: var(--link);
}

/* ── 2. Modernisering ───────────────────────────────────────────────────────── */
html {
  -webkit-text-size-adjust: 100%;
}
body {
  background: var(--achtergrond);
  color: var(--tekst);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  padding: 0 1em;
}
body,
input,
textarea,
button {
  font-family: var(--font);
}

#page {
  background: var(--pagina);
  margin: 2.5em auto;
  border-radius: 8px;
  /* clip i.p.v. hidden: anders werkt de sticky menubalk niet */
  overflow: clip;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* Kop: geen grijze rand meer, afbeelding loopt tot de rand */
#branding {
  border-top: 0;
  padding-bottom: 0;
}
#branding img {
  display: block;
  margin-bottom: 0;
}

/* Menu: vlakke balk (met zoekveld) die bij het scrollen bovenaan blijft;
   de actieve pagina krijgt een rode streep */
#access {
  background: var(--menu);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04), 0 2px 8px rgba(0, 0, 0, 0.12);
  margin: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
#access .menubalk {
  display: none;
}
#access #hoofdmenu {
  display: flex;
  align-items: center;
  gap: 1em;
}
#access .menu-zoeken {
  order: 2;
  margin-left: auto;
}
#access .menu-zoeken input {
  box-sizing: border-box;
  width: 190px;
  border: 1px solid #444;
  border-radius: 999px;
  /* Lichte loep: de thema-afbeelding is donker en valt weg op de donkere balk */
  background: #2a2a2a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23a0a0a0' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E") no-repeat 12px 50%;
  color: #fff;
  font-size: 14px;
  padding: 7px 12px 7px 34px;
  transition: border-color 0.15s, width 0.2s;
}
#access .menu-zoeken input::placeholder {
  color: #9a9a9a;
}
#access .menu-zoeken input:focus {
  border-color: var(--rood);
  outline: none;
  width: 240px;
}
#access ul.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25em;
  margin: 0;
}
#access li {
  float: none;
}
#access a {
  position: relative;
  font-size: 15px;
  font-weight: 500;
  color: #cfcfcf;
  line-height: 1.2;
  padding: 1.05em 1.1em;
  transition: color 0.15s;
}
#access a::after {
  content: "";
  position: absolute;
  left: 1.1em;
  right: 1.1em;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--rood);
  transform: scaleX(0);
  transition: transform 0.2s ease, opacity 0.2s;
}
#access li:hover > a,
#access a:focus {
  background: transparent;
  color: #fff;
}
#access li:hover > a::after {
  transform: scaleX(1);
  opacity: 0.45;
}
#access a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -6px;
  border-radius: 6px;
}
#access .current-menu-item > a {
  background: transparent;
  color: #fff;
  font-weight: 600;
}
#access .current-menu-item > a::after {
  transform: scaleX(1);
  opacity: 1;
}

/* Inhoud */
#main {
  padding-top: 2.5em;
}
.entry-title,
.entry-title a,
.singular .entry-title {
  color: var(--tekst);
  font-weight: 650;
  letter-spacing: -0.01em;
}
.entry-title {
  font-size: 28px;
  line-height: 1.25;
  padding-top: 0;
}
.singular .entry-title {
  font-size: 34px;
  line-height: 1.2; /* thema: vaste 48px, te ruim zodra de titel breekt */
}
.page-title {
  color: var(--zacht);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2em;
}
.page-title span {
  color: var(--tekst);
}
.entry-meta {
  color: var(--zacht);
  font-size: 13px;
}
.entry-meta a {
  color: var(--zacht);
}
.entry-header .entry-meta {
  margin-top: 0.4em;
}
.entry-content,
.entry-summary {
  font-size: 16px;
  line-height: 1.7;
  padding-top: 1.2em;
}
.entry-content p,
.entry-summary p {
  margin-bottom: 1.1em;
}
.entry-content a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.entry-content a:hover {
  color: var(--link-hover);
}
.entry-content img {
  border-radius: 4px;
}
.hentry,
.no-results {
  border-bottom: 1px solid var(--lijn);
  padding-bottom: 2em;
  margin-bottom: 2.5em;
}
.singular .hentry {
  border-bottom: 0;
  padding-top: 0;
}
footer.entry-meta {
  margin-top: 1.5em;
}

/* Vorige/volgende */
#nav-single,
#nav-above,
#nav-below {
  font-size: 14px;
}
#nav-above,
#nav-below {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2em;
}
#nav-above .nav-previous,
#nav-below .nav-previous,
#nav-above .nav-next,
#nav-below .nav-next {
  float: none;
}
#nav-single a,
#nav-above a,
#nav-below a {
  display: inline-block;
  padding: 0.35em 0.9em;
  border: 1px solid var(--lijn);
  border-radius: 999px;
  color: var(--tekst);
  text-decoration: none;
}
#nav-single a:hover,
#nav-above a:hover,
#nav-below a:hover {
  border-color: var(--link);
  color: var(--link);
}

/* Zijbalk */
.widget {
  background: var(--vlak);
  border-radius: 6px;
  padding: 1.1em 1.2em;
  margin-bottom: 1.5em;
}
.widget-title {
  color: var(--zacht);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.6em;
}
.widget ul {
  margin: 0;
}
.widget ul li {
  hyphens: manual;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.45;
  padding: 0.3em 0;
  color: var(--tekst);
}
.widget a {
  color: var(--tekst);
  text-decoration: none;
}
.widget a:hover {
  color: var(--link);
}

/* Voet */
#colophon {
  border-top: 1px solid var(--lijn);
}
#site-generator {
  background: var(--vlak);
  color: var(--zacht);
  border-top: 0;
  padding: 1.2em;
}

/* ── Mobiel en tablet (≤ 800px) ─────────────────────────────────────────────── */
@media (max-width: 800px) {
  body {
    padding: 0;
  }
  #page {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  /* Menubalk met naam en menuknop */
  #access div {
    margin: 0;
  }
  #access div.menubalk {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 0 16px;
  }
  .menubalk-naam {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .menubalk-naam:hover {
    color: #fff;
  }
  .menu-knop {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font: 500 15px/1 var(--font);
    cursor: pointer;
  }
  .menu-knop:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
  }
  /* Hamburgericoon dat een kruis wordt */
  .menu-knop-icoon,
  .menu-knop-icoon span {
    display: block;
    position: relative;
    width: 18px;
    height: 2px;
  }
  .menu-knop-icoon span,
  .menu-knop-icoon span::before,
  .menu-knop-icoon span::after {
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.2s ease, background-color 0.2s;
  }
  .menu-knop-icoon span::before,
  .menu-knop-icoon span::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
  }
  .menu-knop-icoon span::before {
    transform: translateY(-6px);
  }
  .menu-knop-icoon span::after {
    transform: translateY(6px);
  }
  #access.open .menu-knop-icoon span {
    background: transparent;
  }
  #access.open .menu-knop-icoon span::before {
    transform: rotate(45deg);
  }
  #access.open .menu-knop-icoon span::after {
    transform: rotate(-45deg);
  }

  /* Zonder JavaScript staat het menu open en is er geen knop */
  html:not(.js) .menu-knop {
    display: none;
  }
  html.js #access #hoofdmenu {
    display: none;
  }
  html.js #access.open #hoofdmenu {
    display: block;
  }

  /* Uitklapmenu */
  #access #hoofdmenu {
    display: block;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 16px 16px;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
  }
  #access .menu-zoeken {
    margin: 0 0 10px;
  }
  #access .menu-zoeken input,
  #access .menu-zoeken input:focus {
    width: 100%;
    background-position: 14px 50%;
    font-size: 16px; /* voorkomt inzoomen op iOS */
    padding: 11px 14px 11px 38px;
  }
  #access ul.menu {
    flex-direction: column;
    gap: 2px;
  }
  #access a {
    display: block;
    font-size: 17px;
    padding: 14px 14px;
    border-radius: 8px;
    color: #e6e6e6;
  }
  #access a::after {
    display: none;
  }
  #access li:hover > a {
    background: #2a2a2a;
  }
  #access .current-menu-item > a {
    background: #2a2a2a;
    box-shadow: inset 3px 0 0 var(--rood);
  }

  /* Inhoud met vaste marges in plaats van percentages */
  #main {
    padding-top: 1.5em;
  }
  /* Twenty Eleven laat #primary zweven; dan schuift de zijbalk (met zijn rand) achter de inhoud */
  #primary {
    float: none;
    margin: 0;
  }
  #main #content,
  #main #secondary {
    margin: 0 20px;
  }
  .entry-title {
    font-size: 23px;
  }
  .singular .entry-title {
    font-size: 26px;
  }
  .entry-content,
  .entry-summary {
    font-size: 16px;
  }
  .entry-content img {
    max-width: 100%;
    height: auto;
  }
  .page-title {
    margin-bottom: 1.25em;
  }
  #nav-single {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5em;
  }
  #nav-single .nav-previous,
  #nav-single .nav-next {
    float: none;
  }
  #nav-above,
  #nav-below {
    border-bottom: 0;
  }
  #secondary {
    border-top: 1px solid var(--lijn);
    padding-top: 1.5em;
  }
  .widget {
    margin-left: 0;
    margin-right: 0;
  }
}

/* Telefoon: zwevende afbeeldingen worden blokken (Twenty Eleven doet dit al vanaf 650px) */
@media (max-width: 650px) {
  .entry-content .alignright,
  .entry-content .alignleft {
    margin: 0 auto 1.2em;
  }
}

/* ── 3. Donkere modus ───────────────────────────────────────────────────────── */
/* Twenty Eleven (style.css, blocks.css) zet zijn kleuren vast; wat op deze site voorkomt
   (tekst, koppen, randen, invoervelden, bijschriften, tabellen) gaat hier via de variabelen. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --rood: #e5484d;
    --rood-donker: #c62f35;
    --tekst: #e6e6e3;
    --zacht: #a2a29e;
    --lijn: #303236;
    --vlak: #1e2023;
    --achtergrond: #0f1012;
    --menu: #0b0c0d;
    --pagina: #17181b;
    --veld: #1e2023;
    /* Rood op donker haalt het contrast niet; links worden lichter */
    --link: #ff8a80;
    --link-hover: #ffb3ac;
  }

  body,
  input,
  textarea,
  .entry-content th,
  .widget ul li,
  .page-link a {
    color: var(--tekst);
  }
  .entry-content h1,
  .entry-content h2,
  .entry-content h3,
  .entry-content h4,
  .entry-content h5,
  .entry-content h6,
  .singular .entry-title,
  #site-title a {
    color: var(--tekst);
  }
  blockquote cite,
  .wp-caption .wp-caption-text,
  .wp-caption .wp-caption-text:before,
  [class^="wp-block-"]:not(.wp-block-gallery) > figcaption,
  [class^="wp-block-"]:not(.wp-block-gallery) > figcaption:before,
  .wp-block-quote cite,
  #site-generator a {
    color: var(--zacht);
  }

  hr {
    background-color: var(--lijn);
  }
  pre,
  .wp-caption,
  .page-link a,
  .error404 #main #searchform {
    background: var(--vlak);
  }
  ins {
    background: #4a4420;
  }
  .entry-content table,
  .wp-block-table,
  #nav-below,
  #site-generator,
  .error404 #main #searchform {
    border-color: var(--lijn);
  }
  .entry-content td,
  .wp-block-table td {
    border-top-color: var(--lijn);
  }
  img[class*="align"],
  img[class*="wp-image-"],
  .wp-caption img {
    border-color: var(--lijn);
  }
  a:focus img[class*="align"],
  a:hover img[class*="align"],
  a:active img[class*="align"],
  a:focus img[class*="wp-image-"],
  a:hover img[class*="wp-image-"],
  a:active img[class*="wp-image-"] {
    background: var(--vlak);
    border-color: var(--zacht);
  }

  /* Invoervelden buiten de menubalk */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="url"],
  input[type="number"],
  input[type="search"]:not(.field),
  textarea {
    background: var(--veld);
    border-color: var(--lijn);
    color: var(--tekst);
  }

  /* Menubalk: donkerder dan de pagina, met een lijn eronder zodat hij loskomt */
  #access {
    box-shadow: 0 1px 0 var(--lijn), 0 2px 8px rgba(0, 0, 0, 0.4);
  }
  #access .menu-zoeken input {
    background-color: #1c1d20;
    border-color: #3a3c40;
  }

  /* Witte logo's en foto's minder fel, alleen in de inhoud (de kopafbeelding blijft zoals hij is) */
  .entry-content img {
    filter: brightness(0.9);
  }

  #page {
    box-shadow: 0 0 0 1px var(--lijn), 0 8px 24px rgba(0, 0, 0, 0.4);
  }
}

@media (prefers-color-scheme: dark) and (max-width: 800px) {
  #access li:hover > a,
  #access .current-menu-item > a {
    background: #1c1d20;
  }
  #access #hoofdmenu {
    border-top-color: var(--lijn);
  }
}

@media (prefers-reduced-motion: reduce) {
  #access a::after,
  .menu-knop-icoon span,
  .menu-knop-icoon span::before,
  .menu-knop-icoon span::after {
    transition: none;
  }
}
