/**
 * Namik Mesic - CV Stylesheet
 * Clean and simple styling for a professional CV
 */

/* CSS Custom Properties */
:root {
  /* Colors - Light Theme */
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f9fafb;
  --color-bg-accent: #f3f4f6;
  
  --color-text-primary: #111827;
  --color-text-secondary: #1f2937;
  --color-text-muted: #4b5563;
  --color-text-light: #6b7280;
  
  --color-border: #e5e7eb;
  --color-link: #2563eb;
  --color-link-hover: #1d4ed8;
  --color-focus: #3b82f6;
  
  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 0.75rem;
  --spacing-lg: 1rem;
  --spacing-xl: 1.5rem;
  --spacing-2xl: 2rem;
  --spacing-3xl: 2.5rem;
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}


/* CSS Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  min-height: 100vh;
  transition: background-color var(--transition-base);
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3 {
  color: var(--color-text-primary);
  line-height: 1.2;
  font-weight: 600;
}

h1 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.25rem;
  margin-block-end: var(--spacing-md);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

h3 {
  font-size: 1.125rem;
}

p {
  color: var(--color-text-muted);
  margin-block-end: var(--spacing-sm);
}

/* Links */
a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-link-hover);
}

a:focus {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

a:focus:not(:focus-visible) {
  outline: none;
}

/* Layout */
.container {
  max-width: 64rem;
  margin-inline: auto;
  margin-block: var(--spacing-2xl);
  background-color: var(--color-bg-primary);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-base);
}

.content {
  padding: var(--spacing-xl);
}

@media (min-width: 640px) {
  .content {
    padding: var(--spacing-3xl);
  }
}

/* Header */
.header {
  border-block-end: 1px solid var(--color-border);
  padding-block-end: var(--spacing-xl);
  margin-block-end: var(--spacing-xl);
}

.header h1 {
  margin-block-end: var(--spacing-sm);
}

.location {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  margin-block-end: var(--spacing-lg);
}

.contact-info {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-lg);
  margin-block-start: var(--spacing-lg);
}

.contact-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

/* Components */
.skip-link {
  position: absolute;
  inset-block-start: -40px;
  inset-inline-start: 0;
  background: var(--color-bg-primary);
  color: var(--color-link);
  padding: var(--spacing-sm) var(--spacing-lg);
  text-decoration: none;
  border-radius: var(--radius-sm);
  z-index: 100;
  transition: transform var(--transition-fast);
}

.skip-link:focus {
  inset-block-start: var(--spacing-sm);
}

.action-buttons {
  text-align: right;
  margin-block-end: var(--spacing-xl);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-md);
  background-color: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  appearance: none;
}

.btn:hover {
  background-color: var(--color-bg-accent);
  color: var(--color-text-primary);
  border-color: var(--color-text-light);
}

.btn:focus {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.btn:active {
  background-color: var(--color-border);
  transform: translateY(1px);
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-text-light);
  flex-shrink: 0;
}


/* Content Sections */
.section {
  padding-block: var(--spacing-xl);
  border-block-end: 1px solid var(--color-border);
}

.section:last-child {
  border-block-end: none;
}

.job {
  margin-block-end: var(--spacing-2xl);
}

.job:last-child {
  margin-block-end: 0;
}

.job-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--spacing-sm);
  margin-block-end: var(--spacing-sm);
}

.job-date {
  color: var(--color-text-light);
  font-size: 0.875rem;
  white-space: nowrap;
}

.job-title {
  font-style: italic;
  color: var(--color-text-muted);
  margin-block-end: var(--spacing-sm);
}

.job-description {
  margin-block-end: var(--spacing-md);
}

.subsection {
  margin-block-start: var(--spacing-md);
}

.subsection-title {
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-block-end: var(--spacing-xs);
}

/* Lists */
ul {
  list-style-position: outside;
  padding-inline-start: 1.5rem;
}

li {
  color: var(--color-text-muted);
  margin-block-end: var(--spacing-xs);
}

li::marker {
  color: var(--color-text-light);
}

/* Education */
.education-item {
  margin-block-end: var(--spacing-lg);
}

.education-item:last-child {
  margin-block-end: 0;
}

