/*
Theme Name: Openwoordtrainer
Version: 1.0
Description: WordPress theme for Openwoordtrainer
Author: Ruud Verhoeven
Author URI: https://ruudverhoeven.nl
*/

/* ========== GENERAL ========== */
:root{
  --owt-bg: #ffffff;           
  --owt-text: #000000;         
  --owt-text-muted: #000000;   
  --owt-brand: #7318de;        
  --owt-chip: rgba(0,0,0,.06); 
  --owt-hover: rgba(0,0,0,.08);
  --owt-ring: 0 0 0 3px rgba(115,24,222,.35); 
  --owt-shadow: 0 6px 20px rgba(0,0,0,.06);

  --owt-bg-page: #fff;
  --owt-text-intro: #e5e7eb;
  --owt-card: #ffffff;
  --owt-card-text: var(--owt-brand);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  background-color: var(--owt-bg-page);
  margin: 0;
  font-family: Roboto, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
}

/* ========== PROFESSIONAL HEADER (OWT) ========== */
.owt-header{
  position: sticky; top: 0; z-index: 1000;
  background: var(--owt-brand);
  color: var(--owt-bg);
  box-shadow: var(--owt-shadow);
}

.owt-header__inner{
  max-width: 1200px; margin: 0 auto;
  display: grid; align-items: center;
  grid-template-columns: 1fr auto auto; /* brand | nav/toggle | logos */
  gap: clamp(10px,2vw,24px);
  padding: clamp(10px,1.6vw,16px) clamp(14px,2.4vw,24px);
}

/* Brand */
.owt-brand__link{
  
  font-weight: 800; letter-spacing: .2px;
  font-size: clamp(18px, 2.2vw, 22px);
  text-decoration: none;
  color: var(--owt-bg);           /* purple brand text */
  white-space: nowrap;
}

/* Logos (right) */
.owt-logos{
  display:flex; align-items:center; justify-content: center;
  gap: clamp(10px, 1.2vw, 18px);
}
.owt-logos img{
  height: clamp(26px, 3.3vw, 42px);
  width:auto; object-fit:contain;
}


/* Make both logos fit into the same box */
.owt-logos img{
  width: 80px;        /* fixed width box */
  height: 30px;        /* fixed height box */
  object-fit: contain; /* keep proportions inside box */
  object-position: center;
  display: block;
}

/* Nav (center) */
.owt-nav{ justify-self:center; text-transform: uppercase;}
.owt-nav .menu{
  margin:0; padding:0; list-style:none;
  display:flex; align-items:center; flex-wrap:wrap;
  gap: clamp(6px, 0.9vw, 12px);
}
.owt-nav .menu > li{ position:relative; }
.owt-nav .menu > li > a{
  position: relative;
  display:inline-flex; align-items:center; gap:.4rem;
  padding:.55rem .8rem;
  font: 600 15px/1 Roboto, system-ui, sans-serif;
  color: var(--owt-bg);             
  text-decoration:none;
  border-radius: 999px;               /* pill */
  background: transparent;
  transition: background .18s ease, color .18s ease;
  outline: none;
}/* Hover / focus: only text color change + soft underline */
.owt-nav .menu > li > a:hover,
.owt-nav .menu > li > a:focus-visible{
  background: transparent;          /* no background highlight */
  box-shadow: none;                 /* no ring */
}

/* Active/current: just purple text, no chip background */
.owt-nav .menu > li.current-menu-item > a,
.owt-nav .menu > li.current-menu-ancestor > a{
  background: transparent;
  color: var(--owt-bg);
  font-weight: 700;                 /* subtle weight bump instead of bg */
}

/* Underline accent: thinner, faded, shorter */
.owt-nav .menu > li > a::after{
  content:""; position:absolute;
  left: 20%; right: 20%; bottom:.25rem;
  height:1px; border-radius:1px;
  background: currentColor;
  opacity:.4;                      /* softer */
  transform: scaleX(0);
  transform-origin:center;
  transition: transform .22s ease, opacity .22s ease;
}
.owt-nav .menu > li > a:hover::after,
.owt-nav .menu > li > a:focus-visible::after,
.owt-nav .menu > li.current-menu-item > a::after,
.owt-nav .menu > li.current-menu-ancestor > a::after{
  transform: scaleX(1);
  opacity:.7;
}


