/* Companies listing and company detail styles */
/* ===============================
   RESET & BASE
   =============================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #2c3e50;
  background-color: #ffffff;
  overflow-x: hidden;
}

/* Accessibility helpers */

.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;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #5040ae;
  color: #ffffff;
  padding: 8px 10px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 10000;
  transition: top 0.2s ease;
  font-size: 0.9rem;
}

.skip-link:focus {
  top: 6px;
}

/* Focus styles */

:focus-visible {
  outline: 2px solid #5040ae;
  outline-offset: 2px;
}

/* Typography */

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 0.6em;
  color: #1f2933;
}

h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
}

h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.1rem);
}

h3 {
  font-size: clamp(1.25rem, 2.8vw, 1.6rem);
}

p {
  margin-bottom: 1em;
}

a {
  color: #5040ae;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #3b2f96;
  text-decoration: underline;
}

/* Layout helpers */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
}

.main-content {
  padding: 1.5rem 0 3rem;
}

/* ===============================
   HEADER & NAVIGATION
   =============================== */

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.nav {
  padding: 0.75rem 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-logo img {
  width: 160px;
  height: 40px;
  aspect-ratio: 4 / 1;
  display: block;
}

/* Hamburger button (mobile) */

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}

.nav-toggle .hamburger,
.nav-toggle .hamburger::before,
.nav-toggle .hamburger::after {
  display: block;
  width: 22px;
  height: 2px;
  background: #111827;
  border-radius: 2px;
  position: relative;
  transition: 0.2s;
}

.nav-toggle .hamburger::before,
.nav-toggle .hamburger::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle .hamburger::before {
  top: -6px;
}

.nav-toggle .hamburger::after {
  top: 6px;
}

/* Desktop nav */

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-item {
  position: relative;
}

.nav-link {
  color: #111827;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: #5040ae;
}

/* Dropdown */

.nav-item.dropdown .dropdown-toggle {
  cursor: pointer;
}

.nav-item.dropdown .dropdown-toggle::after {
  content: "";
  display: inline-block;
  margin-left: 0.35rem;
  border-width: 4px 4px 0 4px;
  border-style: solid;
  border-color: currentColor transparent transparent transparent;
  vertical-align: middle;
  transition: transform 0.15s;
}

.nav-item.dropdown.open > .dropdown-toggle::after {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 190px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
  padding: 0.25rem 0;
  list-style: none;
  display: none;
  z-index: 1001;
}

.nav-item.dropdown.open > .dropdown-menu {
  display: block;
}

.dropdown-link {
  display: block;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  color: #111827;
}

.dropdown-link:hover {
  background: #f3f4f6;
  color: #5040ae;
}

/* Language selector */

.language-selector select {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
}

/* Mobile nav */

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

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem 1rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease,
      visibility 0.18s ease;
  }

  .nav-menu.active {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    display: block;
    padding: 0.6rem 0;
  }

  .nav-item.dropdown .dropdown-menu {
    position: static;
    box-shadow: none;
    border-radius: 0;
    border: none;
    margin-left: 0;
    margin-top: 0.3rem;
    background: #f9fafb;
  }
}

/* ===============================
   BREADCRUMB
   =============================== */

/* For listing page with .breadcrumb + .breadcrumb-list */
.breadcrumb {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.75rem 0;
}

.breadcrumb-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #6b7280;
}

.breadcrumb-item a {
  color: #4b5563;
}

.breadcrumb-item a:hover {
  color: #111827;
  text-decoration: underline;
}

.breadcrumb-item:not(:last-child)::after {
  content: "/";
  margin-left: 0.4rem;
  color: #9ca3af;
}

/* For detail pages using <section class="breadcrumb"> with simple links */

.breadcrumb nav {
  font-size: 0.85rem;
  color: #6b7280;
}

.breadcrumb nav a {
  color: #4b5563;
}

.breadcrumb nav a:hover {
  color: #111827;
  text-decoration: underline;
}

/* ===============================
   PAGE HEADER (LISTING)
   =============================== */

.page-header {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.page-title {
  font-size: clamp(2rem, 3vw, 2.5rem);
  margin-bottom: 0.4rem;
}

.page-subtitle {
  font-size: 1rem;
  color: #6b7280;
  margin-bottom: 0.4rem;
}

.page-meta {
  font-size: 0.9rem;
  color: #6b7280;
}

/* ===============================
   COMPANY LISTING GRID
   =============================== */

.companies-grid {
  padding: 2rem 0 0;
}

.companies-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
}

.company-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, border-color 0.15s ease;
  will-change: transform;
}

