/* ── SHARED STYLES – KenyaCVTemplates.co.ke ── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --green: #1a5c38;
  --green-light: #2d8653;
  --gold: #c8952a;
  --gold-light: #f0b429;
  --cream: #faf8f3;
  --dark: #111810;
  --mid: #3d4a3e;
  --soft: #6b7c6d;
  --border: #dde8de;
  --white: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'DM Sans', sans-serif; background: var(--cream); color: var(--dark); line-height: 1.6; overflow-x: hidden; }

/* NAV */
header { background: var(--green); padding: 0 5%; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 20px rgba(0,0,0,0.2); }
.nav-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-family: 'Playfair Display', serif; font-size: 1.3rem; color: var(--white); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo span { color: var(--gold-light); }
nav a { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 0.88rem; font-weight: 500; margin-left: 28px; transition: color 0.2s; }
nav a:hover, nav a.active { color: var(--gold-light); }

/* BREADCRUMB */
.breadcrumb { background: var(--white); border-bottom: 1px solid var(--border); padding: 10px 5%; font-size: 0.8rem; color: var(--soft); }
.breadcrumb a { color: var(--green-light); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* PAGE HERO */
.page-hero { background: linear-gradient(135deg, var(--green) 0%, #0d3d24 60%, #071e12 100%); padding: 56px 5% 60px; position: relative; overflow: hidden; }
.page-hero::before { content: ''; position: absolute; top: -60px; right: -60px; width: 360px; height: 360px; background: radial-gradient(circle, rgba(200,149,42,0.13) 0%, transparent 70%); border-radius: 50%; }
.page-hero-inner { max-width: 1200px; margin: 0 auto; position: relative; z-index: 1; }
.page-badge { display: inline-block; background: rgba(200,149,42,0.2); border: 1px solid rgba(200,149,42,0.4); color: var(--gold-light); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 14px; border-radius: 20px; margin-bottom: 16px; }
.page-hero h1 { font-family: 'Playfair Display', serif; font-size: clamp(1.8rem, 4vw, 3rem); color: var(--white); line-height: 1.2; margin-bottom: 14px; max-width: 700px; }
.page-hero h1 em { font-style: normal; color: var(--gold-light); }
.page-hero p { color: rgba(255,255,255,0.72); font-size: 1rem; max-width: 560px; }

/* LAYOUT */
.page-body { max-width: 1200px; margin: 0 auto; padding: 50px 5%; display: grid; grid-template-columns: 1fr 340px; gap: 48px; align-items: start; }
.main-col {}
.sidebar {}

/* SECTION LABELS */
.section-label { font-size: 0.73rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--green-light); margin-bottom: 8px; }
.section-title { font-family: 'Playfair Display', serif; font-size: clamp(1.5rem, 2.5vw, 2rem); color: var(--dark); margin-bottom: 10px; }
.section-sub { color: var(--soft); font-size: 0.95rem; margin-bottom: 30px; }

/* TEMPLATE PREVIEW BOX */
.template-box { background: var(--white); border: 1.5px solid var(--border); border-radius: 14px; padding: 36px 32px; box-shadow: 0 8px 40px rgba(26,92,56,0.07); margin-bottom: 32px; }
.template-box h2 { font-family: 'Playfair Display', serif; font-size: 1.4rem; color: var(--dark); margin-bottom: 4px; }
.template-box .subtitle { color: var(--soft); font-size: 0.85rem; margin-bottom: 18px; }

/* CV DOCUMENT STYLES */
.cv-doc { background: white; border: 1px solid #e0e0e0; border-radius: 6px; padding: 32px 28px; font-size: 0.83rem; line-height: 1.6; box-shadow: 0 2px 16px rgba(0,0,0,0.06); }
.cv-name { font-family: 'Playfair Display', serif; font-size: 1.6rem; color: var(--green); font-weight: 900; }
.cv-role { color: var(--gold); font-weight: 600; font-size: 0.88rem; margin-bottom: 10px; }
.cv-divider { height: 2px; background: linear-gradient(90deg, var(--green), var(--gold), transparent); margin: 10px 0 14px; }
.cv-contact { color: var(--soft); font-size: 0.79rem; margin-bottom: 14px; line-height: 1.8; }
.cv-section-h { font-weight: 700; font-size: 0.73rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--green); margin: 16px 0 6px; border-bottom: 1.5px solid var(--border); padding-bottom: 4px; }
.cv-entry-title { font-weight: 600; color: var(--dark); font-size: 0.84rem; display: flex; justify-content: space-between; }
.cv-entry-sub { color: var(--soft); font-size: 0.79rem; margin-bottom: 4px; }
.cv-bullet { color: var(--mid); font-size: 0.8rem; padding-left: 14px; position: relative; }
.cv-bullet::before { content: '•'; position: absolute; left: 2px; color: var(--green-light); }
.cv-date { color: var(--soft); font-size: 0.76rem; font-weight: 400; }
.cv-skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }
.cv-skill-item { font-size: 0.8rem; color: var(--mid); padding: 2px 0; }
.cv-skill-item::before { content: '▸ '; color: var(--green-light); }

/* ACTION BUTTONS */
.action-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.btn-primary { display: block; background: linear-gradient(135deg, var(--green), var(--green-light)); color: white; text-align: center; padding: 13px; border-radius: 8px; font-weight: 600; text-decoration: none; font-size: 0.9rem; transition: opacity 0.2s; cursor: pointer; border: none; width: 100%; }
.btn-primary:hover { opacity: 0.88; }
.btn-outline { display: block; background: transparent; border: 1.5px solid var(--green); color: var(--green); text-align: center; padding: 11px; border-radius: 8px; font-weight: 600; text-decoration: none; font-size: 0.9rem; cursor: pointer; transition: all 0.2s; width: 100%; }
.btn-outline:hover { background: var(--green); color: white; }

/* CONTENT PROSE */
.prose h3 { font-family: 'Playfair Display', serif; font-size: 1.1rem; color: var(--dark); margin: 28px 0 10px; }
.prose p { color: var(--mid); font-size: 0.93rem; line-height: 1.75; margin-bottom: 14px; }
.prose ul { list-style: none; margin-bottom: 16px; }
.prose ul li { font-size: 0.9rem; color: var(--mid); padding: 5px 0 5px 22px; position: relative; }
.prose ul li::before { content: '✓'; position: absolute; left: 0; color: var(--green-light); font-weight: 700; }
.prose ol { padding-left: 20px; margin-bottom: 16px; }
.prose ol li { font-size: 0.9rem; color: var(--mid); padding: 4px 0; line-height: 1.6; }
.tip-box { background: #e8f3ec; border-left: 4px solid var(--green-light); border-radius: 0 8px 8px 0; padding: 16px 20px; margin: 20px 0; }
.tip-box strong { color: var(--green); display: block; margin-bottom: 4px; font-size: 0.85rem; }
.tip-box p { color: var(--mid); font-size: 0.87rem; margin: 0; }
.warn-box { background: #fff8e8; border-left: 4px solid var(--gold); border-radius: 0 8px 8px 0; padding: 16px 20px; margin: 20px 0; }
.warn-box strong { color: var(--gold); display: block; margin-bottom: 4px; font-size: 0.85rem; }
.warn-box p { color: var(--mid); font-size: 0.87rem; margin: 0; }

/* SIDEBAR */
.sidebar-card { background: var(--white); border: 1.5px solid var(--border); border-radius: 12px; padding: 22px; margin-bottom: 20px; }
.sidebar-card h4 { font-family: 'Playfair Display', serif; font-size: 1rem; color: var(--dark); margin-bottom: 14px; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--mid); font-size: 0.86rem; transition: color 0.2s; }
.sidebar-link:last-child { border-bottom: none; }
.sidebar-link:hover { color: var(--green); }
.sidebar-link .icon { width: 32px; height: 32px; background: var(--cream); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.sidebar-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-mini { background: var(--cream); border-radius: 8px; padding: 12px; text-align: center; }
.stat-mini-num { font-family: 'Playfair Display', serif; font-size: 1.3rem; color: var(--green); font-weight: 700; display: block; }
.stat-mini-label { font-size: 0.72rem; color: var(--soft); }

/* AD BOXES */
.ad-box { background: #e8f0e9; border: 2px dashed var(--border); border-radius: 8px; text-align: center; padding: 18px; color: var(--soft); font-size: 0.8rem; margin-bottom: 20px; }
.ad-banner { background: #e8f0e9; border: 2px dashed var(--border); border-radius: 8px; text-align: center; padding: 18px; color: var(--soft); font-size: 0.8rem; max-width: 1200px; margin: 0 auto 0; width: 90%; }

/* RELATED GRID */
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 16px; }
.related-card { background: var(--white); border: 1.5px solid var(--border); border-radius: 10px; padding: 18px; text-decoration: none; color: inherit; transition: all 0.2s; display: block; }
.related-card:hover { border-color: var(--green); box-shadow: 0 6px 24px rgba(26,92,56,0.1); transform: translateY(-2px); }
.related-card .tag { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--green-light); margin-bottom: 6px; }
.related-card h4 { font-family: 'Playfair Display', serif; font-size: 0.95rem; color: var(--dark); line-height: 1.35; margin-bottom: 6px; }
.related-card p { font-size: 0.8rem; color: var(--soft); }

/* PILLS */
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.pill { background: var(--white); border: 1.5px solid var(--border); color: var(--mid); font-size: 0.83rem; font-weight: 500; padding: 6px 16px; border-radius: 30px; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.pill:hover, .pill.active { background: var(--green); border-color: var(--green); color: var(--white); }

/* FOOTER */
footer { background: var(--dark); color: rgba(255,255,255,0.6); padding: 50px 5% 30px; margin-top: 60px; }
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 36px; margin-bottom: 36px; }
.footer-brand p { font-size: 0.84rem; line-height: 1.6; margin-top: 10px; }
.footer-col h4 { color: white; font-size: 0.84rem; font-weight: 600; margin-bottom: 14px; letter-spacing: 0.05em; }
.footer-col a { display: block; color: rgba(255,255,255,0.55); text-decoration: none; font-size: 0.82rem; margin-bottom: 8px; transition: color 0.2s; }
.footer-col a:hover { color: var(--gold-light); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 22px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 0.78rem; }

/* ANIMATIONS */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp 0.5s ease both; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .page-body { grid-template-columns: 1fr; }
  .sidebar { order: -1; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  /* nav display handled by mobile CSS */
  .footer-top { grid-template-columns: 1fr; }
}

/* ── MOBILE NAV ─────────────────────────────────── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.nav-overlay.open { display: block; }

@media (max-width: 768px) {
  header nav {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 0; right: -280px;
    width: 260px; height: 100vh;
    background: var(--green);
    padding: 80px 24px 40px;
    z-index: 200;
    transition: right 0.3s ease;
    box-shadow: -4px 0 30px rgba(0,0,0,0.3);
    gap: 0;
  }
  header nav.open { right: 0; }
  header nav a {
    margin: 0;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    font-size: 1rem;
  }
  .nav-mobile {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 300;
    position: relative;
    border-radius: 6px;
    transition: background 0.2s;
  }
  .nav-mobile:hover { background: rgba(255,255,255,0.1); }
}

/* ── SCROLL TO TOP ──────────────────────────────── */
#scroll-top {
  position: fixed;
  bottom: 28px; right: 24px;
  width: 44px; height: 44px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, background 0.2s;
  box-shadow: 0 4px 16px rgba(26,92,56,0.4);
  z-index: 50;
}
#scroll-top:hover { background: var(--green-light); }

/* ── GLOBAL RESPONSIVE FIXES ────────────────────────────────────── */

/* CV doc preview: allow text wrap on small screens */
@media (max-width: 600px) {
  .cv-entry-title { flex-direction: column; gap: 2px; }
  .cv-date { font-size: 0.72rem; }
  .cv-skills-grid { grid-template-columns: 1fr; }
  .cv-doc { padding: 20px 16px; }

  /* Template box padding */
  .template-box { padding: 20px 16px; }

  /* Action buttons full width already, just reduce font */
  .action-btns .btn-primary,
  .action-btns .btn-outline { font-size: 0.85rem; padding: 11px; }

  /* Page hero */
  .page-hero { padding: 36px 5% 40px; }
  .page-hero h1 { font-size: 1.7rem; }

  /* Breadcrumb */
  .breadcrumb { font-size: 0.74rem; padding: 8px 4%; }

  /* Related grid: single column */
  .related-grid { grid-template-columns: 1fr; }

  /* Footer: stack everything */
  .footer-top { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Pills: allow wrap nicely */
  .pills { gap: 6px; }
  .pill { font-size: 0.78rem; padding: 5px 12px; }

  /* Ad banner full width */
  .ad-banner { width: 100%; border-radius: 0; }
}

/* Tablet-level fixes */
@media (max-width: 900px) {
  /* Sidebar on page-body pages moves below on tablet */
  .page-body { padding: 32px 5%; gap: 32px; }

  /* resign letter variant buttons */
  .letter-variations { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  /* resign letter variant buttons: single column */
  .letter-variations { grid-template-columns: 1fr; }

  /* salary table: allow horizontal scroll */
  .salary-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
