/* ------------------------------------------------------
   1. COLOR PALETTE & GLOBAL VARIABLES
------------------------------------------------------ */
:root {
  --primary: #2563eb;
  --secondary: #4338ca;
  --background: #f5f7fa;
  --paper: #fff;
  --border: #e0e7ef;
  --text-main: #18181b;
  --text-muted: #64748b;
  --accent-green: #4ade80;
  --accent-gold: #fbbf24;
}

/* ------------------------------------------------------
   2. GLOBAL BODY STYLES
------------------------------------------------------ */
body {
  background: var(--background);
  color: var(--text-main);
  font-family: "Inter", "Segoe UI", "Roboto", Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------
   3. NAVBAR
------------------------------------------------------ */
.navbar {
  background: var(--primary) !important;
  box-shadow: 0 2px 12px 0 rgba(37, 99, 235, 0.07);
}
.navbar-brand,
.navbar-nav .nav-link {
  color: var(--paper) !important;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: color 0.15s;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--accent-green) !important;
  text-decoration: underline;
}
.navbar-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-green);
  margin: 0;
  box-shadow: none;
  display: block;
}
@media (max-width: 767.98px) {
  .navbar-avatar {
    width: 44px;
    height: 44px;
  }
}
.navbar-brand {
  margin-right: 0 !important;
}
.navbar-spacer {
  height: 64px;
}
@media (max-width: 575.98px) {
  .navbar-spacer {
    height: 90px;
  }
}

/* ------------------------------------------------------
   4. CONTAINER & GENERAL SECTIONS
------------------------------------------------------ */
.container,
.container-fluid {
  padding-top: 32px;
  padding-bottom: 32px;
}

/* Section Title */
.section-title {
  color: var(--primary);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-left: 6px solid var(--secondary);
  padding-left: 0.7rem;
  background: transparent;
}

/* ------------------------------------------------------
   5. GENERIC CARD STYLE (USED BY ALL SECTIONS)
------------------------------------------------------ */
.card,
.hobbies-card,
.languages-card,
.project-card {
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 2px 12px 0 rgba(67, 56, 202, 0.06);
  margin-bottom: 1.5rem;
  transition: box-shadow 0.16s, border-color 0.16s;
}
.card:hover,
.project-card:hover,
.hobbies-card:hover,
.languages-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 36px 0 rgba(37, 99, 235, 0.13),
    0 2px 4px 0 var(--accent-green);
}
.card-title,
.project-title {
  color: var(--primary);
  font-weight: 600;
  font-size: 1.22rem;
}

/* ------------------------------------------------------
   6. PROJECTS SECTION
------------------------------------------------------ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Always 3 on desktop */
  gap: 2rem;
}
@media (max-width: 1100px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.4rem;
  }
}
@media (max-width: 750px) {
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }
}
.project-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 2px 12px 0 rgba(67, 56, 202, 0.06);
  min-height: 370px;
  padding: 0;
  transition: box-shadow 0.16s, border-color 0.16s;
}
.project-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 36px 0 rgba(37, 99, 235, 0.13),
    0 2px 4px 0 var(--accent-green);
}
.project-img,
.project-img-placeholder {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
  background: #f5f7fa;
  border-bottom: 1.5px solid var(--border);
}
.project-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.3rem;
  color: var(--primary);
}
.project-info {
  padding: 1.1rem 1.1rem 0.3rem 1.1rem;
  flex: 1;
}
.project-title {
  color: var(--primary);
  font-size: 1.18rem;
  font-weight: 600;
  margin-bottom: 0.34rem;
}
.project-desc {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 0.7rem;
  line-height: 1.5;
}
.project-stack {
  margin-bottom: 0.7rem;
  flex-wrap: wrap;
}
.project-chip {
  display: inline-block;
  background: var(--accent-green);
  color: var(--text-main);
  font-size: 0.91rem;
  font-weight: 500;
  padding: 0.29em 0.69em;
  border-radius: 1.5em;
  margin-right: 0.46em;
  margin-bottom: 0.41em;
}
.project-links {
  display: flex;
  justify-content: flex-end;
  gap: 0.65em;
  padding: 0.56rem 1.1rem 0.68rem 1.1rem;
  border-top: 1px dashed var(--border);
}
.project-link {
  color: var(--secondary);
  font-size: 1.24rem;
  transition: color 0.13s, background 0.13s;
  padding: 0.17em 0.41em;
  border-radius: 50%;
}
.project-link:hover,
.project-link:focus {
  color: var(--primary);
  background: var(--accent-green);
  text-decoration: none;
}
@media (max-width: 600px) {
  .projects-grid {
    gap: 1.2rem;
  }
  .project-img,
  .project-img-placeholder {
    height: 100px;
  }
  .project-info {
    padding: 0.81rem 0.6rem 0.09rem 0.6rem;
  }
  .project-links {
    padding: 0.33rem 0.67rem 0.42rem 0.67rem;
  }
}

