/* ==========================================================================
   base.css — reset minim, tipografie, container, grid, butoane, titluri
   Depinde de: tokens.css (încarcă-l primul).
   Prefix de clase: t-
   ========================================================================== */

/* --- 1. Reset minim ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* oprește derularea orizontală provocată de formele decorative și de
     translațiile de intrare; `clip` păstrează funcțional position: sticky */
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--t-font-body);
  font-size: var(--t-fs-base);
  line-height: var(--t-lh-base);
  color: var(--t-text);
  background: var(--t-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--t-space-3);
  font-family: var(--t-font-title);
  color: var(--t-heading);
  line-height: var(--t-lh-title);
  font-weight: var(--t-fw-bold);
}
h1 { font-size: var(--t-fs-h1); font-weight: var(--t-fw-black); }
h2 { font-size: var(--t-fs-h2); font-weight: var(--t-fw-black); }
h3 { font-size: var(--t-fs-h3); }
h4 { font-size: var(--t-fs-h4); }
h5 { font-size: var(--t-fs-h5); }
h6 { font-size: var(--t-fs-h6); }

p { margin: 0 0 var(--t-space-4); }
p:last-child { margin-bottom: 0; }

a { color: var(--t-primary); text-decoration: none; transition: color var(--t-transition); }
a:hover { color: var(--t-primary-700); }

img, svg, video { max-width: 100%; height: auto; display: block; }

ul, ol { margin: 0 0 var(--t-space-4); padding-left: 1.25rem; }
ul.t-list-bare, ol.t-list-bare { list-style: none; margin: 0; padding: 0; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--t-primary);
  outline-offset: 3px;
}

.t-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.t-skip-link {
  position: absolute; left: 8px; top: -60px; z-index: var(--t-z-top);
  background: var(--t-primary); color: #fff; padding: 10px 18px;
  border-radius: var(--t-radius-xs); transition: top var(--t-transition);
}
.t-skip-link:focus { top: 8px; color: #fff; }

/* --- 2. Container și grid utilitar --------------------------------------- */
.t-container {
  width: 100%;
  max-width: var(--t-container);
  margin-inline: auto;
  padding-inline: var(--t-container-pad);
}
.t-container--narrow { max-width: 900px; }

.t-grid { display: grid; gap: var(--t-gap-grid); }
.t-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.t-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.t-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.t-grid--auto { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.t-flex { display: flex; }
.t-flex--center { align-items: center; }
.t-flex--between { justify-content: space-between; }
.t-flex--wrap { flex-wrap: wrap; }
.t-flex--gap { gap: var(--t-space-5); }

@media (max-width: 991px) {
  .t-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .t-grid--2, .t-grid--3, .t-grid--4 { grid-template-columns: minmax(0, 1fr); }
}

/* --- 3. Secțiuni --------------------------------------------------------- */
.t-section { padding-block: var(--t-section-y); position: relative; }
.t-section--lg { padding-block: var(--t-section-y-lg); }
.t-section--sm { padding-block: var(--t-section-y-sm); }
.t-section--tight-top { padding-top: var(--t-space-7); }
.t-section--alt { background: var(--t-bg-alt); }
.t-section--dark { background: var(--t-navy); color: var(--t-text-on-dark); }
.t-section--dark h1, .t-section--dark h2,
.t-section--dark h3, .t-section--dark h4 { color: var(--t-white); }

/* --- 4. Titluri de secțiune (echivalentul „section-title style1") --------- */
.t-title { position: relative; }
.t-title--center { text-align: center; }
.t-title--center .t-title__bar { margin-inline: auto; }

.t-title__sub {
  display: inline-block;
  margin: 0 0 var(--t-space-3);
  font-size: var(--t-fs-base);
  font-weight: var(--t-fw-bold);
  letter-spacing: 5px;
  color: var(--t-primary);
}
.t-title__main {
  margin: 0;
  font-size: var(--t-fs-h2);
  font-weight: var(--t-fw-black);
  line-height: var(--t-lh-title);
  color: var(--t-heading);
}
.t-title__main span { color: var(--t-primary); }
.t-title__lead {
  margin: var(--t-space-3) 0 0;
  font-size: var(--t-fs-lead);
  line-height: 1.6;
}
.t-title--center .t-title__lead { max-width: 720px; margin-inline: auto; }

/* bara decorativă cu bulină care se plimbă */
.t-title__bar {
  position: relative;
  height: 5px; width: 90px;
  margin: 18px 0;
  border-radius: var(--t-radius-pill);
  background: var(--t-primary-200);
}
.t-title__bar::before {
  content: "";
  position: absolute; left: 0; top: -2.5px;
  height: 10px; width: 10px;
  border-radius: var(--t-radius-full);
  background: var(--t-primary);
  animation: t-bar-move 3s linear infinite;
}
@keyframes t-bar-move {
  0%   { transform: translateX(0); }
  50%  { transform: translateX(80px); }
  100% { transform: translateX(0); }
}

/* Variantă pe fundal închis */
.t-title--invert .t-title__main { color: var(--t-white); }
.t-title--invert .t-title__sub { color: var(--t-white); }
.t-title--invert .t-title__lead { color: rgba(255, 255, 255, .82); }

/* --- 5. Butoane ---------------------------------------------------------- */
.t-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  border: 1px solid transparent;
  border-radius: var(--t-radius-sm);
  font-family: var(--t-font-title);
  font-size: var(--t-fs-base);
  font-weight: var(--t-fw-semi);
  line-height: 1.2;
  text-align: center;
  color: var(--t-white);
  background: var(--t-grad-primary);
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: color var(--t-transition), background var(--t-transition),
              border-color var(--t-transition), transform var(--t-transition);
}
.t-btn::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--t-dark);
  clip-path: circle(0% at 50% 50%);
  transition: clip-path .7s var(--t-ease);
  z-index: -1;
}
.t-btn:hover { color: var(--t-white); transform: translateY(-2px); }
.t-btn:hover::before { clip-path: circle(140% at 50% 50%); }
.t-btn .t-icon { width: 18px; height: 18px; flex: none; }
.t-btn--arrow .t-icon { transition: transform var(--t-transition); }
.t-btn--arrow:hover .t-icon { transform: translateX(5px); }

