/* =============================================================================
   base.css — Reset normalizat + tipografie + utilități
   ============================================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img,
picture,
svg {
  max-width: 100%;
  display: block;
}

img {
  height: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration);
}

a:hover {
  color: var(--accent-hover);
}

button {
  font: inherit;
  cursor: pointer;
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* --- Tipografie titluri --------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--text-primary);
  margin: 0 0 var(--space-4);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.005em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-weight: 700;
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
}

h4 {
  font-size: 1.15rem;
  font-weight: 600;
}

p {
  margin: 0 0 var(--space-4);
  color: var(--text-secondary);
}

/* --- Container + secțiuni ------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.section--alt {
  background: var(--bg-secondary);
}

.section--flush-top {
  padding-top: var(--space-6);
}

.section--flush-top .section-header {
  margin-bottom: var(--space-6);
}

.section--dark {
  background: var(--bg-dark);
  color: var(--text-on-dark);
}

.section--dark h1,
.section--dark h2,
.section--dark h3 {
  color: var(--text-on-dark);
}

.section--dark p {
  color: rgba(250, 248, 243, 0.85);
}

/* --- Cod CA-XXX ---------------------------------------------------------- */
.work-code {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* --- Iconuri SVG --------------------------------------------------------- */
.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* --- Ornament decorativ -------------------------------------------------- */
.title-ornament {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  justify-content: center;
  margin: 0 auto var(--space-8);
}

.title-ornament::before,
.title-ornament::after {
  content: "";
  height: 1px;
  width: 48px;
  background: var(--border-strong);
}

.title-ornament span {
  color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-weight: 600;
}

/* --- Section header centrat ---------------------------------------------- */
.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto var(--space-12);
}

.section-header h2 {
  margin-bottom: var(--space-3);
}

.section-header p {
  font-size: 1.05rem;
}

/* --- Focus visible ------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

/* --- Accesibilitate: screen-reader only ---------------------------------- */
.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;
}

/* --- Main wrapper -------------------------------------------------------- */
main {
  flex: 1 0 auto;
}

/* --- Compensare bottom-bar mobil pe body --------------------------------- */
@media (max-width: 768px) {
  body {
    padding-bottom: var(--bottom-bar-height);
  }
}

/* --- Selection ----------------------------------------------------------- */
::selection {
  background: var(--accent-soft);
  color: var(--text-primary);
}