/* Dropdowns */
.owt-nav .sub-menu{
  position:absolute; top: calc(100% + 10px); left:0;
  min-width: 220px; border-radius: 14px;
  background: #ffffff; color:#111;
  padding: 8px; border: 1px solid #eee;
  box-shadow: 0 18px 40px rgba(0,0,0,.12);
  list-style:none; margin:0;
  opacity:0; visibility:hidden; transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  z-index: 50;
}
.owt-nav .menu > li:hover > .sub-menu,
.owt-nav .menu > li:focus-within > .sub-menu{
  opacity:1; visibility:visible; transform: translateY(0);
}
.owt-nav .sub-menu li a{
  display:block; padding:.55rem .65rem; border-radius:8px;
  color:#000; text-decoration:none; white-space:nowrap;
}
.owt-nav .sub-menu li a:hover,
.owt-nav .sub-menu li a:focus-visible{
  background:#f5f5f5; color: var(--owt-brand);
}

/* Keep dropdown inside on right edge */
.owt-nav .menu > li:last-child > .sub-menu{ right:0; left:auto; }

/* Mobile toggle (CSS-only) */
.owt-nav__checkbox{ display:none; }
.owt-nav__toggle{
  display:none; /* shown on small screens */
  width:44px; height:44px; border-radius:10px;
  justify-self:center;
  align-items:center; justify-content:center;
  cursor:pointer; user-select:none;
  transition: background .2s ease;
}
.owt-nav__toggle:hover{ background: var(--owt-hover); }
.owt-nav__hamburger,
.owt-nav__hamburger::before,
.owt-nav__hamburger::after{
  content:""; display:block; height:2px; width:22px; background: #fff;
  position:relative; border-radius:2px; transition: transform .2s ease, opacity .2s ease;
}
.owt-nav__hamburger::before{ position:absolute; top:-7px; }
.owt-nav__hamburger::after{ position:absolute; top:7px; }

/* ========== FRONT PAGE (intro, buttons, footer) ========== */

/* Intro */
#introtext{
  font-weight: 400;
  width: min(600px, 90vw);
  margin: clamp(40px, 6vh, 120px) auto 0;
  padding: 0;
  font-size: clamp(18px, 2.1vw, 28px);
  line-height: 1.5;
  color: var(--owt-text);
  text-align: center;
  margin-bottom: 40px;
}
#introtext p{ margin: 0 0 1rem; }

#subtext {
	font-weight: 300;
	font-size: 1.2rem;
	text-align: center; 
    color: #bbb;
}


/* Buttons wrapper: responsive grid */
#buttons{
  justify-content: center; 
	display: flex; 
	margin-top: 10px;
  cursor: pointer;
  gap: 20px;
}

/* Button card (square, capped size) */
.button-home{
  display: grid; place-items: center; text-align: center;
  aspect-ratio: 1 / 1;
  max-width: 280px; max-height: 280px;
  padding: 30px;
  border-radius: 18px;
  background: var(--owt-card);
  color: var(--owt-text);
  font-weight: 800;
  font-size: 1.8rem;
  text-decoration: none;
  border: 2px solid #ddd;
  position: relative; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, color .18s ease, background .18s ease;
}

.button-home::before{
  content:""; position:absolute; inset:0;
  background: radial-gradient(120% 80% at 20% -20%, rgba(115,24,222,.08), transparent 60%);
  pointer-events:none;
}
.button-home:hover{
  background: #f8f6ff;
  border-color: var(--owt-brand);
  transform: translateY(-2px);
}
.button-home:focus-visible{
  outline: none;
}
.button-home:active{
  transform: translateY(0);
}

/* Corner icons */
.button-svg1, .button-svg2{
  width: 26px; position: absolute; bottom: 16px;
}
.button-svg1{ right: 56px; }
.button-svg2{ right: 18px; }

