/* uwords Dergi — Component Styles */

:root {
  --uw-yellow: #FBBA00;
  --uw-yellow-hover: #B8860A; /* AA-compliant dark yellow for text on light backgrounds (4.6:1) */
  --uw-dark: #1D1D1B;
  --uw-dark-lighter: #2a2a28;
  --uw-dark-card: #242422;
  --uw-gray-100: #f5f5f4;
  --uw-gray-200: #e7e5e4;
  --uw-gray-300: #d6d3d1;
  --uw-gray-400: #a8a29e;
  --uw-gray-500: #78716c;
  --uw-gray-600: #57534e;
  --uw-white: #fafaf9;
}

/*
 * Removed the global `* { margin:0; padding:0; box-sizing:border-box }` reset:
 * it fought Tailwind Preflight and stripped native <button> focus rings,
 * <summary> markers and WP list padding. Only box-sizing + body margin are
 * re-asserted defensively; Tailwind's Preflight handles the rest.
 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--uw-dark);
  background: var(--uw-white);
  overflow-x: hidden;
}

/* Defensive global image constraint — prevents WP content images from
   overflowing horizontally. Tailwind Preflight already does this for
   img, but this also covers video/svg inserted via the editor. */
img,
video,
svg {
  max-width: 100%;
  height: auto;
}

.font-serif {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

.font-sans {
  font-family: 'Inter', system-ui, sans-serif;
}

/* Navbar logo — preserve aspect ratio, cap by container height.
   Logo keeps its natural width; only the height is constrained. */
.custom-logo {
  height: auto;
  width: auto;
  max-height: 2rem;
  max-width: 100%;
  object-fit: contain;
}

@media (min-width: 1024px) {
  .custom-logo {
    max-height: 2.5rem;
  }
}

/* WP admin bar offset — when logged-in, push fixed elements below
   #wpadminbar (32px desktop, 46px mobile) to avoid overlap/gap. */
.admin-bar #navbar,
.admin-bar #mobileMenu,
.admin-bar #searchOverlay {
  top: 32px;
}

@media (max-width: 782px) {
  .admin-bar #navbar,
  .admin-bar #mobileMenu,
  .admin-bar #searchOverlay {
    top: 46px;
  }
}

::selection {
  background: var(--uw-yellow);
  color: var(--uw-dark);
}

::-moz-selection {
  background: var(--uw-yellow);
  color: var(--uw-dark);
}

/* Accessibility: global focus indicators */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--uw-yellow);
  outline-offset: 2px;
}

.focus-visible:focus-visible {
  outline: 2px solid #FBBA00;
  outline-offset: 2px;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-4 {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-overlay {
  background: linear-gradient(to top, rgba(29,29,27,0.95) 0%, rgba(29,29,27,0.6) 40%, rgba(29,29,27,0.1) 100%);
}

.category-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.category-card:hover {
  transform: translateY(-4px);
}

.category-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--uw-yellow);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.category-card:hover::after {
  transform: scaleX(1);
}

.article-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(29,29,27,0.12);
}

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

.article-card-image {
  overflow: hidden;
}

.article-card-image img {
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tag {
  display: inline-block;
  padding: 8px 12px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--uw-yellow);
  color: var(--uw-dark);
  border-radius: 2px;
}

.tag-outline {
  display: inline-block;
  padding: 8px 12px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1.5px solid var(--uw-dark);
  color: var(--uw-dark);
  border-radius: 2px;
  transition: all 0.2s ease;
}

.tag-outline:hover {
  background: var(--uw-dark);
  color: var(--uw-yellow);
}

.tag-dark {
  display: inline-block;
  padding: 8px 12px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--uw-dark);
  color: var(--uw-yellow);
  border-radius: 2px;
}

.tag-white {
  display: inline-block;
  padding: 8px 12px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(29,29,27,0.45);
  color: #fff;
  border-radius: 2px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.divider {
  width: 60px;
  height: 3px;
  background: var(--uw-yellow);
}

.nav-link {
  position: relative;
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--uw-yellow);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-link:hover {
  color: var(--uw-yellow-hover);
}

.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mobile-menu.open {
  transform: translateX(0);
}

.search-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.search-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.editorial-divider {
  display: flex;
  align-items: center;
  gap: 16px;
}

.editorial-divider::before,
.editorial-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--uw-gray-200);
}

.trending-number {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--uw-gray-400);
  line-height: 1;
}

.article-content,
.entry-content {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.article-content a,
.entry-content a {
  word-break: break-word;
}

.article-content p {
  font-size: 1.125rem;
  line-height: 1.85;
  color: var(--uw-gray-600);
  margin-bottom: 1.5rem;
}

.article-content h2 {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--uw-dark);
  margin: 2.5rem 0 1rem;
}

/* Shared blockquote styling — used for both .article-content blockquote
   and the standalone .blockquote utility class. */
.article-content blockquote,
.blockquote {
  border-left: 4px solid var(--uw-yellow);
  padding: 1rem 0 1rem 1.5rem;
  margin: 2rem 0;
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: 1.25rem;
  font-style: italic;
  color: var(--uw-gray-500);
}

