/* Endpoint Tech Blog - design system */
/* Self-declared latin @font-face — skips fonts.googleapis.com CSS round-trip (big mobile FCP win) */
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 500 800;
  font-display: optional;
  src: url("https://fonts.gstatic.com/s/outfit/v15/QGYvz_MVcBeNP4NJtEtqUYLknw.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  /* Closer metrics to system-ui fallback → less header/hero jump on mobile */
  size-adjust: 102%;
  ascent-override: 95%;
  descent-override: 25%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: optional;
  src: url("https://fonts.gstatic.com/s/sourcesans3/v19/nwpStKy2OAdR1K-IwhWudF-R3w8aZejf5Hc.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  size-adjust: 100%;
  ascent-override: 94%;
  descent-override: 24%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: italic;
  font-weight: 400;
  font-display: optional;
  src: url("https://fonts.gstatic.com/s/sourcesans3/v19/nwpDtKy2OAdR1K-IwhWudF-R3woAa8opPOrG97lwqLlOxCkSmqXCzTo.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --navy: #0f172a;
  --navy-mid: #172033;
  --ink: #0b1220;
  --white: #ffffff;
  --paper: #f7f6f3;
  --gray: #f0efec;
  --gray-mid: #ddd9d2;
  --teal: #0d9488;
  --teal-dark: #0f766e;
  --teal-glow: #14b8a6;
  --text: #3d4553;
  --text-muted: #6b7280;
  --font-display: "Outfit", system-ui, sans-serif;
  --font: "Source Sans 3", system-ui, sans-serif;
  --radius: 0.35rem;
  --shadow-soft: 0 18px 50px rgba(15, 23, 42, 0.08);
  --max: 70rem;
  --measure: 65ch;
  --text-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --lead-size: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);
  --text-leading: 1.65;
  /* Hero title stack — same on home, pages, and posts (mobile + desktop) */
  --hero-eyebrow-size: 0.75rem;
  --h1-size: clamp(1.65rem, 1.3rem + 1.5vw, 2.5rem);
  --h2-size: clamp(1.5rem, 1.25rem + 1.2vw, 2.35rem);
  --h3-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.35rem);
  --h4-size: clamp(1.05rem, 1rem + 0.2vw, 1.2rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Legacy aliases used across HTML */
  --primary-color: var(--teal);
  --primary-dark: var(--teal-dark);
  --secondary-color: var(--teal-glow);
  --text-color: var(--text);
  --text-light: var(--text-muted);
  --bg-color: var(--paper);
  --bg-light: var(--gray);
  --border-color: var(--gray-mid);
  --shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 8px 28px rgba(15, 23, 42, 0.12);
  --transition: all 0.2s var(--ease);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-wrap: break-word;
  word-break: normal;
  -webkit-hyphens: none;
  hyphens: none;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: var(--text-size);
  color: var(--text);
  background: var(--paper);
  line-height: var(--text-leading);
  text-align: start;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-wrap: break-word;
  word-break: normal;
  -webkit-hyphens: none;
  hyphens: none;
}

body > main,
main {
  flex: 1 0 auto;
  width: 100%;
}

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

a {
  color: var(--teal-dark);
  transition: color 0.15s var(--ease);
}

a:hover {
  color: var(--teal);
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: clamp(1.1rem, 3.5vw, 1.5rem);
  padding-right: clamp(1.1rem, 3.5vw, 1.5rem);
  width: 100%;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  letter-spacing: -0.035em;
  line-height: 1.18;
  margin: 0 0 0.9rem;
  font-weight: 700;
  /* balance causes a late reflow pass → CLS on mobile */
  text-wrap: pretty;
  -webkit-hyphens: none;
  hyphens: none;
}

h1 { font-size: var(--h1-size); font-weight: 800; line-height: 1.14; }
h2 { font-size: var(--h2-size); line-height: 1.2; }
h3 { font-size: var(--h3-size); line-height: 1.3; }
h4 { font-size: var(--h4-size); line-height: 1.35; }

p {
  max-width: var(--measure);
  margin-top: 0;
  margin-bottom: 1.25rem;
  line-height: var(--text-leading);
  text-wrap: pretty;
  -webkit-hyphens: none;
  hyphens: none;
  overflow-wrap: break-word;
  word-break: normal;
}

p:last-child { margin-bottom: 0; }

li {
  text-wrap: pretty;
  overflow-wrap: break-word;
  word-break: normal;
  -webkit-hyphens: none;
  hyphens: none;
}

.prose {
  max-width: min(var(--measure), 100%);
}

.lead {
  font-size: var(--lead-size);
  color: var(--text-muted);
  max-width: var(--measure);
  line-height: 1.65;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--hero-eyebrow-size);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-glow);
  margin-bottom: 0.85rem;
}

