:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f5f7fb;
  line-height: 1.6;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #f5f7fb;
  color: #172033;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 70px;
  padding: 10px max(24px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #ffffff;
  border-bottom: 1px solid #e3e8f0;
}

.brand {
  flex: 0 0 auto;
  color: #172033;
  font-size: 1.25rem;
  font-weight: 800;
  text-decoration: none;
}

.top-nav,
header nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-width: 0;
}

header nav a,
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: #47546a;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

header nav a:hover {
  color: #285ed1;
}

header nav input,
#search {
  width: min(280px, 34vw);
  padding: 10px 14px;
  border: 1px solid #ccd5e2;
  border-radius: 999px;
  background: #ffffff;
  color: #172033;
}

header nav .linkedin-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  color: #0a66c2;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

header nav .linkedin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 3px;
  background: #0a66c2;
  color: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px !important;
  font-weight: 700;
  line-height: 22px !important;
  letter-spacing: -1px;
  overflow: hidden;
  flex: 0 0 22px;
}

header nav .linkedin-link:hover {
  color: #004182;
}

header nav .linkedin-link:hover .linkedin-icon {
  background: #004182;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px;
  border: 1px solid #dce3ed;
  border-radius: 999px;
  background: #f7f9fc;
  flex: 0 0 auto;
}

.language-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  min-width: 31px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  filter: grayscale(35%);
  opacity: 0.72;
}

.language-button:hover,
.language-button:focus-visible {
  background: #eaf1ff;
  filter: none;
  opacity: 1;
  outline: none;
}

.language-button.active {
  background: #ffffff;
  box-shadow: 0 1px 5px rgba(25, 44, 78, 0.2);
  filter: none;
  opacity: 1;
}

.language-notice {
  margin: 0 0 22px;
  padding: 12px 15px;
  border: 1px solid #f0d59c;
  border-radius: 10px;
  background: #fff8e8;
  color: #775614;
  font-size: 0.9rem;
}

main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 44px 24px;
}

.hero {
  max-width: 720px;
  padding: 42px 0 34px;
}

.hero h1,
.admin-head h1 {
  margin: 0.15em 0;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 1;
}

.eyebrow {
  color: #3265d5;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.blog-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.posts-sidebar {
  position: sticky;
  top: 90px;
  align-self: start;
  height: calc(100vh - 110px);
  min-width: 0;
}

.posts-sidebar-inner {
  height: 100%;
  overflow-y: auto;
  padding: 20px;
  background: #ffffff;
  border: 1px solid #e0e6ef;
  border-radius: 16px;
  box-shadow: 0 12px 35px rgba(25, 44, 78, 0.06);
}

.posts-sidebar h2 {
  margin: 0 0 14px;
  font-size: 1.05rem;
  line-height: 1.3;
}

.posts-list {
  display: grid;
  gap: 6px;
}

