/* =========================================================
   Fabian Frobenius — Curriculum Vitae (web app)
   Visual identity is drawn directly from the PDF export:
   navy (#1F3864), Calibri/Carlito, small-caps section
   headings, italic company/date lines, square bullets,
   justified body copy. The PDF is the "print version" of
   this same document — the app bar links to it directly.
   ========================================================= */

:root {
  --navy:       #1F3864;
  --navy-deep:  #16294B;
  --navy-tint:  #EAF0F7;
  --ink:        #1A1A1A;
  --grey:       #8C8C8C;
  --rule:       #BFBFBF;
  --rule-soft:  #D9D9D9;
  --canvas:     #F2F3F5;
  --paper:      #FFFFFF;

  --font: 'Aptos', 'Carlito', 'Segoe UI', Arial, sans-serif;

  --content-width: 1180px;
  --sidebar-width: 300px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  font-family: var(--font);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  hyphens: auto;
  -webkit-hyphens: auto;      /* ältere Safari-Versionen */
  overflow-wrap: break-word;  /* Notbremse, falls keine Trennstelle gefunden wird */
  hyphenate-limit-chars: 7 3 3;  /* nur Wörter ab 7 Buchstaben, mind. 3 davor/danach */
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

a { color: inherit; }

/* ---------------------------------------------------------
   App bar
   --------------------------------------------------------- */

.appbar {
  background: var(--navy);
  color: #fff;
  padding: 1.4rem 1.6rem 1.1rem;
}

.appbar__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.appbar__identity {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.avatar {
  flex: 0 0 auto;

  height: 79px;
  border-radius: 12%;
  overflow: hidden;
  background: rgba(255,255,255,.12);
  border: 2px solid rgba(255,255,255,.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar__initials {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: #fff;
}

.appbar__text { min-width: 0; }

.appbar__name {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}

.appbar__role {
  margin: .2rem 0 0;
  font-size: .84rem;
  color: rgba(255,255,255,.82);
}

.appbar__tagline {
  max-width: var(--content-width);
  margin: .9rem auto 0;
  font-style: italic;
  font-size: .88rem;
  color: rgba(255,255,255,.75);
}

.appbar__actions {
  display: flex;
  align-items: center;
  gap: .9rem;
  flex: 0 0 auto;
}

.lang-switch {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: rgba(255,255,255,.85);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 3px;
  padding: .3rem .5rem;
}

.lang-switch:hover { background: rgba(255,255,255,.12); }

.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--navy-deep);
  background: #fff;
  text-decoration: none;
  padding: .45rem .8rem;
  border-radius: 3px;
  white-space: nowrap;
}

.pdf-link:hover { background: var(--navy-tint); }

/* ---------------------------------------------------------
   Tab bar
   --------------------------------------------------------- */

.tabbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid var(--rule-soft);
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabbar::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .95rem 1.3rem;
  font-family: var(--font);
  font-size: .88rem;
  font-weight: 600;
  color: var(--grey);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.tab[aria-selected="true"] {
  color: var(--navy);
  border-bottom-color: var(--navy);
}

.tab:hover { color: var(--navy); }

.tab:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: -2px;
}

.tab__icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 auto;
}

.dot { white-space: nowrap; }   /* statt margin-left */

/* ---------------------------------------------------------
   Layout — sidebar (Professional Details) + tab content.
   Sidebar is persistent across all tabs; on narrow screens it
   stacks above the content instead of sitting beside it.
   --------------------------------------------------------- */

.layout {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1.8rem 1.6rem 3rem;
}

@media (min-width: 1000px) {
  .layout {
    display: flex;
    align-items: flex-start;
    gap: 1.8rem;
  }
}

.sidebar { margin-bottom: 1.8rem; }

@media (min-width: 1000px) {
  .sidebar {
    flex: 0 0 var(--sidebar-width);
    margin-bottom: 0;
    position: sticky;
    top: 64px; /* clears the sticky tab bar */
  }
}

