/* ============================================================
   Coptic Wedding Calendar Widget
   Uses CSS variables from the parent site (styles.css)
   ============================================================ */

.cwc-container {
  max-width: 480px;
  margin: 2rem auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 4px 16px var(--shadow);
  font-family: Inter, system-ui, sans-serif;
}

/* Header: nav + title */
.cwc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.cwc-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.cwc-nav {
  background: var(--gold-dim);
  border: 1px solid var(--gold);
  color: var(--ink);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
}

.cwc-nav:hover:not(:disabled) {
  background: var(--gold);
  color: var(--wood-dark);
  transform: scale(1.08);
}

.cwc-nav:disabled {
  opacity: 0.3;
  cursor: default;
}

/* Day labels row */
.cwc-day-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.35rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

/* Calendar grid */
.cwc-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

/* Individual day cell */
.cwc-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  cursor: default;
  user-select: none;
}

.cwc-empty {
  background: transparent;
}

/* Available dates — subtle gold */
.cwc-available {
  background: rgba(212, 175, 55, 0.08);
  color: var(--ink);
}

.cwc-available:hover {
  background: var(--gold-dim);
  transform: scale(1.06);
  box-shadow: 0 2px 8px var(--shadow);
}

/* Blocked dates — red */
.cwc-blocked {
  background: rgba(139, 26, 26, 0.12);
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}

.cwc-blocked:hover {
  background: rgba(139, 26, 26, 0.22);
  transform: scale(1.06);
  box-shadow: 0 2px 8px var(--shadow);
}

/* Today marker */
.cwc-today {
  box-shadow: inset 0 0 0 2px var(--gold);
}

/* Tooltip */
.cwc-tooltip {
  position: absolute;
  z-index: 9999;
  background: var(--wood-dark);
  color: var(--white-linen);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.4;
  max-width: 260px;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  font-family: Inter, system-ui, sans-serif;
}

/* Legend */
.cwc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--muted);
}

.cwc-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cwc-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  display: inline-block;
  flex-shrink: 0;
}

.cwc-dot-available {
  background: rgba(212, 175, 55, 0.25);
  border: 1px solid var(--gold);
}

.cwc-dot-blocked {
  background: rgba(139, 26, 26, 0.2);
  border: 1px solid var(--primary);
}

.cwc-dot-today {
  background: var(--surface);
  border: 2px solid var(--gold);
}

/* ── Dark mode overrides ───────────────────────────────────── */
[data-theme="dark"] .cwc-available {
  background: rgba(238, 206, 98, 0.06);
}

[data-theme="dark"] .cwc-available:hover {
  background: rgba(238, 206, 98, 0.14);
}

[data-theme="dark"] .cwc-blocked {
  background: rgba(224, 72, 72, 0.14);
  color: var(--primary);
}

[data-theme="dark"] .cwc-blocked:hover {
  background: rgba(224, 72, 72, 0.25);
}

[data-theme="dark"] .cwc-tooltip {
  background: #1a1212;
  border: 1px solid var(--border);
}

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .cwc-container {
    padding: 0.85rem;
    border-radius: 8px;
    margin: 1rem auto;
  }

  .cwc-title {
    font-size: 1.1rem;
  }

  .cwc-cell {
    font-size: 0.8rem;
    border-radius: 6px;
  }

  .cwc-grid {
    gap: 2px;
  }

  .cwc-legend {
    flex-direction: column;
    gap: 0.5rem;
  }

  .cwc-nav {
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
  }
}
