/* Alexander Chernyavskiy's Cosmos - Static Site Stylesheet */
:root {
  --bg-color: #0d0f12;
  --bg-card: #15191e;
  --bg-header: #111419;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --accent-blue: #38bdf8;
  --accent-hover: #7dd3fc;
  --border-color: #272f3d;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.6);
}

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

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-color);
  background-image: radial-gradient(circle at 50% 0%, #1e293b 0%, #0d0f12 70%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

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

/* Container */
.site-wrapper {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  flex: 1;
  box-sizing: border-box;
}

/* Header */
.site-header {
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
  width: 100%;
  box-sizing: border-box;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.logo-link {
  display: inline-block;
  text-decoration: none;
}

.logo-img {
  max-height: 55px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.site-search {
  position: relative;
  width: 240px;
}

.site-search input {
  width: 100%;
  padding: 8px 36px 8px 14px;
  background: #1e2530;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.site-search input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.site-search button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

/* Navigation */
.main-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: block;
  padding: 8px 14px;
  color: #cbd5e1;
  font-weight: 500;
  font-size: 14px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-item.active > .nav-link {
  color: #ffffff;
  background: #1e293b;
  text-decoration: none;
}

/* Dropdown */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #1a222d;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  list-style: none;
  padding: 6px 0;
  z-index: 100;
}

.nav-item:hover > .dropdown-menu {
  display: block;
}

.dropdown-item a {
  display: block;
  padding: 8px 16px;
  color: #cbd5e1;
  font-size: 13px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.dropdown-item a:hover {
  background: #243041;
  color: #ffffff;
  text-decoration: none;
}

/* Categories quick bar */
.categories-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #131820;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-top: 14px;
  overflow-x: auto;
  max-width: 100%;
  box-sizing: border-box;
}

.cat-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.cat-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-pill {
  display: inline-block;
  padding: 4px 12px;
  background: #1e2634;
  border: 1px solid #2e3a4d;
  border-radius: 14px;
  color: #cbd5e1;
  font-size: 12px;
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.2s;
}

.cat-pill:hover, .cat-pill.active {
  background: var(--accent-blue);
  color: #0f172a;
  border-color: var(--accent-blue);
  font-weight: 600;
  text-decoration: none;
}

/* Intro banner */
.intro-banner {
  background: linear-gradient(135deg, #182232 0%, #111722 100%);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-blue);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
  box-sizing: border-box;
}

.intro-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.intro-text {
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.5;
}

/* Featured Slider */
.featured-slider {
  display: grid;
  grid-template-columns: 1fr 340px;
  background: #141a23;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 30px;
  box-shadow: var(--shadow-lg);
  max-width: 100%;
  box-sizing: border-box;
}

.slider-main-image {
  position: relative;
  height: 420px;
  background: #000000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.slider-main-image:hover img {
  transform: scale(1.02);
}

.slider-zoom-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}

.slider-zoom-btn:hover {
  background: var(--accent-blue);
  color: #0f172a;
}

.slider-details {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #18202c;
  border-left: 1px solid var(--border-color);
  box-sizing: border-box;
}

.slider-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}

.slider-title a {
  color: #ffffff;
  text-decoration: none;
}

.slider-title a:hover {
  color: var(--accent-blue);
}

.slider-meta {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 12px;
}

.slider-desc {
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.slider-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.slider-btn {
  background: #243041;
  border: 1px solid #334155;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  text-decoration: none;
  min-height: 38px;
}

.slider-btn.slider-prev,
.slider-btn.slider-next {
  width: 44px;
  font-size: 18px;
  padding: 0;
}

.slider-btn:hover {
  background: var(--accent-blue);
  color: #0f172a;
  border-color: var(--accent-blue);
  text-decoration: none;
}

/* Main Layout Grid */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  margin-bottom: 36px;
  width: 100%;
  box-sizing: border-box;
}

.main-layout.full-width {
  grid-template-columns: 1fr;
}

.content-area {
  min-width: 0;
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  word-wrap: break-word;
}

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

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

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
  width: 100%;
}

.gallery-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
  border-color: #3b82f6;
}

.gallery-thumb-wrap {
  position: relative;
  aspect-ratio: 1/1;
  background: #0b0e13;
  overflow: hidden;
  cursor: pointer;
}

.gallery-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-card:hover .gallery-thumb-wrap img {
  transform: scale(1.05);
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: opacity 0.2s ease;
}

.gallery-card:hover .gallery-overlay {
  opacity: 1;
}

.overlay-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
  text-decoration: none;
}

.overlay-btn:hover {
  background: var(--accent-blue);
  color: #0f172a;
  transform: scale(1.1);
  text-decoration: none;
}

.gallery-info {
  padding: 10px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.gallery-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 6px;
  word-wrap: break-word;
}

.gallery-title a {
  color: #f1f5f9;
  text-decoration: none;
}

