/* =================================================================
   Beveron Blog — style-v2.css
   Foundation styles aligned with /css-new/beveron-common.css.
   Tokens, typography, buttons, breadcrumb, cards, forms +
   the publication-index page module (.pub-*).
   Scope: include this file on any Blog/ page that should adopt the
   new visual language. Page content can optionally be wrapped in
   <div class="bv-page"> for stronger scoping vs. legacy Bootstrap.
   ================================================================= */

/* ---------- 1. Design tokens (mirrors css-new/beveron-common.css) ---------- */
:root {
  /* Brand */
  --accent-cyan:        #0084c8;
  --accent-cyan-dark:   #006b9f;
  --accent-cyan-light:  #e0f2fe;
  --accent-warm:        #fae251;

  /* Backgrounds */
  --bg-main:            #ffffff;
  --bg-hero:            #f8f9fa;
  --bg-surface:         #ffffff;
  --bg-surface-hover:   #f1f5f9;
  --bg-alt:             #f1f5f9;
  --bg-dark:            #212f3c;

  /* Borders */
  --border-subtle:      #e2e8f0;
  --border-focus:       #cbd5e1;

  /* Text */
  --text-primary:       #111827;
  --text-secondary:     #4b5563;
  --text-tertiary:      #6b7280;

  /* Radii */
  --radius-sm:          8px;
  --radius-md:          14px;
  --radius-lg:          20px;
  --radius-xl:          28px;

  /* Fonts */
  --font-sans:          "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono:          "JetBrains Mono", "Roboto Mono", monospace;

  /* Shadows */
  --shadow-sm:          0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md:          0 6px 20px -6px rgba(15, 23, 42, 0.12);
  --shadow-lg:          0 14px 40px -10px rgba(15, 23, 42, 0.18);
  --shadow-cyan:        0 8px 28px -8px rgba(0, 132, 200, 0.35);
}

/* ---------- 2. Layout containers (opt-in only) ---------- */
.bv-wrap        { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.bv-wrap-narrow { max-width: 800px;  margin: 0 auto; padding: 0 24px; }
.bv-wrap-wide   { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.bv-sec-pad     { padding: 72px 0; }
.bv-sec-pad-lg  { padding: 100px 0; }

/* ---------- 3. Breadcrumb (.bv-hbc — matches main site .hbc pattern) ---------- */
/* Renamed from .hbc to .bv-hbc to avoid colliding with the main site nav.css */
.bv-hbc {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 18px 0 0;
  color: var(--text-tertiary);
}
.bv-hbc a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.2s;
}
.bv-hbc a:hover { color: var(--accent-cyan); }
.bv-hbc .sp {
  color: var(--border-focus);
  font-size: 0.55rem;
  display: inline-flex;
  align-items: center;
}
.bv-hbc .cur {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ---------- 5. Buttons ---------- */
.bv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  font-family: inherit;
  line-height: 1.2;
}
.bv-btn-primary {
  background: var(--accent-cyan);
  color: #fff;
  box-shadow: var(--shadow-cyan);
}
.bv-btn-primary:hover {
  background: var(--accent-cyan-dark);
  color: #fff;
  transform: translateY(-2px);
}
.bv-btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-subtle);
}
.bv-btn-outline:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: var(--accent-cyan-light);
}
.bv-btn-ghost {
  background: transparent;
  color: var(--accent-cyan);
}
.bv-btn-ghost:hover { background: var(--accent-cyan-light); }

/* ---------- 6. Form controls ---------- */
.bv-input,
.bv-select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.bv-input:focus,
.bv-select:focus {
  outline: 0;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 132, 200, 0.12);
}
.bv-input::placeholder { color: var(--text-tertiary); }
.bv-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  padding-right: 36px;
  cursor: pointer;
}

/* ====================================================================
   PUBLICATION INDEX PAGE MODULE (.pub-*)
   ==================================================================== */

/* ---------- Page background tint (mirrors main site .bg-hero #f8f9fa) ---------- */
.pub-page-bg {
  background: var(--bg-hero);
  padding-bottom: 1px; /* contains margin of last child */
}

/* ---------- Hero ---------- */
.pub-hero {
  text-align: center;
  padding: 60px 24px 36px;
  max-width: 880px;
  margin: 0 auto;
}
.pub-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-cyan);
  background: var(--accent-cyan-light);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 22px;
}
.pub-eyebrow i { font-size: 0.85rem; }
.pub-hero h1 {
  font-family: var(--font-sans);
  font-size: clamp(1.9rem, 4.5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--text-primary);
  margin: 0 0 18px;
}
.pub-subtitle {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 700px;
  margin: 0 auto 32px;
}

/* ---------- Search bar ---------- */
.pub-search {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  box-shadow: var(--shadow-md);
  padding: 6px 8px 6px 22px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pub-search:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-cyan);
}
.pub-search .pub-search-icon {
  color: var(--text-tertiary);
  font-size: 0.95rem;
  margin-right: 8px;
}
.pub-search input[type="search"] {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-primary);
  padding: 10px 0;
  min-width: 0;
}
.pub-search input[type="search"]::placeholder { color: var(--text-tertiary); }
.pub-search button {
  flex-shrink: 0;
  background: var(--accent-cyan);
  color: #fff;
  border: 0;
  border-radius: 100px;
  padding: 10px 22px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}
.pub-search button:hover { background: var(--accent-cyan-dark); }

.pub-result-count {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 20px 0 0;
}
.pub-result-count a {
  color: var(--accent-cyan);
  font-weight: 500;
  margin-left: 6px;
}
.pub-result-count a:hover { text-decoration: underline; }