.no-wrap { white-space: nowrap; }
.text-balance { text-wrap: balance; }
.text-center { text-align: center; }
.text-center .lead,
.text-center p { margin-left: auto; margin-right: auto; }

/* Buttons */
.btn,
.btn-submit,
.read-more,
.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.btn-primary,
.btn-submit {
  background: var(--teal);
  color: var(--white);
  padding: 0.75rem 1.35rem;
  border-color: var(--teal);
}

.btn-primary:hover,
.btn-submit:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--teal-dark);
  border: 1px solid var(--teal);
  padding: 0.75rem 1.35rem;
}

.btn-outline:hover {
  background: var(--teal);
  color: var(--white);
}

.read-more {
  color: var(--teal-dark);
  font-weight: 700;
  padding: 0;
  background: none;
  border: none;
}

.read-more:hover { color: var(--teal); }

/* Header / Nav */
.site-header,
header:has(.navbar) {
  position: sticky;
  top: 0;
  z-index: 50;
}

.navbar {
  background: rgba(11, 18, 32, 0.92);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.navbar > .container,
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  /* Lock header height so webfont swap cannot shove the page down (mobile CLS) */
  min-height: 4.25rem;
  box-sizing: border-box;
}

.logo a,
.logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--white);
}

.logo img {
  width: 1.85rem;
  height: 1.85rem;
  object-fit: contain;
  border-radius: 0;
  display: block;
  flex-shrink: 0;
}

/* Navy mark → white on dark header / footer */
.navbar .logo img,
.site-footer .footer-brand img,
.footer-brand img {
  filter: brightness(0) invert(1);
}

.logo h1,
.logo-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.logo-tag {
  display: block;
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.25;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  align-items: center;
  gap: 0.15rem;
}

.nav-menu a {
  color: #b8c0cc;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius);
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.07);
}

.nav-menu a.active::after { display: none; }

.navbar-search {
  display: none;
  align-items: center;
  gap: 0.35rem;
}

.search-input {
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  font: inherit;
  font-size: 0.9rem;
  min-width: 11rem;
}

.search-input::placeholder { color: #94a3b8; }
.search-input:focus {
  outline: none;
  border-color: var(--teal-glow);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.25);
}

.blog-posts .search-input,
.posts-toolbar .search-input {
  background: var(--white);
  color: var(--ink);
  border-color: var(--gray-mid);
  min-width: 0;
  width: 100%;
}

.blog-posts .search-input::placeholder { color: var(--text-muted); }

.search-btn,
.dark-mode-toggle {
  display: none;
}

.hamburger,
.btn-menu {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.85rem;
  height: 2.85rem;
  padding: 0.65rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--white);
  -webkit-tap-highlight-color: transparent;
}

.hamburger span,
.btn-menu-bars span {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.22s var(--ease), opacity 0.18s ease;
}

.hamburger.active span:nth-child(1),
.btn-menu[aria-expanded="true"] .btn-menu-bars span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2),
.btn-menu[aria-expanded="true"] .btn-menu-bars span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3),
.btn-menu[aria-expanded="true"] .btn-menu-bars span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-mobile {
  display: none;
  flex-direction: column;
  padding: 0.5rem 1.15rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #0b1220;
  max-height: min(70vh, 28rem);
  overflow-y: auto;
}

