/* Modern layout primitives (Flexbox-based)
   Scope: layout utilities, cards, forms, accessibility helpers
   Responsive behaviour relies on intrinsic flex wrapping — no media queries. */

/* CSS Reset / Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: #111827; background: #fff; font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji'; line-height: 1.5; }
img, video { max-width: 100%; height: auto; display: block; }
picture { display: block; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

/* Accessibility */
.u-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* Global Link Styles - Brand Colors */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--color-accent);
}

/* Color System */
:root {
  --color-bg: #ffffff;
  --color-fg: #111827; /* gray-900 */
  --color-muted: #6b7280; /* gray-500 */
  --color-border: #e5e7eb; /* gray-200 */
  --color-primary: #04344D; /* udreamjob brand primary */
  --color-primary-700: #022338; /* udreamjob brand darker */
  --color-primary-50: #e6eef3; /* udreamjob brand lighter */
  --color-accent: #057389; /* udreamjob brand accent/hover */
  --radius-sm: 6px;
  --radius-md: 10px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.08);
  --shadow: 0 6px 16px rgba(0,0,0,.1);
}

/* Layout Primitives */
.l-container {
  width: min(100%, 1280px);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.l-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap, 1.5rem);
}

.l-col {
  flex: 1 1 320px;
  max-width: 100%;
  min-width: 0;
}

.l-col-12,
.l-col-12\@md,
.l-col-12\@lg,
.l-col-12\@xl { flex-basis: 100%; }

.l-col-8,
.l-col-8\@md,
.l-col-8\@lg,
.l-col-8\@xl { flex-basis: clamp(320px, 66.6667%, 100%); }

.l-col-6,
.l-col-6\@md,
.l-col-6\@lg,
.l-col-6\@xl { flex-basis: clamp(280px, 50%, 100%); }

.l-col-4,
.l-col-4\@md,
.l-col-4\@lg,
.l-col-4\@xl { flex-basis: clamp(240px, 33.3333%, 100%); }

.l-col-3,
.l-col-3\@md,
.l-col-3\@lg,
.l-col-3\@xl { flex-basis: clamp(200px, 25%, 100%); }

/* Utilities */
.u-flex { display: flex; }
.u-inline-flex { display: inline-flex; }
.u-wrap { flex-wrap: wrap; }
.u-items-center { align-items: center; }
.u-items-start { align-items: flex-start; }
.u-items-end { align-items: flex-end; }
.u-justify-between { justify-content: space-between; }
.u-justify-center { justify-content: center; }
.u-gap-0 { gap: 0; }
.u-gap-2 { gap: .5rem; }
.u-gap-3 { gap: .75rem; }
.u-gap-4 { gap: 1rem; }
.u-gap-6 { gap: 1.5rem; }
.u-mt-4 { margin-top: 1rem; }
.u-mb-4 { margin-bottom: 1rem; }
.u-pt-4 { padding-top: 1rem; }
.u-pb-4 { padding-bottom: 1rem; }
.u-px-2 { padding-left: .5rem; padding-right: .5rem; }
.u-px-4 { padding-left: 1rem; padding-right: 1rem; }
.u-py-2 { padding-top: .5rem; padding-bottom: .5rem; }
.u-order-1,
.u-order-1\@md,
.u-order-1\@lg,
.u-order-1\@xl { order: 1; }
.u-order-2,
.u-order-2\@md,
.u-order-2\@lg,
.u-order-2\@xl { order: 2; }
.u-rounded { border-radius: var(--radius-sm); }
.u-shadow-sm { box-shadow: var(--shadow-sm); }
.u-shadow { box-shadow: var(--shadow); }
.u-text-muted { color: var(--color-muted); }
.u-text-center { text-align: center; }
.u-w-full { width: 100%; }

