/* Copyright © 2026 Ahmed Gamal Refaey. All rights reserved.
   Contact: eng_gahmed@yahoo.com — Scola EDU, proprietary. See LICENSE.

   Avatar photo treatments — "use my own photo as my avatar".

   These are PURE CSS filters over the person's existing photo URL. Nothing is copied,
   re-encoded or written: the stored photo is untouched, and official documents (ID cards,
   certificates) render it with no class from this file. Filters are static, so they are
   identical with motion off and under prefers-reduced-motion — this file is deliberately NOT
   gated on data-motion, because a photo treatment is not motion.

   Loaded by base.html and mobile_base.html. Byte-cost is a few hundred bytes. */

.scola-av-photo { object-fit: cover; background: #e9eef4; }

/* Vivid, posterised "illustrated" look — reads as an avatar rather than a passport photo. */
.scola-av-photo.av-photo-art {
  filter: saturate(1.45) contrast(1.28) brightness(1.04);
}

/* Soft and warm — gentle, flattering, still clearly the real person. */
.scola-av-photo.av-photo-soft {
  filter: saturate(.88) contrast(.94) brightness(1.08) sepia(.16);
}

/* Brand-tinted duotone — the most "avatar-like" of the three, and the most forgiving of a
   poorly-lit photo. */
.scola-av-photo.av-photo-mono {
  filter: grayscale(1) contrast(1.15) brightness(1.05)
          sepia(.55) hue-rotate(115deg) saturate(2.1);
}

/* Dark mode: photos sit on dark chrome, so lift the shadows a touch. */
[data-bs-theme="dark"] .scola-av-photo,
html[data-theme="dark"] .scola-av-photo { background: #2b3138; }
[data-bs-theme="dark"] .scola-av-photo.av-photo-art,
html[data-theme="dark"] .scola-av-photo.av-photo-art {
  filter: saturate(1.4) contrast(1.2) brightness(1.12);
}

/* A broken or missing photo must not leave a torn-image icon in the chrome. */
.scola-av-photo:not([src]), .scola-av-photo[src=""] { visibility: hidden; }

/* W1B-AVD — the dark rules above key off the app's own theme attribute. A viewer whose
   OS is dark while the school leaves the theme on "auto" never sets that attribute, so
   the photo tile kept its light backing plate against dark chrome. Same values, driven by
   the OS preference, and skipped when the school has explicitly chosen light — the shape
   base.html already uses for its dark tints. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .scola-av-photo { background: #2b3138; }
  :root:not([data-theme="light"]) .scola-av-photo.av-photo-art {
    filter: saturate(1.4) contrast(1.2) brightness(1.12);
  }
}