.company-card:hover { transform: translateY(-4px); border-color: #c7d2fe; }

@media (prefers-reduced-motion: reduce) {
  .company-card { transition: none; }
  .company-card:hover { transform: none; }
}

.company-info {
  margin-bottom: 1.25rem;
}

.company-name {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #111827;
}

.company-description {
  font-size: 0.92rem;
  color: #6b7280;
}

.company-actions {
  margin-top: auto;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  min-height: 40px;
  transition: background-color 0.15s ease,
    box-shadow 0.15s ease, transform 0.1s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #ffffff;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4338ca, #4f46e5);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.35);
  transform: translateY(-1px);
}

/* ===============================
   COMPANY DETAIL LAYOUT
   =============================== */

.main-content > .container {
  display: block;
}

/* Top header block for single company */

.company-header {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  padding: 1.75rem 0;
}

.company-header-content {
  display: flex;
  align-items: flex-start;
  gap: 1.75rem;
  flex-wrap: wrap;
}

.company-logo {
  flex-shrink: 0;
  background: #ffffff;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.company-logo img {
  max-width: 130px;
  max-height: 70px;
  object-fit: contain;
}

.company-info-block {
  flex: 1;
  min-width: 0;
}

.company-title {
  font-size: clamp(2rem, 3.2vw, 2.4rem);
  margin-bottom: 0.4rem;
}

.company-subtitle {
  font-size: 1rem;
  color: #6b7280;
  margin-bottom: 0.6rem;
}

.company-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  font-size: 0.88rem;
  color: #6b7280;
}

/* Main text content */

.company-content-wrapper {
  padding: 2rem 0 0;
}

.company-content-wrapper > div {
  max-width: 900px;
}

/* Generic text content */

.company-content-wrapper h1 {
  margin-bottom: 0.75rem;
}

.company-content-wrapper h2 {
  margin-top: 1.5rem;
}

.company-content-wrapper h3 {
  margin-top: 1.25rem;
}

.company-content-wrapper ul,
.company-content-wrapper ol {
  margin: 0.5rem 0 1rem 1.2rem;
  padding-left: 0.75rem;
}

.company-content-wrapper li {
  margin-bottom: 0.4rem;
}

.company-content-wrapper table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.9rem;
}

.company-content-wrapper table th,
.company-content-wrapper table td {
  border: 1px solid #d1d5db;
  padding: 0.5rem 0.6rem;
}

.company-content-wrapper table th {
  background: #f3f4f6;
  font-weight: 600;
}

/* FAQ blocks */

.company-content-wrapper dl {
  margin: 1rem 0 1.5rem;
}

.company-content-wrapper dt {
  font-weight: 600;
  margin-top: 0.6rem;
}

.company-content-wrapper dd {
  margin-left: 0;
  margin-bottom: 0.4rem;
}

/* Generic .wcustomhtml containers from imported content */

.wcustomhtml {
  font-size: 0.96rem;
}

/* Responsive detail layout */

@media (max-width: 768px) {
  .company-header-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .company-meta {
    justify-content: center;
  }

  .company-content-wrapper > div {
    padding: 0 0.25rem;
  }
}

/* ===============================
   FOOTER (BASIC)
   =============================== */

#footer-wrap,
footer.footer {
  background: #111827;
  color: #9ca3af;
  padding: 2.25rem 0 1.75rem;
  margin-top: 2rem;
}

#footer-wrap .container,
footer.footer .container,
.wsite-footer .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.wsite-footer {
  font-size: 0.9rem;
}

.wsite-footer a {
  color: #e5e7eb;
}

.wsite-footer a:hover {
  color: #ffffff;
}

/* ===============================
   MISC
   =============================== */

/* Prevent text jumping when ads / external scripts load by reserving some space if needed */

.ad-slot,
.ad-container {
  min-height: 250px;
}

