/******************************
 00. CSS Custom Properties
******************************/

:root {
  /* Colors - Light */
  --color-text: rgb(40, 42, 53);
  --color-text-muted: #767676;
  --color-bg: #fff;
  --color-accent: rgb(45, 100, 188);
  --color-heading: #333;
  --color-link: rgb(40, 42, 53);
  --color-link-visited: rgb(40, 42, 53);
  --color-border: #d8d8d8;
  --color-border-accent: rgb(45, 100, 188);
  --color-surface: #f7f8fa;
  --color-logo-fill: #f1f1f1;

  /* Dark mode overrides (declared here, applied below) */
  --color-name: #333;
  --color-copyright: #767676;
  --color-news-border: transparent;
  --color-principal-border: #333;
  --color-accordion-underline: rgb(40, 42, 53);

  /* Typography */
  --font-display: "Jost", "Inter", sans-serif;
  --font-body: "Inter", "Verdana", sans-serif;
  --font-size-base: 18px;
  --line-height-base: 1.6;

  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;

  /* Layout */
  --wrapper-max-width: 52rem;
  --wrapper-padding: var(--space-md);

  /* Border radius */
  --radius-sm: 5px;
  --radius-md: 10px;
  --radius-lg: 20px;
}

[data-theme="dark"] {
    --color-text: #cacaca;
    --color-text-muted: #9e9e9e;
    --color-bg: rgb(37, 38, 39);
    --color-accent: rgb(236, 103, 94);
    --color-heading: #f1f1f1;
    --color-link: rgb(90, 153, 213);
    --color-link-visited: rgb(90, 153, 213);
    --color-border: #444;
    --color-border-accent: rgb(236, 103, 94);
    --color-surface: rgba(255, 255, 255, 0.04);
    --color-logo-fill: #313131;
    --color-name: #dadada;
    --color-copyright: #eff0eb;
    --color-news-border: #444;
    --color-principal-border: #dadada;
    --color-accordion-underline: #dadada;
}


/******************************
 a.news-link styles
******************************/

a.news-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

a.news-link:hover {
  text-decoration: none;
}

a.news-link:visited {
  color: inherit;
}

a.news-link .news {
  transition: transform 0.2s ease;
  border-radius: var(--radius-lg);
  padding: 15px;
}

a.news-link:hover .news {
  transform: translateY(-15px) scale(1.05);
  transition: transform 0.3s cubic-bezier(.34, 1.56, .64, 1);
  cursor: pointer;
}


/******************************
 01. Typography
******************************/

@font-face {
  font-family: "Jost";
  src: url("fonts/Jost-700-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: "Avenir-Medium";
  src: url("../fonts/Avenir Medium.ttf") format("truetype");
}


/******************************
 02. Main
******************************/

html {
  font-size: var(--font-size-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-size: 1em;
  color: var(--color-text);
  background-color: var(--color-bg);
  font-family: var(--font-body);
  line-height: var(--line-height-base);
  margin: 0;
}

p {
  margin: var(--space-sm) 0;
  text-align: justify;
}

a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:visited {
  color: var(--color-link-visited);
}

a div {
  transition: 0.3s;
  max-width: var(--wrapper-max-width);
}

a div:hover {
  filter: brightness(1.2);
  transform: scale(1.05);
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3);
}

h1 {
  font-family: var(--font-display);
  font-size: 3.6em;
  text-transform: uppercase;
  color: var(--color-heading);
  margin: 0;
  margin-top: var(--space-md);
  margin-bottom: var(--space-md);
  line-height: 1.1em;
}

h2 {
  font-size: 1.2em;
  text-transform: uppercase;
}

h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1em;
  text-transform: uppercase;
  text-align: left;
  margin-top: var(--space-md);
  margin-bottom: var(--space-sm);
}

h4 {
  font-size: 0.9em;
}

li {
  font-size: 0.9em;
  text-align: justify;
}

/* Tagline (replaces h6 "Since 2014") */
.tagline {
  font-size: 1em;
  text-transform: uppercase;
  color: rgb(42, 42, 42);
  text-align: left;
  font-weight: bold;
  margin: var(--space-sm) 0;
}

[data-theme="dark"] .tagline {
  color: #dadada;
}


/******************************
 03. Classes
******************************/

.news {
  border-bottom: 2px solid var(--color-news-border);
  padding-bottom: var(--space-lg);
  padding-top: var(--space-md);
}

[data-theme="dark"] .news {
  border: 2px groove var(--color-news-border);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-lg);
  border-radius: var(--radius-lg);
  padding-left: var(--space-xs);
  padding-right: var(--space-xs);
}