.nav-mobile.is-open,
.nav-menu.active {
  display: flex;
}

.nav-mobile a {
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 600;
  padding: 0.85rem 0.65rem;
  border-radius: 0.35rem;
  text-align: center;
}

.nav-mobile a:hover,
.nav-mobile a.active {
  color: var(--teal-glow);
  background: rgba(20, 184, 166, 0.1);
}

body.nav-open { overflow: hidden; }

@media (min-width: 900px) {
  .nav-menu { display: flex; }
  .navbar-search { display: flex; }
  .hamburger, .btn-menu { display: none; }
  .nav-mobile { display: none !important; }
}

/* Heroes */
.hero-modern,
.page-header,
.page-hero {
  background:
    radial-gradient(ellipse 70% 80% at 90% -10%, rgba(13, 148, 136, 0.28), transparent 50%),
    radial-gradient(ellipse 45% 50% at -5% 110%, rgba(13, 148, 136, 0.1), transparent 45%),
    linear-gradient(145deg, #0b1220 0%, #172033 55%, #0f3d3a 120%);
  padding: clamp(2.75rem, 6vw, 3.75rem) 0;
  position: relative;
  overflow: hidden;
  color: #d4dae3;
}

.hero-modern .container,
.page-header .container,
.page-hero .container {
  position: relative;
  z-index: 1;
}

.hero-badge,
.hero-modern .hero-badge {
  max-width: 42rem;
}

@media (max-width: 767px) {
  .hero-badge,
  .hero-modern .hero-badge {
    /* Reserve title+lead space before webfont metrics settle (mobile CLS) */
    min-height: 10.5rem;
  }
}

/* Same title size on home, About/Contact/Thank you, and all blog posts */
.badge-label,
.hero-modern .badge-label,
.page-header h1,
.page-header h1.badge-label,
.page-hero h1,
.page-hero h1.badge-label {
  display: block;
  font-family: var(--font-display);
  font-size: var(--h1-size) !important;
  font-weight: 800;
  line-height: 1.14;
  color: var(--white);
  letter-spacing: -0.035em;
  margin: 0 0 0.75rem;
  max-width: 42rem;
  text-wrap: pretty;
}

.badge-description,
.hero-modern .badge-description,
.page-header p,
.page-header p.badge-description,
.page-hero .lead,
.page-hero .badge-description {
  color: #9aa6b5;
  font-size: var(--lead-size) !important;
  font-weight: 400;
  line-height: 1.65;
  max-width: min(36rem, 100%);
  margin: 0;
}

.page-header .container::before,
.page-header .container::after { display: none; }

/* Sections */
.section,
.blog-posts,
.about-content,
.contact-content,
.features-section {
  padding: clamp(3rem, 6vw, 4.5rem) 0;
}

.section-title {
  font-family: var(--font-display);
  margin: 0;
}

.posts-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.posts-toolbar .section-title {
  flex: 0 1 auto;
  line-height: 1.2;
}

.posts-toolbar-search {
  display: flex;
  flex: 1 1 14rem;
  max-width: 28rem;
  align-items: center;
  min-height: 2.75rem;
}

.posts-toolbar-search .search-input {
  width: 100%;
  height: 2.75rem;
  padding: 0.65rem 0.9rem;
  box-sizing: border-box;
}

.posts-toolbar-filter {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.65rem;
  flex: 0 0 auto;
  min-height: 2.75rem;
}

.posts-toolbar-filter label {
  display: inline-block;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text);
  white-space: nowrap;
  line-height: 1;
}

.posts-toolbar-filter select,
#categoryFilter {
  width: auto;
  min-width: 11rem;
  height: 2.75rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--gray-mid);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.9rem;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  box-sizing: border-box;
  line-height: 1.2;
}

.posts-toolbar-filter select:focus,
#categoryFilter:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
}