/* Accessibility: links inside post body should be underlined */
.article-content a,
.entry-content a {
  text-decoration: underline;
}

.article-content a:hover,
.entry-content a:hover {
  color: var(--uw-dark);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--uw-yellow);
  color: var(--uw-dark);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--uw-dark);
  color: var(--uw-yellow);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: transparent;
  color: var(--uw-dark);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 2px solid var(--uw-dark);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  background: var(--uw-dark);
  color: var(--uw-yellow);
}

.parallax-bg {
  background-attachment: scroll;
  background-size: cover;
  background-position: center;
}

/* `background-attachment: fixed` is broken on iOS Safari and is one of
   the most paint-expensive CSS properties — restrict to hover-capable,
   larger screens where it actually works. */
@media (hover: hover) and (min-width: 768px) {
  .parallax-bg {
    background-attachment: fixed;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
  .animate-fade-in-up {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .category-card,
  .article-card,
  .article-card-image img,
  .hero-slide,
  .hero-slide-img {
    transition: none !important;
    transform: none !important;
  }
  .category-card:hover,
  .article-card:hover {
    transform: none;
  }
  .article-card:hover .article-card-image img {
    transform: none;
  }
}

@media (max-width: 768px) {
  .trending-number {
    font-size: 2rem;
  }

  .article-content p {
    font-size: 1rem;
    line-height: 1.75;
  }
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.img-placeholder {
  background: linear-gradient(135deg, var(--uw-gray-200) 0%, var(--uw-gray-300) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--uw-gray-600);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.footer-logo {
  filter: brightness(0) invert(1);
}

/* Accessibility: WordPress screen-reader-text */
.screen-reader-text {
  border: 0;
  clip: rect(1px,1px,1px,1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: #fff;
  clip: auto !important;
  clip-path: none;
  color: #1D1D1B;
  display: block;
  font-size: 14px;
  font-weight: 700;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
  border-radius: 4px;
  box-shadow: 0 0 2px 2px rgba(0,0,0,0.2);
}

/* Accessibility: skip link — hidden visually, visible on focus */
.skip-link {
  position: fixed;
  top: -100px;
  left: 0;
  background: var(--uw-dark);
  color: var(--uw-yellow);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 12px 20px;
  z-index: 100000;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid var(--uw-yellow);
  outline-offset: 2px;
}

/* ============================================
   Hero section — arkaplan
   ============================================ */

.uwd-hero-pattern {
  background-color: #1D1D1B;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 24' preserveAspectRatio='none' fill='%23FBBA00'%3E%3Cpolygon points='0,24 1200,24 1200,0'/%3E%3C/svg%3E");
  background-size: 100% 24px;
  background-position: bottom center;
  background-repeat: no-repeat;
  padding-bottom: 24px;
}

.uwd-hero-pattern::after {
  content: none;
}

/* ==========================================================
   Ad Carousel — fade transitions + dots
   Used by: hero-ad, featured-ad, sidebar-ad templates
   Slot-specific dot positions defined below.
   ========================================================== */

.uwd-ad-carousel {
  position: relative;
}

.uwd-ad-track {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Track içinde absolute slide stack — sadece multi-slide durumlarda. */
.uwd-ad-carousel[data-slot] .uwd-ad-track {
  /* Aspect-square outer'dan geliyor. */
}

.uwd-ad-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.uwd-ad-slide.active {
  opacity: 1;
  visibility: visible;
}

/* Single-slide durumunda (.uwd-ad-carousel[data-slot] YOKSA) — statik. */
.uwd-ad-carousel:not([data-slot]) .uwd-ad-slide {
  position: relative;
  opacity: 1;
  visibility: visible;
}

/* Dots — default bottom-center. */
.uwd-ad-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 5;
  padding: 6px 10px;
  background: rgba(29, 29, 27, 0.35);
  backdrop-filter: blur(6px);
  border-radius: 999px;
}

.uwd-ad-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: all 0.3s ease;
}

.uwd-ad-dot:hover {
  background: rgba(255, 255, 255, 0.85);
}

.uwd-ad-dot.active {
  background: var(--uw-yellow, #FBBA00);
  width: 22px;
  border-radius: 4px;
}

/* Slot-specific dot positions. */
.uwd-hero-ad .uwd-ad-dots,
.uwd-sidebar-ad .uwd-ad-dots {
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
}

.uwd-featured-ad .uwd-ad-dots {
  bottom: 10px;
  left: auto;
  right: 10px;
  transform: none;
}

/* prefers-reduced-motion: transition'ları kısalt. */
@media (prefers-reduced-motion: reduce) {
  .uwd-ad-slide {
    transition: opacity 0.1s ease, visibility 0.1s ease;
  }
}

/* Touch cihazlarda hover pause'a gerek yok; ama dots yine de tıklanabilir olmalı. */
@media (hover: none) {
  .uwd-ad-dots {
    padding: 8px 12px;
  }
  .uwd-ad-dot {
    width: 10px;
    height: 10px;
  }
  .uwd-ad-dot.active {
    width: 26px;
  }
}