/* ------------------------------------------------------
   7. LANGUAGES SECTION (with percentage meter)
------------------------------------------------------ */
.languages-card {
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: 0 2px 12px 0 rgba(67, 56, 202, 0.06);
  padding: 2.3rem 2rem;
}
@media (max-width: 767.98px) {
  .languages-card {
    padding: 1.3rem 0.8rem;
  }
}

/* Language Progress Meter Style */
.language-meter-wrap {
  margin-bottom: 1.22rem;
}
.language-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.36rem;
}
.language-label {
  font-weight: 600;
  color: var(--primary);
  font-size: 1.09rem;
}
.language-percent {
  color: var(--secondary);
  font-size: 1rem;
  font-weight: 500;
}
.language-meter {
  width: 100%;
  height: 13px;
  background: #f0f4fa;
  border-radius: 1.2rem;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 0.08rem;
  position: relative;
}
.language-meter-bar {
  height: 100%;
  border-radius: 1.2rem;
  background: linear-gradient(
    to right,
    var(--primary) 70%,
    var(--accent-green) 100%
  );
  box-shadow: 0 1px 3px 0 rgba(67, 56, 202, 0.1);
  transition: width 1.1s cubic-bezier(0.21, 0.57, 0.41, 0.98);
}
/* Tweaked bar color for lower percentages */
.language-meter-bar[style*="40%"] {
  background: linear-gradient(
    90deg,
    var(--accent-gold) 60%,
    var(--primary) 100%
  );
}
.language-meter-bar[style*="10%"] {
  background: linear-gradient(90deg, #fbbf24 33%, #f87171 100%);
}

/* ------------------------------------------------------
   8. HOBBIES SECTION
------------------------------------------------------ */
.hobbies-card {
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: 0 2px 12px 0 rgba(67, 56, 202, 0.06);
  padding: 2.3rem 2rem;
}
@media (max-width: 767.98px) {
  .hobbies-card {
    padding: 1.3rem 0.8rem;
  }
}
.hobbies-list {
  margin-bottom: 0;
  padding-left: 0;
  font-size: 1.07rem;
}
.hobby-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.2rem;
  line-height: 1.7;
}
.hobby-icon {
  font-size: 1.65rem;
  padding-top: 0.08rem;
  min-width: 2.2rem;
  text-align: center;
}
.hobby-text {
  color: var(--text-main);
}
.hobby-link {
  color: var(--secondary);
  text-decoration: underline dotted;
  transition: color 0.17s;
}
.hobby-link:hover,
.hobby-link:focus {
  color: var(--primary);
  text-decoration: underline;
}

/* ------------------------------------------------------
   9. OTHERS SECTION (Other Projects & Activities)
------------------------------------------------------ */
#others {
  scroll-margin-top: 120px; /* offset for fixed navbar */
}

.others-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Always 3 per row on desktop */
  gap: 2rem;
  padding-left: 1.7rem;
  padding-right: 1.7rem;
}

@media (max-width: 1000px) {
  .others-grid {
    grid-template-columns: repeat(2, 1fr); /* Two per row on tablets */
    gap: 1.4rem;
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }
}
@media (max-width: 650px) {
  .others-grid {
    grid-template-columns: 1fr; /* One per row on mobile */
    gap: 1rem;
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }
}