.posts-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
  .posts-grid { grid-template-columns: repeat(3, 1fr); }
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--gray-mid);
  border-radius: 0.45rem;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  min-height: 100%;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
}

.post-card.hidden { display: none !important; }

.post-card[hidden] {
  display: none !important;
}

.post-image {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.25rem 0.5rem;
  background: linear-gradient(180deg, var(--gray) 0%, var(--white) 100%);
  min-height: 5.5rem;
}

.post-image img {
  max-width: 64px;
  max-height: 64px;
  width: 64px;
  height: 64px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  margin: 0 auto;
}

.post-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1rem 1.25rem 1.35rem;
}

.post-meta {
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.post-date,
.post-author {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.post-content h3 {
  font-size: 1.12rem;
  margin-bottom: 0.65rem;
}

.post-content h3 a {
  color: var(--ink);
  text-decoration: none;
}

.post-content h3 a:hover { color: var(--teal-dark); }

.post-content > p {
  color: var(--text);
  font-size: 0.95rem;
  max-width: none;
  flex: 1;
}

.post-card-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-mid);
}

/* Pagination */
.pagination-container {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
  /* Reserve control row so JS hydrate cannot shift footer into view */
  min-height: 3.25rem;
}

.pagination-container[hidden] {
  display: none !important;
  min-height: 0;
  margin-top: 0;
}

.pagination-ellipsis {
  padding: 0 0.35rem;
  color: var(--text-light);
  line-height: 2.5rem;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
}

.pagination-btn {
  padding: 0.5rem 0.85rem;
  background: var(--white);
  border: 1px solid var(--gray-mid);
  color: var(--ink);
}

.pagination-btn:hover:not(.disabled):not(:disabled) {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.pagination-btn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
}

.pagination-btn.disabled,
.pagination-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* About */
.intro-section,
.feature-card,
.contact-form-container {
  background: var(--white);
  border: 1px solid var(--gray-mid);
  border-radius: 0.45rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.intro-section p,
.intro-section li,
.feature-card p {
  max-width: none;
}

.intro-section ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.intro-section li {
  margin-bottom: 0.75rem;
  color: var(--text);
  line-height: 1.7;
}

.motto-box {
  background: var(--gray);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  text-align: center;
}

.about-social {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-mid);
}

.about-social a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.about-social a:hover { color: var(--teal-dark); }
.about-social img {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 50%;
}

.features-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  margin-bottom: 1.5rem;
}