.wrapper {
  max-width: var(--wrapper-max-width);
  margin: 0 auto;
  padding: var(--space-md);
}

/* Header & Navigation */
.site-header {
  padding: var(--space-sm) 0;
  margin-bottom: var(--space-md);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-display);
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.site-nav a {
  text-decoration: none;
  color: var(--color-text-muted);
  transition: color 0.2s;
}

.site-nav a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

/* Hamburger + brand — hidden on desktop */
.hamburger {
  display: none;
}

.mobile-header-bar {
  display: none;
}

.mobile-brand {
  display: none;
}

/* Nav logo — hidden on desktop, shown in mobile drawer */
.nav-logo {
  display: none;
}

/* Nav toggles (lang + theme) */
.nav-toggles {
  margin-left: auto;
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.lang-toggle {
  margin-left: 0;
}

.lang-toggle a {
  font-size: 1.3em;
  line-height: 1;
  text-decoration: none;
}

.lang-toggle a:hover {
  opacity: 0.7;
}

/* Theme toggle */
.theme-toggle {
  cursor: pointer;
  font-size: 1.1em;
  line-height: 1;
  padding: 2px 4px;
  border: none;
  background: none;
  color: var(--color-text-muted);
  transition: color 0.2s;
}

.theme-toggle:hover {
  color: var(--color-accent);
}

/* Intro header — grid: logo left, title+subtitle right */
.intro-header {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: var(--space-lg);
  align-items: center;
  margin-bottom: var(--space-md);
}

.site-logo-intro {
  grid-row: 1 / 3;
  width: 120px;
  height: auto;
  border-radius: var(--radius-sm);
  align-self: center;
}

.intro-header h1 {
  grid-column: 2;
  margin-top: 0;
  align-self: end;
}

.intro-header .principal {
  grid-column: 2;
  margin-bottom: 0;
  align-self: start;
}

/* Contact header — logo + address side by side on desktop */
.contact-header {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.site-logo-footer {
  width: 80px;
  height: auto;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}

/* Breadcrumb logo */
.breadcrumb-logo {
  height: 20px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
  border-radius: 2px;
}

.principal {
  border: 2px solid var(--color-text);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
}

.separator {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
  position: relative;
}

.separator .label {
  font-family: var(--font-display);
  font-size: 1.4em;
  text-transform: uppercase;
  color: var(--color-accent);
  background-color: var(--color-bg);
  display: inline-block;
  padding-right: var(--space-md);
  position: relative;
  z-index: 2;
  font-weight: 800;
  /* Reset h2 defaults when used as label */
  margin: 0;
  text-align: left;
}

.separator hr {
  position: absolute;
  top: 40%;
  left: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  border-top: 1px solid var(--color-border-accent);
}

.team {
  display: grid;
  grid-template-columns: 50% 50%;
  margin-bottom: var(--space-xl);
}

.person {
  margin-bottom: var(--space-lg);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease;
}

.person:hover {
  background-color: var(--color-surface);
}


.avatar {
  max-width: 100%;
  display: block;
  margin-bottom: var(--space-sm);
  border-radius: 10%;
}

.person a {
  text-decoration: none;
}

.Media {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding-top: 56.25%;
}

.responsive-iframe {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
}

.name {
  font-family: var(--font-display);
  font-size: 1.3em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-name);
  text-align: center;
  margin-bottom: var(--space-sm);
}

.job {
  color: var(--color-text-muted);
  font-size: 0.8em;
  max-width: 90%;
  text-align: justify;
}

.copyright {
  color: var(--color-copyright);
}

.sursa {
  font-style: italic;
  text-align: right;
  color: var(--color-text-muted);
  font-size: 0.75em;
}

.contacts {
  margin-top: 0;
}

.contacts a {
  white-space: nowrap;
}

.logo-wrapper {
  margin-top: 25%;
  margin-bottom: 20%;
  text-align: center;
}

.logo-wrapper svg {
  max-width: 80px;
  height: auto;
}

.linie_separare {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.date {
  text-align: right;
  font-style: italic;
  font-size: 0.85em;
}

#logo {
  fill: var(--color-logo-fill);
}

#text-in-pic {
  display: none;
}


/******************************
 04. Images
******************************/

.imagine {
  background-image: url("../images/2024/building.jpg");
  background-size: cover;
  background-position: center;
  height: 60vh;
  display: flex;
  align-items: flex-end;
  position: relative;
  flex-direction: column;
  margin-bottom: 0;
  border-radius: var(--radius-sm);
}

