/* ==========================================================================
   Jičín.info – Educational Website Styles
   ========================================================================== */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&family=Source+Sans+3:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* ---------- Custom Properties ---------- */
:root {
  /* Colors */
  --primary: #2D6A4F;
  --primary-dark: #1B4332;
  --primary-light: #40916C;
  --secondary: #D4A843;
  --secondary-light: #E8C96A;
  --bg: #FAFAF5;
  --bg-alt: #F0F0EB;
  --text: #2B2B2B;
  --text-light: #5A5A5A;
  --text-muted: #888888;
  --accent: #3A7CA5;
  --accent-light: #5AADCF;
  --light-section: #E8F0E9;
  --white: #FFFFFF;
  --border: #D5D5D0;
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-lg: rgba(0, 0, 0, 0.15);
  --overlay: rgba(0, 0, 0, 0.5);

  /* Typography */
  --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 2rem;
  --fs-3xl: 2.5rem;
  --fs-4xl: 3rem;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Layout */
  --max-width: 1200px;
  --header-height: 70px;
  --sidebar-width: 340px;
  --border-radius: 8px;
  --border-radius-lg: 12px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition: 300ms ease;
  --transition-slow: 500ms ease;
}

/* ---------- Modern Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

/* ---------- Utility Classes ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

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

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--space-md); }
.mt-2 { margin-top: var(--space-xl); }
.mt-3 { margin-top: var(--space-2xl); }
.mb-1 { margin-bottom: var(--space-md); }
.mb-2 { margin-bottom: var(--space-xl); }
.mb-3 { margin-bottom: var(--space-2xl); }

.section-title {
  font-size: var(--fs-2xl);
  font-weight: 800;
  margin-bottom: var(--space-xl);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 60px;
  height: 4px;
  background: var(--secondary);
  border-radius: 2px;
}

/* ---------- Fade-in Animation ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Reading Progress Bar ---------- */
.reading-progress {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  z-index: 999;
  transition: width 50ms linear;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  height: var(--header-height);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

.site-header.scrolled {
  box-shadow: 0 2px 20px var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.logo {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

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

.logo .dot {
  color: var(--secondary);
}

/* Main Navigation */
.main-nav ul {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.main-nav a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  color: var(--text);
  font-weight: 600;
  font-size: var(--fs-sm);
  border-radius: var(--border-radius);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--primary);
  background: var(--light-section);
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---------- Hero Section ---------- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: var(--space-4xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(212, 168, 67, 0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

.hero h1 {
  color: var(--white);
  font-size: var(--fs-4xl);
  font-weight: 800;
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

.hero p {
  font-size: var(--fs-lg);
  opacity: 0.9;
  margin-bottom: var(--space-xl);
  line-height: 1.6;
}

.btn {
  display: inline-block;
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--fs-base);
  border-radius: var(--border-radius);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  border: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--shadow-lg);
}

.btn-primary {
  background: var(--secondary);
  color: var(--text);
}

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

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-white {
  background: var(--white);
  color: var(--primary);
}

.btn-white:hover {
  background: var(--light-section);
  color: var(--primary);
}

/* ---------- Article Cards Grid ---------- */
.articles-section {
  padding: var(--space-3xl) 0;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.article-card {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 10px var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px var(--shadow-lg);
}

.card-image {
  width: 100%;
  height: 200px;
  position: relative;
  overflow: hidden;
}

.card-image.placeholder-1 {
  background: linear-gradient(135deg, #2D6A4F 0%, #40916C 50%, #52B788 100%);
}

.card-image.placeholder-2 {
  background: linear-gradient(135deg, #3A7CA5 0%, #5AADCF 50%, #89CFF0 100%);
}

.card-image.placeholder-3 {
  background: linear-gradient(135deg, #D4A843 0%, #E8C96A 50%, #F0DFA0 100%);
}

.card-image.placeholder-4 {
  background: linear-gradient(135deg, #6B4E71 0%, #9B72A0 50%, #C49BC8 100%);
}

.card-image.placeholder-5 {
  background: linear-gradient(135deg, #C25B40 0%, #E07A5F 50%, #F0A58E 100%);
}

.card-image.placeholder-6 {
  background: linear-gradient(135deg, #1B4332 0%, #2D6A4F 50%, #3A7CA5 100%);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.article-card:hover .card-image img {
  transform: scale(1.05);
}

.card-badge {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  background: var(--secondary);
  color: var(--text);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 4px;
  font-size: var(--fs-xs);
  font-weight: 700;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-body {
  padding: var(--space-lg);
}

.card-body h3 {
  font-size: var(--fs-lg);
  margin-bottom: var(--space-sm);
}

.card-body h3 a {
  color: var(--text);
  text-decoration: none;
}

.card-body h3 a:hover {
  color: var(--primary);
}

.card-perex {
  color: var(--text-light);
  font-size: var(--fs-sm);
  margin-bottom: var(--space-md);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.card-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* ---------- Most Read Section ---------- */
.most-read {
  padding: var(--space-3xl) 0;
  background: var(--bg-alt);
}

.most-read-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.most-read-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
  background: var(--white);
  padding: var(--space-lg);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 2px 10px var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: inherit;
}

.most-read-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px var(--shadow-lg);
  color: inherit;
}

.most-read-number {
  font-family: var(--font-heading);
  font-size: var(--fs-3xl);
  font-weight: 800;
  color: var(--primary);
  opacity: 0.3;
  line-height: 1;
  flex-shrink: 0;
}

.most-read-content h3 {
  font-size: var(--fs-base);
  margin-bottom: var(--space-xs);
}

.most-read-content h3 a {
  color: var(--text);
}

.most-read-content h3 a:hover {
  color: var(--primary);
}

.most-read-content p {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* ---------- Newsletter CTA ---------- */
.newsletter-cta {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: var(--space-3xl) 0;
  text-align: center;
}

.newsletter-cta h2 {
  color: var(--white);
  margin-bottom: var(--space-sm);
}

.newsletter-cta p {
  opacity: 0.9;
  margin-bottom: var(--space-xl);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.newsletter-form {
  display: flex;
  max-width: 460px;
  margin: 0 auto;
  gap: var(--space-sm);
}

.newsletter-form input[type="email"] {
  flex: 1;
  padding: var(--space-md) var(--space-lg);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  font-size: var(--fs-base);
  outline: none;
  transition: border-color var(--transition-fast);
}

.newsletter-form input[type="email"]::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.newsletter-form input[type="email"]:focus {
  border-color: var(--secondary);
}

.newsletter-form button {
  padding: var(--space-md) var(--space-xl);
  background: var(--secondary);
  color: var(--text);
  font-weight: 700;
  font-family: var(--font-heading);
  border-radius: var(--border-radius);
  transition: background var(--transition-fast), transform var(--transition-fast);
  white-space: nowrap;
}

.newsletter-form button:hover {
  background: var(--secondary-light);
  transform: translateY(-1px);
}

.newsletter-msg {
  margin-top: var(--space-md);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.newsletter-msg.success {
  color: var(--secondary-light);
}

.newsletter-msg.error {
  color: #FF6B6B;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--text);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-3xl) 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col h4 {
  color: var(--white);
  font-size: var(--fs-base);
  margin-bottom: var(--space-lg);
  position: relative;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 30px;
  height: 2px;
  background: var(--secondary);
}

.footer-col p {
  font-size: var(--fs-sm);
  line-height: 1.8;
}

.footer-col ul li {
  margin-bottom: var(--space-sm);
}

.footer-col ul a {
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--fs-sm);
  transition: color var(--transition-fast), padding-left var(--transition-fast);
}

.footer-col ul a:hover {
  color: var(--secondary);
  padding-left: 5px;
}

.footer-social {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: var(--white);
  font-size: var(--fs-sm);
  font-weight: 700;
  transition: background var(--transition-fast);
}

.footer-social a:hover {
  background: var(--primary);
  color: var(--white);
}

.footer-bottom {
  padding: var(--space-lg) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: var(--fs-xs);
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.5);
}

.footer-bottom a:hover {
  color: var(--secondary);
}

/* ---------- Cookie Consent Banner ---------- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--text);
  color: var(--white);
  padding: var(--space-lg) var(--space-xl);
  z-index: 9999;
  box-shadow: 0 -4px 20px var(--shadow-lg);
  transform: translateY(100%);
  transition: transform var(--transition);
}

.cookie-banner.show {
  transform: translateY(0);
}

.cookie-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
  max-width: var(--max-width);
  margin: 0 auto;
  flex-wrap: wrap;
}

.cookie-inner p {
  font-size: var(--fs-sm);
  flex: 1;
  min-width: 250px;
}

.cookie-inner a {
  color: var(--secondary);
  text-decoration: underline;
}

.cookie-buttons {
  display: flex;
  gap: var(--space-sm);
}

.cookie-btn {
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: var(--fs-sm);
  transition: background var(--transition-fast);
}

.cookie-btn-accept {
  background: var(--primary);
  color: var(--white);
}

.cookie-btn-accept:hover {
  background: var(--primary-light);
}

.cookie-btn-decline {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
}

.cookie-btn-decline:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ---------- Back to Top ---------- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 46px;
  height: 46px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  box-shadow: 0 4px 15px var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition), background var(--transition-fast);
  z-index: 99;
  cursor: pointer;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-dark);
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  padding: var(--space-lg) 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
}

.breadcrumbs li::after {
  content: '›';
  margin-left: var(--space-sm);
  color: var(--text-muted);
}

.breadcrumbs li:last-child::after {
  display: none;
}

.breadcrumbs a {
  color: var(--text-muted);
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.breadcrumbs .current {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Category Page ---------- */
.category-header {
  padding: var(--space-2xl) 0;
  background: var(--light-section);
  border-bottom: 1px solid var(--border);
}

.category-header h1 {
  margin-bottom: var(--space-sm);
}

.category-header p {
  color: var(--text-light);
  font-size: var(--fs-md);
  max-width: 600px;
}

.content-with-sidebar {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--space-2xl);
  padding: var(--space-2xl) 0;
}

/* Article List (horizontal cards) */
.article-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.article-list-card {
  display: flex;
  gap: var(--space-lg);
  background: var(--white);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 10px var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.article-list-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px var(--shadow-lg);
}

.article-list-image {
  width: 280px;
  min-height: 200px;
  flex-shrink: 0;
  position: relative;
}

.article-list-body {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.article-list-body h3 {
  font-size: var(--fs-lg);
  margin-bottom: var(--space-sm);
}

.article-list-body h3 a {
  color: var(--text);
}

.article-list-body h3 a:hover {
  color: var(--primary);
}

.article-list-body .card-perex {
  margin-bottom: var(--space-md);
}

.read-more {
  color: var(--primary);
  font-weight: 600;
  font-size: var(--fs-sm);
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  transition: gap var(--transition-fast);
}

.read-more:hover {
  color: var(--primary-dark);
  gap: var(--space-sm);
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-2xl) 0;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--space-sm);
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: var(--fs-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.pagination a {
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
}

.pagination a:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.pagination .active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.pagination .dots {
  color: var(--text-muted);
  border: none;
  background: none;
}

/* ---------- Sidebar ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.sidebar-widget {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  padding: var(--space-lg);
  box-shadow: 0 2px 10px var(--shadow);
}

.sidebar-widget h4 {
  font-size: var(--fs-base);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--light-section);
}

.sidebar-widget ul li {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--bg-alt);
}

.sidebar-widget ul li:last-child {
  border-bottom: none;
}

.sidebar-widget ul a {
  color: var(--text);
  font-size: var(--fs-sm);
}

.sidebar-widget ul a:hover {
  color: var(--primary);
}

/* Ad Placeholder */
.ad-placeholder {
  background: linear-gradient(135deg, var(--bg-alt), var(--border));
  border-radius: var(--border-radius-lg);
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-family: var(--font-heading);
  border: 2px dashed var(--border);
}

.ad-inline {
  margin: var(--space-xl) 0;
  min-height: 120px;
}

/* Affiliate Box */
.affiliate-box {
  background: linear-gradient(135deg, var(--light-section), var(--white));
  border: 2px solid var(--primary);
  border-radius: var(--border-radius-lg);
  padding: var(--space-lg);
  text-align: center;
}

.affiliate-box h4 {
  color: var(--primary);
  margin-bottom: var(--space-sm);
  border-bottom: none;
}

.affiliate-box p {
  font-size: var(--fs-sm);
  color: var(--text-light);
  margin-bottom: var(--space-md);
}

/* Sidebar Sticky */
.sidebar-sticky {
  position: sticky;
  top: calc(var(--header-height) + var(--space-xl));
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

/* ---------- Article Detail ---------- */
.article-detail {
  padding: var(--space-2xl) 0;
}

.article-detail-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--space-2xl);
}

.article-content {
  max-width: 720px;
}

.article-header {
  margin-bottom: var(--space-2xl);
}

.article-header h1 {
  font-size: var(--fs-3xl);
  margin-bottom: var(--space-lg);
  line-height: 1.2;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-lg);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.article-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.article-meta .category-link {
  background: var(--light-section);
  color: var(--primary);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 4px;
  font-weight: 600;
}

/* Article Body Rich Text */
.article-body h2 {
  font-size: var(--fs-xl);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.article-body h3 {
  font-size: var(--fs-lg);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

.article-body p {
  margin-bottom: var(--space-lg);
}

.article-body blockquote {
  margin: var(--space-xl) 0;
  padding: var(--space-lg) var(--space-xl);
  border-left: 4px solid var(--secondary);
  background: var(--bg-alt);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  font-style: italic;
  color: var(--text-light);
}

.article-body ul,
.article-body ol {
  margin: var(--space-lg) 0;
  padding-left: var(--space-xl);
}

.article-body ul {
  list-style: disc;
}

.article-body ol {
  list-style: decimal;
}

.article-body li {
  margin-bottom: var(--space-sm);
}

.article-body img,
.article-image-placeholder {
  width: 100%;
  border-radius: var(--border-radius-lg);
  margin: var(--space-xl) 0;
}

.article-image-placeholder {
  height: 350px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: var(--fs-sm);
  font-family: var(--font-heading);
}

.article-body a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-body a:hover {
  color: var(--accent);
}

/* Share Buttons */
.share-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: var(--space-xl) 0;
}

.share-buttons span {
  font-weight: 700;
  font-size: var(--fs-sm);
  margin-right: var(--space-sm);
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-radius);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--white);
  transition: opacity var(--transition-fast);
  text-decoration: none;
}

.share-btn:hover {
  opacity: 0.85;
  color: var(--white);
}

.share-btn.facebook { background: #1877F2; }
.share-btn.twitter { background: #1DA1F2; }
.share-btn.linkedin { background: #0A66C2; }
.share-btn.email-share { background: var(--text-light); }

/* Related Articles */
.related-articles {
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--border);
  margin-top: var(--space-2xl);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

/* Comments Placeholder */
.comments-section {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--border);
}

.comments-placeholder {
  background: var(--bg-alt);
  border-radius: var(--border-radius-lg);
  padding: var(--space-2xl);
  text-align: center;
  color: var(--text-muted);
}

/* ---------- Others / Static Page ---------- */
.static-page {
  padding: var(--space-3xl) 0;
}

.static-content {
  max-width: 720px;
  margin: 0 auto;
}

.static-content h1 {
  margin-bottom: var(--space-lg);
}

.static-content h2 {
  font-size: var(--fs-xl);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.static-content p {
  margin-bottom: var(--space-lg);
  color: var(--text-light);
}

.static-content ul {
  list-style: disc;
  padding-left: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.static-content li {
  margin-bottom: var(--space-sm);
  color: var(--text-light);
}

/* Contact Form */
.contact-form {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  padding: var(--space-2xl);
  box-shadow: 0 2px 10px var(--shadow);
  margin-top: var(--space-xl);
}

.contact-form h2 {
  margin-bottom: var(--space-xl);
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: var(--fs-sm);
  margin-bottom: var(--space-sm);
  color: var(--text);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--space-md);
  border: 2px solid var(--border);
  border-radius: var(--border-radius);
  background: var(--bg);
  font-size: var(--fs-base);
  transition: border-color var(--transition-fast);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

.form-group .error-msg {
  display: none;
  color: #D32F2F;
  font-size: var(--fs-xs);
  margin-top: var(--space-xs);
}

.form-group.has-error input,
.form-group.has-error textarea {
  border-color: #D32F2F;
}

.form-group.has-error .error-msg {
  display: block;
}

.form-success {
  display: none;
  background: var(--light-section);
  color: var(--primary);
  padding: var(--space-lg);
  border-radius: var(--border-radius);
  text-align: center;
  font-weight: 600;
  margin-top: var(--space-md);
}

.form-success.show {
  display: block;
}

/* ---------- Responsive: Tablet (1024px) ---------- */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 280px;
  }

  .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .most-read-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .most-read-grid > *:last-child {
    grid-column: span 2;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-grid > *:last-child {
    display: none;
  }
}

/* ---------- Responsive: Mobile (768px) ---------- */
@media (max-width: 768px) {
  :root {
    --fs-3xl: 2rem;
    --fs-4xl: 2.5rem;
    --header-height: 60px;
  }

  .hamburger {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: var(--white);
    box-shadow: -4px 0 20px var(--shadow-lg);
    padding: calc(var(--header-height) + var(--space-xl)) var(--space-xl) var(--space-xl);
    transform: translateX(100%);
    transition: transform var(--transition);
    z-index: 1000;
    overflow-y: auto;
  }

  .main-nav.open {
    transform: translateX(0);
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .main-nav a {
    padding: var(--space-md);
    font-size: var(--fs-base);
    border-bottom: 1px solid var(--bg-alt);
  }

  .nav-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
  }

  .nav-overlay.show {
    opacity: 1;
    visibility: visible;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .most-read-grid {
    grid-template-columns: 1fr;
  }

  .most-read-grid > *:last-child {
    grid-column: span 1;
  }

  .content-with-sidebar {
    grid-template-columns: 1fr;
  }

  .article-detail-layout {
    grid-template-columns: 1fr;
  }

  .article-list-card {
    flex-direction: column;
  }

  .article-list-image {
    width: 100%;
    min-height: 180px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .related-grid > *:last-child {
    display: block;
  }

  .hero {
    padding: var(--space-2xl) 0;
  }

  .hero h1 {
    font-size: var(--fs-2xl);
  }

  .newsletter-form {
    flex-direction: column;
  }

  .cookie-inner {
    flex-direction: column;
    text-align: center;
  }

  .cookie-buttons {
    width: 100%;
    justify-content: center;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .share-buttons {
    flex-wrap: wrap;
  }

  .sidebar-sticky {
    position: static;
  }

  .pagination {
    flex-wrap: wrap;
  }
}

/* ---------- Responsive: Small (480px) ---------- */
@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-md);
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}

/* ---------- Print Styles ---------- */
@media print {
  .site-header,
  .site-footer,
  .cookie-banner,
  .back-to-top,
  .reading-progress,
  .sidebar,
  .share-buttons,
  .newsletter-cta,
  .ad-placeholder,
  .affiliate-box,
  .hamburger,
  .nav-overlay,
  .pagination,
  .comments-section {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .content-with-sidebar,
  .article-detail-layout {
    grid-template-columns: 1fr;
  }

  .article-content {
    max-width: 100%;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 0.8em;
    color: #555;
  }

  .article-card,
  .most-read-card,
  .article-list-card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
}