/* Aspect ratios and media placeholders */
.u-aspect { position: relative; width: 100%; overflow: hidden; background: #f3f4f6; }
.u-aspect > img, .u-aspect > picture, .u-aspect > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.u-aspect-1x1 { aspect-ratio: 1 / 1; }
.u-aspect-4x3 { aspect-ratio: 4 / 3; }
.u-aspect-16x9 { aspect-ratio: 16 / 9; }

/* Buttons */
.c-button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.5rem; padding: .5rem 1rem; border-radius: var(--radius-sm); border: 1px solid transparent; background: var(--color-border); color: #111827; text-decoration: none; font-weight: 600; line-height: 1.2; transition: background .2s ease, color .2s ease, border-color .2s ease, transform .02s ease; }
.c-button:hover { filter: brightness(0.98); }
.c-button:active { transform: translateY(1px); }
.c-button:disabled, .c-button[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }

.c-button--primary { background: var(--color-primary); color: #fff; }
.c-button--primary:hover { background: var(--color-primary-700); }
.c-button--secondary { background: #fff; color: var(--color-primary); border-color: var(--color-primary); }
.c-button--secondary:hover { background: var(--color-primary-50); }
.c-button--ghost { background: transparent; color: var(--color-primary); border-color: transparent; }
.c-button--ghost:hover { background: var(--color-primary-50); }

/* Legacy button shims */
.btn { /* LEGACY shim to new button */ }
.btn, .apply-button { 
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.5rem;
  padding: .5rem 1rem; border-radius: var(--radius-sm); border: 1px solid transparent; background: var(--color-primary); color: #fff; font-weight: 600; text-decoration: none;
}
.btn:hover, .apply-button:hover { background: var(--color-primary-700); }

/* Navigation */
.c-topbar { position: sticky; top: 0; z-index: 100; background: #fff; border-bottom: 1px solid var(--color-border); }
.c-topbar__row { min-height: 56px; }
.c-nav__toggle { display: inline-flex; align-items: center; padding: .25rem .5rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); }
.c-nav { width: auto; flex: 1 1 100%; min-width: 0; }
.c-nav__list { display: flex; flex-wrap: wrap; gap: 1rem; list-style: none; margin: 0; padding: 0; }
.c-nav__link { display: inline-flex; padding: .25rem .5rem; color: inherit; text-decoration: none; border-radius: var(--radius-sm); }
.c-nav__link:hover, .c-nav__link:focus-visible { background: var(--color-primary-50); }

/* Cards */
.c-card { display: flex; flex-direction: column; border: 1px solid var(--color-border); border-radius: var(--radius-sm); overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); }
.c-card__media img { width: 100%; height: auto; display: block; }
.c-card__body { padding: 1rem; }
.c-card__title { font-size: 1rem; margin: 0 0 .25rem; }
.c-card__meta { font-size: .875rem; color: var(--color-muted); }

.job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

.job-grid .grid-sb-wrap {
  float: none;
  width: 100% !important;
  padding: 0;
}

.job-grid .col-md-4 {
  flex: none;
  max-width: none;
}

.job-grid .c-grid-card {
  height: 100%;
}

/* Sidebar + widgets */
.c-sidebar { display: block; }
.c-sidebar--sticky { position: sticky; top: clamp(70px, 8vh, 110px); }
.c-widget { border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: #fff; box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 1rem; }
.c-widget__header { padding: .75rem 1rem; background: #f9fafb; border-bottom: 1px solid var(--color-border); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .75rem; color: #6b7280; }
.c-widget__body { padding: 1rem; }
.c-list-reset { list-style: none; margin: 0; padding: 0; }
.c-media.c-media--sm { gap: .75rem; }
.c-media.c-media--sm .c-media__img { width: 64px; height: 64px; }
.c-media.c-media--sm .c-media__img img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }
.c-widget a { color: inherit; text-decoration: none; }
.c-widget a:hover { color: var(--color-accent); text-decoration: underline; }

/* Grid cards used in list pages (keeps Isotope hooks) */
.c-grid-card { display: flex; flex-direction: column; height: 100%; border: 1px solid var(--color-border); border-radius: var(--radius-sm); overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); }
.c-grid-card__media { display: block; }
.c-grid-card__body { padding: .75rem 1rem; display: flex; flex-direction: column; gap: .25rem; flex: 1 1 auto; }
.c-grid-card__title { font-size: 1rem; margin: 0; }
.c-grid-card__title a { color: inherit; text-decoration: none; }
.c-grid-card__title a:hover { color: var(--color-accent); text-decoration: underline; }

/* Forms */
.c-input { width: 100%; padding: .5rem .75rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: #fff; }
.c-input:focus-visible { border-color: var(--color-primary); box-shadow: 0 0 0 4px var(--color-primary-50); }
.c-label { font-weight: 600; font-size: .875rem; margin-bottom: .25rem; display: inline-block; }

/* Media blocks */
.c-media { display: flex; gap: 1rem; align-items: flex-start; }
.c-media__img { flex: 0 0 auto; }
.c-media__body { flex: 1 1 auto; min-width: 0; }

/* Responsive helpers */
.hide-sm { display: none !important; }
.show-sm { display: inline-block; }

/* Page/section helpers */
.section { padding-block: 2rem; }
.section--muted { background: #f9fafb; }

/* Legacy alignment shims (non-destructive) */
.fl-right { float: none; }
.fl-left { float: none; }

/* NEW: Override legacy floats in two-column content + sidebar layout */
.article-holder.l-row .col-wrap,
.article-holder.l-row .main-sidebar { float: none; width: auto; }
.article-holder.l-row .main-sidebar { padding-left: 0; }
.article-holder.l-row > .col-wrap,
.article-holder.l-row > .article-wrap {
  flex: 2 1 clamp(320px, 66.6667%, 100%);
  max-width: 100%;
}
.article-holder.l-row > .main-sidebar {
  flex: 1 1 clamp(260px, 20.3333%, 100%);
  max-width: 100%;
}

/* Images responsiveness guard */
main img, article img, .content img { max-width: 100%; height: auto; }

/* Search Bar Styles */
.search-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 15px 0;
}

.search-form {
  width: 100%;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  height: 44px;
}

.search-input-wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-50);
}

.search-input {
  flex: 1;
  border: none;
  padding: 0 1rem;
  font-size: 0.9375rem;
  outline: none;
  background: transparent;
  color: var(--color-fg);
  font-family: inherit;
  height: 100%;
}

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


.search-button {
  background: #04344D;
  border: none;
  padding: 0 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  height: 100%;
  border-radius: 0 999px 999px 0;
}

.search-button:hover {
  background: #057389;
}

.search-button:active {
  transform: scale(0.98);
}

.search-button svg {
  color: #fff;
  display: block;
  width: 18px;
  height: 18px;
}

.search-button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Header-specific search bar */
.header-search-bar {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.header-search-bar .search-container {
  padding: 0;
  margin: 0;
  max-width: 340px;
  min-width: 280px;
}

.header-search-bar .search-input-wrapper {
  height: 40px;
  box-shadow: var(--shadow-sm);
}

.header-search-bar .search-input {
  font-size: 1.175rem;
  padding: 0 0.875rem;
}

.header-search-bar .search-button {
  padding: 0 1rem;
}

.header-search-bar .search-button svg {
  width: 16px;
  height: 16px;
}

/* Responsive search bar */
@media (max-width: 1024px) {
  .header-search-bar .search-container {
    max-width: 260px;
    min-width: 220px;
  }
}

@media (max-width: 768px) {
  .search-container {
    padding: 10px 0;
    max-width: 100%;
  }
  
  .search-input-wrapper {
    height: 42px;
  }
  
  .search-input {
    font-size: 0.875rem;
    padding: 0 0.875rem;
  }
  
  .search-button {
    padding: 0 1rem;
  }
  
  .header-search-bar {
    width: 100%;
    order: 3;
    margin-top: 0.75rem;
  }
  
  .header-search-bar .search-container {
    max-width: 100%;
    min-width: 100%;
  }
  
  .c-topbar__row {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .search-input {
    font-size: 0.875rem;
    padding: 0 0.75rem;
  }
  
  .search-button {
    padding: 0 0.875rem;
  }
}

/* Category Dropdown Styles */
.category-dropdown-wrapper {
  display: inline-flex;
  align-items: center;
}

.category-select {
  padding: 0.25rem 2rem 0.25rem 0.75rem;
  border: none;
  border-radius: var(--radius-sm);
  background-color: var(--color-primary);
  color: #fff;
  font-size: inherit;
  font-family: inherit;
  font-weight: inherit;
  cursor: pointer;
  transition: background-color 0.2s ease;
  background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%228%22%20viewBox%3D%220%200%2012%208%22%3E%3Cpath%20fill%3D%22%23ffffff%22%20d%3D%22M1.41%200L6%204.59%2010.59%200%2012%201.42l-6%206-6-6z%22%2F%3E%3C%2Fsvg%3E');
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 10px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-width: auto;
  height: auto;
  box-shadow: none;
}

.category-select:hover {
  background-color: var(--color-accent);
}

.category-select:focus,
.category-select:focus-visible {
  outline: none;
  background-color: var(--color-accent);
}

.category-select option {
  background: #fff;
  color: var(--color-fg);
  padding: 0.5rem;
}

/* Header-specific category dropdown */
.header-category-dropdown {
  display: flex;
  align-items: center;
  margin-right: 0;
}

.header-category-dropdown .category-select {
  min-width: auto;
  padding: 0.25rem 1.75rem 0.25rem 0.5rem;
  font-size: inherit;
}

@media (max-width: 1024px) {
  .header-category-dropdown .category-select {
    min-width: auto;
    font-size: inherit;
  }
}

@media (max-width: 768px) {
  .header-category-dropdown {
    order: 2;
    margin-right: 0;
    margin-top: 0;
    width: auto;
  }
  
  .header-category-dropdown .category-dropdown-wrapper {
    width: auto;
  }
  
  .header-category-dropdown .category-select {
    width: auto;
    min-width: auto;
  }
}

/* ==========================================================================
   Post Breadcrumb Styles
   ========================================================================== */

.post-breadcrumb {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--color-bg-light, #f8fafc);
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  font-size: 1rem;
  color: var(--color-muted);
  line-height: 1.5;
}

.breadcrumb-item a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 600;
}

.breadcrumb-item a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.breadcrumb-home-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  max-width: 20px;
  color: var(--color-primary);
  flex-shrink: 0;
}

.breadcrumb-home-text {
  font-weight: 600;
}

.breadcrumb-item a:hover .breadcrumb-home-icon {
  color: var(--color-accent);
}

.breadcrumb-separator {
  width: 18px;
  height: 18px;
  min-width: 18px;
  max-width: 18px;
  color: var(--color-muted);
  margin: 0 0.25rem;
  flex-shrink: 0;
}

.breadcrumb-current {
  color: var(--color-fg);
  font-weight: 700;
  font-size: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Post Category Section (Bottom of Post)
   ========================================================================== */

.post-category-section {
  margin: 3rem 0;
  padding: 2.5rem;
  background: var(--color-bg-light, #f8fafc);
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.post-category-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-fg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 1.25rem 0;
}

.post-category-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.post-category-tag {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  background: var(--color-primary);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 24px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.post-category-tag:hover {
  background: var(--color-primary-dark, #022a3d);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(4, 52, 77, 0.2);
}

.category-separator {
  color: var(--color-text-muted);
  font-size: 1.25rem;
  font-weight: 600;
}

.post-category-links {
  border-top: 1px solid var(--color-border);
  padding-top: 1.5rem;
  margin-top: 1rem;
}

.category-explore-text {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin: 0 0 1.25rem 0;
  font-weight: 500;
}

.category-explore-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  margin-right: 0.75rem;
  margin-bottom: 0.75rem;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 8px);
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.category-explore-link:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(4, 52, 77, 0.1);
}

.category-link-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.category-explore-link:hover .category-link-icon {
  transform: translateX(2px);
}

@media (max-width: 768px) {
  .post-category-section {
    padding: 1rem;
    margin: 1.5rem 0;
  }
  
  .post-category-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
  }
  
  .category-explore-link {
    width: 100%;
    justify-content: space-between;
    margin-right: 0;
  }
}