/* Tooltip retained */
.has-tooltip{ position: relative; }
.has-tooltip .tooltiptext{
  visibility: hidden; opacity: 0;
  position: absolute; left: 50%; bottom: 30%;
  transform: translateX(-50%) translateY(6px);
  background: #111; color:#fff;
  font: 500 12px/1.2 Roboto, system-ui, sans-serif;
  padding: 8px 10px; border-radius: 8px;
  white-space: nowrap; z-index: 1000;
  box-shadow: 0 10px 22px rgba(0,0,0,.35);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.has-tooltip:hover .tooltiptext,
.has-tooltip:focus-visible .tooltiptext{
  visibility: visible; opacity: 1; transform: translateX(-50%) translateY(0);
}

/* Footer */
#footer{
  font-size: clamp(14px, 1.6vw, 18px);
  color: #cbd5e1;
  width: 100%; min-height: 60px;
  text-align: center;
  padding: 40px 16px 28px;
  margin-top: clamp(28px, 6vh, 56px);
  border-top: 1px solid rgba(255,255,255,.06);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 980px){
  .owt-header__inner{
    grid-template-columns: 1fr auto auto; /* brand | toggle | logos */
  }
  .owt-nav__toggle{ display:flex; }
  .owt-nav{ grid-column: 1 / -1; order: 3; width:100%; }
  .owt-nav .menu{
    display:none; /* hidden until toggled */
    background: rgba(0,0,0,.04);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 14px;
    padding: 8px;
  }
  /* show when toggled */
  #nav-toggle:checked ~ .owt-nav .menu{ display:flex; flex-direction:column; gap:6px; padding:8px; }
  /* animate toggle icon to X */
  #nav-toggle:checked + .owt-nav__toggle .owt-nav__hamburger{
    transform: rotate(45deg);
  }
  #nav-toggle:checked + .owt-nav__toggle .owt-nav__hamburger::before{
    transform: rotate(90deg) translateX(-7px);
  }
  #nav-toggle:checked + .owt-nav__toggle .owt-nav__hamburger::after{
    opacity:0;
  }

  /* Mobile dropdowns become inline lists */
  .owt-nav .sub-menu{
    position: static; transform:none; opacity:1; visibility:visible;
    background: transparent; border:none; box-shadow:none; padding:0; margin-left: .5rem;
  }
  .owt-nav .sub-menu li a{
    color: var(--owt-text); opacity:.95; padding:.5rem .75rem; border-radius:10px;
  }
  .owt-nav .sub-menu li a:hover{ background: var(--owt-hover); color: var(--owt-brand); }
}

@media (max-width: 900px){
  #introtext{ margin-top: clamp(64px, 8vh, 96px); }
  .button-svg1, .button-svg2{ width: 24px; bottom: 14px; }
  .button-svg1{ right: 50px; } .button-svg2{ right: 16px; }
}

@media (max-width: 620px){
  #introtext{ width: 92vw; font-size: clamp(16px, 4.2vw, 20px); }
  #buttons{ grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .button-home{ border-radius: 16px; }
  .button-svg1, .button-svg2{ width: 22px; bottom: 12px; }
  .button-svg1{ right: 44px; } .button-svg2{ right: 14px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .owt-nav .menu > li > a::after,
  .owt-nav .sub-menu,
  .owt-nav__hamburger,
  .owt-nav__hamburger::before,
  .owt-nav__hamburger::after,
  .button-home,
  .has-tooltip .tooltiptext{ transition: none; }
}

/* ========== CLEANUP LEGACY ========== */
/* Remove legacy header/menu spacing from older theme rules if present */
.menu-navigatie-container{ margin-top: 0 !important; }
/* If an old #header bar existed, ensure it doesn't show */
#header{ display:none !important; }

/* Hides only #footer that also has role="contentinfo" */
#footer[role="contentinfo"] {
  display: none !important;
}

/* === Card grid for #buttons-link === */
#buttons-link {
  display: grid;
	width: 80%; 
	margin: 0 auto;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(12px, 2vw, 24px);
  align-items: stretch;
  margin-block: 1.5rem 2rem;
}

