/* Létej.com - Shared Styles */

:root {
  --primary: #ef7445;
  --secondary: #ef5b21;
  --bg: #ffffff;
  --light-bg: #f0f9f3;
  --dark-bg: #041e42;
  --text: #0d1e42;
  --text-muted: #666;
  --radius: 8px;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.9;
  color: var(--text);
  background: var(--bg);
}

.container { max-width: 1170px; margin: 0 auto; padding: 0 20px; }

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

/* Header */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid #e5e5e5;
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 15px;
}

.logo img { max-width: 48px; height: auto; }
.logo h1 { font-size: 24px; font-weight: 600; color: var(--text); }

nav ul { list-style: none; display: flex; gap: 30px; }
nav a { color: var(--text); font-weight: 500; }
nav a:hover { color: var(--secondary); }

/* Main content - pull up 1px to overlap site-header border-bottom, background covers the border */
main { margin-top: -1px; background: var(--bg); }

/* Hero */
.hero {
  position: relative;
  height: 400px;
  background: linear-gradient(rgba(4, 30, 66, 0.3), rgba(4, 30, 66, 0.5)),
              url('/assets/images/hero.webp') center/cover;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
}

.hero h1 { font-size: 48px; font-weight: 700; margin-bottom: 15px; }
.hero p { font-size: 20px; opacity: 0.95; }

/* Posts Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 40px;
  margin: 60px 0;
}

.post-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, box-shadow 0.2s;
  border-radius: var(--radius);
  overflow: hidden;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.post-card.featured {
  position: relative;
}

.post-card.featured::after {
  content: 'Doporučené';
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-card img { width: 100%; height: 220px; object-fit: cover; }
.post-card-content { padding: 25px; }
.post-card h2 { font-size: 20px; font-weight: 700; margin: 10px 0 15px; line-height: 1.3; }
.post-meta { font-size: 12px; color: #999; text-transform: uppercase; font-weight: 600; }
.post-excerpt { font-size: 15px; line-height: 1.7; color: var(--text-muted); }

/* Tags */
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 15px; }
.tag {
  background: #fff;
  color: #333;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #ddd;
  transition: all 0.2s;
}
.tag:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.post-card .tag {
  pointer-events: none;
}
.post-card .tag:hover {
  background: #fff;
  color: #333;
  border-color: #ddd;
}

/* Tag filter bar */
.tag-filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 40px;
}
.filter-tag {
  cursor: pointer;
}
.filter-tag.active {
  background: var(--primary);
  color: white;
}

/* Single Post */
/* Sentinel for sticky detection - positioned after header in document flow */
.sticky-sentinel {
  height: 1px;
  width: 100%;
  pointer-events: none;
}

.post-content > .post-header {
  text-align: center;
  padding: 60px 0 40px;
  position: sticky;
  top: 86px; /* site-header height: 20px padding + 46px logo + 20px padding = 86px */
  background: var(--bg);
  z-index: 50;
  transition: padding 0.2s ease, box-shadow 0.2s ease;
}
.post-content > .post-header.is-stuck {
  padding: 15px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  /* Break out of container to full width */
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}
.post-content > .post-header.is-stuck h1 {
  font-size: 24px;
  margin-bottom: 0;
}
.post-content > .post-header.is-stuck .post-meta {
  display: none;
}
.post-content > .post-header.is-stuck .tags {
  display: none;
}
.post-header h1 { font-size: 42px; font-weight: 700; margin-bottom: 20px; line-height: 1.2; transition: font-size 0.2s ease; }
.post-featured-image { width: 100%; max-height: 500px; object-fit: cover; border-radius: var(--radius); margin-bottom: 40px; }

.post-content { position: relative; max-width: 800px; margin: 0 auto; padding-bottom: 60px; }
.post-content h2 { font-size: 28px; font-weight: 700; margin: 50px 0 25px; }
.post-content h3 { font-size: 22px; font-weight: 700; margin: 35px 0 20px; }
.post-content p { margin-bottom: 25px; }
.post-content ul, .post-content ol { margin: 25px 0 25px 35px; }
.post-content li { margin-bottom: 12px; }
.post-content img { max-width: 100%; height: auto; border-radius: var(--radius); margin: 30px 0; }
.post-content video {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 10px 0;
  display: block;
  border: 2px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  background: #000;
}
.video-wrapper {
  position: relative;
  margin: 10px 0;
  cursor: pointer;
}
.video-wrapper video {
  margin: 0;
  pointer-events: none;
}
.video-wrapper.playing video {
  pointer-events: auto;
}
.video-wrapper .play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  pointer-events: none;
}
.video-wrapper .play-overlay::after {
  content: '';
  border-style: solid;
  border-width: 15px 0 15px 25px;
  border-color: transparent transparent transparent #fff;
  margin-left: 5px;
}
.video-wrapper:hover .play-overlay {
  background: rgba(0,0,0,0.8);
  transform: translate(-50%, -50%) scale(1.1);
}
.video-wrapper.playing .play-overlay {
  display: none;
}
.post-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 15px 25px;
  margin: 30px 0;
  background: var(--light-bg);
  font-style: italic;
}
.post-content pre {
  background: var(--dark-bg);
  color: #fff;
  padding: 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 30px 0;
}
.post-content code { font-family: 'Fira Code', monospace; font-size: 0.9em; }
.post-content a { text-decoration: underline; }

/* Footer */
footer {
  background: var(--dark-bg);
  color: white;
  padding: 40px 0;
  text-align: center;
}
footer a { color: white; opacity: 0.8; }
footer a:hover { opacity: 1; }