/* ---------- List section ---------- */
.pub-list-section {
  max-width: 1400px;
  margin: 56px auto 64px;
  padding: 0 24px;
}
.pub-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}
.pub-list-header h2 {
  font-family: var(--font-sans);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
}
.pub-count {
  color: var(--text-tertiary);
  font-weight: 400;
  font-size: 0.95rem;
  margin-left: 4px;
}
.pub-sort {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pub-sort label {
  color: var(--text-tertiary);
  font-size: 0.9rem;
  font-weight: 500;
}

/* =====================================================
   Custom dropdown (open-panel styled), same pattern as
   demo page's industry/role widget (.bk-dd-*).
   ===================================================== */
.pub-dd-wrap {
  position: relative;
  min-width: 180px;
}
.pub-dd-toggle {
  width: 100%;
  padding: 9px 36px 9px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: border-color 0.15s;
}
.pub-dd-toggle:hover { border-color: #cbd5e1; }
.pub-dd-toggle.pub-dd-open {
  border-color: var(--accent-cyan);
  outline: none;
}
.pub-dd-toggle .pub-dd-chev {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 11px;
  transition: transform 0.18s, color 0.18s;
  pointer-events: none;
}
.pub-dd-toggle.pub-dd-open .pub-dd-chev {
  transform: translateY(-50%) rotate(180deg);
  color: var(--accent-cyan);
}

/* The open panel — the styled list the user wants */
.pub-dd-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 100%;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 14px 40px -12px rgba(15, 23, 42, 0.18);
  z-index: 50;
  overflow: hidden;
  display: none;
  animation: pubDdIn 0.18s ease;
}
.pub-dd-wrap.pub-dd-open .pub-dd-panel { display: block; }
@keyframes pubDdIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pub-dd-list {
  list-style: none;
  padding: 6px 0;
  margin: 0;
  max-height: 240px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.pub-dd-list::-webkit-scrollbar { width: 8px; }
.pub-dd-list::-webkit-scrollbar-track { background: transparent; }
.pub-dd-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
.pub-dd-list::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.pub-dd-list { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }

.pub-dd-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.9rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.12s;
}
.pub-dd-opt:hover { background: #f1f5f9; }
.pub-dd-opt.pub-dd-selected {
  background: rgba(0, 132, 200, 0.08);
  color: var(--accent-cyan);
  font-weight: 600;
}

/* ---------- Cards ---------- */
.pub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 24px;
}
.pub-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: row;
  transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
  position: relative;
}
/* Hover: full cyan border on every side (matches .office-card pattern in css-new/contact-us.css) */
.pub-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
  box-shadow: 0 8px 24px -4px rgba(0, 132, 200, 0.18);
}

.pub-card-image-link {
  flex: 0 0 180px;
  max-width: 180px;
  align-self: flex-start;  /* prevent stretching to match card height */
  display: block;
  background: #f5f5f5;
  overflow: hidden;
}
.pub-card-image-link img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  aspect-ratio: 3 / 4;     /* portrait — 180 × 240 */
}
.pub-card-body {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.pub-card-tag {
  display: inline-block;
  color: var(--accent-cyan);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.pub-card-body h3 {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0 0 6px;
}
.pub-card-body h3 a {
  color: inherit;
  text-decoration: none;
}
.pub-card-body h3 a:hover { color: var(--accent-cyan); }
.pub-card-body > p {
  color: var(--text-secondary);
  font-size: 0.72rem;
  line-height: 1.35;
  margin: 0 0 8px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}
.pub-card-meta {
  color: var(--text-tertiary);
  font-size: 0.68rem;
  letter-spacing: 0.2px;
  margin-top: auto;
  margin-bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.pub-card-meta-icon {
  font-size: 0.72rem;
  color: #94a3b8;
  opacity: 0.9;
}
.pub-card .bv-btn {
  align-self: flex-start;
  padding: 6px 14px;
  font-size: 0.74rem;
}

/* ---------- Empty + Pagination ---------- */
.pub-empty {
  max-width: 600px;
  margin: 40px auto;
  padding: 56px 24px;
  text-align: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.pub-empty h3 {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 8px;
}
.pub-empty p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.9rem;
}
.pub-empty a {
  color: var(--accent-cyan);
  font-weight: 600;
}

.pub-pagination {
  text-align: center;
  margin: 36px 0 16px;
}
.pub-pagination a,
.pub-pagination strong {
  display: inline-block;
  padding: 8px 14px;
  margin: 0 3px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.pub-pagination a:hover {
  background: var(--accent-cyan-light);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}
.pub-pagination strong {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #fff;
}

/* ---------- Accessibility helpers ---------- */
.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;
}

/* ---------- AJAX loading state ---------- */
.pub-loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 0;
  color: var(--text-tertiary);
  font-size: 0.9rem;
}
.pub-loading[hidden] { display: none; }
.pub-loading.is-on   { display: flex; }
.pub-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: pub-spin 0.7s linear infinite;
}
@keyframes pub-spin { to { transform: rotate(360deg); } }

#pub-results.is-loading { opacity: 0.5; transition: opacity 0.2s; pointer-events: none; }

/* ---------- Responsive ----------
   Card internals (image left, content right) DO NOT change with viewport.
   Only the outer grid reflows and the hero/search shrink. */
@media (max-width: 575px) {
  .pub-hero { padding: 36px 16px 24px; }
  .pub-search { border-radius: 24px; padding: 4px 4px 4px 16px; }
  .pub-search button { padding: 8px 14px; font-size: 0.8rem; }
  .pub-list-header { flex-direction: column; align-items: flex-start; }
  .pub-grid { grid-template-columns: 1fr; }
}
