/* ============================================
   Integrations.at Hugo Theme
   Based on original site design (Poppins, dark header, card layout)
   ============================================ */

/* --- Reset & Base --- */

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

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f5f5f5;
  --color-bg-dark: #2d3436;
  --color-text: #333333;
  --color-muted-text: #6c757d;
  --color-link: #2d3436;
  --color-border: #e0e0e0;
  --color-focus: #1a73e8;
  --color-danger: #dc3545;
  --color-success: #28a745;
  --font-primary: 'Poppins', sans-serif;
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-card-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
  --container-max: 1170px;
  --header-height: 60px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

ul {
  list-style: none;
}

h1,
h2,
h3,
h4 {
  line-height: 1.3;
  font-weight: 600;
}

/* --- Skip to Content --- */

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

.sr-only:focus,
.sr-only:active {
  clip: auto;
  clip-path: none;
  height: auto;
  overflow: visible;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  width: auto;
  padding: 1rem 2rem;
  background: var(--color-bg-dark);
  color: #ffffff;
  font-size: 1rem;
}

/* --- Container --- */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 15px;
  width: 100%;
}

/* --- Header / Navbar --- */

header {
  background-color: var(--color-bg-dark);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

#logo a {
  display: flex;
  align-items: center;
}

#logo img {
  width: 144px;
  height: 40px;
}

.main-nav ul {
  display: flex;
  gap: 0;
}

.main-nav li a {
  display: block;
  color: #cccccc;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition:
    color 0.3s ease,
    background-color 0.3s ease,
    border-bottom-color 0.3s ease;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  position: relative;
}

.main-nav li a:hover {
  color: #ffffff;
  text-decoration: none;
  border-bottom-color: #4a9eff;
  background-color: rgba(74, 158, 255, 0.08);
}

.main-nav li.active a {
  color: #ffffff;
  text-decoration: none;
  border-bottom-color: #2d7fd9;
  background-color: rgba(74, 158, 255, 0.08);
}

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid #cccccc;
  color: #cccccc;
  padding: 0.4rem 0.8rem;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 4px;
}

.nav-toggle:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

/* --- Banner --- */

.banner {
  background-color: var(--color-bg-dark);
  background-size: cover;
  background-position: center;
  position: relative;
  min-height: 280px;
  display: flex;
  align-items: center;
}

.banner-overlay {
  position: relative;
  width: 100%;
  padding: 3rem 0;
  background: rgba(0, 0, 0, 0.5);
}

.banner-content {
  color: #ffffff;
  width: 100%;
}

.banner-content h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.banner-bullets {
  list-style: disc;
  padding-left: 1.5rem;
}

.banner-bullets li {
  font-size: 1rem;
  margin-bottom: 0.4rem;
  list-style: disc;
}

.banner-badges {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
  margin-top: 1rem;
  width: 100%;
}

.banner-badges img {
  width: 109px;
  height: 109px;
  object-fit: contain;
}

/* --- Section Headers --- */

.section-header {
  margin-bottom: 2rem;
}

.section-subtitle {
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--color-muted-text);
  margin-bottom: 0.25rem;
  letter-spacing: 0.5px;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
}

/* --- Cards Grid --- */

.cards-grid {
  display: grid;
  gap: 1.5rem;
}

.cards-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.cards-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.card {
  background: var(--color-bg);
  border-radius: 4px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.card-shadow {
  box-shadow: var(--shadow-card);
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
}

.card-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.card-body {
  padding: 1.25rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0.75rem 0 0.5rem;
  color: var(--color-text);
}

.card a {
  color: inherit;
}

.card a:hover {
  text-decoration: none;
}

.card-text {
  font-size: 0.9rem;
  color: var(--color-muted-text);
  line-height: 1.6;
}

.card-text p {
  margin-bottom: 0.75rem;
}

.card-text p:last-child {
  margin-bottom: 0;
}

/* --- Service Cards --- */

.card-service .card-title {
  padding: 0 1rem;
}

.card-service .card-text {
  padding: 0 1rem 1.25rem;
}

/* --- Focus Area Cards --- */

.card-focus {
  text-align: center;
}

.card-focus .card-title {
  padding: 0 0.5rem 1rem;
}

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

.content-cards {
  padding: 3rem 0;
  background: var(--color-bg);
}

.services-section {
  padding: 3rem 0;
  background: var(--color-bg-alt);
}

.focus-areas-section {
  padding: 3rem 0;
  background: var(--color-bg-alt);
}

/* --- About Page --- */

.about-section {
  padding: 3rem 0;
  background: var(--color-bg-alt);
}

.about-section {
  padding: 2rem 0;
}

.about-section .card {
  max-width: var(--container-max);
  margin: 0 auto 1.5rem;
  padding: 2rem;
}

.about-header-card {
  margin: 0 auto 1.5rem !important;
  padding: 2rem !important;
}

.about-header-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.about-header-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.about-header-v-divider {
  width: 1px;
  height: 200px;
  background-color: var(--color-border);
  margin: 0 0.5rem;
}

.about-header-divider {
  width: 100%;
  height: 1px;
  background-color: var(--color-border);
  border: none;
  margin: 1rem 0;
}

.about-header-media .avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
}