.gallery-title a:hover {
  color: var(--accent-blue);
}

.gallery-date {
  font-size: 11px;
  color: var(--text-muted);
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
}

.sidebar-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.sidebar-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-list li a {
  color: #cbd5e1;
  font-size: 13px;
  display: block;
  padding: 4px 6px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.sidebar-list li a:hover {
  background: #1e293b;
  color: #ffffff;
  text-decoration: none;
}

/* Article / Post / Page Content */
.post-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
  max-width: 100%;
}

.post-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.post-page-title {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  margin-bottom: 8px;
  word-wrap: break-word;
}

.post-meta-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.post-image-hero {
  margin: 0 auto 24px;
  text-align: center;
  background: #080a0e;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  max-width: 100%;
}

.post-image-hero img {
  max-height: 600px;
  max-width: 100%;
  margin: 0 auto;
}

.post-body {
  color: #cbd5e1;
  font-size: 14.5px;
  line-height: 1.7;
  max-width: 100%;
  overflow-wrap: break-word;
}

.post-body p {
  margin-bottom: 16px;
}

.post-body h1, .post-body h2, .post-body h3, .post-body h4 {
  color: #ffffff;
  margin: 24px 0 12px;
}

.post-body blockquote {
  border-left: 3px solid var(--accent-blue);
  background: #1a2230;
  padding: 12px 18px;
  margin: 16px 0;
  font-style: italic;
  border-radius: 0 6px 6px 0;
}

.post-body img {
  max-width: 100% !important;
  height: auto !important;
  margin: 16px auto;
  border-radius: 6px;
}

.wp-caption {
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin: 16px auto !important;
  text-align: center;
}

.wp-caption img {
  max-width: 100% !important;
  height: auto !important;
  margin: 0 auto !important;
}

.wp-caption-text {
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
}

/* Post Navigation Bar (Arrow buttons) */
.post-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
  width: 100%;
  box-sizing: border-box;
}

.nav-prev, .nav-next {
  flex-shrink: 0;
}

.nav-center {
  flex-shrink: 0;
}

.nav-arrow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 40px;
  background: #1e2634;
  border: 1px solid #334155;
  color: #ffffff;
  border-radius: 6px;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  user-select: none;
}

.nav-arrow-btn:hover {
  background: var(--accent-blue);
  color: #0f172a;
  border-color: var(--accent-blue);
  text-decoration: none;
}

.nav-arrow-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.nav-gallery-btn {
  display: inline-block;
  padding: 8px 16px;
  background: #18202c;
  border: 1px solid var(--border-color);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-gallery-btn:hover {
  background: #243041;
  color: #ffffff;
  text-decoration: none;
}

/* Bottom section (Featured only) */
.bottom-widgets {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  width: 100%;
  box-sizing: border-box;
}

.bottom-widget-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 18px 20px;
  width: 100%;
  box-sizing: border-box;
}

.bottom-widget-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  letter-spacing: 0.5px;
}

.featured-widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  width: 100%;
}

.widget-post-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  background: #11151c;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #1e2634;
}

.widget-thumb {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #000;
}

.widget-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.widget-post-info {
  min-width: 0;
  flex: 1;
}

.widget-post-info a {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  display: block;
  line-height: 1.35;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget-post-info a:hover {
  color: var(--accent-blue);
}

.widget-date {
  font-size: 11px;
  color: var(--text-muted);
}

/* Lightbox Modal */
.lightbox-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(8px);
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 0 30px rgba(0,0,0,0.8);
}

.lightbox-caption {
  color: #f8fafc;
  font-size: 15px;
  font-weight: 600;
  margin-top: 14px;
  text-align: center;
  max-width: 800px;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #cbd5e1;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
}

.lightbox-close:hover {
  color: #ffffff;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255,255,255,0.2);
  color: #ffffff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.lightbox-nav:hover {
  background: var(--accent-blue);
  color: #0f172a;
}

.lightbox-prev {
  left: -60px;
}

.lightbox-next {
  right: -60px;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background: #090c10;
  padding: 24px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
}

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

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

/* Responsive */
@media (max-width: 900px) {
  .featured-slider {
    grid-template-columns: 1fr;
  }
  .slider-main-image {
    height: 320px;
  }
  .slider-details {
    border-left: none;
    border-top: 1px solid var(--border-color);
  }
  .main-layout {
    grid-template-columns: 1fr;
  }
  .featured-widget-grid {
    grid-template-columns: 1fr 1fr;
  }
  .lightbox-prev {
    left: 10px;
  }
  .lightbox-next {
    right: 10px;
  }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .header-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .site-search {
    width: 100%;
  }
  .nav-menu {
    gap: 2px;
  }
  .nav-link {
    padding: 6px 10px;
    font-size: 13px;
  }
  .post-nav-bar {
    gap: 8px;
  }
  .featured-widget-grid {
    grid-template-columns: 1fr;
  }
}