.others-card {
  display: flex;
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 2px 12px 0 rgba(67, 56, 202, 0.06);
  padding: 1.4rem 1.2rem;
  min-height: 175px;
  transition: box-shadow 0.16s ease, border-color 0.13s ease;
  align-items: flex-start;
  gap: 1.2rem;
}
.others-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 36px 0 rgba(37, 99, 235, 0.13),
    0 2px 4px 0 var(--accent-green);
}
.others-icon {
  font-size: 2.2rem;
  min-width: 2.3rem;
  margin-top: 0.14rem;
  color: var(--secondary);
}
.others-content {
  flex: 1;
}
.others-title {
  color: var(--primary);
  font-size: 1.12rem;
  font-weight: 600;
  margin-bottom: 0.23rem;
}
.others-desc {
  color: var(--text-main);
  font-size: 1rem;
  margin-bottom: 0.74rem;
}
.others-stack {
  margin-bottom: 0.2rem;
}
.others-chip {
  display: inline-block;
  background: var(--accent-green);
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.23em 0.7em;
  border-radius: 1.4em;
  margin-right: 0.38em;
  margin-bottom: 0.34em;
}
.others-link {
  color: var(--secondary);
  font-weight: 500;
  text-decoration: underline dotted;
  transition: color 0.14s;
}
.others-link:hover,
.others-link:focus {
  color: var(--primary);
  text-decoration: underline;
}
@media (max-width: 650px) {
  .others-grid {
    gap: 1.1rem;
  }
  .others-card {
    padding: 1rem 0.7rem;
    gap: 0.7rem;
  }
}

/* ------------------------------------------------------
   10. HERO/INTRO SECTION
------------------------------------------------------ */
.intro-hero {
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 2px 12px 0 rgba(67, 56, 202, 0.07);
  padding: 2.1rem 2rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
@media (max-width: 767.98px) {
  .intro-hero {
    flex-direction: column;
    padding: 1.1rem 0.8rem;
    gap: 1.1rem;
  }
}
.intro-content {
  max-width: 530px;
  min-width: 260px;
  flex: 1;
}
.intro-title {
  color: var(--primary);
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: 0.01em;
}
.intro-lead {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.8;
}
.intro-photo-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* .intro-hero-photo {
  width: 170px;
  height: 170px;
  object-fit: cover;
  border-radius: 50%;
  border: 5px solid var(--primary);
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.09);
  background: var(--paper);
}
@media (max-width: 767.98px) {
  .intro-hero-photo {
    width: 100px;
    height: 100px;
  }
} */

/* Rectangular Intro Image Style */

.intro-hero-photo-rect {
  width: 330px;
  height: 220px; /* e.g. 3:2 ratio (wide landscape) */
  object-fit: contain; /* Fills box, cropping if needed, always covers. */
  border-radius: 1rem; /* Rounded corners */
  border: 3px solid var(--primary);
  background: var(--paper);
  box-shadow: 0 6px 26px rgba(37, 99, 235, 0.08);
  display: block;
}

@media (max-width: 500px) {
  .intro-hero-photo-rect {
    width: 96vw;
    height: 170px;
  }
}