.about-header-badge .badge-img {
  width: 160px;
  height: 160px;
  object-fit: contain;
}

.about-header-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.about-header-social {
  display: flex;
  justify-content: center;
  gap: 1rem;
  align-items: center;
}

.about-header-social img {
  height: 24px;
  width: auto;
}

.about-phases {
  margin-top: 2rem;
}

.about-phases h2 {
  margin-bottom: 2rem;
}

.phases-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.phase-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border, #e0e0e0);
}

.phase-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.phase-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text, #333);
}

.phase-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.5rem;
}

.phase-period {
  font-weight: 600;
  color: var(--color-text, #333);
  font-size: 0.95rem;
  line-height: 1.4;
}

.phase-content {
  display: flex;
  flex-direction: column;
}

.phase-description {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text, #333);
}

@media (max-width: 768px) {
  .about-section {
    padding: 1rem 0;
  }
  .about-section .card {
    padding: 1.5rem;
    margin-bottom: 1rem;
  }
  .about-header-card {
    padding: 1.5rem !important;
    margin-bottom: 1rem !important;
  }
  .about-header-grid {
    flex-direction: column;
    gap: 1rem;
  }
  .about-header-v-divider {
    width: 100%;
    height: 1px;
    margin: 0.5rem 0;
  }
  .about-header-divider {
    margin: 0.75rem 0;
  }
  .about-header-media .avatar,
  .about-header-badge .badge-img {
    width: 140px;
    height: 140px;
  }
  .phase-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .phase-period {
    font-weight: 700;
  }
}

.about-certs h2,
.about-skills h2,
.about-ecg h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.5rem;
}

.cert-table {
  width: 100%;
  border-collapse: collapse;
}

.cert-table tr {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--color-border);
}

.cert-table tr:last-child {
  border-bottom: none;
}

.cert-date {
  color: var(--color-text);
  padding: 0.3rem 0;
  font-weight: 600;
  font-size: 0.85rem;
  width: 120px;
  text-align: left;
  flex-shrink: 0;
}

.cert-name {
  font-size: 0.9rem;
  color: var(--color-text);
  flex: 1;
  padding: 0.25rem 0;
  line-height: 1.4;
}

.cert-list p,
.ecg-content p {
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--color-muted-text);
}

/* --- Footer --- */

footer {
  background: var(--color-bg-dark);
}

.footer-social-section {
  background: #d4dce6;
  padding: 1rem 0;
}

.social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s,
    filter 0.2s;
  text-decoration: none;
}

.social-links a:hover {
  transform: scale(1.15);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.social-links img {
  height: 28px;
  width: auto;
}

.social-links .back-to-top {
  padding: 0.5rem;
  color: #0052cc;
  font-size: 2rem;
}

.social-links .back-to-top i {
  display: block;
  font-size: 2rem;
}

/* --- Back to Top --- */

#top-link-block {
  position: fixed;
  bottom: 1rem;
  right: 2rem;
  z-index: 999;
}

.btn-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--color-bg-dark);
  color: #ffffff;
  border-radius: 4px;
  font-size: 1.2rem;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-top:hover {
  background: #444444;
  text-decoration: none;
}

.btn-top:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

/* --- Forced Colors / High Contrast --- */

@media (forced-colors: active) {
  header,
  footer,
  .banner-overlay {
    border: 1px solid ButtonBorder;
  }

  .card {
    border: 1px solid ButtonBorder;
  }

  .btn-top {
    border: 2px solid ButtonBorder;
  }

  .social-links img {
    filter: none;
  }

  .main-nav li.active a {
    border: 2px solid Highlight;
  }
}

/* --- Responsive --- */

@media (max-width: 992px) {
  .cards-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .cards-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .banner-badges {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg-dark);
    padding: 1rem 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }

  .main-nav.open {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
  }

  .main-nav li a {
    padding: 0.75rem 1.5rem;
  }

  .cards-grid-3,
  .cards-grid-4 {
    grid-template-columns: 1fr;
  }

  .banner-content h1 {
    font-size: 1.5rem;
  }

  .banner-badges {
    justify-content: center;
    gap: 0.75rem;
  }

  .banner-badges img {
    width: 85px;
    height: 85px;
  }

  .about-section .card {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
  }

  .cert-table tr {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.4rem 0;
  }

  .cert-date {
    min-width: auto;
    width: 100%;
    text-align: left;
    padding: 0.3rem 0.5rem;
  }

  .cert-name {
    width: 100%;
    padding: 0;
  }
}

@media (max-width: 500px) {
  .banner-content h1 {
    font-size: 1.25rem;
  }

  .banner-badges {
    gap: 0.5rem;
  }

  .banner-badges img {
    width: 70px;
    height: 70px;
  }

  .cert-date {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }

  .cert-name {
    font-size: 0.85rem;
  }
}

/* --- Nav Toggle JS Helper --- */
