/* ============================================================
   BBjCloud Theme — modern business design
   PaperMod supplies the base layout; this layer adds brand,
   layout overrides, dark-mode polish, footer, and search modal.
   ============================================================ */
@import "./fonts.css";

/* ─── Design tokens ─────────────────────────────────────────── */
:root {
  --font-sans:    'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;

  /* Light-mode palette — white chrome with Alice Blue content */
  --color-primary:    #1a4fa0;
  --color-primary-h:  rgba(26, 79, 160, .10);
  --color-accent:     #0284c7;
  --color-accent-rgb: 2, 132, 199;
  --color-surface:    #ffffff;          /* white header/footer surfaces */
  --color-surface-alt:#f0f8ff;          /* Alice Blue content surfaces */
  --color-border:     #b8ccdf;
  --color-text:       #1a2b4a;
  --color-muted:      #4a6180;
  --color-badge-bg:   #d4e5f5;
  --color-badge-text: #1a4fa0;

  /* Shared */
  --radius:    8px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.12);
  --transition: 200ms ease;
}

:root[data-theme="dark"] {
  --color-primary:    #60a5fa;
  --color-primary-h:  rgba(96,165,250,.15);
  --color-accent:     #38bdf8;
  --color-accent-rgb: 56, 189, 248;
  --color-surface:    #0d1f38;          /* dark blue for header/footer bg */
  --color-surface-alt:#0f2240;
  --color-border:     #1e3a5f;
  --color-text:       #dce8f7;
  --color-muted:      #8faac8;
  --color-badge-bg:   #1a3560;
  --color-badge-text: #93c5fd;

  --theme: #0b1929;
  --entry: #0f2240;
  --border: #1e3a5f;
  --primary: #e0eeff;
  --secondary: #8faac8;
  --content: #d4e4f4;
}

/* ─── Base typography and light-theme surfaces ───────────────── */
body            { font-family: var(--font-sans); }
:root:not([data-theme="dark"]) .list,
:root:not([data-theme="dark"]) body {
  background: #f0f8ff;
}
:root:not([data-theme="dark"]) .main,
:root:not([data-theme="dark"]) .post-single {
  background: #f0f8ff;
}
h1, h2, h3, h4,
.font-display   { font-family: var(--font-display); }
a               { text-underline-offset: .2em; }
.sr-only        { position: absolute; width: 1px; height: 1px; padding: 0;
                  margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
                  white-space: nowrap; border: 0; }

