/*
 * Cross-site quality layer: accessibility, theme consistency, social links,
 * compact blog discovery and focused sector archives.
 */
:root {
  --surface-0: #ffffff;
  --surface-1: #f7f9f8;
  --surface-2: #eef4f1;
  --ink-strong: #17201c;
  --ink-muted: #4b5b53;
  --focus-ring: #0b7a48;
}

html[data-theme="dark"] {
  --surface-0: #142033;
  --surface-1: #0f172a;
  --surface-2: #1c2b40;
  --ink-strong: #f8fafc;
  --ink-muted: #cbd5e1;
  --focus-ring: #34d399;
}

.nav-links {
  gap: clamp(0.2rem, 0.7vw, 0.75rem);
}

.nav-links a {
  padding-inline: clamp(0.65rem, 1vw, 1rem);
}

.hamburger,
.drawer .close-btn {
  align-items: center;
  display: inline-flex;
  height: 48px;
  justify-content: center;
  min-width: 48px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.topbar .social a,
footer .social a {
  min-height: 44px;
  min-width: 44px;
}

.topbar .social {
  gap: 0.2rem;
}

footer h2 {
  color: #ffffff;
  font-size: 1.0625rem;
  font-weight: 900;
  margin-bottom: 0.875rem;
}

footer li a {
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

footer li a:hover,
footer li a:focus-visible {
  text-decoration-color: currentColor;
}

main[data-hub-division] .hub-card[data-system] {
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(24, 24, 27, 0.12);
}

main[data-hub-division="it"] .hub-card[data-system="erp"] {
  background: #edf5ff;
  box-shadow: inset 0 0 0 2px #b9d8fb;
}

main[data-hub-division="it"] .hub-card[data-system="qms"] {
  background: #ecf8f1;
  box-shadow: inset 0 0 0 2px #b5dfc7;
}

main[data-hub-division="it"] .hub-card[data-system="erp"] h3 {
  color: #073c73;
}

main[data-hub-division="it"] .hub-card[data-system="qms"] h3 {
  color: #056839;
}

.hub-archive-link {
  margin-top: 1.5rem;
}

.blog-portal,
.blog-archive-library {
  background: var(--surface-1);
  padding-block: clamp(3rem, 7vw, 5.5rem);
}

.blog-portal-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.blog-portal-sector {
  align-items: start;
  background: var(--surface-0);
  border-radius: 14px;
  color: var(--ink-strong);
  display: grid;
  gap: 1.25rem 2rem;
  grid-template-columns: minmax(240px, 0.85fr) minmax(280px, 1.15fr) auto;
  padding: clamp(1.4rem, 3vw, 2.25rem);
}

.blog-portal-heading h2,
.blog-archive-summary h2 {
  color: var(--ink-strong);
  font-size: clamp(1.45rem, 2.8vw, 2.15rem);
  margin-bottom: 0.6rem;
}

.blog-portal-heading p,
.blog-archive-summary p,
.blog-sector-gateway p {
  color: var(--ink-muted);
}

.blog-count {
  color: var(--focus-ring);
  display: inline-block;
  font-weight: 900;
  margin-top: 0.6rem;
}

.blog-language-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.blog-language-summary strong {
  background: color-mix(in srgb, var(--focus-ring) 10%, var(--surface-0));
  border-radius: 999px;
  color: var(--ink-strong);
  display: inline-flex;
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  font-weight: 900;
  padding: 0.65rem 1rem;
}

.blog-featured-links {
  display: grid;
  gap: 0.65rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.blog-featured-links a {
  color: var(--ink-strong);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--focus-ring) 45%, transparent);
  text-underline-offset: 0.22em;
}

.blog-featured-links a:hover {
  color: var(--focus-ring);
}

.blog-back-link {
  color: inherit;
  display: inline-flex;
  font-weight: 800;
  margin-bottom: 1rem;
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

.blog-archive-summary {
  margin-bottom: 1.75rem;
  max-width: 72ch;
}

.blog-archive-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.blog-library-card {
  background: var(--surface-0);
  border: 0;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(24, 24, 27, 0.12);
}

.blog-library-card h2 {
  color: var(--ink-strong);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.65;
}

.blog-library-card p {
  color: var(--ink-muted);
}

[data-blog-archive-card][hidden] {
  display: none !important;
}

.blog-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 2rem;
}

.blog-page-button {
  align-items: center;
  background: var(--surface-0);
  border: 2px solid var(--focus-ring);
  border-radius: 999px;
  color: var(--focus-ring);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 900;
  height: 48px;
  justify-content: center;
  min-width: 48px;
}

.blog-page-button.is-active {
  background: var(--focus-ring);
  color: #ffffff;
}

#blog-home #blog-grid {
  align-items: stretch;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.blog-sector-gateway {
  background: var(--surface-0);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(24, 24, 27, 0.12);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1.35rem, 3vw, 1.8rem);
}