.post-list-link {
  display: block;
  padding: 10px 11px;
  border-radius: 9px;
  color: #37445a;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}

.post-list-link:hover,
.post-list-link:focus-visible {
  background: #eef4ff;
  color: #285ed1;
  outline: none;
}

.post-list-title {
  display: block;
  font-size: 0.93rem;
  font-weight: 700;
  line-height: 1.3;
}

.post-list-date {
  display: block;
  margin-top: 3px;
  color: #7b8598;
  font-size: 0.75rem;
}

.sidebar-loading,
.sidebar-empty {
  margin: 0;
  color: #7b8598;
  font-size: 0.88rem;
}

.posts-content {
  min-width: 0;
}

.articles-stack {
  display: grid;
  gap: 24px;
}

.card,
.panel {
  background: #ffffff;
  border: 1px solid #e0e6ef;
  border-radius: 18px;
  box-shadow: 0 12px 35px rgba(25, 44, 78, 0.06);
}

.card {
  padding: 25px;
}

.card h2 {
  margin: 0.1em 0 0.4em;
}

.blog-post {
  scroll-margin-top: 92px;
}

.blog-post .article-body {
  max-width: 760px;
  white-space: pre-wrap;
}

.article-body p {
  margin: 0 0 1.1em;
}

.meta {
  color: #778197;
  font-size: 0.86rem;
}

#articles .card .article-image,
.article-body img,
.article-content img {
  display: block;
  width: auto !important;
  height: auto !important;
  max-width: 320px !important;
  max-height: 260px !important;
  object-fit: contain !important;
  margin: 18px auto !important;
  border-radius: 10px;
}

.panel {
  padding: 24px;
}

.narrow {
  max-width: 440px;
  margin: 8vh auto;
}

.admin-main {
  max-width: 1380px;
}

.admin-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.admin-head h1 {
  font-size: 3rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
}

.article-list {
  display: grid;
  gap: 9px;
}

.article-item {
  padding: 12px;
  border: 1px solid #e0e6ef;
  border-radius: 11px;
  cursor: pointer;
}

.article-item:hover,
.article-item.active {
  border-color: #3265d5;
  background: #f3f7ff;
}

.article-item strong {
  display: block;
}

.status {
  color: #728099;
  font-size: 0.75rem;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 17px;
  font-weight: 700;
}

input,
textarea,
select {
  padding: 11px 12px;
  border: 1px solid #cbd4e2;
  border-radius: 9px;
  background: #ffffff;
  color: #172033;
  font: inherit;
}

textarea {
  resize: vertical;
}

button {
  padding: 11px 18px;
  border: 0;
  border-radius: 10px;
  background: #285ed1;
  color: #ffffff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.danger {
  background: #b52c37;
}

.form-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 14px;
}

.actions {
  display: flex;
  align-items: end;
  gap: 12px;
}

.upload-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 1rem;
  align-items: end;
}

.upload-form label {
  margin-bottom: 0;
}

.upload-form button {
  min-height: 44px;
}

.notice {
  padding: 0.85rem 1rem;
  border: 1px solid #d7dce2;
  border-radius: 0.6rem;
  background: #f7f8fa;
  color: #4b5563;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.error {
  color: #b42331;
}

.message {
  color: #217044;
}

.image-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.image-card {
  padding: 10px;
  border: 1px solid #dbe2ec;
  border-radius: 12px;
}

.image-card img {
  display: block;
  width: 100% !important;
  height: 120px !important;
  max-height: 120px !important;
  margin: 0 0 10px !important;
  border-radius: 8px;
  object-fit: cover !important;
}

.image-card button {
  padding: 7px 10px;
  background: #b52c37;
  font-size: 0.8rem;
}

hr {
  margin: 30px 0;
  border: 0;
  border-top: 1px solid #e1e6ee;
}

@media (max-width: 900px) {
  .blog-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
  }

  .posts-sidebar-inner {
    padding: 16px;
  }

  .top-nav,
  header nav {
    gap: 10px;
  }

  .language-switcher {
    gap: 2px;
    padding: 2px;
  }

  .language-button {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 16px;
  }
}

@media (max-width: 850px) {
  header {
    padding-inline: 16px;
  }

  header nav input,
  #search {
    display: none;
  }

  main {
    padding: 28px 16px;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-head {
    align-items: flex-start;
    gap: 15px;
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .upload-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }

  .posts-sidebar {
    position: static;
    height: auto;
  }

  .posts-sidebar-inner {
    height: auto;
    overflow: visible;
  }

  .posts-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 620px) {
  header {
    flex-wrap: wrap;
  }

  .linkedin-text {
    display: none;
  }

  header nav .linkedin-link {
    gap: 0;
  }

  #articles .card .article-image,
  .article-body img,
  .article-content img {
    max-width: 240px !important;
    max-height: 220px !important;
  }

  .hero {
    padding-top: 24px;
  }
}
