/**
 * @file
 * Styles for Appellate Advocacy block.
 */

/* Detail Page Layout */
.litigation-case-detail__wrapper {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  max-width: 1280px;
  /* padding: 0 1rem; */
}

/* Sidebar - Case Information */
.litigation-case-detail__sidebar {
  position: sticky;
  top: 2rem;
  align-self: start;
}

/* Sidebar redesign follows the teal/Open Sans/Roboto conventions already
   established elsewhere on this page. Figma MCP is rate-limited for this
   node, so exact values are inferred from sibling components already
   confirmed from this same file: the light transparent teal border matches
   the pager "Previous" button border (rgba(41,94,99,0.17)), and the topic
   pill reuses the exact .litigation-case-tag chip styling. */
.case-info-box {
  background: #f5f5f5;
  border-radius: 15px;
  padding: 30px 0;
}

.case-info-box__title {
  font-family: "Open Sans", sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 30px;
  margin: 0 0 20px 0;
  color: #295e63;
  padding: 0 30px;
}

/* Horizontal divider between each item (Filing Date / Topics / Court),
   matching the same border-top separator pattern already used for
   .litigation-case-detail__section in the main content area. */
.case-info-box__item {
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid #d8dcde;
}

.case-info-box__item:first-of-type {
  border-top: 0 !important;
  padding-top: 0 !important;
}

.case-info-box__label {
  font-family: 'Open Sans', sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  color: #111827;
  margin-bottom: 8px;
  padding: 0 30px;
}

.case-info-box__value {
  font-family: "Open Sans", sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 27px;
  color: #111827;
  padding: 0 30px;
}

/* Each topic renders as a plain nested <div><a>...</a></div> (Drupal core's
   field.html.twig does not add a `.field__item` class), so style the link
   itself rather than a non-existent `.field__item` wrapper. */
.case-info-box__topics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* field.html.twig wraps each value (and the "multiple" group) in its own
   <div> with no distinguishing class - flatten those wrapper divs so the
   flex-wrap above applies directly to the <a> tags, not to a single
   block-level wrapper. */
.case-info-box__topics > div,
.case-info-box__topics > div > div {
  display: contents;
}

.case-info-box__topics a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2edeb;
  color: #295e63;
  padding: 1px 18px;
  border-radius: 30px;
  font-family: "Open Sans", sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 30px;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.3s;
}

.case-info-box__topics a:hover {
  background: #d0ded9;
}

/* Main Content Area */
.litigation-case-detail__main {
  border: 0 solid #1a5490;
  border-radius: 8px;
  padding: 0 2rem;
  padding-right: 0;
  margin-bottom: 2rem;
}

.litigation-case-detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 25px;
}

.litigation-case-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2edeb;
  color: #295e63;
  padding: 1px 18px;
  border-radius: 30px;
  font-family: "Open Sans", sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 30px;
  /* white-space: nowrap; */
}

.litigation-case-detail__title {
  font-family: "Open Sans", sans-serif;
  font-size: 30px;
  font-weight: 700;
  color: #295e63;
  margin: 0 0 12px 0;
  line-height: normal;
}

.litigation-case-detail__subtitle {
  font-family: "Roboto", sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: #646F78;
  line-height: 27px;
  max-width: 836px;
  margin-bottom: 2rem;
}

.litigation-case-detail__section {
  margin-top: 2rem;
  /* padding-top: 2rem;
  border-top: 1px solid #e0e0e0; */
}

.litigation-case-detail__section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.litigation-case-detail__section-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 1rem 0;
  font-family: 'Open Sans';
}

.litigation-case-detail__section-content {
  color: #646F78;
  font-family: Open Sans;
  font-weight: 400;
  font-size: 18px;
  line-height: 27px;
  letter-spacing: 0%;
}

/* =========================================================
   DOCUMENTS TABLE
========================================================= */

.documents-table {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;

  border: 1px solid #d8d8d8 !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;

  table-layout: fixed !important;

  box-sizing: border-box !important;
}


