/**
 * FreshPress Highlight Pro – Public Styles
 *
 * Basic front-end styling for the "Last Updated" / freshness badge.
 * This CSS is intentionally minimal and theme-friendly.
 */

/* ================
   BASE BADGE STYLE
   ================ */

.fphp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.25em 0.75em;
  margin-bottom: 0.75em;
  border-width: 1px;
  border-style: solid;
  border-radius: 999px; /* pill by default */
  font-size: 0.85rem;
  line-height: 1.2;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  box-sizing: border-box;
}

/* Keep badge on its own line above content by default */
.fphp-badge + * {
  margin-top: 0.5em;
}

/* Container elements may override display if needed */
.fphp-badge-style-pill {
  border-radius: 999px;
}

/* alias vechi – încă îl menținem pentru siguranță */
.fphp-badge-style-classic {
  border-radius: 4px;
}

.fphp-badge-style-minimal {
  border-radius: 999px;
  padding: 0.15em 0.5em;
  font-size: 0.8rem;
}

.fphp-badge-style-top_bar {
  width: 100%;
  justify-content: center;
  border-radius: 0;
  padding: 0.35em 0.75em;
}

/* Floating style suggestion – positioned near the top-right corner of content */
.fphp-badge-style-floating {
  position: absolute;
  top: 0.75em;
  right: 0.75em;
  margin-bottom: 0;
  z-index: 10;
}

/* Ribbon corner style
   IMPORTANT: noul stil intern este .fphp-badge-style-ribbon
   iar .fphp-badge-style-ribbon_corner rămâne ca alias de compatibilitate. */
.fphp-badge-style-ribbon,
.fphp-badge-style-ribbon_corner {
  padding: 0.3em 0.8em;
  border-radius: 0;
  clip-path: polygon(0 0, 100% 0, 100% 75%, 90% 100%, 0 100%);
}

/* =========
   TYPOGRAPHY
   ========= */

.fphp-badge-main-text {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25em;
}

.fphp-badge-date {
  font-weight: 600;
}

/* Optional freshness label to the right */
.fphp-badge-freshness-label {
  display: inline-flex;
  align-items: center;
  padding: 0.1em 0.55em;
  margin-left: 0.25em;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.16);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ===
   ICON
   === */

.fphp-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  border-radius: 999px;
  position: relative;
}

/* Clock icon (CSS-based) */
.fphp-badge-icon-clock::before,
.fphp-badge-icon-clock::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background-color: currentColor;
}

.fphp-badge-icon-clock::before {
  width: 100%;
  height: 100%;
  opacity: 0.16;
}

.fphp-badge-icon-clock::after {
  width: 40%;
  height: 2px;
  top: 50%;
  left: 50%;
  transform-origin: left center;
  transform: translate(-50%, -50%) rotate(0deg);
  opacity: 0.9;
}

/* Refresh icon */
.fphp-badge-icon-refresh::before,
.fphp-badge-icon-refresh::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background-color: currentColor;
}

.fphp-badge-icon-refresh::before {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  border: 2px solid currentColor;
  background: transparent;
  box-sizing: border-box;
  opacity: 0.8;
}

.fphp-badge-icon-refresh::after {
  width: 45%;
  height: 45%;
  border-radius: 0;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  background: transparent;
  box-sizing: border-box;
  transform: rotate(45deg);
  top: 18%;
  right: 8%;
}

/* Dot indicator */
.fphp-badge-icon-dot::before {
  content: "";
  position: absolute;
  width: 45%;
  height: 45%;
  border-radius: 999px;
  background-color: currentColor;
}

/* Custom SVG icon gets no extra pseudo-elements */
.fphp-badge-icon-custom {
  width: 1.1em;
  height: 1.1em;
}

/* =====================
   THEMES (COLOR PRESETS)
   ===================== */

/* Note: background, text and border colors are mostly controlled inline.
 * These classes are helpful for future enhancements or non-inline variants.
 */

.fphp-theme-clean_white {
  color: #111827;
}

.fphp-theme-pro_blue {
  color: #ffffff;
}

.fphp-theme-trust_green {
  color: #ecfdf5;
}

.fphp-theme-warning_orange {
  color: #fffbeb;
}

.fphp-theme-dark_mode {
  color: #e5e7eb;
}

.fphp-theme-minimal_gray {
  color: #111827;
}

.fphp-theme-ribbon_red {
  color: #fef2f2;
}

.fphp-theme-soft_shadow {
  color: #ffffff;
}

.fphp-theme-neon {
  color: #0f172a;
}

.fphp-theme-elegant_black {
  color: #f9fafb;
}

/* =====================
   FRESHNESS RULE CLASSES
   ===================== */

.fphp-freshness-fresh {
  /* tweak layout if needed */
}

.fphp-freshness-recent {
  /* tweak layout if needed */
}

.fphp-freshness-stale {
  /* tweak layout if needed */
}

/* ======================
   RESPONSIVE BEHAVIOR
   ====================== */

@media (max-width: 600px) {
  .fphp-badge {
    font-size: 0.8rem;
    padding: 0.2em 0.6em;
    flex-wrap: wrap;
  }

  .fphp-badge-style-floating {
    position: static;
    margin-bottom: 0.75em;
  }

  .fphp-badge-freshness-label {
    margin-top: 0.15em;
  }
}

/* ======================
   BASIC DARK MODE SUPPORT
   ====================== */

/* If themes use prefers-color-scheme, this keeps badge readable */
@media (prefers-color-scheme: dark) {
  .fphp-theme-clean_white {
    color: #e5e7eb;
  }

  .fphp-theme-minimal_gray {
    color: #e5e7eb;
  }
}

/* ======================
   UTILITY / SAFETY
   ====================== */

/* Ensure badge never overflows weirdly inside tight containers */
.fphp-badge {
  max-width: 100%;
  white-space: normal;
  word-wrap: break-word;
}

/* ======================
   WIDGET & BLOCK WRAPPERS
   ====================== */

.fphp-widget-wrap,
.fphp-block-wrap {
  margin: 0.25em 0;
}

.fphp-block-title {
  margin-bottom: 0.35em;
  font-weight: 600;
  font-size: 0.9rem;
}