.imagine2 {
  background-image: url("/images/biblio.jpg");
  background-size: cover;
  background-position: center;
  height: 60vh;
  display: flex;
  align-items: flex-end;
  position: relative;
  flex-direction: column;
  margin-bottom: 0;
  border-radius: var(--radius-sm);
}

.imagine_news {
  background-size: cover;
  background-position: center;
  height: 30vh;
  display: flex;
  align-items: flex-end;
  position: relative;
  flex-direction: column;
  margin-bottom: 0;
  border-radius: var(--radius-sm);
}

.imagine_news:hover {
  border: 1px solid var(--color-accent);
}


/******************************
 05. Animation
******************************/

#animation1 {
  animation-name: ingros;
  animation-duration: 1s;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
}

#animation2 {
  animation-name: ingros;
  animation-duration: 1s;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
  animation-delay: 1s;
}

#animation3 {
  animation-name: ingros;
  animation-duration: 1s;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
  animation-delay: 2s;
}

@keyframes ingros {
  0% { font-weight: 300; }
  50% { font-weight: 500; }
  100% { font-weight: 700; }
}

.titlu-animat {
  font-family: "Roboto", sans-serif;
  font-size: 1.6em;
  font-weight: 500;
  text-align: left;
  margin-top: var(--space-lg);
  overflow: hidden;
  white-space: nowrap;
  will-change: transform, opacity;
}

.titlu-animat span {
  display: inline-block;
  position: relative;
  opacity: 0;
}

.animation3 {
  animation: slideIn3 1.2s ease-out forwards;
  animation-delay: 0.1s;
}

@keyframes slideIn3 {
  0%   { transform: translateX(110vw); opacity: 0; }
  70%  { transform: translateX(-12%);  opacity: 1; }
  85%  { transform: translateX(6%);    opacity: 1; }
  100% { transform: translateX(0);     opacity: 1; }
}

.animation4 {
  animation: slideIn4 1.2s ease-out forwards;
  animation-delay: 0.5s;
}

@keyframes slideIn4 {
  0%   { transform: translateX(110vw); opacity: 0; }
  70%  { transform: translateX(-12%);  opacity: 1; }
  85%  { transform: translateX(6%);    opacity: 1; }
  100% { transform: translateX(0);     opacity: 1; }
}

.animation5 {
  animation: slideIn5 1.2s ease-out forwards;
  animation-delay: 0.9s;
}

@keyframes slideIn5 {
  0%   { transform: translateX(110vw); opacity: 0; }
  70%  { transform: translateX(-12%);  opacity: 1; }
  85%  { transform: translateX(6%);    opacity: 1; }
  100% { transform: translateX(0);     opacity: 1; }
}


/******************************
 06. Accordion
******************************/

details {
  padding: var(--space-sm) 0;
  margin: var(--space-md) 0;
}

details > summary {
  list-style: none;
  list-style-type: none;
  cursor: pointer;
}

details > summary::marker {
  display: none;
  content: "";
}

details > summary::-webkit-details-marker {
  display: none;
}

details > summary::before {
  content: "▸ ";
  font-size: 1em;
  color: var(--color-text-muted);
}

details[open] > summary::before {
  content: "▾ ";
}

details > summary > span {
  font-weight: bold;
  font-size: 0.9em;
  background: linear-gradient(0deg, var(--color-accordion-underline), var(--color-accordion-underline)) no-repeat right bottom / 0 var(--bg-h);
  transition: background-size 700ms;
  --bg-h: 2px;
  padding-bottom: 2px;
}

details > summary > span:where(:hover, :focus-visible) {
  background-size: 100% var(--bg-h);
  background-position-x: left;
  cursor: pointer;
}


/******************************
 07. Phone (Mobile)
******************************/