.sidebar-card { padding: 1.8rem 1.6rem 2rem; }

.sidebar-photo {

  border-radius: 9%;
  overflow: hidden;
  background: var(--navy-tint);
  border: 3px solid var(--navy-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.4rem;
}

.sidebar-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-photo__initials {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--navy);
}

.sidebar-card .section-title,
.sidebar-card .subheading { text-align: left; }

.sidebar-card .info-field { margin-bottom: .85rem; }
.sidebar-card .info-field:last-of-type { margin-bottom: 0; }

.sidebar-card .tag-group { padding-right: 0; }



/* ---------------------------------------------------------
   Off-canvas sidebar on mobile.
   Progressive enhancement: the drawer positioning only
   activates once html.js is present (set by the page's own
   script). Without JS there is no way to open/close it, so
   it falls back to the plain in-flow stacked layout instead
   of disappearing.
   --------------------------------------------------------- */

.sidebar-toggle, .sidebar-backdrop, .sidebar-close { display: none; }

html.js .sidebar-toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 0 0 auto;
  padding: .95rem 1.1rem;
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 600;
  color: var(--navy);
  background: none;
  border: none;
  border-right: 1px solid var(--rule-soft);
  cursor: pointer;
  white-space: nowrap;
}

@media (min-width: 1000px) {
  html.js .sidebar-toggle { display: none; }
}

html.js .sidebar-backdrop {
  display: block;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0,0,0,.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 40;
}

html.js .sidebar-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 1000px) {
  html.js .sidebar-backdrop { display: none !important; }
}

@media (max-width: 999px) {
  html.js .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    width: 85%;
    max-width: 340px;
    margin-bottom: 0;
    transform: translateX(-105%);
    transition: transform .25s ease;
    z-index: 50;
    overflow-y: auto;
    box-shadow: 4px 0 24px rgba(0,0,0,.18);
  }
  html.js .sidebar.is-open { transform: translateX(0); }
  html.js .sidebar-card {
    min-height: 100%;
    border: none;
    border-radius: 0;
    padding-top: 3.2rem;
    position: relative;
  }
}

html.js .sidebar-close {
  display: flex;
  position: absolute;
  top: .8rem;
  right: .8rem;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  background: var(--canvas);
  border: none;
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
}

html.js .sidebar-close svg { width: 16px; height: 16px; }

@media (min-width: 1000px) {
  html.js .sidebar-close { display: none; }
}

/* ---------------------------------------------------------
   Content
   --------------------------------------------------------- */

.content {
  min-width: 0;
}

@media (min-width: 1000px) {
  .content { flex: 1 1 auto; }
}

.panel {
  animation: fade-in .18s ease-out;
  animation-fill-mode: both;
}

@keyframes fade-in {
  from { transform: translateY(4px); }
  to   { transform: translateY(0); }
}

.card {
  background: var(--paper);
  border: 1px solid var(--rule-soft);
  border-radius: 6px;
  padding: 2rem 2.2rem 2.2rem;
}

@media (max-width: 640px) {
  .layout { padding: 1.2rem 1rem 2.4rem; }
  .card { padding: 1.4rem 1.2rem 1.6rem; }
}

/* ---------------------------------------------------------
   Section headings
   --------------------------------------------------------- */

.section-title {
  display: block;
  font-variant: small-caps;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 1.2rem;
  padding-bottom: .4rem;
  border-bottom: 1.5px solid var(--navy);
}

.subheading {
  font-variant: small-caps;
  font-size: .95rem;
  font-weight: 700;
  color: var(--grey);
  margin: 1.8rem 0 .8rem;
}

.subheading--divider {
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule-soft);
}

.card > .subheading:first-of-type,
.card > .taggrid:first-of-type + .subheading { margin-top: 1.8rem; }

/* ---------------------------------------------------------
   Personal-info / contact field grid
   --------------------------------------------------------- */

/*.fieldflex {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
}*/