/* --- Custom Modal Styles for VOIP Popup --- */
.custom-modal-backdrop {
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(36, 50, 80, 0.29);
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-modal {
  background: var(--paper);
  padding: 2rem 1.4rem 1.2rem 1.4rem;
  border-radius: 1rem;
  box-shadow: 0 10px 24px 0 rgba(37, 99, 235, 0.08);
  max-width: 410px;
  width: 95vw;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.close-modal {
  position: absolute;
  top: 0.7rem;
  right: 1.1rem;
  font-size: 2.1rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2;
  line-height: 1;
  transition: color 0.17s;
}
.close-modal:hover {
  color: var(--primary);
}

@media (max-width: 600px) {
  .custom-modal {
    padding: 0.7rem 0.2rem 0.9rem 0.2rem;
  }
}

/* --- Custom Modal Styles for VOIP Popup --- */
.custom-modal-backdrop {
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(36, 50, 80, 0.29);
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-modal {
  background: var(--paper);
  padding: 2rem 1.4rem 1.2rem 1.4rem;
  border-radius: 1rem;
  box-shadow: 0 10px 24px 0 rgba(37, 99, 235, 0.08);
  max-width: 410px;
  width: 95vw;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.close-modal {
  position: absolute;
  top: 0.7rem;
  right: 1.1rem;
  font-size: 2.1rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2;
  line-height: 1;
  transition: color 0.17s;
}
.close-modal:hover {
  color: var(--primary);
}

@media (max-width: 600px) {
  .custom-modal {
    padding: 0.7rem 0.2rem 0.9rem 0.2rem;
  }
}

/* --- SERVICES SECTION (inside intro) --- */
.intro-services {
  margin-top: 2.2rem;
  width: 100%;
}
.services-title {
  color: var(--primary);
  font-size: 1.37rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 1.1rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.1rem;
  justify-content: center;
  padding: 0 0.5rem;
}
@media (max-width: 890px) {
  .services-grid {
    gap: 1.1rem;
  }
}
@media (max-width: 700px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
}

.service-card {
  background: var(--paper);
  border: 1.6px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 2px 12px 0 rgba(37, 99, 235, 0.075);
  padding: 2rem 1.18rem 1rem 1.18rem;
  align-items: center;
  display: flex;
  flex-direction: column;
  min-height: 210px;
  transition: box-shadow 0.17s, border-color 0.15s;
  text-align: center;
}
.service-card:hover {
  border-color: var(--accent-green);
  box-shadow: 0 10px 36px 0 rgba(37, 99, 235, 0.11),
    0 2px 4px 0 var(--accent-green);
}

.service-icon {
  font-size: 2.5rem;
  color: var(--secondary);
  margin-bottom: 1.1rem;
  display: block;
}
.service-card-title {
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.42rem;
}
.service-desc {
  color: var(--text-muted);
  font-size: 0.96rem;
  margin-bottom: 0;
}

/* --- Custom Modal Styles for VOIP Popup --- */
.custom-modal-backdrop {
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(36, 50, 80, 0.29);
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-modal {
  background: var(--paper);
  padding: 2rem 1.4rem 1.2rem 1.4rem;
  border-radius: 1rem;
  box-shadow: 0 10px 24px 0 rgba(37, 99, 235, 0.08);
  max-width: 410px;
  width: 95vw;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: auto;
}

.close-modal {
  position: absolute;
  top: 0.7rem;
  right: 1.1rem;
  font-size: 2.1rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2;
  line-height: 1;
  transition: color 0.17s;
}
.close-modal:hover {
  color: var(--primary);
}

@media (max-width: 600px) {
  .custom-modal {
    padding: 0.7rem 0.2rem 0.9rem 0.2rem;
  }
}

/* --- SERVICES SECTION (inside intro) --- */
.intro-services {
  margin-top: 2.2rem;
  width: 100%;
}

.services-title {
  color: var(--primary);
  font-size: 1.37rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 1.1rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.1rem;
  justify-content: center;
  padding: 0 0.5rem;
}

@media (max-width: 890px) {
  .services-grid {
    gap: 1.1rem;
  }
}

@media (max-width: 700px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
}

.service-card {
  background: var(--paper);
  border: 1.6px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 2px 12px 0 rgba(37, 99, 235, 0.075);
  padding: 2rem 1.18rem 1rem 1.18rem;
  align-items: center;
  display: flex;
  flex-direction: column;
  min-height: 210px;
  transition: box-shadow 0.17s, border-color 0.15s;
  text-align: center;
  cursor: default;
}

.service-card:hover {
  border-color: var(--accent-green);
  box-shadow: 0 10px 36px 0 rgba(37, 99, 235, 0.11),
    0 2px 4px 0 var(--accent-green);
}

.service-icon {
  font-size: 2.5rem;
  color: var(--secondary);
  margin-bottom: 1.1rem;
  display: block;
}

.service-card-title {
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.42rem;
}

.service-desc {
  color: var(--text-muted);
  font-size: 0.96rem;
  margin-bottom: 0;
}

/* ------------------------------------------------------
   11. SKILL CHIPS (applies to .MuiChip-root as well)
------------------------------------------------------ */
.MuiChip-root,
.project-chip {
  background: var(--accent-green) !important;
  color: var(--text-main) !important;
  font-weight: 500;
}
.MuiChip-root:not(:last-child),
.project-chip:not(:last-child) {
  margin-right: 0.4em;
  margin-bottom: 0.4em;
}

/* ------------------------------------------------------
   12. GENERAL BUTTONS
------------------------------------------------------ */
.btn-primary,
.btn-accent {
  background: var(--primary) !important;
  color: #fff !important;
  border-radius: 0.4rem;
  box-shadow: 0 2px 6px 0 rgba(37, 99, 235, 0.1);
  border: none !important;
}
.btn-primary:hover,
.btn-accent:hover {
  background: var(--secondary) !important;
}

/* ------------------------------------------------------
   13. CONTACT SECTION / FOOTER
------------------------------------------------------ */
footer#contact {
  background: var(--paper);
  color: var(--primary);
  box-shadow: 0 -2px 8px 0 rgba(67, 56, 202, 0.05);
}
.footer-contact-section {
  background: var(--background);
  border-top: 1.5px solid var(--border);
  margin-top: 0;
}
.footer-contact-section .col-12,
.footer-contact-section .col-md-8,
.footer-contact-section .col-lg-7,
.footer-contact-section .col-xl-6 {
  padding: 2.1rem 1.7rem;
  background: var(--paper);
  border-radius: 1rem;
  box-shadow: 0 2px 12px 0 rgba(67, 56, 202, 0.06);
  border: 1.5px solid var(--border);
  margin-bottom: 2rem;
}
footer#contact .section-title {
  color: var(--secondary);
  border-left: 4px solid var(--secondary);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding-left: 0.7rem;
  background: transparent;
}
.form-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--primary);
}
.form-control:focus {
  border-color: var(--primary);
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.5;
}
footer#contact p {
  color: var(--text-muted);
  font-size: 0.97rem;
}