@media only screen and (max-width: 570px) {
  /* Mobile sticky header — hidden at top, appears on scroll */
  .site-header {
    position: fixed;
    top: -4rem;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 0.4rem var(--space-md);
    margin-bottom: 0;
    transition: top 0.3s ease;
  }

  .site-header.visible {
    top: 0;
  }

  .mobile-header-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    height: 2rem;
  }

  .hamburger {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    font-size: 1.2em;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0;
    margin: 0;
    line-height: 1;
  }

  .hamburger:hover {
    color: var(--color-accent);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    line-height: 1;
  }

  .mobile-brand-logo {
    height: 28px;
    width: auto;
    border-radius: 2px;
  }

  .site-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 45vw;
    max-width: 180px;
    background-color: var(--color-bg);
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: var(--space-xl) var(--space-md);
    font-size: 0.85em;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 200;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .site-nav.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  }

  .site-nav li {
    font-size: 1em;
  }

  .site-nav a {
    display: block;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-logo {
    display: block;
    margin-top: auto;
    padding: var(--space-xl) 0;
    text-align: center;
    border-bottom: none;
  }

  .nav-logo img {
    width: 100px;
    height: auto;
    border-radius: var(--radius-sm);
  }

  .nav-toggles {
    margin-left: 0;
    margin-top: 0;
    padding: var(--space-sm) 0;
    border-bottom: none;
  }

  .menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 150;
  }

  .menu-overlay.open {
    display: block;
  }

  /* General mobile */
  .team {
    display: block;
  }

  .imagine {
    background-position: bottom right;
  }

  h1 {
    font-size: 2em;
  }

  .article-header h1 {
    font-size: 1.4em;
    line-height: 1.3;
  }

  .principal {
    padding: var(--space-sm) var(--space-sm) var(--space-sm) var(--space-md);
    font-size: 0.95em;
  }

  .name {
    font-size: 1.1em;
  }

  .separator .label {
    font-size: 1.2em;
  }

  .site-logo-intro {
    grid-row: 1;
    width: 60px;
  }

  .intro-header {
    column-gap: var(--space-md);
  }

  .intro-header h1 {
    align-self: center;
  }

  .intro-header .principal {
    grid-column: 1 / -1;
    font-size: 0.85em;
  }

  .contact-header {
    display: block;
  }

  .site-logo-footer {
    margin-bottom: var(--space-md);
  }

  #text-in-pic {
    display: inherit;
  }
}


/******************************
 07b. Tablet
******************************/

@media only screen and (min-width: 571px) and (max-width: 768px) {
  .team {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }

  h1 {
    font-size: 2.6em;
  }

  .principal {
    font-size: 0.95em;
  }
}


/******************************
 08. Blog / Article styles
******************************/

.article-nav {
  font-size: 0.85em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
  font-family: var(--font-display);
}

.article-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
}

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

.article-nav .separator-crumb {
  margin: 0 var(--space-xs);
}

.article-header {
  margin-bottom: var(--space-lg);
}

.article-header h1 {
  font-size: 2.2em;
  text-transform: none;
  line-height: 1.25;
  margin-bottom: var(--space-sm);
}

.article-meta {
  color: var(--color-text-muted);
  font-size: 0.9em;
  margin-bottom: var(--space-md);
}

.article-meta time {
  font-style: italic;
}

.article-body {
  margin-bottom: var(--space-xl);
}

.article-body h2 {
  font-size: 1.3em;
  text-align: left;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-md);
}

.article-body h3 {
  font-size: 1.1em;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.article-body blockquote {
  border-left: 3px solid var(--color-accent);
  margin: var(--space-md) 0;
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: var(--space-lg) 0;
}

.tag {
  display: inline-block;
  font-size: 0.78em;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-muted);
}

.article-footer {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-lg);
  margin-top: var(--space-xl);
}

.article-back {
  font-family: var(--font-display);
  font-size: 0.9em;
}

/* News card for listing page */
.news-card {
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.news-card:hover {
  background-color: var(--color-surface);
  transform: translateY(-2px);
}

.news-card h2 {
  font-size: 1.15em;
  text-align: left;
  margin: 0 0 var(--space-sm) 0;
}

.news-card .date {
  font-size: 0.82em;
  color: var(--color-text-muted);
}

.news-card .excerpt {
  font-size: 0.92em;
  color: var(--color-text);
  margin-top: var(--space-sm);
}

.lang-badge {
  display: inline-block;
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  vertical-align: middle;
  margin-left: var(--space-sm);
}


/******************************
 09. Reduced Motion
******************************/

@media (prefers-reduced-motion: reduce) {
  .animation3, .animation4, .animation5 {
    animation: none;
    opacity: 1;
    transform: none;
  }
}


/******************************
 10. Address (Contact section)
******************************/

address {
  font-style: normal;
}

.news_main {
  padding-bottom: var(--space-lg);
  margin-bottom: var(--space-md);
}

[data-theme="dark"] .news_main {
  border-bottom: 2px groove var(--color-border);
  padding-bottom: var(--space-lg);
}

[data-theme="dark"] #animation1 a,
[data-theme="dark"] #animation2 a,
[data-theme="dark"] #animation3 a {
  color: var(--color-text);
}
