/* ==========================================================================
   GAV Infotabula - Wikipedia Daily Info Widget
   Displays current date, name day (meniny), and daily historical events
   Optimized for Touch-Screen Kiosks / TV Mode
   Aligned to Top-Left Corner, matching obed section scale & width (420px)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

.wiki-widget-wrapper {
  position: fixed;
  top: 24px;
  left: 24px;
  width: 420px;
  max-width: calc(100vw - 48px);
  margin: 0;
  box-sizing: border-box;
  -ms-user-select: none;
  user-select: none;
  z-index: 1;
  animation: wikiFadeIn 0.3s ease;
}

@keyframes wikiFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.wiki-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 14px 18px 16px 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  cursor: pointer;
  user-select: none;
}

.wiki-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.11);
  transform: translateY(-1px);
}

/* Header Row: Badge + Title, aligned left */
.wiki-card-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
}

.wiki-badge-group {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
}

.wiki-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  flex-shrink: 0;
}

.wiki-w-icon {
  width: 32px;
  height: 21px;
  padding: 0; /* overrides the global `img { padding-top: 10px }` that squashed the "W" */
  object-fit: contain;
  display: block;
}

.wiki-source-title {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  text-align: left;
}

.wiki-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wiki-current-date {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wiki-source-tag {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 1.5px 7px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.25);
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
}

.wiki-source-tag i {
  font-size: 10.5px;
}

.wiki-shuffle-btn {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px 11px;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  outline: none;
  transition: all 0.18s ease;
  user-select: none;
}

.wiki-shuffle-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}

.wiki-shuffle-btn:active {
  transform: scale(0.96);
}

.wiki-shuffle-btn.d-none {
  display: none !important;
}

.wiki-shuffle-btn.spinning i {
  animation: wiki-spin 0.4s ease;
}

@keyframes wiki-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Divider separating header and content */
.wiki-card-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 10px 0 11px 0;
  width: 100%;
}

/* Main Content Area - Strictly Left-Aligned */
.wiki-content-area {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  text-align: left;
  width: 100%;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.wiki-content-area.fade-out {
  opacity: 0;
  transform: translateY(-4px);
}

/* Row 1: Meniny - Extra large font size, aligned left */
.wiki-meniny-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 6px 10px;
  width: 100%;
  text-align: left;
}

.wiki-meniny-text {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 19px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.35;
  letter-spacing: -0.01em;
  text-align: left;
}

.wiki-occasion-text {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid rgba(5, 150, 105, 0.2);
  border-radius: 6px;
  padding: 3px 8px;
  display: inline-block;
  text-align: left;
}

/* Row 2: Deň v histórii - on a new line, strictly aligned to the left */
.wiki-event-row {
  display: block;
  width: 100%;
  text-align: left;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  line-height: 1.45;
}

.wiki-event-pill {
  display: inline-flex;
  align-items: center;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 2px 8px;
  margin-right: 6px;
  vertical-align: baseline;
  white-space: nowrap;
}

.wiki-event-desc {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #334155;
  line-height: 1.45;
  text-align: left;
  vertical-align: baseline;
}

.wiki-loading {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: #94a3b8;
  font-style: italic;
}

@media (max-width: 768px) {
  .wiki-widget-wrapper {
    top: 12px;
    left: 12px;
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }
  .wiki-card {
    padding: 10px 14px;
  }
  .wiki-badge {
    width: 38px;
    height: 38px;
  }
  .wiki-w-icon {
    width: 24px;
    height: 24px;
  }
  .wiki-current-date {
    font-size: 13.5px;
  }
  .wiki-meniny-text {
    font-size: 17px;
  }
  .wiki-event-desc {
    font-size: 13.5px;
  }
  .wiki-occasion-text {
    font-size: 13.5px;
  }
  .wiki-shuffle-btn span {
    display: none;
  }
  .wiki-shuffle-btn {
    padding: 5px 8px;
  }
}

/* ==========================================================================
   Info windows: Wikipedia (js/wiki.js) and weather (js/weather.js).
   The frame (header, bottom bar, Zatvoriť) is the shared kiosk window from requires/obsadzovnik.css;
   this part adds the content cards they share and the Wikipedia content.
   ========================================================================== */

