/* OSAG portal — shared layout, year groups, homepage, RTL */

.document-filters-wrap {
  margin-bottom: 28px;
}

.document-filters {
  background: var(--card, #fff);
  border: 1px solid var(--line, #e6eef6);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(44, 62, 80, 0.06);
}

.document-filters-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
}

.document-filter-field span,
.document-filter-label-spacer {
  display: block;
  min-height: 18px;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--ink, #2c3e50);
  font-size: 13px;
  line-height: 18px;
}

.document-filter-label-spacer {
  visibility: hidden;
  pointer-events: none;
}

.document-filter-input,
.document-filters select,
.document-filters input[type="text"] {
  width: 100%;
  border: 1.5px solid var(--line, #d5e4f3);
  border-radius: 10px;
  padding: 8px 12px;
  min-height: 42px;
  background: var(--sky-50, #f4fbff);
  color: var(--ink, #1d2b3a);
}

.document-filter-submit {
  width: 100%;
  border: none;
}

/* Year-grouped official bulletins */
.year-archive {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.year-archive-card {
  background: #fff;
  border: 1px solid #e6eef6;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(44, 62, 80, 0.06);
}

.year-archive-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: linear-gradient(135deg, #418fde 0%, #2d5016 100%);
  color: #fff;
}

.year-archive-header h3 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.year-archive-count {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
}

.year-archive-body {
  padding: 18px 22px 22px;
}

.year-group-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 14px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
  color: #2c3e50;
}

.year-group-label.yearly {
  background: #f0f7ff;
  color: #418fde;
}

.bulletin-book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

.bulletin-book-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1.5px solid #e6eef6;
  border-radius: 14px;
  padding: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.bulletin-book-card:hover {
  transform: translateY(-3px);
  border-color: #418fde;
  box-shadow: 0 10px 22px rgba(65, 143, 222, 0.15);
  text-decoration: none;
  color: inherit;
}

.bulletin-book-card h4 {
  margin: 0 0 6px;
  font-size: 16px;
  color: #2c3e50;
}

.bulletin-book-card p {
  margin: 0;
  color: #667;
  font-size: 13px;
}

.bulletin-book-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.year-card {
  display: block;
  text-align: center;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 32px 16px;
  box-shadow: 0 8px 24px rgba(44, 62, 80, 0.06);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.year-card:hover {
  transform: translateY(-5px);
  border-color: #418fde;
  text-decoration: none;
  color: inherit;
}

.year-card-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #418fde 0%, #2d5016 100%);
  color: #fff;
  font-size: 28px;
  box-shadow: 0 4px 15px rgba(65, 143, 222, 0.3);
}

.year-card h3 {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 700;
  color: #2c3e50;
}

.year-card-meta {
  display: inline-block;
  background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
  color: #2c3e50;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 13px;
}

/* Homepage entrance */
.home-hero {
  position: relative;
  padding: 72px 0 80px;
  background: linear-gradient(180deg, #b4d7f4 0%, #b4d7f4 56%, #ffffff 100%);
}

.home-hero-kicker {
  display: inline-block;
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 24px;
  font-weight: 800;
  color: #418fde;
  margin-bottom: 14px;
  line-height: 1.35;
}

.home-hero h1.home-hero-kicker {
  font-size: clamp(18px, 2.3vw, 26px);
  font-weight: 700;
  color: #1f5f9e;
  line-height: 1.3;
  margin-bottom: 0;
  max-width: none;
}

.home-hero p {
  max-width: 58ch;
  margin-bottom: 28px;
}

.home-search {
  display: flex;
  max-width: 640px;
  background: #fff;
  border-radius: 999px;
  padding: 6px;
  box-shadow: 0 12px 36px rgba(65, 143, 222, 0.16);
  border: 1px solid #dceaf7;
}

.home-search input {
  flex: 1;
  border: 0;
  outline: none;
  padding: 12px 20px;
  background: transparent;
  font-size: 16px;
}

.home-search button {
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  background: linear-gradient(135deg, #418fde 0%, #2d5016 100%);
  color: #fff;
  font-weight: 700;
}

.home-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.home-quick-links a {
  background: #fff;
  border: 1px solid #dceaf7;
  color: #2c3e50;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.home-quick-links a:hover {
  border-color: #418fde;
  color: #418fde;
}

.services-compact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.service-compact-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid #e6eef6;
  min-height: 100%;
}

.service-compact-card i {
  color: #418fde;
  font-size: 22px;
  margin-bottom: 10px;
}

.service-compact-card h5 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  white-space: normal;
}

.service-compact-card p {
  margin: 0;
  color: #667;
  font-size: 14px;
}

/* Language switcher */
.language-switcher {
  position: relative;
  display: inline-block;
  margin: 3px 10px;
  z-index: 10000;
}

.lang-toggle {
  background: linear-gradient(135deg, #418fde 0%, #2d5016 100%);
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.lang-dropdown {
  position: absolute;
  top: 100%;
  inset-inline-end: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  z-index: 99999;
  display: none;
  overflow: hidden;
  margin-top: 5px;
  border: 1px solid #e9ecef;
  min-width: 190px;
}

.lang-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  color: #2c3e50;
  text-decoration: none;
}

.lang-dropdown a.is-active {
  background: #f0f7ff;
  border-inline-start: 3px solid #418fde;
}

.lang-flag {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 10px;
}

.lang-flag.en { background: linear-gradient(135deg, #dc3545 0%, #0d6efd 100%); }
.lang-flag.so { background: linear-gradient(135deg, #418fde 0%, #2d5016 100%); }
.lang-flag.ar { background: linear-gradient(135deg, #006c35 0%, #ce1126 100%); }

/* RTL */
[dir="rtl"] .navbar-nav {
  margin-right: auto;
  margin-left: 0;
}

[dir="rtl"] .ml-auto {
  margin-right: auto !important;
  margin-left: 0 !important;
}

[dir="rtl"] .home-search button,
[dir="rtl"] .document-filter-submit {
  direction: rtl;
}

[dir="rtl"] .table-modern th,
[dir="rtl"] .table-modern td {
  text-align: right;
}

[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
  padding-left: 0.5rem;
  padding-right: 0;
}