/* Base spacing for a bare .info-field (used when a field-group's layout
   is "stack" rather than "grid", e.g. Core Expertise categories). */
/*.info-field { margin-bottom: 1rem; }*/
.info-field:last-child { margin-bottom: 0; }

/*.fieldflex--1col .info-field {
  flex: 1 1 100%;
  min-width: 200px;
  padding: 0 1rem .9rem 0;
  margin-bottom: 0;
}
.fieldflex--2col .info-field {
  flex: 1 1 49%;
  min-width: 200px;
  padding: 0 1rem .9rem 0;
  margin-bottom: 0;
}
.fieldflex--3col .info-field {
  flex: 1 1 33%;
  min-width: 200px;
  padding: 0 1rem .9rem 0;
  margin-bottom: 0;
}
.fieldflex .info-field {
  min-width: 200px;
  padding: 0 1rem .9rem 0;
  margin-bottom: 0;
}*/
.fieldflex {
  --cols: 3;             /* wird pro Container per style="" überschrieben */
  --gap: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .9rem var(--gap);
  margin-bottom: 1.6rem;
}

.fieldflex > .info-field {
  flex: 0 1 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
  min-width: 200px;      /* Untergrenze: darunter fallen Spalten automatisch weg */
  margin: 0;
}

.info-field__label {
  display: block;
  text-transform: uppercase;
  font-size: .72rem;
  color: var(--grey);
  letter-spacing: .01em;
  margin-bottom: .15rem;
}

.info-field__value { font-size: .9rem; color: var(--ink); }
.info-field__value a { color: var(--navy); text-decoration: underline; }

@media (max-width: 560px) {
  .fieldflex .info-field { flex-basis: 100%; }
}

/* ---------------------------------------------------------
   Justified body copy
   --------------------------------------------------------- */

.justify { margin: 0; text-align: justify; hyphens: auto; }

.gate-intro { margin: 0 0 1.2rem; color: #4A4A4A; font-size: .95rem; }

/* ---------------------------------------------------------
   Tag groups (Core Experience / Skills)
   --------------------------------------------------------- */

.taggrid {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: .4rem;
}

.tag-group {
  flex: 1 1 45%;
  min-width: 260px;
  padding: 0 1.6rem 1rem 0;
}

.tag-group__label {
  display: block;
  text-transform: uppercase;
  font-size: .74rem;
  color: var(--grey);
  margin-bottom: .2rem;
}

.tag-group__items { font-size: .88rem; color: var(--ink); }

@media (max-width: 640px) {
  .tag-group { flex-basis: 100%; }
}

/* ---------------------------------------------------------
   Entry group — one repeating "entry" template used by both
   Work Experience and Education (any entry_group in content).
   Per-field classes (job__title, edu-item__school, ...) are
   assigned via each field's own display.class in the YAML and
   only control text styling; spacing/divider lives here.
   --------------------------------------------------------- */

.entry {
  margin: 1.7rem 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule-soft);
}

.entry:first-of-type { border-top: none; padding-top: 0; margin-top: .6rem; }
.entry:last-child { margin-bottom: 0; }

.entry h3 { margin: 0; }
.entry p { margin: .35rem 0 0; }

.entry ul { margin: .6rem 0 0; padding-left: 1.2rem; list-style: none; }

.entry li {
  position: relative;
  margin-bottom: .65rem;
  padding-left: .95rem;
  text-align: justify;
  font-size: .92rem;
}

.entry li:last-child { margin-bottom: 0; }

.entry li::before {
  content: "▪";
  position: absolute;
  left: 0;
  color: var(--ink);
  font-size: .7rem;
  top: .28rem;
}

.job__title {
  text-transform: uppercase;
  font-size: .92rem;
  font-weight: 600;
  color: var(--grey);
}

.job__company {
  font-style: italic;
  font-weight: 600;
  color: var(--ink);
  font-size: .95rem;
}