/* The kiosk page centres all text and colours it white; these windows are left-aligned, dark on light */
.info-window-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px;
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 18px;
  color: #0f172a;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  -webkit-overflow-scrolling: touch;
}

.info-window-body * {
  box-sizing: border-box;
  text-align: left;
}

.info-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.info-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  padding: 16px 18px;
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #64748b;
}

.info-card-header i {
  color: #3da870;
  font-size: 14px;
}

.info-card-count {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eef8f2;
  border: 1px solid #c3ebd5;
  color: #1d6e46;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.info-card-count:empty {
  display: none;
}

.info-empty {
  display: block;
  font-size: 14px;
  font-weight: 600;
  font-style: italic;
  color: #94a3b8;
}

.info-source {
  padding: 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}

/* ---- Wikipedia ---- */
/* Wikipedia "W" in the header pill, in a small round badge like an app icon */
.wk-w-badge {
  width: 30px;
  height: 30px;
  margin: -4px 0 -4px -8px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* padding: 0 overrides the global `img { padding-top: 10px }` in style.css, which shrank the "W" */
.wk-w-icon {
  width: 22px;
  height: 15px;
  padding: 0;
  object-fit: contain;
  display: block;
}

.wk-meniny-name {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #0f172a;
}

.wk-meniny-next {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
}

.wk-meniny-next:empty {
  display: none;
}

.wk-meniny-next b {
  color: #334155;
  font-weight: 800;
}

.wk-occasions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wk-occasion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #eef8f2;
  border: 1px solid #c3ebd5;
  color: #1d6e46;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
}

/* The left column fits the window: the picture of the day takes what is left and scales down,
   and only a very long list of days scrolls inside its own card */
.wk-window-body {
  grid-template-rows: minmax(0, 1fr);
}

.wk-window-body > .info-col > .info-card {
  flex-shrink: 0;
}

.wk-window-body > .info-col > .wk-occasions-card {
  flex-shrink: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.wk-occasions-card .wk-occasions {
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.wk-occasions.is-many {
  gap: 6px;
}

.wk-occasions.is-many .wk-occasion {
  padding: 7px 12px;
  font-size: 13.5px;
}

.wk-window-body > .info-col > .wk-featured {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Set by js/wiki.js when the picture would be too small to see */
.wk-window-body > .info-col > .wk-featured.wk-featured-cramped {
  display: none;
}

/* The picture keeps its own shape (portrait or landscape), centred, with rounded corners */
.wk-featured-frame {
  position: relative;
  flex: 1;
  min-height: 0;
}

/* A thin outline and soft shadow keep the rounded edges visible on light photos too */
.wk-featured-frame img {
  position: absolute;
  inset: 4px;
  margin: auto;
  max-width: calc(100% - 8px);
  max-height: calc(100% - 8px);
  width: auto;
  height: auto;
  padding: 0; /* the global img padding pushed the photo down inside its rounded corners */
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.1), 0 6px 16px rgba(15, 23, 42, 0.14);
  display: block;
}

.wk-featured-caption {
  flex-shrink: 0;
  margin-top: 10px;
  text-align: center !important;
  font-size: 14.5px;
  font-weight: 700;
  color: #334155;
}

.wk-featured-caption:empty {
  display: none;
}

/* Timeline: year, a dot on a vertical line, the event */
.wk-timeline-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.wk-timeline {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  -webkit-overflow-scrolling: touch;
}

.wk-event {
  position: relative;
  display: grid;
  grid-template-columns: 86px 36px minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
  padding: 9px 0;
}

.wk-event::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 117px;
  width: 2px;
  background: #e2e8f0;
}

.wk-event:first-child::before {
  top: 50%;
}

.wk-event:last-child::before {
  bottom: 50%;
}

.wk-event:only-child::before {
  display: none;
}

.wk-event-year {
  padding-top: 6px;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  text-align: right !important;
}

.wk-event-dot {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef8f2;
  border: 2px solid #c3ebd5;
  color: #27724a;
  font-size: 14px;
}

.wk-event--birth .wk-event-dot {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #2563eb;
}

.wk-event--death .wk-event-dot {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

.wk-event-text {
  padding-top: 6px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  color: #1e293b;
}

/* Bottom bar filter counts */
.wk-filter-count {
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.obs-day-card-btn.active .wk-filter-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}
