/* ================================
   Legislations – Page Layout
   ================================ */

.legislations-page {
  direction: rtl;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  box-sizing: border-box;
}


.legislations-breadcrumb {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 24px;
}

.legislations-breadcrumb a {
  color: #2563eb;
  text-decoration: none;
}

.legislations-breadcrumb a:hover {
  text-decoration: underline;
}

.legislations-breadcrumb span {
  margin: 0 6px;
  color: #999;
}


.legislations-header {
  background: linear-gradient(135deg, #f5f8fc, #ffffff);
  padding: 48px 40px;
  border-radius: 12px;
  margin-bottom: 40px;
  border-right: 6px solid #003366;
}

.legislations-title {
  font-size: 40px;
  font-weight: 800;
  margin: 0 0 16px;
  color: #002b5c;
}


.legislations-description {
  font-size: 18px;
  line-height: 1.9;
  color: #444;
  max-width: 900px;
}

.legislations-filters {
  background-color: #f7f7f7;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 24px;
  margin-bottom: 48px;
}

.legislations-filters form {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.legislations-filters .form-item {
  display: flex;
  flex-direction: column;
}



.legislations-filters label {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}


.legislations-filters input,
.legislations-filters select {
  height: 36px;
  padding: 4px 10px;
  min-width: 140px;
}

.legislations-filters .form-actions {
  display: flex;
  gap: 8px;
}

.legislations-filters button {
  height: 36px;
  padding: 0 18px;
  font-weight: 600;
}

.legislations-content {
  display: block;
}

.legislations-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 32px;
}

.legislations-pager {
  margin-top: 40px;
  text-align: center;
}


/* ================================
   Decision Card
   ================================ 

.legislations-list .views-row {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px 24px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  min-height: 260px;
}

.legislations-list .views-row:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
}


.legislations-list .views-row h2,
.legislations-list .views-row h3,
.legislations-list .views-row .views-field-title a {
  font-size: 20px;
  font-weight: 600;
  color: #003366;
  text-decoration: none;
}

.legislations-list .views-row .views-field-title a:hover {
  text-decoration: underline;
}


.legislations-list .views-row .views-field {
  font-size: 14px;
  color: #555;
  margin-top: 8px;
}

.legislations-list .views-row .views-field span.views-label {
  font-weight: 600;
  margin-left: 6px;
  color: #333;
}


.legislations-list a[href$=".pdf"] {
  margin-top: auto;
  align-self: flex-start;
  font-weight: 600;
  border-radius: 6s: 6px;
}

.legislations-list .views-row a[href$=".pdf"] {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 14px;
  background-color: #005aa7;
  color: #fff;
  font-size: 14px;
  border-radius: 4px;
  text-decoration: none;
}

.legislations-list .views-row a[href$=".pdf"]:hover {
  background-color: #004080;
}


.legislations-list .views-row > *:first-child {
  margin-top: 0;
}

.legislations-list .views-row > *:last-child {
  margin-bottom: 0;
}
*/

/* ================================
   Inline Field Layout
   ================================ 

.legislations-list .views-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 1.6;
}

.legislations-list .views-field span.views-label {
  min-width: 110px;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
}

*/

/* ================================
   Decision Card – Final Polish
   ================================ */

.decision-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 28px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* رقم الوثيقة */
.decision-number {
  position: absolute;
  top: 16px;
  left: 16px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

/* العنوان */
.decision-title {
  font-size: 22px;
  font-weight: 700;
  color: #003366;
  margin: 0 0 10px;
}

/* البيات
.decision-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.meta-row {
  display: flex;
  gap: 8px;
  font-size: 14px;
}

.meta-label {
  min-width: 110px;
  font-weight: 600;
  color: #1f2937;
}
*/

/* نوع الوثيقة */
.decision-type {
  background: #eef2ff;
  color: #3730a3;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
}

/* ===== Decision Status – FINAL (Stable) ===== */

.decision-status {
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
}

/* ساري */
.status-active {
  background: #ecfdf5;
  color: #065f46;
}

/* ملغي */
.status-cancelled {
  background: #fef2f2;
  color: #991b1b;
}

/* معدل */
.status-amended {
  background: #fffbeb;
  color: #92400e;
}

/* احتياط */
.status-unknown {
  background: #f1f5f9;
  color: #475569;
}



/* زر التحميل */
.decision-actions a {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #005aa7;
  color: #ffffff;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}

.decision-actions a::before {
  content: "⬇";
  font-size: 16px;
}

.decision-actions a:hover {
  background: #004a8f;
}


@media (max-width: 768px) {

  .legislations-list {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .decision-card {
    padding: 20px;
  }

  .decision-title {
    font-size: 18px;
  }
}

@media (max-width: 768px) {

  .legislations-filters form {
    flex-direction: column;
    align-items: stretch;
  }

  .legislations-filters .form-actions {
    justify-content: flex-start;
  }
}


/* ===== No Results Message ===== */

.legislations-empty {
  padding: 40px 24px;
  margin-top: 24px;
  text-align: center;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: 12px;
  font-size: 16px;
  color: #4b5563;
  line-height: 1.8;
}


/* ================================
   Mobile Enhancements – FINAL
   ================================ */

@media (max-width: 768px) {

  /* Header */
  .legislations-header {
    padding: 24px 16px;
    border-radius: 12px;
  }

  .legislations-title {
    font-size: 26px;
    margin-bottom: 12px;
  }

  .legislations-description {
    font-size: 15px;
    line-height: 1.7;
  }

  /* Filters */
  .legislations-filters {
    padding: 12px 16px;
  }

  .legislations-filters input,
  .legislations-filters button {
    width: 100%;
  }

  /* Cards */
  .decision-card {
    padding: 20px 16px;
  }

  .decision-title {
    font-size: 17px;
  }

  .decision-number {
    top: 12px;
    left: 12px;
    font-size: 12px;
    padding: 4px 8px;
  }

  .decision-actions a {
    width: 100%;
    justify-content: center;
    font-size: 15px;
  }
}


/* ================================
   Page Closing Footer
   ================================ */

.legislations-page-footer {
  margin-top: 60px;
  padding: 32px 16px;
  background: #f8fafc;
  border-top: 1px solid #e5e7eb;
}

.legislations-page-footer .footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.legislations-page-footer .footer-meta {
  font-size: 14px;
  color: #334155;
  margin-bottom: 8px;
}

.legislations-page-footer .footer-note {
  font-size: 15px;
  color: #475569;
}


/* ================================
   Node – Legislation Decision
   ================================ */

.legislation-node {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px;
}

.legislation-header {
  margin-bottom: 32px;
}

.legislation-title {
  font-size: 32px;
  font-weight: 800;
  margin: 16px 0;
}

.legislation-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.badge-type {
  background: #eef2ff;
  color: #3730a3;
}

.badge-date {
  background: #f1f5f9;
  color: #334155;
}

/* Status colors */
.badge-status {
  font-weight: 700;
}

.status-active {
  background: #e6f6ef;
  color: #046c4e;
}

.status-cancelled {
  background: #fde8e8;
  color: #9b1c1c;
}

.status-amended {
  background: #fff7ed;
  color: #92400e;
}

.status-unknown {
  background: #f1f5f9;
  color: #475569;
}



.legislation-content {
  font-size: 16px;
  line-height: 1.9;
  margin-bottom: 32px;
}

.download-button {
  display: inline-block;
  padding: 12px 20px;
  background: #005aa7;
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}

.download-button:hover {
  background: #004a8f;
}

.legislation-download {
  margin-top: 32px;
  text-align: center;
}

.download-button {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: 999px;
}


.legislation-footer {
  margin-top: 64px;
  padding: 32px 0;
  border-top: 1px solid #e5e7eb;
  text-align: center;
  color: #64748b;
  font-size: 14px;
  background: linear-gradient(to top, #f8fafc, transparent);
}




/* =========================
   Legislation Meta Card
   ========================= */

.legislation-meta-card {
  width: 100%;
  max-width: 100%;
  margin: 32px 0;
  padding: 24px 32px;
  background: #f9fafb;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
}

.meta-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px dashed #e5e7eb;
}

.meta-row:last-child {
  border-bottom: none;
}

.meta-label {
  font-size: 18px;
  color: #64748b;
  font-weight: 600;
  min-width: 110px;
  text-align: right;
}

.meta-value {
  font-size: 15px;
  color: #0f172a;
  font-weight: 500;
  text-align: center;
}

.meta-row-tags .meta-value {
  line-height: 1.6;
}


.legislation-summary {
  margin-top: 20px;
  font-size: 16px;
  line-height: 1.9;
  color: #0f172a;
}



@media (max-width: 768px) {

  .legislation-title {
    font-size: 26px;
    line-height: 1.4;
  }

  .legislation-meta-card {
    padding: 20px;
  }

  .meta-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .meta-label {
    font-size: 18px;
    text-align: right;
  }

  .meta-value {
    text-align: center;
    font-size: 15px;
  }

  .download-button {
    width: 100%;
  }
}



/* Archive Table */
.legislation-archive-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.legislation-archive-table th,
.legislation-archive-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #eee;
  text-align: right;
  width: min-content;
}

.legislation-archive-table th {
  background: #f7f9fc;
  font-weight: 600;
  font-size: 14px;
}

.archive-row:hover {
  background: #fafbfd;
}

/* Status pills */
.status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}

.status-active {
  background: #e6f7ef;
  color: #0a7a4a;
}

.status-cancelled {
  background: #fdecea;
  color: #b42318;
}

.status-amended {
  background: #fff6e5;
  color: #9a6700;
}


/* Archive filters layout */
.legislations-filters form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  align-items: end;
}

/* Year range box */
.legislations-filters fieldset {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
}

.legislations-filters legend {
  font-weight: 600;
  color: #334155;
  padding: 0 8px;
}

/* Inputs */
.legislations-filters input,
.legislations-filters select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
}

/* Actions */
.legislations-filters .form-actions {
  display: flex;
  gap: 8px;
}


.legislations-archive-link {
  margin-top: 32px;
  text-align: center;
}

.legislations-archive-link a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #f8fafc;
  color: #1e40af;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #e2e8f0;
}

.legislations-archive-link a:hover {
  background: #eef2ff;
}





/* =========================
   Archive – Mobile Layout
   ========================= */
@media (max-width: 768px) {

  .legislation-archive-table thead {
    display: none;
  }

  .legislation-archive-table,
  .legislation-archive-table tbody,
  .legislation-archive-table tr,
  .legislation-archive-table td {
    display: block;
    width: 100%;
  }

  .legislation-archive-table tr {
    background: #fff;
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
  }

  .legislation-archive-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border: none;
    font-size: 14px;
  }

  .legislation-archive-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #475569;
  }
  
  .legislation-archive-table .col-download {
    margin-top: 10px;
  }

  .legislation-archive-table .col-download a {
    display: flex;
    width: 100%;
    text-align: center;
    background: #1c4684;
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
  }

}


.legislations-filters select {
  background-color: #fff;
  font-weight: 500;
}







