/* =============================================================================
 *  theme.css — sistem de teme light/dark (Task 5a, 2026-06-14).
 *
 *  Paletele ca CSS custom properties: LIGHT pe :root (default), DARK pe
 *  [data-theme="dark"] (atributul se pune pe <html> din include/tema.php).
 *  Paleta e warm-neutral cu accent bronz/auriu — cohezivă pe ambele teme,
 *  gandita pt un portofoliu foto (nu o simpla inversare alb/negru).
 *
 *  Restul CSS-urilor (masterphoto.php, formularcontact.php etc.) folosesc
 *  aceste variabile prin var(--...), deci o singura sursa de adevar pt culori.
 * ========================================================================== */

/* ---- LIGHT (default) — alb cald minimalist ---- */
:root {
  --bg-primary:    #f7f5f1;            /* fundal principal (off-white cald) */
  --bg-secondary:  #efece6;            /* panouri / butoane subtile */
  --text-primary:  #34302a;            /* text principal (charcoal cald) */
  --text-secondary:#6f6a62;            /* text mut (caption, copyright) */
  --text-heading:  #1c1813;            /* titluri */
  --accent:        #9c7c4d;            /* accent / linkuri (bronz soft) */
  --accent-hover:  #7e6238;
  --border:        #ddd6ca;            /* chenare galerie, form */
  --photo-glow:    rgba(156,124,77,.30); /* glow la hover poze / focus form */
  --heading-shadow:rgba(0,0,0,.06);    /* umbra fina la titluri */

  /* Butonul de tema e INVERSAT intentionat (2026-06-15): pe tema light arata
     culori DARK (= previzualizezi tema in care vei comuta). Deci aici (light)
     punem culorile inchise. Vezi blocul [data-theme="dark"] pt invers. */
  --toggle-bg:     #1a1815;
  --toggle-fg:     #ece7dd;
  --toggle-border: #34302e;
}

/* ---- DARK — near-black cald, rafinat din actualul #000 ---- */
[data-theme="dark"] {
  --bg-primary:    #100f0d;
  --bg-secondary:  #1a1815;
  --text-primary:  #c9c4bb;
  --text-secondary:#8a857c;
  --text-heading:  #ece7dd;
  --accent:        #c9a978;            /* auriu cald, lizibil pe inchis */
  --accent-hover:  #e0c596;
  --border:        #2c2a26;
  --photo-glow:    rgba(201,169,120,.42);
  --heading-shadow:rgba(0,0,0,.5);

  /* Inversat (vezi :root): pe tema dark butonul arata culori LIGHT (previzualizezi light). */
  --toggle-bg:     #ffffff;
  --toggle-fg:     #34302a;
  --toggle-border: #ddd6ca;
}

/* ---- Tranzitii fine la schimbarea temei (detaliu "smooth") ---- */
body,
#bg,
#contact,
#contact input.cursortext,
#contact textarea,
input.submitbutton,
.copyright,
.prezentare {
  transition: background-color .35s ease, color .35s ease,
              border-color .35s ease, box-shadow .35s ease;
}

/* #bg: in dark pastram o banda subtila de sus (gri -> fundal), in light o scoatem.
   Inainte: url(../images/bg.png) repeat-x — un PNG 1x1000 care se termina in #000 PUR,
   dar --bg-primary e #100f0d (near-black CALD) => la 1000px aparea o LINIE orizontala
   (cusatura #000 vs #100f0d). Acum: linear-gradient care se stinge EXACT in var(--bg-primary),
   deci continua fara sudura pana jos (fix 2026-07-02). Fara asset binar de intretinut. */
[data-theme="dark"] #bg {
  background-image: linear-gradient(to bottom, #4a4948 0, var(--bg-primary) 520px);
  background-repeat: no-repeat;
  background-position: top;
}

/* ---- Butonul de toggle (injectat din include/tema.php) ---- */
#theme-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;       /* jos-dreapta (2026-06-30: mutat din nou jos, ca să nu se suprapună cu RO/EN din topbar) */
  top: auto;
  z-index: 9999;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--toggle-bg);
  color: var(--toggle-fg);
  border: 1px solid var(--toggle-border);
  font-size: 18px;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
  transition: transform .2s ease, background-color .35s ease,
              color .35s ease, border-color .35s ease;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}
#theme-toggle:hover  { transform: translateY(-2px) rotate(-8deg); }
#theme-toggle:active { transform: scale(.94); }

/* Pe mobil: mai mic si mai aproape de colt, ca sa nu acopere continut (tot jos-dreapta) */
@media (max-width: 600px) {
  #theme-toggle { right: 12px; bottom: 12px; top: auto; width: 38px; height: 38px; line-height: 36px; font-size: 16px; }
}

/* ---- Imagine email (mph) comutata pe tema (2026-06-20) ----
   Doua PNG-uri transparente: light = text gri, dark = text auriu.
   Fundalul transparent merge pe ambele layout-uri; comutam doar textul. */
.mph-tema-dark  { display: none; }
[data-theme="dark"] .mph-tema-light { display: none; }
[data-theme="dark"] .mph-tema-dark  { display: inline; }