/* Related Articles */
.related-articles {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid #e5e5e5;
}
.related-articles h2 {
  font-size: 24px;
  margin-bottom: 25px;
  text-align: center;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}
.related-card {
  display: block;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}
.related-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.related-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}
.related-card-content {
  padding: 15px;
}
.related-card-title {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.4;
  margin-bottom: 6px;
  display: block;
}
.related-card-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* Image Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px;
  margin: 30px 0;
}
.gallery a {
  display: block;
  line-height: 0;
}
.post-content .gallery picture {
  display: block;
  line-height: 0;
  margin: 0;
}
.gallery img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
  margin: 0;
}
.gallery img:hover {
  transform: scale(1.03);
  opacity: 0.9;
}
.post-content picture {
  display: block;
  margin: 30px 0;
}
.post-content picture img {
  margin: 0;
}

/* ============================================================================
   About Page (O mně)
   ============================================================================ */

/* Hero section with photo */
.about-hero {
  background: linear-gradient(135deg, var(--dark-bg) 0%, #0a3a6b 100%);
  color: white;
  padding: 80px 0;
  text-align: center;
}

.about-hero .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid rgba(255,255,255,0.2);
  margin-bottom: 30px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.about-hero h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 10px;
}

.about-hero .subtitle {
  font-size: 18px;
  opacity: 0.9;
  max-width: 500px;
}

/* Stats */
.stats {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

.stat {
  text-align: center;
}

.stat-number {
  font-size: 42px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.stat-label {
  font-size: 14px;
  opacity: 0.8;
  margin-top: 5px;
}

/* Content sections */
.about-content {
  padding: 80px 0;
}

.about-section {
  max-width: 800px;
  margin: 0 auto;
}

.about-section p {
  font-size: 18px;
  margin-bottom: 25px;
  color: var(--text);
}

.about-section p:last-child {
  margin-bottom: 0;
}

/* Achievements */
.achievements-section {
  background: var(--light-bg);
  padding: 80px 0;
}

.achievements-section h2 {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 50px;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.achievement {
  background: white;
  border-radius: var(--radius);
  padding: 20px 25px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.achievement-medal {
  font-size: 32px;
  flex-shrink: 0;
}

.achievement-content {
  flex: 1;
}

.achievement-title {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 4px;
}

.achievement-details {
  font-size: 13px;
  color: var(--text-muted);
}

.achievement.gold {
  border-left: 4px solid #FFD700;
}

.achievement.silver {
  border-left: 4px solid #C0C0C0;
}

.achievement.bronze {
  border-left: 4px solid #CD7F32;
}

.achievement.national {
  border-left: 4px solid var(--primary);
}

/* Quote */
.quote-section {
  background: white;
  padding: 60px 0;
  text-align: center;
}

.quote {
  max-width: 700px;
  margin: 0 auto;
  font-size: 24px;
  font-style: italic;
  color: var(--text);
  position: relative;
}

.quote::before {
  content: '"';
  font-size: 80px;
  color: var(--primary);
  opacity: 0.3;
  position: absolute;
  top: -30px;
  left: -20px;
  font-family: Georgia, serif;
}

/* Contact */
.contact-section {
  padding: 80px 0;
  text-align: center;
}

.contact-section h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 30px;
}

.contact-methods {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
}

.contact-icon {
  width: 50px;
  height: 50px;
  background: var(--light-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* CTA */
.cta-section {
  background: var(--primary);
  color: white;
  padding: 60px 0;
  text-align: center;
}

.cta-section h3 {
  font-size: 28px;
  margin-bottom: 15px;
}

.cta-section p {
  font-size: 18px;
  opacity: 0.95;
  margin-bottom: 25px;
}

.cta-btn {
  display: inline-block;
  padding: 15px 40px;
  background: white;
  color: var(--primary);
  font-weight: 600;
  border-radius: var(--radius);
  transition: transform 0.2s, box-shadow 0.2s;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  color: var(--secondary);
}

/* ============================================================================
   Homepage
   ============================================================================ */

.homepage .hero {
  height: 500px;
}
.homepage .hero h1 { font-size: 56px; }
.homepage .hero p { font-size: 22px; opacity: 0.95; max-width: 600px; line-height: 1.6; }
.homepage .hero .btn {
  display: inline-block;
  margin-top: 30px;
  padding: 15px 40px;
  background: var(--primary);
  color: white;
  font-weight: 600;
  border-radius: var(--radius);
  transition: background 0.2s;
}
.homepage .hero .btn:hover { background: var(--secondary); color: white; }

.section { padding: 80px 0; }
.section-title {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 50px;
}

.view-all {
  display: block;
  text-align: center;
  margin-top: 50px;
  font-weight: 600;
}

/* ============================================================================
   Responsive
   ============================================================================ */
@media (max-width: 768px) {
  .post-header.is-stuck { display: none; }
  .posts-grid { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; gap: 20px; }
  nav ul { flex-wrap: wrap; gap: 15px; justify-content: center; }
  .hero { height: 300px; }
  .hero h1 { font-size: 32px; }
  .post-header h1 { font-size: 28px; }

  /* Homepage responsive */
  .homepage .hero { height: 400px; }
  .homepage .hero h1 { font-size: 36px; }
  .homepage .hero p { font-size: 18px; }

  /* About page responsive */
  .about-hero { padding: 60px 0; }
  .about-hero h1 { font-size: 28px; }
  .profile-photo { width: 150px; height: 150px; }

  .stats {
    flex-direction: column;
    gap: 30px;
  }
  .stat-number { font-size: 32px; }

  .about-section p { font-size: 16px; }
  .quote { font-size: 20px; }

  .contact-methods { flex-direction: column; align-items: center; }
}
