/* 
 * Nokta Haber - Homepage Layout Stylesheet
 * Handles Hero Slider, Masonry-like Grids, Category Blocks, Sidebar Widgets
 */

/* Hero Slider */
.hero-slider {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: clamp(440px, 52vw, 590px);
  overflow: hidden;
  margin-top: 24px;
  border-radius: 20px;
  background: #0b1120;
  box-shadow: 0 24px 60px rgb(15 23 42 / 0.18);
  cursor: grab;
}

.hero-slider:active {
  cursor: grabbing;
}

.hero-slider::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: inherit;
  pointer-events: none;
}

.slider-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

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

.slide-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.slide-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.035);
  transition: transform 6s ease;
}

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

.slide-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background:
    linear-gradient(90deg, rgb(2 6 23 / 0.9) 0%, rgb(2 6 23 / 0.62) 44%, rgb(2 6 23 / 0.08) 78%),
    linear-gradient(0deg, rgb(2 6 23 / 0.82) 0%, transparent 58%);
}

.slide-content {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 900px;
  padding: clamp(38px, 5vw, 68px);
  padding-bottom: clamp(70px, 7vw, 88px);
  color: #fff;
}

.slide.active .slide-content > * {
  animation: slide-content-in 0.55s ease both;
}

.slide.active .slide-content > :nth-child(2) {
  animation-delay: 0.05s;
}

.slide.active .slide-content > :nth-child(3) {
  animation-delay: 0.1s;
}

.slide.active .slide-content > :nth-child(4) {
  animation-delay: 0.15s;
}

.slide.active .slide-content > :nth-child(5) {
  animation-delay: 0.2s;
}

.category-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #fff;
  border-radius: var(--radius-sm);
  margin-bottom: 15px;
  letter-spacing: 0.5px;
}

.slide-category {
  position: relative;
  padding: 7px 13px 7px 25px;
  margin-bottom: 18px;
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 999px;
  background: rgb(15 23 42 / 0.48);
  box-shadow: 0 8px 22px rgb(0 0 0 / 0.18);
  backdrop-filter: blur(10px);
}

.slide-category::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--category-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--category-color) 25%, transparent);
  transform: translateY(-50%);
}

.slide-title {
  max-width: 850px;
  margin-bottom: 16px;
  font-size: clamp(2.2rem, 4.6vw, 3.9rem);
  font-weight: 850;
  line-height: 1.06;
  letter-spacing: -0.045em;
  text-wrap: balance;
  text-shadow: 0 4px 24px rgb(0 0 0 / 0.35);
}

.slide-title a:hover {
  color: #fff;
  text-decoration-color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 7px;
}

.slide-summary {
  max-width: 710px;
  margin-bottom: 20px;
  color: #e2e8f0;
  font-size: clamp(0.95rem, 1.25vw, 1.08rem);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 8px rgb(0 0 0 / 0.3);
}

.slide-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 20px;
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 600;
}

.slide-meta span {
  display: inline-flex;
  align-items: center;
}

.slide-meta span:not(:first-child)::before {
  content: "";
  width: 4px;
  height: 4px;
  margin-right: 9px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.48);
}

.slide-author {
  color: #fff;
}

.slide-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 800;
  box-shadow: 0 10px 28px rgb(255 45 75 / 0.28);
}

.slide-cta span {
  font-size: 1.15rem;
  transition: transform 0.2s ease;
}

.slide-cta:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-2px);
}

.slide-cta:hover span {
  transform: translateX(4px);
}

/* Slider Controls */
.slider-prev, .slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 46px;
  height: 46px;
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: 50%;
  background: rgb(15 23 42 / 0.42);
  color: #fff;
  font-size: 1.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(10px);
  user-select: none;
}

@media (hover: hover) {
  .slider-prev:hover, .slider-next:hover {
    border-color: var(--accent);
    background: var(--accent);
  }
}

.slider-prev:active, .slider-next:active {
  background: var(--accent);
  transform: translateY(-50%) scale(0.9);
}

.slider-prev { left: 24px; }
.slider-next { right: 24px; }

.slider-footer {
  position: absolute;
  right: 30px;
  bottom: 24px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 18px;
}

.slider-count {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgb(255 255 255 / 0.65);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.slider-current {
  color: #fff;
  font-size: 0.9rem;
}

.slider-count-separator {
  width: 24px;
  height: 1px;
  background: rgb(255 255 255 / 0.4);
}

.slider-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.42);
  cursor: pointer;
  transition: width 0.25s ease, border-radius 0.25s ease, background-color 0.25s ease;
}

.dot.active {
  width: 24px;
  border-radius: 999px;
  background: var(--accent);
}

.dot:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.slider-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  height: 3px;
  background: rgb(255 255 255 / 0.12);
}

.slider-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
}

.slider-progress span.is-running {
  animation: slider-progress 5s linear forwards;
}

