/* ============================================================
   widgets.css — exanak.com widget & banner display styles
   Mobile-first, matches site design (#0891d1 palette)
   ============================================================ */

/* ── Widget (text + image + link) ────────────────────────── */
.exw-slot {
  display: block;
  width: 100%;
}

.exw-widget {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff;
  border: 1px solid #e5e9f0;
  border-radius: 14px;
  padding: 13px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s;
  overflow: hidden;
  cursor: pointer;
  margin: 12px 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  -webkit-tap-highlight-color: transparent;
}
.exw-widget:hover,
.exw-widget:focus {
  box-shadow: 0 4px 18px rgba(8,145,209,.13);
  border-color: #bae6fd;
  transform: translateY(-1px);
  outline: none;
}
.exw-widget:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.exw-widget__img {
  width: 80px;
  height: 68px;
  flex-shrink: 0;
  border-radius: 9px;
  object-fit: cover;
  background: #f0f7ff;
  display: block;
}

.exw-widget__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.exw-widget__label {
  cursor: pointer;
}
.exw-widget__label:hover {
  background: #e0f2fe;
  border-color: #7dd3fc;
  text-decoration: none;
}
.exw-widget__label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #0891d1;
  background: #f0f7ff;
  border: 1px solid #bae6fd;
  border-radius: 20px;
  padding: 2px 7px;
  margin-bottom: 5px;
  width: fit-content;
}

.exw-widget__title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  color: #1a202c;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.exw-widget__text {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.exw-widget__arrow {
  flex-shrink: 0;
  color: #bae6fd;
  font-size: 11px;
  align-self: center;
  margin-left: 2px;
  transition: color .15s, transform .15s;
}
.exw-widget:hover .exw-widget__arrow {
  color: #0891d1;
  transform: translateX(2px);
}

/* ── Banner (horizontal image) ───────────────────────────── */
.exw-banner-wrap {
  display: block;
  margin: 12px 0;
}

.exw-banner {
  display: block;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.exw-banner__img {
  width: 100%;
  height: auto;
  max-height: 110px;
  min-height: 60px;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  transition: opacity 0.18s;
  background: #f0f7ff;
}
.exw-banner:hover .exw-banner__img,
.exw-banner:focus .exw-banner__img { opacity: .93; }
.exw-banner:active .exw-banner__img { opacity: .85; }

/* Text-only banner fallback */
.exw-banner__fallback {
  background: linear-gradient(135deg, #0891d1 0%, #0369a1 100%);
  border-radius: 12px;
  padding: 18px 16px;
  color: #fff;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.exw-banner__fallback-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}
.exw-banner__fallback-text {
  font-size: 12px;
  opacity: .85;
  margin-top: 4px;
  line-height: 1.4;
}

/* Ad label */
.exw-adlabel {
  font-size: 9px;
  color: #9aa5b4;
  text-align: right;
  margin-top: 3px;
  display: block;
  letter-spacing: .03em;
}

/* ── Skeleton loader ──────────────────────────────────────── */
.exw-skeleton {
  height: 80px;
  background: linear-gradient(90deg, #f4f7fb 25%, #e5e9f0 50%, #f4f7fb 75%);
  background-size: 200% 100%;
  animation: exw-shimmer 1.3s infinite ease-in-out;
  border-radius: 12px;
  margin: 12px 0;
}
@keyframes exw-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Responsive ───────────────────────────────────────────── */
/* Mobile (default — already mobile-first above) */
@media (max-width: 360px) {
  .exw-widget__img { width: 64px; height: 56px; }
  .exw-widget__title { font-size: 13px; }
  .exw-widget { padding: 11px; gap: 10px; }
}

/* Tablet+ */
@media (min-width: 640px) {
  .exw-widget__img { width: 96px; height: 78px; }
  .exw-widget__title { font-size: 14.5px; }
  .exw-banner__img { max-height: 130px; }
  .exw-widget { padding: 15px; gap: 14px; }
}

/* Desktop */
@media (min-width: 1024px) {
  .exw-widget__img { width: 104px; height: 84px; }
  .exw-banner__img { max-height: 150px; }
}

/* Clickable AD labels */
a.exw-widget__label,
a.exw-adlabel {
  text-decoration: none;
  color: #0891d1;
}
a.exw-adlabel {
  display: inline-block;
  color: #9aa5b4;
  font-size: 9px;
  transition: color .15s;
}
a.exw-adlabel:hover { color: #0891d1; }

/* ── Row of widgets — unified container ───────────────────── */
.exw-row {
  display: grid;
  gap: 0;
  margin: 12px 0;
  background: #fff;
  border: 1px solid #e5e9f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

/* Columns */
.exw-row.exw-count-1 { grid-template-columns: 1fr; }
.exw-row.exw-count-2 { grid-template-columns: 1fr 1fr; }
.exw-row.exw-count-3 { grid-template-columns: 1fr 1fr 1fr; }
.exw-row.exw-count-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* Inside row: cards share the container, no individual borders/shadows */
.exw-row .exw-widget {
  margin: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  border: none;
  border-right: 1px solid #e5e9f0;
  border-radius: 0;
  box-shadow: none;
  padding: 12px;
  background: transparent;
}
.exw-row .exw-widget:last-child {
  border-right: none;
}
.exw-row .exw-widget:hover {
  background: #f8fbff;
  box-shadow: none;
  transform: none;
  border-color: transparent;
  border-right-color: #e5e9f0;
}
.exw-row .exw-widget:last-child:hover {
  border-right-color: transparent;
}

/* Image: full width, face visible from top */
.exw-row .exw-widget__img {
  width: 100%;
  height: 110px;
  border-radius: 8px;
  object-fit: cover;
  object-position: top center;
}
.exw-row .exw-widget__arrow { display: none; }
.exw-row .exw-banner-wrap { margin: 0; }

/* Mobile: 2 columns */
@media (max-width: 640px) {
  .exw-row.exw-count-3,
  .exw-row.exw-count-4 {
    grid-template-columns: 1fr 1fr;
  }
  .exw-row .exw-widget__img { height: 80px; }
  .exw-row .exw-widget { padding: 10px; }
}

/* Very small: 1 column */
@media (max-width: 360px) {
  .exw-row.exw-count-2,
  .exw-row.exw-count-3,
  .exw-row.exw-count-4 {
    grid-template-columns: 1fr;
  }
  .exw-row .exw-widget {
    border-right: none;
    border-bottom: 1px solid #e5e9f0;
  }
  .exw-row .exw-widget:last-child { border-bottom: none; }
}