.job__dates {
  font-style: italic;
  color: var(--ink);
  font-size: .92rem;
}

/* ---------------------------------------------------------
   Education (text styling only — layout comes from .entry above)
   --------------------------------------------------------- */

.edu-item__school {
  font-style: italic;
  font-weight: 600;
  font-size: .95rem;
  color: var(--ink);
}

.edu-item__dates { font-style: italic; color: var(--ink); font-size: .92rem; }

.edu-item__course { font-size: .92rem; }

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */

.footer {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .4rem 1rem;
  padding: 1rem 1.6rem 2rem;
  font-size: .8rem;
  color: var(--grey);
}

.footer__legal a { color: var(--grey); }
.footer__legal a:hover { color: var(--navy); }

.privacy-note {
  margin: .9rem 0 0;
  font-size: .78rem;
  color: var(--grey);
}
.privacy-note a { color: var(--grey); text-decoration: underline; }

/* ---------------------------------------------------------
   Accessibility
   --------------------------------------------------------- */

a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

/* ---------------------------------------------------------
   Access-request gate & admin views
   (request-access.php / admin.php — unchanged card-on-canvas look)
   --------------------------------------------------------- */

.page {
  max-width: 620px;
  margin: 2.5rem auto;
  background: #fff;
  padding: 2.4rem 2.6rem;
  border: 1px solid var(--rule-soft);
  border-radius: 6px;
}

.name { margin: 0; font-size: 2rem; font-weight: 700; color: var(--navy-deep); }
.role-line { margin: .3rem 0 0; font-size: .95rem; }
.tagline { margin: .6rem 0 0; font-style: italic; color: #4A4A4A; font-size: .92rem; }

.section-title--static { margin: 2rem 0 .7rem; }

.gate-box { margin-top: 1.6rem; }

.gate-message {
  margin: 0 0 1rem;
  padding: .7rem .9rem;
  font-size: .92rem;
  border-left: 3px solid var(--navy);
  background: #F3F5F9;
}

.gate-message--success { border-left-color: #2E7D32; background: #EFF7EF; color: #1E4620; }
.gate-message--error { border-left-color: #B3261E; background: #FBEEED; color: #7A1913; }

.gate-form { display: flex; gap: .6rem; flex-wrap: wrap; }

.gate-form input[type="email"],
.gate-form input[type="password"] {
  flex: 1 1 260px;
  padding: .55rem .7rem;
  font-family: var(--font);
  font-size: .92rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
}

.gate-form input:focus-visible { outline: 2px solid var(--navy); outline-offset: 1px; }

.gate-form button {
  padding: .55rem 1.3rem;
  font-family: var(--font);
  font-size: .92rem;
  font-weight: 600;
  color: #fff;
  background: var(--navy);
  border: none;
  border-radius: 2px;
  cursor: pointer;
}

.gate-form button:hover { background: var(--navy-deep); }

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

.admin-logout {
  float: right;
  font-variant: normal;
  font-size: .78rem;
  font-weight: 400;
  color: var(--navy);
  text-decoration: underline;
}

.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }

.admin-table th, .admin-table td {
  text-align: left;
  padding: .5rem .6rem;
  border-bottom: 1px solid var(--rule-soft);
}

.admin-table th {
  text-transform: uppercase;
  font-size: .72rem;
  color: var(--grey);
  font-weight: 600;
}

.status-active { color: #2E7D32; font-weight: 600; }
.status-expired { color: #8C8C8C; }

/* ---------------------------------------------------------
   Print — the exported PDF is the canonical print version;
   these rules just keep a same-page print/save from looking broken.
   --------------------------------------------------------- */

@media print {
  body { background: #fff; }
  .tabbar { position: static; }
  .tab { display: none; }
  .panel[hidden] { display: block !important; }
  .card { border: none; padding: 0; }
  .job, .edu-item, .info-field, .tag-group { break-inside: avoid; }
  .section-title, .subheading { break-after: avoid; }
}
