/* Vibekassa - Static Site Styles */

:root {
  --color-bg: #fafafa;
  --color-text: #1a1a2e;
  --color-accent: #4361ee;
  --color-accent-hover: #3651d4;
  --color-muted: #6b7280;
  --color-border: #e5e5e5;
  --color-code-bg: #f4f4f5;
  --color-code-block-bg: #1a1a2e;
  --color-table-stripe: #f9f9f9;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --max-width: 800px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  flex: 1;
  padding: 2rem 0 4rem;
}

/* Header & Navigation */
header {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}

.logo:hover {
  color: var(--color-accent);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-accent);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2rem;
  margin-top: 0;
}

h2 {
  font-size: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1.1rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

strong {
  font-weight: 600;
}

/* Lists */
ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

li > ul, li > ol {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* Horizontal rule */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

/* Blockquote */
blockquote {
  border-left: 4px solid var(--color-accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--color-muted);
  font-style: italic;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-code-bg);
  color: #dc2626;
  padding: 0.2em 0.4em;
  border-radius: 4px;
}

pre {
  background: var(--color-code-block-bg);
  color: #e5e5e5;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  line-height: 1.5;
}

pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: 0.85rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
}

th {
  background: var(--color-code-bg);
  font-weight: 600;
}

tr:nth-child(even) td {
  background: var(--color-table-stripe);
}

/* Responsive tables */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
}

.table-wrapper table {
  margin: 0;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin: 1.5rem 0;
}

/* Make images clickable in main content */
main img {
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

main img:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Lightbox Modal */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
  margin: 0;
}

.lightbox.active .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s, transform 0.2s;
}

.lightbox-close:hover {
  opacity: 1;
  transform: scale(1.1);
}

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

body.lightbox-open {
  overflow: hidden;
}

/* Hero section */
.hero {
  text-align: center;
  padding: 2rem 0;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
}

.hero .tagline {
  font-size: 1.25rem;
  color: var(--color-muted);
  margin-bottom: 1rem;
}

.hero .highlight {
  font-size: 1.1rem;
  color: var(--color-text);
  font-weight: 500;
}

/* CTA Button */
.cta-button {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}

.cta-button:hover {
  background: var(--color-accent-hover);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

/* Info box */
.info-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.info-box p:last-child {
  margin-bottom: 0;
}

/* Footer */
footer {
  background: #fff;
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}

.footer-contacts {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-contacts a {
  color: var(--color-muted);
  font-size: 0.95rem;
}

.footer-contacts a:hover {
  color: var(--color-accent);
}

.footer-copyright {
  color: var(--color-muted);
  font-size: 0.85rem;
}

/* Article meta */
.article-meta {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.back-link:hover {
  color: var(--color-accent);
}

/* Mobile responsive */
@media (max-width: 640px) {
  html {
    font-size: 15px;
  }

  .container {
    padding: 0 1rem;
  }

  nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    gap: 1rem;
    flex-wrap: wrap;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.35rem;
  }

  .hero h1 {
    font-size: 1.85rem;
  }

  .hero .tagline {
    font-size: 1.1rem;
  }

  table {
    font-size: 0.85rem;
  }

  th, td {
    padding: 0.5rem 0.75rem;
  }

  pre {
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    border-radius: 6px;
  }

  .footer-contacts {
    flex-direction: column;
    gap: 0.75rem;
  }

  .lightbox {
    padding: 1rem;
  }

  .lightbox-close {
    top: 0.5rem;
    right: 1rem;
    font-size: 2rem;
  }

  .lightbox-img {
    max-width: 95vw;
    max-height: 85vh;
  }
}

/* Print styles */
@media print {
  header, footer, .back-link {
    display: none;
  }

  body {
    font-size: 12pt;
  }

  a {
    color: inherit;
    text-decoration: underline;
  }

  pre, code {
    background: #f5f5f5 !important;
    color: #000 !important;
  }
}
