/* fixes.css — overrides and additions for accessibility, CTA, and cleanup */

/* =====================================================
   CSS Custom Properties (theme colors)
   ===================================================== */
:root {
  --primary: #5050f5;          /* fills/buttons only — 1.8-2.9:1 as text on dark, do not use for text */
  --primary-hover: #3d3dd4;
  --primary-text: #adadff;     /* accent as text/icons on dark: 4.73:1 on #444, 7.7:1 on #222 */
  --primary-text-hover: #c7c7ff;
  --bg-dark: #222;
  --bg-card: #333;
  --bg-card-alt: #444;
  --border: #555;
  --text-primary: #f5f5f5;
  --text-body: #d5d5d5;
  --text-secondary: #c0c0c0;  /* bumped from #aaa for WCAG AA contrast */
  --text-muted: #999;
  --error: #ff4c4c;
  --success: #4caf50;
}

/* =====================================================
   Link color — match theme (override template cyan)
   ===================================================== */
a {
  color: var(--primary-text);
}

a:hover,
a:focus {
  color: var(--primary-text-hover);
}

/* =====================================================
   Focus states — visible outlines for keyboard users
   ===================================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.btn:focus-visible,
.nav-anim:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* =====================================================
   Color contrast fixes (WCAG AA compliance)
   ===================================================== */

/* Secondary text — bump from #aaa/#a5a6a7 to #c0c0c0 */
.item-company,
.item-period,
.copyrights,
.fun-fact-block-text,
.lm-info-block-text,
.info-list .title {
  color: var(--text-secondary);
}

/* Muted text should still be readable */
.help-block {
  color: var(--text-muted);
}

/* =====================================================
   Skip-to-content link (visible on focus)
   ===================================================== */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  padding: 8px 20px;
  border-radius: 0 0 6px 6px;
  z-index: 10000;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-to-content:focus {
  top: 0;
  color: #fff;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* =====================================================
   h1 in sidebar — match original h2 sizing
   ===================================================== */
.header-titles h1 {
  font-size: 36px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2em;
}

.header-subtitle {
  font-size: 18px;
  font-weight: 300;
  color: #bbb;
  margin: 4px 0 0 0;
}

@media only screen and (max-width: 1024px) {
  .header-titles h1 {
    font-size: 30px;
    margin-bottom: 10px;
  }

  .header-subtitle {
    font-size: 17px;
  }
}

/* =====================================================
   Home page CTA buttons
   ===================================================== */
.home-cta {
  margin-top: 30px;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.home-cta .btn {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.home-cta .btn-primary {
  background: var(--primary);
  color: #fff;
  border: 2px solid var(--primary);
}

.home-cta .btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.home-cta .btn-secondary {
  background: transparent;
  color: var(--text-body);
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.home-cta .btn-secondary:hover {
  border-color: var(--primary);
  color: #fff;
}

/* =====================================================
   Download CV button in sidebar
   ===================================================== */
.header-buttons {
  text-align: center;
  margin: 15px 0;
}

.header-buttons .btn-primary {
  display: inline-block;
  padding: 8px 24px;
  background: var(--primary);
  color: #fff;
  border: 2px solid var(--primary);
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.header-buttons .btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

/* =====================================================
   Layout and element fixes
   ===================================================== */

/* Ensure nav wrapper doesn't break existing menu styles */
header nav {
  display: block;
}

/* Fix button reset for menu-toggle (changed from div to button) */
button.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
}

/* Header photo carries width/height attrs (for CLS); max-width alone would
   keep the 348px attribute height and stretch it into an oval */
.header-photo img {
  height: auto;
}

/* Inline SVG social icon (replaces Font Awesome) */
.social-links ul li a .social-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  vertical-align: middle;
}

/* Footer styling in sidebar */
footer.copyrights {
  display: block;
}

/* =====================================================
   Native scroll (replacing perfect-scrollbar)
   ===================================================== */
.animated-section {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
}

.animated-section::-webkit-scrollbar {
  width: 6px;
}

.animated-section::-webkit-scrollbar-track {
  background: transparent;
}

.animated-section::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.animated-section::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* =====================================================
   No-JS fallback: stack sections as normal flow instead
   of absolutely-positioned overlap
   ===================================================== */
.no-js .animated-section {
  position: static;
  height: auto;
}

/* Sections receive programmatic focus after transitions — no ring on the container itself */
.animated-section:focus {
  outline: none;
}

/* Intro paragraph under section block titles */
.section-intro {
  margin-bottom: 1.5em;
  color: var(--text-secondary);
}