/* Card (anchor acts as the card) */
#buttons-link .button {
  display: block;
  position: relative;
  padding: 18px 54px 18px 18px; /* extra right padding for icons */
  min-height: 88px;
  border-radius: 16px;
  background: var(--card-bg, #fff);
  color: var(--card-text, #111827);
  text-decoration: none;
  border: 1px solid var(--card-border, #e5e7eb);
  line-height: 1.35;
  font-weight: 600;
  font-size: clamp(1rem, .9rem + .4vw, 1.1rem);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
}

#buttons-link .button:hover {
	 background: #f8f6ff;
  border-color: var(--owt-brand);
  transform: translateY(-2px);
}

#buttons-link .button:focus-visible {
  outline: 3px solid var(--card-accent, #3b82f6);
  outline-offset: 2px;
}

/* Corner icons */
#buttons-link .button .share-icon,
#buttons-link .button .button-svg2 {
  position: absolute;
  width: 22px;
  height: 22px;
  opacity: .7;
  transition: transform .18s ease, opacity .18s ease;
  pointer-events: auto; /* keeps the share icon clickable */
}

#buttons-link .button .share-icon { top: 12px; right: 12px; }
#buttons-link .button .button-svg2 { bottom: 12px; right: 12px; }

#buttons-link .button:hover .share-icon,
#buttons-link .button:hover .button-svg2 {
  opacity: 1;
  transform: scale(1.05);
}

/* Touch-friendly */
@media (hover: none) {
  #buttons-link .button { min-height: 96px; }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root{
    --card-bg: #111827;
    --card-text: #f9fafb;
    --card-border: #1f2937;
    --card-accent: #60a5fa;
  }

}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  #buttons-link .button { transition: none; }
  #buttons-link .button:hover { transform: none; }
}

/* Button layout (optional if you already style .button) */
#buttons-link .button {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

/* Share icon hover “light up” */
.share-icon, .embed-icon {
  width: 20px;
  height: 20px;
  color: #64748b; /* slate-500-ish */
  transition: color .2s ease, transform .15s ease, filter .2s ease;
  cursor: pointer;
  outline: none;
}

.share-icon:hover,
.share-icon:focus-visible, .embed-icon:hover, .embed-icon:focus-visible {
  color: #f59e0b; /* amber-500-ish */
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, .7));
  transform: translateY(-1px) scale(1.06);
}

/* Basis button + icoon (als nog niet aanwezig) */
#buttons-link .button { display:inline-flex; align-items:center; gap:.5rem; }
.share-icon {
  width:20px; height:20px; color:#64748b;
  transition:color .2s ease, transform .15s ease, filter .2s ease;
  cursor:pointer; outline:none;
}
.share-icon:hover, .share-icon:focus-visible {
  color:#f59e0b;
  filter:drop-shadow(0 0 6px rgba(245,158,11,.7));
  transform:translateY(-1px) scale(1.06);
}

/* Modal */
.embed-modal.hidden { display:none; }
.embed-modal { position:fixed; inset:0; z-index:9999; }
.embed-backdrop {
  position:absolute; inset:0; background:rgba(0,0,0,.5);
}
.embed-panel {
  position:relative; max-width:820px; margin:5vh auto; z-index:1;
  background:#fff; border-radius:14px; padding:24px; box-shadow:0 20px 60px rgba(0,0,0,.25);
}
.embed-close {
  position:absolute; top:10px; right:12px; border:0; background:transparent;
  font-size:28px; line-height:1; cursor:pointer; color:#6b7280;
}
.embed-close:hover { color:#111827; }

#embed-title { margin:0 0 10px; font-size:1.25rem; }
.embed-label { display:block; margin-top:14px; margin-bottom:6px; font-weight:600; }

.embed-code-row { display:flex; gap:8px; align-items:stretch; }
.embed-code {
  flex:1; font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size:.9rem; padding:10px; border:1px solid #e5e7eb; border-radius:8px; background:#f9fafb; resize:vertical;
}
.embed-copy {
  white-space:nowrap; border:1px solid #e5e7eb; background:#fff; border-radius:8px; padding:0 12px;
  font-weight:600; cursor:pointer;
}
.embed-copy:hover { background:#f3f4f6; }

.embed-tips { margin-top:10px; }
.embed-preview-title { margin:18px 0 8px; font-size:1rem; }
.embed-preview-wrap { background:#f9fafb; border:1px dashed #e5e7eb; border-radius:10px; padding:12px; }

/* Make the embed panel scroll vertically if content is tall */
.embed-panel {
  position: relative;
  max-width: 820px;
  margin: 5vh auto;
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);

  /* NEW: limit height and allow vertical scrolling */
  max-height: 90vh;   /* fits nicely within viewport */
  overflow-y: auto;   /* show vertical scrollbar if needed */
}

.embed-panel {
  overflow-y: scroll;
}

a.button.no-url {
  cursor: default;
  pointer-events: none; /* voorkomt klikken */
  opacity: 0.6;         /* optioneel: geef visueel verschil */
}

a.button.no-url:hover {
  background: inherit;  /* hover effect uitzetten */
}

/* Buttons without URL should not navigate, but remain focusable/hoverable */
a.button.no-url {
  position: relative;
  cursor: default;
}

/* The popover bubble */
a.button .btn-popover {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.95); /* near-black */
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  z-index: 30;
}

/* Popover arrow */
a.button .btn-popover::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 10px; height: 10px;
  background: rgba(17, 24, 39, 0.95);
  transform: translateX(-50%) rotate(45deg);
}