/* ─── Gradient hero accent on home h1 ───────────────────────── */
.post-content h1:first-child {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding-bottom: .1em;
}
[data-theme="dark"] .post-content h1:first-child {
  background: linear-gradient(135deg, #60a5fa 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ─── Alternating heading colors — light theme ───────────────── */
/* h1: deep brand blue (or gradient above takes priority) */
.post-content h1 { color: var(--color-primary); }
/* h2: dark body text — anchors the section */
.post-content h2 { color: var(--color-text); }
/* h3: accent blue — adds vibrancy */
.post-content h3 { color: var(--color-accent); }
/* h4: back to body text */
.post-content h4 { color: var(--color-text); }
/* h5: accent again */
.post-content h5 { color: var(--color-accent); }

/* ─── Alternating heading colors — dark theme ────────────────── */
/* h1: light blue (or gradient above) */
[data-theme="dark"] .post-content h1 { color: var(--color-primary); }
/* h2: near-white — max contrast */
[data-theme="dark"] .post-content h2 { color: #e0eeff; }
/* h3: sky/cyan accent */
[data-theme="dark"] .post-content h3 { color: var(--color-accent); }
/* h4: near-white */
[data-theme="dark"] .post-content h4 { color: #e0eeff; }
/* h5: accent */
[data-theme="dark"] .post-content h5 { color: var(--color-accent); }

/* ─── Header ─────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition), border-color var(--transition);
}
.header-nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
/* ─── Header logo ─────────────────────────────────────────────*/
.header-logo { flex-shrink: 0; }
.header-logo a {
  display: inline-block;
  border-radius: 8px;
  padding: 3px 8px;
  background: #fff;   /* always white pill so the white-bg PNG is clean */
  transition: box-shadow var(--transition);
}
.header-logo a:hover { box-shadow: 0 0 0 2px var(--color-primary); }
.header-logo .site-logo {
  display: block;
  height: 50px;
  width: auto;
}

/* Nav menu — centred */
.menu {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: .25rem;
  overflow-x: auto;
}
.menu li a {
  display: block;
  padding: .45rem .85rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.menu li a:hover  { background: var(--color-primary-h); color: var(--color-primary); }
.menu li a span.active {
  color: var(--color-primary);
  font-weight: 700;
}

/* Controls — right side, all vertically centred */
.header-controls {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
  vertical-align: middle;
  line-height: 1;
  padding: 0;
}
.icon-btn:hover {
  background: var(--color-primary-h);
  color: var(--color-primary);
}
.icon-btn:focus-visible,
.flag-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.icon-btn svg { display: block; }

/* Language controls are compact, wider than icon-only controls, and vertically centered. */
.lang-flags {
  display: contents;
}
.flag-btn {
  box-sizing: border-box;
  flex: 0 0 60px;
  width: 60px;
  height: 30px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
}
.flag-btn .flag-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  width: 100%;
  height: 100%;
}
.flag-btn .flag-icon {
  display: block;
  flex: 0 0 18px;
  width: 18px;
  height: 12px;
}
.flag-btn .flag-label {
  display: block;
  color: var(--color-muted);
  line-height: 18px;
}
.flag-btn:hover {
  transform: none;
}

/* ─── Content area ───────────────────────────────────────────── */
.post-content p { line-height: 1.8; }

.post-content ul li strong:first-child {
  display: inline-block;
  padding: .15em .55em;
  border-radius: 4px;
  font-size: .82rem;
  background: var(--color-badge-bg);
  color: var(--color-badge-text);
  margin-right: .3em;
}

.post-content table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  width: 100%;
}
.post-content th, .post-content td {
  padding: .6rem 1rem;
  border: 1px solid var(--color-border);
  font-size: .9rem;
}
.post-content th {
  background: var(--color-surface);
  font-weight: 600;
  color: var(--color-primary);
}
[data-theme="dark"] .post-content th { background: #0f2240; }

.post-content blockquote {
  border-left: 3px solid var(--color-primary);
  background: var(--color-surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  color: var(--color-muted);
  font-style: italic;
}
[data-theme="dark"] .post-content blockquote { background: #0f2240; }

/* Partner logos — always shown on white pill so PNG bg is clean */
img[src*="logo_basis"] {
  display: inline-block;
  max-width: 160px;
  height: auto;
  background: #fff;
  padding: 4px 10px;
  border-radius: 6px;
}
img[src*="vmw_banner"] {
  max-width: 520px;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* ─── About page two-column layout ──────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 1.5rem;
}
.about-col { }
.about-col h2 {
  margin-top: 0;
  font-size: 1.2rem;
  color: var(--color-primary);
}
/* TidyCal embed — let it fill its column */
.tidycal-embed { min-height: 500px; }

/* TidyCal button */
.btn-schedule {
  display: inline-flex;
  align-items: center;
  padding: .85rem 1.75rem;
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  font: 600 1rem var(--font-display);
  letter-spacing: .02em;
  box-shadow: 0 3px 12px rgba(var(--color-accent-rgb),.35);
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  margin-top: .5rem;
}
.btn-schedule:hover {
  opacity: .92;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(var(--color-accent-rgb),.45);
}
.tidycal-cta { margin: 1rem 0 1.5rem; }
.tidycal-wrapper { margin-top: .5rem; min-height: 500px; }

/* Footer logo — white pill in both themes (PNG has white bg) */
.footer-logo {
  display: block;
  width: 180px;
  height: auto;
  margin: 0 0 1rem;
  background: #fff;
  padding: 6px 10px;
  border-radius: 8px;
}
form { margin: 1rem 0; }
form p { margin: 1rem 0; }
label {
  display: inline-block;
  margin-bottom: .35rem;
  color: var(--color-primary);
  font-weight: 600;
  font-size: .9rem;
}
input, textarea {
  box-sizing: border-box;
  width: 100%;
  padding: .7rem .9rem;
  color: var(--content);
  background: var(--theme);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-h);
}
button[type="submit"] {
  padding: .75rem 1.5rem;
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  letter-spacing: .02em;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 8px rgba(var(--color-accent-rgb),.3);
}
button[type="submit"]:hover {
  opacity: .92;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--color-accent-rgb),.4);
}

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer {
  max-width: 1200px;
  margin: 3rem auto 0;
  padding: 3rem 1.25rem 1.5rem;
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
}
/* Give footer the same branded surface as the header */
footer.site-footer {
  background: var(--color-surface);
  max-width: 100%;
  padding-left: max(1.25rem, calc((100% - 1200px) / 2 + 1.25rem));
  padding-right: max(1.25rem, calc((100% - 1200px) / 2 + 1.25rem));
}
.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
}

.footer-title {
  margin: 0 0 .9rem;
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.footer-brand p { max-width: 280px; margin: 0 0 .7rem; line-height: 1.65; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin: .4rem 0; }
.footer-links a {
  color: var(--color-muted);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--color-primary); }
.site-footer address { font-style: normal; line-height: 1.8; }
.site-footer a { color: inherit; text-decoration: none; transition: color var(--transition); }
.site-footer a:hover { color: var(--color-primary); }
.footer-map-link { display: inline-block; margin-bottom: .25rem; }
.footer-legal {
  max-width: 1200px;
  margin: 2.5rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
  font-size: .8rem;
  color: var(--color-muted);
  text-align: center;
}

/* ─── Search modal ───────────────────────────────────────────── */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: clamp(3rem, 10vh, 7rem);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}
.search-overlay[hidden] { display: none; }
.search-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.search-modal {
  width: 100%;
  max-width: 660px;
  margin: 0 1rem;
  background: var(--theme, #fff);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transform: translateY(-8px);
  transition: transform var(--transition);
}
.search-overlay.is-open .search-modal { transform: translateY(0); }
.search-modal-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--color-border);
}
.search-modal-icon {
  flex-shrink: 0;
  color: var(--color-muted);
}
/* Override PaperMod searchbox so it fills the modal header */
.search-modal-header #searchbox {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .5rem;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}
.search-modal-header #searchbox input,
.search-modal-header #searchInput {
  border: none;
  background: transparent;
  padding: .25rem .5rem;
  font-size: 1rem;
  color: var(--primary, var(--color-text));
  outline: none;
  width: 100%;
  box-shadow: none;
}
.search-modal-close-btn {
  flex-shrink: 0;
  color: var(--color-muted);
}
.search-modal-results {
  max-height: 420px;
  overflow-y: auto;
  margin: 0;
  padding: .5rem 0;
  list-style: none;
}
.search-modal-results li {
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  transition: background var(--transition);
}
.search-modal-results li:last-child { border-bottom: none; }
.search-modal-results li:hover,
.search-modal-results li.focus { background: var(--color-surface); }
.search-modal-results .entry-link {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.search-modal-hint {
  margin: 0;
  padding: .5rem 1rem;
  font-size: .75rem;
  color: var(--color-muted);
  text-align: center;
  border-top: 1px solid var(--color-border);
}

/* ─── Top-link ───────────────────────────────────────────────── */
.top-link { z-index: 99; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .header-nav { height: auto; flex-wrap: wrap; padding: .75rem 1rem; gap: .75rem; }
  .header-logo { order: 0; flex: 1; }
  .menu { order: 2; width: 100%; justify-content: flex-start; overflow-x: auto; padding-bottom: .25rem; }
  .header-controls { order: 1; margin-left: auto; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: auto; }
  .post-content h1:first-child { font-size: 1.6rem; }
}
