/*
Theme Name: Nuage CV
Theme URI: https://cv.nuage.ch/
Author: Gabriel Klein
Description: A focused, accessible portfolio and CV theme for technology leaders.
Version: 1.2.1
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: nuage-cv
*/

:root {
  --ink: #142336;
  --muted: #5d6978;
  --paper: #ffffff;
  --canvas: #f3f6f8;
  --line: #dce4e9;
  --accent: #087e8b;
  --accent-dark: #075e69;
  --navy: #102a43;
  --navy-soft: #183d5d;
  --warm: #f2b84b;
  --max: 1180px;
  --reading: 790px;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(16, 42, 67, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent-dark); text-underline-offset: .18em; }
a:hover { color: var(--accent); }
button, input, textarea { font: inherit; }

.skip-link {
  position: fixed; left: 1rem; top: -5rem; z-index: 1000;
  padding: .7rem 1rem; color: #fff; background: var(--navy); border-radius: 0 0 8px 8px;
}
.skip-link:focus { top: 0; }

.site-header {
  position: sticky; top: 0; z-index: 100;
  color: #fff; background: rgba(16, 42, 67, .97);
  border-bottom: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(14px);
}
.header-inner {
  width: min(calc(100% - 2.5rem), var(--max)); margin: auto; min-height: 78px;
  display: flex; align-items: center; gap: 2rem;
}
.identity { display: flex; min-width: 245px; flex-direction: column; color: #fff; text-decoration: none; line-height: 1.2; }
.identity-name { font-size: 1.12rem; font-weight: 760; letter-spacing: .01em; }
.identity-role { margin-top: .28rem; color: #b9d6df; font-size: .76rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; align-items: center; gap: .12rem; margin: 0; padding: 0; list-style: none; }
.site-nav a {
  position: relative; display: block; padding: .72rem .68rem; color: #d9e8ee;
  font-size: .84rem; font-weight: 650; line-height: 1.25; text-decoration: none; white-space: nowrap;
}
.site-nav a::after {
  position: absolute; right: .68rem; bottom: .38rem; left: .68rem; height: 2px;
  background: var(--warm); border-radius: 2px; content: "";
  opacity: 0; transform: scaleX(.35); transition: opacity .18s ease, transform .18s ease;
}
.site-nav a:hover, .site-nav a:focus-visible,
.site-nav .current_page_item > a, .site-nav .current-menu-item > a { color: #fff; }
.site-nav a:hover::after, .site-nav a:focus-visible::after,
.site-nav .current_page_item > a::after, .site-nav .current-menu-item > a::after { opacity: 1; transform: scaleX(1); }
.menu-toggle { display: none; margin-left: auto; padding: .55rem .7rem; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; }
.menu-toggle svg { display: block; }

.site-main { min-height: calc(100vh - 158px); }
.page-shell { width: min(calc(100% - 2.5rem), var(--max)); margin: 2.8rem auto 4.5rem; }
.content-card { overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.page-heading { padding: 3rem clamp(1.5rem, 5vw, 4.5rem) 2.1rem; color: #fff; background: linear-gradient(125deg, var(--navy) 0%, var(--navy-soft) 65%, #126976 100%); }
.page-heading::before { display: block; width: 45px; height: 4px; margin-bottom: 1.1rem; background: var(--warm); border-radius: 5px; content: ""; }
.page-title { max-width: 900px; margin: 0; font-size: clamp(2rem, 5vw, 3.45rem); line-height: 1.08; letter-spacing: -.035em; }
.page-kicker { margin: .75rem 0 0; color: #c8e0e5; font-size: .92rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.entry-content { max-width: var(--reading); margin: auto; padding: clamp(2rem, 6vw, 4.8rem); }
.home .page-heading { display: none; }
.home .entry-content { max-width: 940px; }

.entry-content > :first-child { margin-top: 0; }
.entry-content > :last-child { margin-bottom: 0; }
.entry-content h2, .entry-content h3, .entry-content h4 { color: var(--navy); line-height: 1.23; letter-spacing: -.02em; }
.entry-content h2 { margin: 3.2rem 0 1.15rem; padding-top: .4rem; font-size: clamp(1.55rem, 3vw, 2.1rem); }
.entry-content h2::after { display: block; width: 38px; height: 3px; margin-top: .65rem; background: var(--accent); border-radius: 3px; content: ""; }
.entry-content h3 { margin: 2.2rem 0 .75rem; font-size: 1.28rem; }
.entry-content p { margin: 0 0 1.2rem; }
.entry-content ul, .entry-content ol { margin: 0 0 1.5rem; padding-left: 1.35rem; }
.entry-content li { margin: .38rem 0; padding-left: .28rem; }
.entry-content li::marker { color: var(--accent); }
.entry-content strong { color: var(--navy); }
.entry-content hr { margin: 3rem 0; border: 0; border-top: 1px solid var(--line); }
.entry-content blockquote { margin: 1.8rem 0; padding: 1rem 1.4rem; background: #edf7f7; border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0; }
.entry-content figure { margin: 1.8rem 0; }
.entry-content figcaption { color: var(--muted); font-size: .82rem; text-align: center; }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { padding: .7rem; border-bottom: 1px solid var(--line); text-align: left; }
.entry-content .wp-block-button__link, .entry-content a.wp-element-button {
  color: #fff; background: var(--accent-dark); border-radius: 8px; box-shadow: none; font-weight: 700; text-decoration: none;
}
.entry-content .wp-block-button__link:hover, .entry-content a.wp-element-button:hover { color: #fff; background: var(--accent); }
.entry-content .wp-block-image img { border-radius: 10px; }
.entry-content .ub-tabbed-content-tabs-title { border-radius: 6px 6px 0 0; }

.site-footer { color: #c6d5dd; background: var(--navy); }
.footer-inner {
  width: min(calc(100% - 2.5rem), var(--max)); min-height: 80px; margin: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: .83rem;
}
.footer-inner p { margin: 0; }
.footer-links { display: flex; gap: 1.2rem; }
.footer-links a { color: #dce9ed; text-decoration: none; }

.error-page { padding: 6rem 2rem; text-align: center; }
.error-page h1 { margin: 0 0 1rem; color: var(--navy); font-size: clamp(3rem, 10vw, 6rem); }
.pagination { margin-top: 2rem; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

body.cv-assistant-open { overflow: hidden; }
.cv-assistant { position: relative; z-index: 500; }
.cv-assistant-launcher {
  position: fixed; right: 1.4rem; bottom: 1.35rem; z-index: 501; display: flex; align-items: center; gap: .65rem;
  padding: .38rem .85rem .38rem .38rem; color: #fff; background: var(--navy); border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px; box-shadow: 0 14px 36px rgba(5, 25, 43, .32); cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.cv-assistant-launcher:hover { transform: translateY(-3px); box-shadow: 0 18px 42px rgba(5, 25, 43, .4); }
.cv-assistant-launcher:focus-visible { outline: 3px solid var(--warm); outline-offset: 3px; }
.cv-assistant-avatar {
  position: relative; display: block; width: 58px; height: 58px; overflow: hidden;
  border: 2px solid #35c6d0; border-radius: 50%; box-shadow: 0 0 0 4px rgba(53,198,208,.13), 0 0 24px rgba(53,198,208,.42);
  animation: cv-assistant-float 3.2s ease-in-out infinite;
}
.cv-assistant-avatar::after {
  position: absolute; inset: -2px; border: 2px solid transparent; border-top-color: var(--warm); border-radius: 50%; content: "";
  animation: cv-assistant-orbit 4s linear infinite;
}
.cv-assistant-avatar img, .cv-assistant-header-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cv-assistant-scan {
  position: absolute; right: 0; left: 0; top: -20%; height: 25%; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(70,235,242,.4), transparent); animation: cv-assistant-scan 2.8s ease-in-out infinite;
}
.cv-assistant-launcher-label { font-size: .88rem; font-weight: 780; letter-spacing: .025em; }
.cv-assistant-overlay {
  position: fixed; inset: 0; z-index: 600; padding: clamp(1rem, 4vw, 3rem); opacity: 0;
  background: rgba(5, 18, 31, .72); backdrop-filter: blur(9px); transition: opacity .18s ease;
}
.cv-assistant-overlay.is-visible { opacity: 1; }
.cv-assistant-dialog {
  width: min(760px, 100%); height: min(760px, calc(100vh - 2rem)); margin: auto; overflow: hidden;
  display: grid; grid-template-rows: auto 1fr auto auto; color: var(--ink); background: #f7fafb;
  border: 1px solid rgba(120,210,218,.5); border-radius: 18px; box-shadow: 0 30px 90px rgba(0,0,0,.4);
  transform: translateY(18px) scale(.985); transition: transform .2s ease;
}
.cv-assistant-overlay.is-visible .cv-assistant-dialog { transform: none; }
.cv-assistant-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.15rem;
  color: #fff; background: linear-gradient(120deg, #0b2239, #123f59 68%, #087e8b);
}
.cv-assistant-identity { display: flex; align-items: center; gap: .85rem; }
.cv-assistant-header-avatar { width: 54px; height: 54px; overflow: hidden; flex: 0 0 auto; border: 2px solid #53d0d8; border-radius: 50%; box-shadow: 0 0 18px rgba(69,221,229,.35); }
.cv-assistant-kicker { margin: 0; color: #9fe3e6; font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.cv-assistant-header h2 { margin: .12rem 0 0; color: #fff; font-size: 1.25rem; line-height: 1.2; }
.cv-assistant-close { width: 42px; height: 42px; color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.22); border-radius: 50%; font-size: 1.7rem; line-height: 1; cursor: pointer; }
.cv-assistant-body { min-height: 0; padding: 1.15rem; overflow: hidden; display: flex; flex-direction: column; }
.cv-assistant-messages { min-height: 0; overflow-y: auto; padding: .15rem .25rem 1rem; scrollbar-color: #a9bdc7 transparent; }
.cv-assistant-message { width: fit-content; max-width: 86%; margin: 0 0 .8rem; padding: .72rem .9rem; border-radius: 12px; line-height: 1.52; white-space: pre-wrap; }
.cv-assistant-message.is-assistant { background: #fff; border: 1px solid var(--line); border-radius: 4px 12px 12px; }
.cv-assistant-message.is-user { margin-left: auto; color: #fff; background: var(--accent-dark); border-radius: 12px 4px 12px 12px; }
.cv-assistant-message.is-error { color: #842029; background: #f8d7da; }
.cv-assistant-message.is-notice { color: #664d03; background: #fff3cd; }
.cv-assistant-message p { margin: 0 0 .65rem; }
.cv-assistant-message p:last-child { margin-bottom: 0; }
.cv-assistant-message h3, .cv-assistant-message h4, .cv-assistant-message h5, .cv-assistant-message h6 {
  margin: .8rem 0 .38rem; color: var(--navy); font-size: 1rem; line-height: 1.3;
}
.cv-assistant-message h3:first-child, .cv-assistant-message h4:first-child,
.cv-assistant-message h5:first-child, .cv-assistant-message h6:first-child { margin-top: 0; }
.cv-assistant-message ul, .cv-assistant-message ol { margin: .35rem 0 .75rem; padding-left: 1.3rem; }
.cv-assistant-message li { margin: .22rem 0; }
.cv-assistant-message li::marker { color: var(--accent); }
.cv-assistant-message blockquote { margin: .55rem 0; padding: .35rem .7rem; color: var(--muted); border-left: 3px solid var(--accent); }
.cv-assistant-message hr { margin: .85rem 0; border: 0; border-top: 1px solid var(--line); }
.cv-assistant-message code { padding: .08rem .28rem; color: #0d5360; background: #e7f1f3; border-radius: 4px; font-size: .9em; }
.cv-assistant-message a { overflow-wrap: anywhere; }
.cv-assistant-suggestions { display: flex; flex-wrap: wrap; gap: .45rem; padding: .35rem .25rem 0; }
.cv-assistant-suggestions button { padding: .45rem .65rem; color: var(--accent-dark); background: #eaf5f6; border: 1px solid #bbdce0; border-radius: 999px; font-size: .75rem; cursor: pointer; }
.cv-assistant-form { display: flex; gap: .65rem; padding: .85rem 1.15rem; background: #fff; border-top: 1px solid var(--line); }
.cv-assistant-form textarea { min-height: 52px; max-height: 120px; flex: 1; resize: vertical; padding: .68rem .8rem; color: var(--ink); background: #f9fbfc; border: 1px solid #b9c9d1; border-radius: 9px; line-height: 1.4; }
.cv-assistant-form textarea:focus { border-color: var(--accent); outline: 3px solid rgba(8,126,139,.14); }
.cv-assistant-send { align-self: stretch; min-width: 76px; color: #fff; background: var(--accent-dark); border: 0; border-radius: 9px; font-weight: 750; cursor: pointer; }
.cv-assistant-send:disabled { opacity: .5; cursor: wait; }
.cv-assistant-statusbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem 1.15rem; color: var(--muted); background: #edf2f4; font-size: .7rem; }
.cv-assistant-status[data-state="connected"]::before { color: #16845b; content: "● "; }
.cv-assistant-status[data-state="streaming"]::before { color: var(--accent); content: "● "; animation: cv-assistant-pulse 1s ease-in-out infinite; }
.cv-assistant-status[data-state="error"]::before { color: #b4232d; content: "● "; }
.cv-assistant-clear { padding: 0; color: var(--accent-dark); background: none; border: 0; font-size: inherit; text-decoration: underline; cursor: pointer; }

@keyframes cv-assistant-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes cv-assistant-orbit { to { transform: rotate(360deg); } }
@keyframes cv-assistant-scan { 0%, 15% { top: -25%; opacity: 0; } 35%, 70% { opacity: 1; } 90%, 100% { top: 105%; opacity: 0; } }
@keyframes cv-assistant-pulse { 50% { opacity: .35; } }

@media (max-width: 1180px) {
  .header-inner { min-height: 70px; }
  .menu-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 70px; right: 0; left: 0; padding: .7rem 1.25rem 1.2rem; background: var(--navy); border-top: 1px solid rgba(255,255,255,.12); }
  .site-nav.is-open { display: block; }
  .site-nav ul { align-items: stretch; flex-direction: column; }
  .site-nav a { padding: .72rem; }
  .site-nav a::after { right: auto; bottom: .32rem; left: .72rem; width: 34px; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .header-inner, .page-shell, .footer-inner { width: min(calc(100% - 1.4rem), var(--max)); }
  .identity-role { max-width: 210px; font-size: .65rem; }
  .page-shell { margin-top: 1rem; margin-bottom: 2rem; }
  .content-card { border-radius: 10px; }
  .page-heading { padding: 2.1rem 1.35rem 1.6rem; }
  .entry-content { padding: 2rem 1.35rem 2.8rem; }
  .footer-inner { padding: 1.25rem 0; align-items: flex-start; flex-direction: column; }
  .cv-assistant-launcher { right: .8rem; bottom: .8rem; padding-right: .65rem; }
  .cv-assistant-avatar { width: 50px; height: 50px; }
  .cv-assistant-overlay { padding: 0; }
  .cv-assistant-dialog { width: 100%; height: 100%; border: 0; border-radius: 0; }
  .cv-assistant-header { padding: .75rem .85rem; }
  .cv-assistant-body { padding: .8rem; }
  .cv-assistant-message { max-width: 92%; }
  .cv-assistant-form { padding: .7rem .8rem; }
  .cv-assistant-statusbar { padding: .5rem .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cv-assistant-avatar, .cv-assistant-avatar::after, .cv-assistant-scan,
  .cv-assistant-status::before { animation: none !important; }
  .cv-assistant-overlay, .cv-assistant-dialog, .cv-assistant-launcher { transition: none; }
}

@media print {
  body { color: #000; background: #fff; font-size: 10.5pt; }
  .site-header, .site-footer, .page-heading, .skip-link, .cv-assistant { display: none !important; }
  .page-shell { width: 100%; margin: 0; }
  .content-card { border: 0; box-shadow: none; }
  .entry-content { max-width: none; padding: 0; }
  .entry-content h2 { break-after: avoid; margin-top: 1.4rem; }
  .entry-content h2::after { display: none; }
  .entry-content a { color: #000; text-decoration: none; }
  .entry-content img { break-inside: avoid; }
  @page { margin: 14mm; }
}