@keyframes slide-content-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slider-progress {
  from { width: 0; }
  to { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .slide,
  .slide-image img,
  .slide-content > *,
  .slider-progress span {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 768px) {
  .hero-slider {
    height: clamp(420px, 75vh, 540px);
    margin-top: 16px;
    border-radius: 14px;
  }

  .slide-overlay {
    background:
      linear-gradient(90deg, rgb(2 6 23 / 0.78) 0%, rgb(2 6 23 / 0.22) 100%),
      linear-gradient(0deg, rgb(2 6 23 / 0.94) 0%, rgb(2 6 23 / 0.38) 68%, transparent 100%);
  }

  .slide-content {
    max-width: 100%;
    padding: 26px 22px 74px;
  }

  .slide-title {
    max-width: 100%;
    margin-bottom: 12px;
    font-size: clamp(1.7rem, 7vw, 2.45rem);
    line-height: 1.1;
  }

  .slide-summary {
    margin-bottom: 15px;
    font-size: 0.9rem;
  }

  .slide-category {
    margin-bottom: 13px;
  }

  .slider-prev, .slider-next {
    display: none;
  }

  .slider-footer {
    right: 20px;
    bottom: 19px;
    left: 20px;
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .hero-slider {
    height: 440px;
  }

  .slide-content {
    padding-right: 18px;
    padding-left: 18px;
  }

  .slide-summary {
    -webkit-line-clamp: 2;
  }

  .slide-meta {
    gap: 7px;
    font-size: 0.75rem;
  }

  .slide-cta {
    min-height: 40px;
    padding: 0 15px;
    font-size: 0.8rem;
  }

  .slider-dots {
    gap: 6px;
  }

  .dot {
    width: 6px;
    height: 6px;
  }

  .dot.active {
    width: 18px;
  }
}

/* Main Grid Area */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 30px;
  margin-top: 40px;
}

/* Featured & News Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

/* News Cards */
.news-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.news-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background-color: #000;
}

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

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

.card-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  z-index: 2;
}

.news-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.news-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.news-card-title a:hover {
  color: var(--accent);
}

.news-card-summary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.meta-left {
  display: flex;
  gap: 10px;
}

/* Category Blocks */
.category-block {
  margin-bottom: 45px;
}

.block-title {
  font-size: 1.4rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.block-title span {
  position: relative;
}

.block-title span::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent);
}

/* Sidebar Widgets */
.sidebar-widget {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
}

.widget-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

.widget-news-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.widget-news-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.widget-news-item img {
  width: 80px;
  min-width: 80px;
  height: 60px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.widget-news-info h4 {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 5px;
}

.widget-news-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Popular Counter Widget */
.popular-widget-item {
  display: flex;
  gap: 15px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-color);
}
.popular-widget-item:last-child {
  border-bottom: none;
}
.popular-number {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text-muted);
  opacity: 0.4;
  line-height: 1;
}
.popular-widget-item:nth-child(1) .popular-number { color: #f59e0b; opacity: 1; }
.popular-widget-item:nth-child(2) .popular-number { color: #3b82f6; opacity: 1; }
.popular-widget-item:nth-child(3) .popular-number { color: #10b981; opacity: 1; }

.popular-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

/* Advertisement Container */
.ad-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 30px 0;
  overflow: hidden;
}
.ad-container img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}
.ad-header { margin: 20px 0; }
.ad-sidebar-top, .ad-sidebar-bottom { margin: 0 0 30px; }

/* Responsive adjustments */
@media (max-width: 992px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Priority/Tiered Grid for Featured News */
.news-grid-featured {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.featured-card-large {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.featured-card-large:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.featured-card-large .news-card-image {
  aspect-ratio: auto;
  height: 100%;
}

.featured-card-large .news-card-content {
  padding: 30px;
}

.featured-card-large .news-card-title {
  font-size: 1.6rem;
  margin-bottom: 15px;
}

/* Tech Layout: 1 Large Left, 3 List Right */
.tech-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.tech-list-wrapper {
  display: flex;
  flex-direction: column;
  gap: 15px;
  justify-content: space-between;
}

.tech-list-item {
  display: flex;
  gap: 15px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.tech-list-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.tech-list-item img {
  width: 90px;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.tech-list-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tech-list-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 6px;
}

.tech-list-info h4 a:hover {
  color: var(--accent);
}

.tech-list-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Magazin Layout: Horizontal Visual Cards */
.magazin-layout {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.magazin-card {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.magazin-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

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

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

.magazin-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0) 100%);
  z-index: 1;
}

.magazin-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 15px;
  color: #fff;
  z-index: 2;
}

.magazin-content h4 {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
}

@media (max-width: 992px) {
  .featured-card-large {
    grid-column: 1 / -1;
  }
  .news-grid-featured {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tech-layout {
    grid-template-columns: 1fr;
  }
  .magazin-layout {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .featured-card-large {
    grid-template-columns: 1fr;
  }

  .news-grid-featured {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .news-grid {
    grid-template-columns: 1fr;
  }

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