/* =========================================================
   COLUMN WIDTH
========================================================= */

/* Document */
.documents-table th:nth-child(1),
.documents-table td:nth-child(1) {
  width: 48% !important;
}

.documents-table td:nth-child(1) {
  width: 48% !important;
  color: #295E63 !important;
  font-family: 'Open Sans' !important;
  font-weight: 600 !important;
  font-size: 15px !important;
}

/* Date */
.documents-table th:nth-child(2),
.documents-table td:nth-child(2) {
  width: 32% !important;
}

/* View Document */
.documents-table th:nth-child(3),
.documents-table td:nth-child(3) {
  width: 30% !important;
}


/* =========================================================
   HEADER
========================================================= */

.documents-table thead th {
  padding: 15px 30px !important;

  /* border: 1px solid #d8d8d8 !important; */

  background: transparent !important;
  font-family: 'Open Sans' !important;
  color: #111827 !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  text-align: left !important;
  vertical-align: middle !important;

  box-sizing: border-box !important;
}


/* =========================================================
   BODY CELLS
========================================================= */

.documents-table tbody td {
    padding: 12px 30px !important;
    border-top: 1px solid #d8d8d8 !important;
    background: transparent !important;
    color: #111827 !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    text-align: left !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    font-family: 'Open Sans';

  /*
   * Very important for long PDF filenames.
   */
  min-width: 0 !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}


/* =========================================================
   DOCUMENT ICON + TITLE
========================================================= */

.documents-table .document-icon {
  display: inline-block !important;

  margin-right: 8px !important;

  color: #216574 !important;

  font-size: 16px !important;
  line-height: 1 !important;

  vertical-align: middle !important;
}


/* =========================================================
   DOCUMENT LINK
========================================================= */

.documents-table .document-link {
  font-family: 'Open Sans' !important;
  font-weight: 600 !important;
  font-size: 16px !important;
  line-height: 30px !important;
  letter-spacing: 0%;
  text-decoration: underline !important;
  text-decoration-style: solid !important;
  text-decoration-thickness: 0% !important;
  text-decoration-skip-ink: auto !important;
}

.documents-table .document-link:hover,
.documents-table .document-link:focus {
  color: #174b57 !important;
}


/* =========================================================
   THIRD COLUMN
========================================================= */

.documents-table th:nth-child(3),
.documents-table td:nth-child(3) {
  text-align: center !important;
}


/* =========================================================
   ROW HEIGHT / BORDER
========================================================= */

.documents-table tbody tr {
  border: 0 !important;
}

.documents-table tbody tr td {
  height: 50px !important;
}

body.page-node-type-impact-litigation .appellate-advocacy-block {
  padding: 0;
}

@media (min-width: 1440px) {
  body.page-node-type-impact-litigation main>div.container {
    padding-left: 0 !important;
  }
}


/* =========================================================
   MOBILE
========================================================= */

@media screen and (max-width: 767px) {

  .documents-table {
    width: 100% !important;
    max-width: 100% !important;

    table-layout: fixed !important;

    overflow: hidden !important;
  }

  .documents-table thead th,
  .documents-table tbody td {
    padding: 12px 15px !important;

    font-size: 14px !important;
  }

  .documents-table th:nth-child(1),
  .documents-table td:nth-child(1) {
    width: 45% !important;
  }

  .documents-table th:nth-child(2),
  .documents-table td:nth-child(2) {
    width: 30% !important;
  }

  .documents-table th:nth-child(3),
  .documents-table td:nth-child(3) {
    width: 25% !important;
  }

  .documents-table .document-link {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
}



/* Responsive Design */
@media (max-width: 768px) {
  .appellate-advocacy-opinions__featured {
    grid-template-columns: 1fr;
  }

  .featured-card__footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (max-width: 680px) {
  .litigation-case-detail__wrapper {
    grid-template-columns: 1fr;
  }

  .litigation-case-detail__sidebar {
    position: static;
  }
}