/* Company hero layout */
.company-hero {
  padding: 1.75rem 0;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.company-hero .container {
  display: flex;
  align-items: center;
  gap: 1.25rem;       /* space between logo and text */
  flex-wrap: wrap;    /* so on very small screens it can wrap nicely */
}

.company-hero img {
  flex-shrink: 0;     /* keep the logo from shrinking */
}

.company-hero h1 {
  margin: 0;          /* remove extra gap above/below */
}

.company-hero p {
  margin: 0.25rem 0 0;
  color: #6b7280;
}

/* =========================================================
   COMPANY APPLICATION FORM LAYOUT & STYLES
   (for .application-form / .job-application-form block)
   ========================================================= */

.application-form {
  padding: 2.5rem 0;
  background-color: #f9fafb;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

.application-form .container {
  max-width: 900px;
  margin: 0 auto;
}

.application-form h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  text-align: center;
}

.application-form .form-description {
  margin: 0 0 1.75rem;
  font-size: 0.95rem;
  color: #4b5563;
  text-align: center;
}

/* Card around the form */
.job-application-form {
  background-color: #ffffff;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

/* Grid layout */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group-full {
  grid-column: 1 / -1;
}

/* Labels & required */
.form-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #111827;
}

.required {
  color: #dc2626;
  font-weight: 600;
  margin-left: 2px;
}

/* Inputs, selects, textarea */
.form-input,
.form-select,
.form-textarea,
.form-file {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #111827;
  background-color: #ffffff;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #9ca3af;
}

/* Focus */
.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.form-file:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

/* File upload styling */
.file-upload {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.form-file {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-label {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px dashed #d1d5db;
  background-color: #f9fafb;
  cursor: pointer;
}

.file-text {
  font-size: 0.85rem;
  color: #6b7280;
}

.file-button {
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  background-color: #2563eb;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Checkbox row */
.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.checkbox-input {
  margin-top: 0.2rem;
  width: 16px;
  height: 16px;
}

.checkbox-label {
  font-size: 0.88rem;
  color: #374151;
}

/* Help, error, success messages */
.form-help {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.form-error {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #b91c1c;
}

.form-messages {
  margin-top: 1.5rem;
}

.form-success,
.form-error-message {
  padding: 0.9rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
}

.form-success {
  background-color: #ecfdf3;
  border: 1px solid #16a34a;
  color: #166534;
}

.form-error-message {
  background-color: #fef2f2;
  border: 1px solid #dc2626;
  color: #b91c1c;
}

/* Button styling (re-use primary button but ensure large version looks right) */
.btn.btn-primary.btn-large,
.btn-primary.btn-large,
.button-primary.btn-large {
  width: 100%;
  padding: 0.75rem 1.4rem;
  font-size: 0.95rem;
  border-radius: 9999px;
}

/* Button internals */
.btn-text {
  display: inline;
}

.btn-loading {
  margin-left: 0.5rem;
  font-size: 0.85rem;
}

/* Responsive: 2 columns on wider screens */
@media (min-width: 768px) {
  .job-application-form {
    padding: 2rem 2rem;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-group-full {
    grid-column: 1 / -1;
  }

  .btn.btn-primary.btn-large {
    width: auto;
    justify-self: flex-start;
  }
}


/* =========================================================
   7. MISSING STYLES FOR COMPANY DETAILS (3R Global type)
   ========================================================= */

/* Main layout container for the details page */
.company-content {
  padding: 2.5rem 0;
  background-color: #f9fafb; /* Matches the hero background */
}

/* The white cards holding content (About, Contact, etc.) */
.info-box {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.info-box h2 {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  color: #111827;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 0.75rem;
}

.info-box h3 {
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #374151;
}

/* Grid layout for "Recruitment Areas" and "Office Locations" */
.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .info-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* SVG Icons next to headers */
.icon {
  width: 28px;
  height: 28px;
  fill: #5040ae; /* Primary brand color */
  flex-shrink: 0;
}

/* Lists styling (Recruitment list, Office list) */
.recruitment-list,
.office-list,
.info-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recruitment-list li,
.office-list li,
.info-box ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  color: #4b5563;
}

/* Add a custom bullet point (check or dot) */
.recruitment-list li::before,
.office-list li::before,
.info-box ul li::before {
  content: "•";
  color: #5040ae;
  font-weight: bold;
  position: absolute;
  left: 0;
  font-size: 1.2em;
  line-height: 1;
}

/* Specific styling for the Contact Box to make it stand out */
.contact-box {
  background: #f0fdf4; /* Light green tint */
  border-color: #bbf7d0;
}

.contact-box h2 {
  border-bottom-color: #dcfce7;
  color: #166534;
}

.contact-box a {
  font-weight: 600;
  color: #15803d;
}

/* FAQ Box Styling */
.faq-box dl {
  margin: 0;
}

.faq-box dt {
  font-weight: 600;
  color: #111827;
  margin-top: 1.25rem;
  font-size: 1.05rem;
}

.faq-box dt:first-child {
  margin-top: 0;
}

.faq-box dd {
  margin-left: 0;
  margin-top: 0.25rem;
  color: #4b5563;
  line-height: 1.6;
}

/* =========================================================
   8. FIXES FOR GENERIC PAGES (Abosta type)
   ========================================================= */

/* Fix for tables appearing in raw HTML pages like Abosta */
.main-content table,
.info-box table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  border-radius: 8px;
  overflow: hidden; /* For rounded corners */
  border: 1px solid #e5e7eb;
}

.main-content table th,
.info-box table th {
  background-color: #f3f4f6;
  color: #111827;
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid #e5e7eb;
}

.main-content table td,
.info-box table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
}

.main-content table tr:last-child td {
  border-bottom: none;
}