@media (min-width: 700px) {
  .features-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  .features-grid.features-grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.feature-card {
  text-align: center;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.feature-card-small {
  background: linear-gradient(155deg, #0b1220 0%, #134e4a 110%);
  padding: 1.75rem;
  border-radius: 0.45rem;
  color: #e2e8f0;
  text-align: center;
}

.feature-card-small h3 { color: var(--white); }
.feature-card-small p {
  color: #94a3b8;
  font-size: 0.95rem;
  max-width: none;
  margin: 0;
}

/* Contact */
.contact-form-container {
  max-width: 40rem;
  margin: 0 auto;
}

.contact-intro {
  text-align: center;
  margin-bottom: 2rem;
}

.contact-intro h2 { margin-bottom: 0.75rem; }
.contact-intro p {
  margin-left: auto;
  margin-right: auto;
  color: var(--text-muted);
}

.contact-form,
.form {
  display: grid;
  gap: 1rem;
}

.form-row {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .form-row.cols-2 { grid-template-columns: 1fr 1fr; }
}

.form-group label,
label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.required { color: #ea580c; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="search"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #c9c4bb;
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

.form-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0;
}

.field-error,
.error-msg {
  display: block;
  color: #b91c1c;
  font-size: 0.85rem;
  margin-top: 0.35rem;
  min-height: 1.1em;
}

.contact-form-status {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.contact-form-status.is-error { color: #b91c1c; }

.btn-submit {
  width: 100%;
  margin-top: 0.35rem;
}

/* Blog article */
.blog-post {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--teal-dark);
  text-decoration: none;
  font-weight: 600;
}

.back-link:hover { color: var(--teal); }

.blog-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.page-header .blog-meta {
  color: #94a3b8;
  margin-top: 1rem;
  margin-bottom: 0;
}

.blog-content {
  line-height: var(--text-leading);
  color: var(--text);
}

.blog-content h2,
.blog-content h3 {
  margin-top: 2rem;
}

.blog-content p,
.blog-content li {
  color: var(--text);
  max-width: none;
  text-wrap: pretty;
  -webkit-hyphens: none;
  hyphens: none;
}

.blog-content ul,
.blog-content ol {
  margin: 0 0 1.25rem;
  padding-left: 1.35rem;
}

.blog-content code {
  background: var(--gray);
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.9em;
}

.blog-content pre {
  background: var(--navy);
  color: #e2e8f0;
  padding: 1rem 1.15rem;
  border-radius: 0.45rem;
  overflow-x: auto;
  margin: 0 0 1.25rem;
}

.blog-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.blog-content img {
  width: 100%;
  max-width: 900px;
  margin: 1.5rem auto;
  border-radius: 0.45rem;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.share-section { margin-top: 2rem; }
.share-label {
  display: block;
  margin-bottom: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.share-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--gray);
  border: 1px solid var(--gray-mid);
  transition: var(--transition);
}

.share-btn:hover {
  background: rgba(13, 148, 136, 0.12);
  border-color: var(--teal);
}

.share-btn img {
  width: 1.15rem;
  height: 1.15rem;
  object-fit: cover;
  border-radius: 50%;
}

/* Lightbox */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.lightbox-overlay.active { display: flex; }

.lightbox-content {
  max-width: 95%;
  max-height: 95vh;
  position: relative;
  cursor: default;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 0.45rem;
  margin: 0;
  cursor: default;
  box-shadow: none;
}

.lightbox-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  color: white;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  width: 2.5rem;
  height: 2.5rem;
}

.lightbox-caption {
  color: white;
  text-align: center;
  margin-top: 1rem;
}

/* Footer — same on every page (home, about, contact, posts) */
footer,
.site-footer {
  background: var(--ink);
  color: #94a3b8;
  padding: 2.5rem 0 1.75rem;
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
}

footer .container,
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

footer.footer > .container {
  flex-direction: column;
  align-items: stretch;
}

footer p,
.site-footer p,
.footer-section p,
.footer-bottom p {
  margin: 0;
  color: #94a3b8;
  max-width: none;
  font-size: 0.925rem;
}

footer img,
.site-footer .footer-brand img,
.footer-brand img {
  height: 1.5rem;
  width: 1.5rem;
  object-fit: contain;
  max-width: none;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 0 1 auto;
}

.site-footer .footer-brand p,
.footer-brand p {
  min-width: 0;
  margin: 0;
  line-height: 1.35;
  color: #94a3b8;
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  font-size: clamp(0.65rem, 0.52rem + 1.1vw, 0.925rem);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1.75rem;
  width: 100%;
}

.footer-section h3 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--white);
}

.footer-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-section li {
  margin: 0.35rem 0;
}

.footer-section a {
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
}

.footer-section a:hover {
  color: var(--teal-glow);
}

.footer-bottom {
  width: 100%;
  margin-top: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.social-links {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.social-links a {
  opacity: 0.9;
  transition: opacity 0.15s;
}

.social-links a:hover { opacity: 1; }

.social-links img {
  width: 1.5rem;
  height: 1.5rem;
  object-fit: cover;
  border-radius: 50%;
}

.site-footer .social-links a[aria-label="GitHub"] img {
  filter: brightness(0) invert(1);
}

/* Thank you */
.thank-you-card {
  max-width: 32rem;
  margin: 0 auto;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--gray-mid);
  border-radius: 0.45rem;
  padding: 2.5rem 1.75rem;
}

.thank-you-panel {
  max-width: min(56rem, 100%);
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--gray-mid);
  border-radius: 0.45rem;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  box-shadow: var(--shadow-soft);
}

.thank-you-intro {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-mid);
}