/* Show on hover or keyboard focus */
a.button.no-url:hover .btn-popover,
a.button.no-url:focus-visible .btn-popover,
a.button.no-url.show-popover .btn-popover {
  opacity: 1;
}


#buttons .button-home {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 120px;
  padding: 8.5rem 1rem;
  border-radius: 16px;

  background: var(--owt-card, #fff);
  color: var(--owt-text);
  font-size: 1.8rem;
  font-weight: 700;
  text-decoration: none;

  position: relative;
  transition: transform .2s ease, box-shadow .2s ease, color .2s ease, background .2s ease;
}

#buttons .button-home:hover {
  transform: translateY(-4px);
  background: #f8f6ff;
}

#buttons .button-home:focus-visible {
  outline: none;

}

/* Share icon in corner */
#buttons .button-home .share-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  color: #64748b;
  transition: color .2s ease, transform .15s ease;
  cursor: pointer;
}

#buttons .button-home:hover .share-icon {
  color: #f59e0b;
  transform: scale(1.1);
}

.button-home.no-url {
  position: relative;
  cursor: not-allowed;
}

/* hidden by default */
.button-home.no-url .btn-popover {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.95);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  z-index: 30;
}

.button-home.no-url .btn-popover::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: rgba(17, 24, 39, 0.95);
  transform: translateX(-50%) rotate(45deg);
}

/* show on hover (desktop) */
.button-home.no-url:hover .btn-popover,
.button-home.no-url.show-popover .btn-popover {
  opacity: 1;
}

/* allow tooltip to escape the card */
#buttons .button-home.no-url {
  position: relative;
  overflow: visible !important; /* was hidden on .button-home */
  cursor: not-allowed;
}

/* tooltip base (hidden) */
#buttons .button-home.no-url .btn-popover {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.95);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
  z-index: 30;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .15s ease, visibility .15s ease;
}

#buttons .button-home.no-url .btn-popover::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 8px; height: 8px;
  background: rgba(17, 24, 39, 0.95);
  transform: translateX(-50%) rotate(45deg);
}

/* show on hover (desktop) and when toggled (mobile) */
#buttons .button-home.no-url:hover .btn-popover,
#buttons .button-home.no-url.show-popover .btn-popover {
  opacity: 1;
  visibility: visible;
}

.no-url, .no-link {
	background: gray;
}

.button-text-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* keeps text left aligned */
}

.unavailable-text {
  font-size: 0.8em;
  color: #888; /* lighter grey for secondary look */
  margin-top: 0.25rem;
  display: block;
}

.button-group-title{
  margin: 1.25rem 0 .5rem;
  font-size: 1.1rem;
  font-weight: 700;
  opacity: .9;
}

/* The wrapper already exists */
#buttons-link{
  display: flex;
  flex-direction: column;
  gap: 1.25rem; /* space between groups */
}

/* Group headings */
.button-group-title{
  margin: 0;
  padding: .75rem 0 .5rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: .01em;
  border-top: 2px solid rgba(0,0,0,.08);
}

/* Remove top border on the first group */
#buttons-link .button-group-title:first-of-type{
  border-top: 0;
  padding-top: 0;
}

/* Space buttons under the heading */
.button-group-title + .button{
  margin-top: .25rem;
}

/* Add consistent spacing between buttons within a group */
#buttons-link .button{
  margin-top: .5rem;
}