.education-degree {
  font-style: italic;
  color: var(--color-text-muted);
  margin-block: var(--spacing-xs);
}

.education-date {
  color: var(--color-text-light);
  font-size: 0.875rem;
}

/* Utility Classes */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Animations */
@media (prefers-reduced-motion: no-preference) {
  .container {
    animation: fadeIn 0.5s ease-out;
  }
  
  .section {
    animation: slideUp 0.5s ease-out;
    animation-fill-mode: both;
  }
  
  .section:nth-child(1) { animation-delay: 0.1s; }
  .section:nth-child(2) { animation-delay: 0.2s; }
  .section:nth-child(3) { animation-delay: 0.3s; }
  .section:nth-child(4) { animation-delay: 0.4s; }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Media Queries */
@media (max-width: 1024px) {
  .container {
    margin: var(--spacing-lg);
  }
}

@media (max-width: 640px) {
  .container {
    margin: 0;
    border-radius: 0;
  }
  
}

/* Print Styles */
@media print {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    min-height: 0 !important;
  }
  
  body {
    background: white;
    color: black;
    font-size: 10.5pt;
    line-height: 1.4;
  }
  
  .container {
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    background: none !important;
  }
  
  .content {
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .skip-link,
  .action-buttons {
    display: none !important;
  }
  
  h1 {
    font-size: 20pt;
    margin: 0 0 4pt 0;
    padding: 0;
    line-height: 1.1;
    page-break-after: avoid;
  }
  
  h2 {
    font-size: 12pt;
    margin: 10pt 0 4pt 0;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 0.5pt;
    line-height: 1.2;
    page-break-after: avoid;
  }
  
  h3 {
    font-size: 11pt;
    margin: 0 0 3pt 0;
    padding: 0;
    line-height: 1.2;
    page-break-after: avoid;
  }
  
  h1, h2, h3 {
    color: black;
  }
  
  p {
    margin: 0 0 4pt 0;
    padding: 0;
    orphans: 2;
    widows: 2;
  }
  
  p, li {
    color: #222;
    font-size: 10pt;
    line-height: 1.4;
  }
  
  a {
    color: black;
    text-decoration: none;
  }
  
  .header {
    padding: 0 0 6pt 0 !important;
    margin: 0 0 6pt 0 !important;
    border-bottom: 1pt solid #666;
  }
  
  .location {
    font-size: 11pt;
    margin-bottom: 6pt;
  }
  
  .contact-info {
    margin-top: 6pt;
    gap: 12pt;
    font-size: 10pt;
  }
  
  .contact-item {
    font-size: 10pt;
  }
  
  .icon {
    display: none;
  }
  
  .section {
    padding: 4pt 0 4pt 0;
    border-bottom: 0.5pt solid #ddd;
  }
  
  .section:first-of-type {
    padding-top: 0;
  }
  
  .section:first-of-type h2 {
    margin-top: 8pt;
  }
  
  .section:last-child {
    border-bottom: none;
  }
  
  .job {
    margin-bottom: 10pt;
  }
  
  .job:last-child {
    margin-bottom: 0;
  }
  
  .job-header {
    margin-bottom: 4pt;
    page-break-after: avoid; /* Keep header with content */
  }
  
  .job-date {
    font-size: 9.5pt;
  }
  
  .job-title {
    margin-bottom: 4pt;
    font-size: 10pt;
    font-style: italic;
  }
  
  .job-description {
    margin-bottom: 4pt;
  }
  
  .subsection {
    margin-top: 4pt;
  }
  
  .subsection-title {
    margin-bottom: 2pt;
    font-size: 10pt;
    font-weight: 600;
    page-break-after: avoid; /* Keep title with content */
  }
  
  ul {
    padding-left: 18pt;
    margin: 0;
  }
  
  li {
    margin-bottom: 1.5pt;
  }
  
  .education-item {
    margin-bottom: 6pt;
  }
  
  .education-degree {
    margin: 2pt 0;
    font-size: 10pt;
    font-style: italic;
  }
  
  .education-date {
    font-size: 9.5pt;
  }
  
  @page {
    margin: 0.5in 0.6in;
    size: letter;
  }
  
  @page :first {
    margin-top: 0.5in;
  }
}