/* ============================================
   ARTICLE PAGE STYLES
   Specifické styly pro jednotlivé články
   ============================================ */

/* Allow overflow for article section to enable sticky sidebars */
#article.main.style1 {
  overflow: visible;
}

/* Article sections spacing */
#article > section {
  margin-bottom: 2rem;
}

/* Article TOC styling */
#article .article-toc {
  background: rgba(15, 15, 16, 0.04);
  padding: 2rem;
  border-radius: 12px;
  margin: 2rem 0 3rem;
  border: 1px solid rgba(15, 15, 16, 0.1);
}

#article .article-toc ol {
  margin: 0.5rem 0 0 0;
  padding-left: 0;
  list-style: none;
  counter-reset: toc-counter;
}

#article .article-toc ol li {
  counter-increment: toc-counter;
  padding-left: 0;
  margin-bottom: 0.75rem;
}

#article .article-toc ol li::before {
  display: none;
}

#article .article-toc a {
  color: #0f0f10;
  font-size: 1rem;
  line-height: 1.6;
}

#article .article-toc a:hover {
  color: #4a4a4a;
}

/* Box styling */
#article .box {
  border: 1px solid rgba(15, 15, 16, 0.15);
  border-left: 4px solid #0f0f10;
  padding: 1.5rem;
  border-radius: 8px;
  margin: 2rem 0;
  background: rgba(15, 15, 16, 0.03);
}

#article .box p, #article .box ul, #article .box li {
  color: #2d2d2d;
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

#article .box p:last-child, #article .box ul:last-child {
  margin-bottom: 0;
}

/* Author box styling */
#article .author-box {
  background: rgba(15, 15, 16, 0.04);
  padding: 1.5rem;
  border-radius: 8px;
  margin: 2rem 0;
  border: 1px solid rgba(15, 15, 16, 0.1);
}

#article .author-box h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

#article .author-box p {
  margin: 0.5rem 0;
  color: #4a4a4a;
}

#article .author-box .author-meta {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.5rem;
}

#article .author-box a {
  color: #0f0f10;
  text-decoration: none;
}

#article .author-box a:hover {
  text-decoration: underline;
}

/* Article meta in header */
#header .article-meta {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
  opacity: 0.9;
}

/* Hero section padding for article pages */
/* These styles apply when article.css is loaded (article pages only) */
#header .inner {
  max-width: 800px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* Responsive hero padding for article pages */
@media screen and (max-width: 980px) {
  #header .inner {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media screen and (max-width: 640px) {
  #header .inner {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

/* Article container wrapper */
#article .article-container-wrapper {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Article content wrapper - centered, full width up to max */
#article .article-content-wrapper {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

#article .article-content {
  width: 100%;
}

/* Article sidebars - sticky positioning */
@media screen and (min-width: 981px) {
  #article {
    overflow: visible;
  }
  
  #article .container {
    overflow: visible;
  }
  
  #article .article-container-wrapper {
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    gap: 3rem;
    align-items: start;
    overflow: visible;
  }
  
  #article .article-sidebar-left {
    position: sticky;
    top: 6rem; /* Offset pro fixed header (header height ~4rem + padding) */
    align-self: start;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    grid-column: 1;
    padding-right: 1rem;
    width: 250px;
    z-index: 100;
  }
  
  #article .article-content-wrapper {
    grid-column: 2;
    max-width: 800px;
    margin: 0;
  }
  
  #article .article-sidebar-right {
    grid-column: 3;
    padding-left: 1rem;
    position: static;
    width: 250px;
  }
}

/* Mobile fallback */
@media screen and (max-width: 980px) {
  #article .article-sidebar {
    position: static;
    width: 100%;
    max-height: none;
  }
}

/* Article TOC in sidebar */
#article .article-sidebar-left .article-toc {
  background: rgba(15, 15, 16, 0.04);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid rgba(15, 15, 16, 0.1);
  margin: 0;
}

#article .article-sidebar-left .article-toc h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

