/* ============================================================
   dzishandlowa.pl — Custom Styles
   Tailwind CSS handles layout/spacing/colors.
   This file covers animations, transitions, and print.
   ============================================================ */

/* ─── Base ─── */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Status Card Entrance ─── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.5s ease-out both;
}

/* ─── Countdown Digit Transition ─── */
.countdown-digit {
  transition: transform 0.3s ease;
}

.countdown-digit.tick {
  transform: scale(1.08);
}

/* ─── Calendar Day Hover ─── */
.cal-day {
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.cal-day:hover {
  transform: scale(1.15);
}

/* ─── Calendar Tooltip (mobile-friendly) ─── */
.cal-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #1e293b;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.3;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 30;
}

/* Strzałka */
.cal-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #1e293b;
}

.cal-tooltip.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Cookie Banner Slide ─── */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cookie-banner-enter {
  animation: slideUp 0.35s ease-out both;
}

/* ─── Month Card ─── */
.month-card {
  transition: box-shadow 0.2s ease;
}

.month-card:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* ─── Year Selector Button ─── */
.year-btn {
  transition: all 0.15s ease;
}

.year-btn:hover {
  background-color: #f1f5f9;
}

.year-btn.active {
  background-color: #1e293b;
  color: #ffffff;
}

/* ─── Shared page link hover ─── */
a.nav-link {
  position: relative;
}

a.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #2563eb;
  transition: width 0.2s ease;
}

a.nav-link:hover::after {
  width: 100%;
}

/* ─── Tooltip (share feedback) ─── */
.tooltip {
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.tooltip.show {
  opacity: 1;
}

/* ─── Print ─── */
@media print {
  .no-print,
  #cookie-banner,
  #ad-slot-1,
  #ad-slot-2,
  #share-btn {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
    font-size: 12pt;
  }

  .month-card {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}

/* ─── Scrollbar (subtle) ─── */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ============================================================
   BLOG POST — Typografia artykułów
   Nadpisuje Tailwind Preflight reset dla treści Markdown
   ============================================================ */

/* ─── Kontener główny ─── */
article .blog-prose {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #334155;
}

/* ─── Nagłówki ─── */
article .blog-prose h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

article .blog-prose h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

article .blog-prose h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #334155;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

/* ─── Paragraf ─── */
article .blog-prose p {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

/* ─── Linki ─── */
article .blog-prose a {
  color: #2563eb;
  text-decoration: underline;
  text-decoration-color: #93c5fd;
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

article .blog-prose a:hover {
  color: #1d4ed8;
  text-decoration-color: #2563eb;
}

/* ─── Pogrubienia i kursywa ─── */
article .blog-prose strong {
  font-weight: 700;
  color: #1e293b;
}

article .blog-prose em {
  font-style: italic;
  color: #475569;
}

/* ─── Cytaty (blockquote) ─── */
article .blog-prose blockquote {
  border-left: 4px solid #3b82f6;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  margin: 1.75rem 0;
  padding: 1.25rem 1.5rem 1.25rem 2.5rem;
  border-radius: 0 12px 12px 0;
  position: relative;
}

article .blog-prose blockquote::before {
  content: '\201C';
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 2.5rem;
  color: #93c5fd;
  font-family: Georgia, serif;
  line-height: 1;
}

article .blog-prose blockquote p {
  margin: 0;
  font-style: italic;
  color: #334155;
}

/* ─── Listy nieuporządkowane ─── */
article .blog-prose ul {
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  padding-left: 0;
  list-style: none;
}

article .blog-prose ul > li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.6rem;
  line-height: 1.7;
}

article .blog-prose ul > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
}

/* ─── Listy uporządkowane ─── */
article .blog-prose ol {
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  padding-left: 0;
  list-style: none;
  counter-reset: ol-counter;
}

article .blog-prose ol > li {
  position: relative;
  padding-left: 2.25rem;
  margin-bottom: 0.6rem;
  counter-increment: ol-counter;
  line-height: 1.7;
}

article .blog-prose ol > li::before {
  content: counter(ol-counter);
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 1.5rem;
  height: 1.5rem;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Tabele ─── */
article .blog-prose table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1.75rem;
  margin-bottom: 1.75rem;
  font-size: 0.9rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

article .blog-prose thead {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

article .blog-prose th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 700;
  color: #1e293b;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid #cbd5e1;
}

article .blog-prose td {
  padding: 0.75rem 1rem;
  border-top: 1px solid #f1f5f9;
  color: #334155;
}

article .blog-prose tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

article .blog-prose tbody tr:hover {
  background-color: #eff6ff;
}

/* ─── Inline code ─── */
article .blog-prose code {
  background: #f1f5f9;
  color: #c026d3;
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  font-size: 0.88em;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-weight: 500;
}

/* ─── Code blocks ─── */
article .blog-prose pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  overflow-x: auto;
  margin-top: 1.75rem;
  margin-bottom: 1.75rem;
  font-size: 0.85rem;
  line-height: 1.7;
  border: 1px solid #1e293b;
}

article .blog-prose pre code {
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

/* ─── Linia pozioma ─── */
article .blog-prose hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, #cbd5e1, transparent);
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}

/* ─── Obrazy ─── */
article .blog-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin-top: 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ─── Nota prawna (ostatni blok: hr + p z em) ─── */
article .blog-prose hr + p {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.6;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

article .blog-prose hr + p em {
  font-style: normal;
  color: #64748b;
}

article .blog-prose hr + p a {
  color: #64748b;
  text-decoration-color: #94a3b8;
}

/* ─── Obrazy blokowe (figure) ─── */
article .blog-prose .blog-figure {
  margin: 2rem 0;
  text-align: center;
}

article .blog-prose .blog-figure img {
  margin: 0 auto;
  display: block;
}

/* ─── Reklamy w treści ─── */
.blog-ad {
  margin: 2rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  background: #fafbfc;
  border-radius: 8px;
  min-height: 90px;
}

.adblock-msg {
  text-align: center;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  border: 1px dashed #93c5fd;
  border-radius: 12px;
  max-width: 500px;
  margin: 0 auto;
}

/* ─── Responsywność ─── */
@media (max-width: 640px) {
  article .blog-prose {
    font-size: 1rem;
  }

  article .blog-prose h2 {
    font-size: 1.3rem;
  }

  article .blog-prose h3 {
    font-size: 1.1rem;
  }

  article .blog-prose blockquote {
    padding: 1rem 1rem 1rem 2rem;
    margin: 1.25rem 0;
  }

  article .blog-prose blockquote::before {
    font-size: 2rem;
    top: 4px;
    left: 6px;
  }

  article .blog-prose pre {
    padding: 1rem;
    font-size: 0.8rem;
    border-radius: 8px;
  }

  article .blog-prose table {
    display: block;
    overflow-x: auto;
    font-size: 0.8rem;
  }

  article .blog-prose th,
  article .blog-prose td {
    padding: 0.5rem 0.65rem;
    white-space: nowrap;
  }
}