/* ------------------------------------------------------
   14. SECTION SCROLL-OFFSET FOR FIXED NAVBAR
------------------------------------------------------ */
#intro,
#education,
#experience,
#hobbies,
#projects,
#skills,
#contact,
#languages,
#others {
  scroll-margin-top: 120px;
}
@media (max-width: 767.98px) {
  #intro,
  #education,
  #experience,
  #hobbies,
  #projects,
  #skills,
  #contact,
  #languages,
  #others {
    scroll-margin-top: 90px;
  }
}

/*-----------------------------------------------------------------------------------------------------
Blog CSS
-----------------------------------------------------------------------------------------------------*/

.blog-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 2rem;
  justify-content: center;
}
.blog-filter-btn {
  border: none;
  background: var(--border);
  color: var(--secondary);
  font-weight: 500;
  font-size: 1rem;
  border-radius: 2rem;
  padding: 0.47em 1.2em;
  transition: background 0.13s, color 0.13s;
  cursor: pointer;
}
.blog-filter-btn.active,
.blog-filter-btn:hover {
  background: var(--primary);
  color: #fff;
}
@media (max-width: 550px) {
  .blog-filter-btn {
    font-size: 0.97rem;
    padding: 0.4em 0.85em;
  }
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.blog-card {
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 2px 12px 0 rgba(67, 56, 202, 0.06);
  transition: box-shadow 0.16s, border-color 0.15s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  border-color: var(--accent-green);
  box-shadow: 0 8px 36px 0 rgba(37, 99, 235, 0.11),
    0 2px 4px 0 var(--accent-green);
}

.blog-img,
.blog-img-placeholder {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: #f5f7fa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: var(--primary);
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
  border-bottom: 1.5px solid var(--border);
}

.blog-content {
  padding: 1.2rem 1.08rem 1.08rem 1.08rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.blog-tag {
  background: #f1f5f9;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
}

.blog-title {
  color: #000;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.blog-summary {
  color: var(--text-main);
  font-size: 1rem;
  margin-bottom: 0.88rem;
  min-height: 48px;
  line-height: 1.55;
}

.blog-link {
  align-self: flex-start;
  color: #0f766e;
  text-decoration: none;
  font-weight: 700;
  margin-top: auto;
  font-size: 0.95rem;
  transition: color 0.14s;
}
.blog-link:hover,
.blog-link:focus {
  color: #115e59;
  text-decoration: none;
}

@media (max-width: 650px) {
  .blog-grid {
    gap: 1.1rem;
  }
  .blog-img,
  .blog-img-placeholder {
    height: 90px;
  }
  .blog-content {
    padding: 0.74rem 0.5rem 0.86rem 0.5rem;
  }
}

.blog-controls {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin-bottom: 2rem;
}

.blog-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.blog-filter-btn {
  border: none;
  background: var(--border);
  color: var(--secondary);
  font-weight: 500;
  font-size: 1rem;
  border-radius: 2rem;
  padding: 0.47em 1.2em;
  transition: background 0.13s, color 0.13s;
  cursor: pointer;
}
.blog-filter-btn.active,
.blog-filter-btn:hover {
  background: var(--primary);
  color: #fff;
}
@media (max-width: 550px) {
  .blog-filter-btn {
    font-size: 0.97rem;
    padding: 0.4em 0.85em;
  }
}

.blog-search-wrap {
  flex-shrink: 0;
}
.blog-search {
  padding: 0.44em 1.1em;
  font-size: 1rem;
  border: 1.5px solid var(--border);
  border-radius: 2rem;
  background: var(--background);
  color: var(--text-main);
  min-width: 190px;
  outline: none;
  transition: border-color 0.13s;
}
.blog-search:focus {
  border-color: var(--primary);
}

@media (max-width: 900px) {
  .blog-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
  }
  .blog-search-wrap {
    width: 100%;
  }
  .blog-search {
    width: 100%;
    min-width: 0;
  }
}

/* Blog grid and cards—same as before (3 per row desktop) */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

@media (max-width: 1100px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.4rem;
  }
}
@media (max-width: 700px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }
}