.blog-sector-gateway h3 {
  color: var(--ink-strong);
  font-size: 1.25rem;
  line-height: 1.55;
}

.blog-sector-gateway .btn {
  margin-top: auto;
}

html[data-theme="dark"] main[data-hub-division] .hub-overview,
html[data-theme="dark"] main[data-hub-division] .hub-process,
html[data-theme="dark"] main[data-hub-division] .hub-related,
html[data-theme="dark"] main[data-hub-division] .hub-services,
html[data-theme="dark"] main[data-hub-division] .hub-deliverables,
html[data-theme="dark"] main[data-hub-division] .hub-contact {
  background: var(--surface-1);
}

html[data-theme="dark"] main[data-hub-division] .hub-card,
html[data-theme="dark"] main[data-hub-division] .hub-audience li,
html[data-theme="dark"] main[data-hub-division] [data-hub-deliverables] li {
  background: var(--surface-0);
  color: var(--ink-strong);
}

html[data-theme="dark"] main[data-hub-division="it"] .hub-card[data-system="erp"] {
  background: #102a47;
  box-shadow: inset 0 0 0 2px #2d659d;
}

html[data-theme="dark"] main[data-hub-division="it"] .hub-card[data-system="qms"] {
  background: #102d22;
  box-shadow: inset 0 0 0 2px #2f7954;
}

html[data-theme="dark"] main[data-hub-division="it"] .hub-card[data-system] h3,
html[data-theme="dark"] main[data-hub-division] h2,
html[data-theme="dark"] main[data-hub-division] h3,
html[data-theme="dark"] main[data-hub-division] .hub-lead {
  color: var(--ink-strong);
}

html[data-theme="dark"] main[data-hub-division] p,
html[data-theme="dark"] main[data-hub-division] li {
  color: var(--ink-muted);
}

html[data-theme="dark"] main[data-hub-division] .hub-contact .btn-outline {
  background: transparent !important;
  border-color: #60a5fa !important;
  color: #bfdbfe !important;
}

html[data-theme="dark"] .sector-contact,
html[data-theme="dark"] .blog-portal,
html[data-theme="dark"] .blog-archive-library,
html[data-theme="dark"] #blog-home {
  background: var(--surface-1) !important;
}

html[data-theme="dark"] .blog-portal-sector,
html[data-theme="dark"] .blog-library-card,
html[data-theme="dark"] .blog-sector-gateway {
  box-shadow: inset 0 0 0 1px #334155;
}

@media (max-width: 900px) {
  .blog-portal-sector {
    grid-template-columns: 1fr;
  }

  #blog-home #blog-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 767px) {
  .topbar {
    display: none;
  }

  header .container.nav {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: minmax(0, 1fr) auto auto;
    width: min(94%, 100%);
  }

  header .container.nav > nav {
    display: none;
  }

  header .container.nav .logo {
    min-width: 0;
  }

  header .container.nav .logo img {
    height: 48px;
    max-width: 132px;
    object-fit: contain;
  }

  header .container.nav > #theme-toggle,
  header .container.nav > #langToggle {
    height: 48px;
    margin: 0 !important;
    min-width: 48px;
    padding: 0.5rem 0.75rem;
  }

  footer .foot {
    display: grid !important;
    gap: 1.5rem;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  footer .foot > * {
    max-width: 100%;
    min-width: 0;
  }

  .hamburger {
    font-size: 1.35rem;
  }

  .blog-portal-sector .btn,
  .blog-archive-hero .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-page-button,
  .blog-featured-links a,
  .topbar .social a,
  footer .social a {
    scroll-behavior: auto;
    transition: none !important;
  }
}