.t-btn--outline {
  background: transparent;
  border-color: var(--t-primary-line);
  color: var(--t-primary);
}
.t-btn--outline:hover { color: var(--t-white); }
.t-btn--outline::before { background: var(--t-primary); }

.t-btn--white {
  background: var(--t-white);
  color: var(--t-primary);
}
.t-btn--white:hover { color: var(--t-white); }
.t-btn--white::before { background: var(--t-dark); }

.t-btn--ghost-light {
  background: transparent;
  border-color: rgba(255, 255, 255, .45);
  color: var(--t-white);
}
.t-btn--ghost-light::before { background: var(--t-white); }
.t-btn--ghost-light:hover { color: var(--t-primary); }

.t-btn--sm { padding: 10px 20px; font-size: var(--t-fs-small); }
.t-btn--block { display: flex; width: 100%; justify-content: center; }

/* Link cu săgeată (stil „Read More" din demo) */
.t-link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: var(--t-fw-semi);
  color: var(--t-heading);
}
.t-link-arrow .t-icon { width: 16px; height: 16px; transition: transform var(--t-transition); }
.t-link-arrow:hover { color: var(--t-primary); }
.t-link-arrow:hover .t-icon { transform: translateX(5px); }

/* --- 6. Iconițe SVG (sprite) --------------------------------------------- */
.t-icon {
  width: 24px; height: 24px;
  display: inline-block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  flex: none;
}
.t-icon--lg { width: 40px; height: 40px; }
.t-icon--xl { width: 48px; height: 48px; }

/* --- 7. Utilitare de spațiere și text ------------------------------------ */
.t-mt-0 { margin-top: 0 !important; }
.t-mt-2 { margin-top: var(--t-space-2) !important; }
.t-mt-3 { margin-top: var(--t-space-3) !important; }
.t-mt-4 { margin-top: var(--t-space-4) !important; }
.t-mt-5 { margin-top: var(--t-space-5) !important; }
.t-mt-6 { margin-top: var(--t-space-6) !important; }
.t-mt-7 { margin-top: var(--t-space-7) !important; }
.t-mb-0 { margin-bottom: 0 !important; }
.t-mb-4 { margin-bottom: var(--t-space-4) !important; }
.t-mb-5 { margin-bottom: var(--t-space-5) !important; }
.t-mb-6 { margin-bottom: var(--t-space-6) !important; }
.t-mb-7 { margin-bottom: var(--t-space-7) !important; }

.t-text-center { text-align: center; }
.t-text-left   { text-align: left; }
.t-text-right  { text-align: right; }
.t-text-primary { color: var(--t-primary); }
.t-text-muted   { color: var(--t-text-soft); }

/* --- 8. Animații discrete la scroll --------------------------------------
   Starea de repaus este VIZIBILĂ: orice randare statică (miniaturi, motoare
   de căutare, dispozitive lente, JS oprit) arată conținutul complet.
   JS-ul ascunde (.is-pending) doar elementele aflate sub ecran la încărcare
   și le dezvăluie (.is-visible) când intră în ecran, cu o tranziție scurtă. */
.t-js [data-anim] { transition: opacity .6s var(--t-ease), transform .6s var(--t-ease); }
.t-js [data-anim].is-pending { opacity: 0; transform: translateY(24px); will-change: opacity, transform; }
.t-js [data-anim="left"].is-pending  { transform: translateX(-28px); }
.t-js [data-anim="right"].is-pending { transform: translateX(28px); }
.t-js [data-anim="zoom"].is-pending  { transform: scale(.95); }
.t-js [data-anim].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .t-js [data-anim], .t-js [data-anim].is-pending { opacity: 1 !important; transform: none !important; transition: none !important; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