#article .article-sidebar-left .article-toc ol {
  margin: 0;
  padding-left: 1.25rem;
  list-style: decimal;
}

#article .article-sidebar-left .article-toc ol li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

#article .article-sidebar-left .article-toc a {
  color: #0f0f10;
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.5;
}

#article .article-sidebar-left .article-toc a:hover {
  color: #4a4a4a;
  text-decoration: underline;
}

/* Author box in sidebar */
#article .author-box-sidebar {
  background: rgba(15, 15, 16, 0.04);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid rgba(15, 15, 16, 0.1);
  text-align: center;
}

#article .author-box-sidebar .author-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  display: block;
  border: 2px solid rgba(15, 15, 16, 0.1);
}

#article .author-box-sidebar h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
}

#article .author-box-sidebar .author-role {
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

#article .author-box-sidebar .author-bio {
  margin: 0 0 1rem 0;
  font-size: 0.85rem;
  color: #4a4a4a;
  line-height: 1.5;
  text-align: left;
}

#article .author-box-sidebar .author-social {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

#article .author-box-sidebar .author-social a {
  color: #666;
  font-size: 1.2rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

#article .author-box-sidebar .author-social a:hover {
  color: #0f0f10;
}

/* Responsive: tablet and mobile */
@media screen and (max-width: 980px) {
  #article .article-container-wrapper {
    padding: 0;
    display: block;
  }
  
  #article .article-sidebar {
    position: static;
    top: auto;
    width: 100%;
    max-height: none;
    margin-bottom: 2rem;
  }
  
  #article .article-sidebar-left,
  #article .article-sidebar-right {
    padding-left: 2rem;
    padding-right: 2rem;
    left: auto;
    right: auto;
  }
  
  #article .article-content-wrapper {
    max-width: 100%;
    margin: 0;
    padding-left: 2rem;
    padding-right: 2rem;
  }
  
  #article .article-content {
    padding-left: 0;
    padding-right: 0;
  }
  
  /* Ensure headings are aligned with text on tablet */
  #article .article-content > section > header.major,
  #article .article-content > section > header.major h2,
  #article .article-content > section > h3,
  #article .article-content > section > h4 {
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
  }
}

/* Responsive typography for articles */
@media screen and (max-width: 980px) {
  #article .container {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
  }
  
  #article header.major h2 {
    font-size: 2rem;
  }
  
  #article h3 {
    font-size: 1.5rem;
  }
}

@media screen and (max-width: 640px) {
  #article .article-content-wrapper {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
  
  #article .article-sidebar-left,
  #article .article-sidebar-right {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
  
  #article .container {
    padding-left: 0;
    padding-right: 0;
  }
  
  #article header.major {
    margin-top: 3rem;
    margin-bottom: 2rem;
  }
  
  #article header.major h2 {
    font-size: 1.75rem;
    line-height: 1.3;
  }
  
  #article h3 {
    font-size: 1.35rem;
    margin-top: 2rem;
  }
  
  #article p {
    font-size: 1rem;
    line-height: 1.7;
  }
  
  #article ul, #article ol {
    font-size: 1rem;
  }
  
  #article .image.fit {
    margin: 2rem 0;
  }
  
  #article blockquote {
    padding: 1.25rem 1.25rem 1.25rem 1.5rem;
    margin: 2rem 0;
  }
  
  /* Ensure all content elements respect the padding */
  #article .article-content > section,
  #article .article-content > section > header.major,
  #article .article-content > section > header.major h2,
  #article .article-content > section > p,
  #article .article-content > section > ul,
  #article .article-content > section > ol,
  #article .article-content > section > h3,
  #article .article-content > section > h4,
  #article .article-content > section > .box {
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
  }
  
  /* Tables - ensure they don't overflow and respect container padding */
  #article .article-content > section > table {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Box elements - ensure they respect padding */
  #article .article-content > section > .box {
    margin-left: 0;
    margin-right: 0;
  }
}