.blog-card {
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 2px 12px 0 rgba(67, 56, 202, 0.06);
  transition: box-shadow 0.16s, border-color 0.15s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.blog-card:hover {
  border-color: var(--accent-green);
  box-shadow: 0 8px 36px 0 rgba(37, 99, 235, 0.11),
    0 2px 4px 0 var(--accent-green);
}

.blog-img,
.blog-img-placeholder {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: #f5f7fa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: var(--primary);
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
  border-bottom: 1.5px solid var(--border);
}

.blog-content {
  padding: 1.2rem 1.08rem 1.08rem 1.08rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.blog-tag {
  background: #f1f5f9;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
}

.blog-title {
  color: #000;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.blog-summary {
  color: var(--text-main);
  font-size: 1rem;
  margin-bottom: 0.88rem;
  min-height: 48px;
  line-height: 1.55;
}

.blog-link {
  align-self: flex-start;
  color: #0f766e;
  text-decoration: none;
  font-weight: 700;
  margin-top: auto;
  font-size: 0.95rem;
  transition: color 0.14s;
}
.blog-link:hover,
.blog-link:focus {
  color: #115e59;
  text-decoration: none;
}

@media (max-width: 650px) {
  .blog-img,
  .blog-img-placeholder {
    height: 90px;
  }
  .blog-content {
    padding: 0.74rem 0.5rem 0.86rem 0.5rem;
  }
}
/* --- Responsive horizontal gap for blog grid --- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding-left: 1.7rem;
  padding-right: 1.7rem;
}

@media (max-width: 1100px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.4rem;
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }
}
@media (max-width: 700px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.1rem;
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }
}