.thank-you-intro h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.15rem + 0.8vw, 1.75rem);
  color: var(--ink);
  text-wrap: balance;
}

.thank-you-intro p {
  margin: 0;
  max-width: none;
  color: var(--text);
  font-size: var(--lead-size);
  line-height: var(--text-leading);
}

.thank-you-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  margin-bottom: 0.5rem;
}

@media (min-width: 720px) {
  .thank-you-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.thank-you-block {
  background: var(--paper);
  border: 1px solid var(--gray-mid);
  border-radius: 0.4rem;
  padding: 1.25rem 1.35rem;
  text-align: left;
}

.thank-you-block h3 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
}

.thank-you-block p {
  margin: 0 0 0.75rem;
  max-width: none;
  color: var(--text);
  font-size: 0.98rem;
}

.thank-you-block p:last-child {
  margin-bottom: 0;
}

.thank-you-steps,
.thank-you-links {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text);
}

.thank-you-steps li,
.thank-you-links li {
  margin: 0.45rem 0;
  line-height: 1.55;
}

.thank-you-links a {
  color: var(--teal-dark);
  font-weight: 600;
  text-decoration: none;
}

.thank-you-links a:hover {
  color: var(--teal);
  text-decoration: underline;
}

.thank-you-social {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.35rem;
}

.thank-you-social a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.thank-you-social a:hover {
  color: var(--teal-dark);
}

.thank-you-social img {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: cover;
  border-radius: 50%;
}

.thank-you-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-mid);
}

/* Mobile / tablet menu overlay (below desktop breakpoint) */
@media (max-width: 899px) {
  .navbar {
    position: relative;
  }

  .navbar > .container {
    flex-wrap: nowrap;
  }

  /* Keep hamburger on the right */
  .navbar-right {
    margin-left: auto;
    flex-shrink: 0;
  }

  .nav-menu.active {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    width: 100%;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #0b1220;
    padding: 0.75rem 1.15rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    z-index: 60;
    gap: 0.15rem;
  }

  .nav-menu.active li {
    width: 100%;
    text-align: center;
  }

  .nav-menu.active a {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.85rem 0.65rem;
  }
}

/* Mobile center reading */
@media (max-width: 767px) {
  .site-footer .container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
  }

  .site-footer .footer-brand {
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    flex: 0 1 auto;
    gap: 0.35rem;
  }

  .site-footer .footer-brand img {
    margin: 0;
    flex-shrink: 0;
  }

  .site-footer .footer-brand p {
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    text-align: center;
    flex: 0 1 auto;
    max-width: 100%;
    width: 100%;
    /* Scales down on small phones so the full copyright stays on one line */
    font-size: clamp(0.58rem, 2.9vw, 0.85rem);
    overflow: hidden;
  }

  .site-footer .social-links {
    justify-content: center;
  }

  .hero-modern,
  .page-header,
  .page-hero,
  .blog-posts,
  .about-content,
  .contact-content,
  .features-section,
  .intro-section,
  .contact-form-container,
  .thank-you-card {
    text-align: center;
  }

  .thank-you-panel {
    text-align: left;
  }

  .thank-you-actions {
    justify-content: center;
  }

  .thank-you-social {
    justify-content: flex-start;
  }

  .badge-label,
  .badge-description,
  .page-header h1,
  .page-header p,
  .page-hero h1,
  .page-hero .lead,
  .section-title,
  .intro-section p,
  .feature-card p {
    margin-left: auto;
    margin-right: auto;
  }

  .posts-toolbar {
    justify-content: center;
    align-items: stretch;
  }

  .posts-toolbar-filter {
    justify-content: center;
    width: 100%;
    flex-wrap: nowrap;
  }

  .posts-toolbar-filter select,
  #categoryFilter {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
  }

  .posts-toolbar-search {
    width: 100%;
    max-width: none;
  }
}

/* Utility hide legacy dark-mode artifacts */
.dark-mode-toggle { display: none !important; }
