/* ProjectProfile — page-mounted overrides on top of companyProfileComponent.css.
   The CompanyProfile component renders inside an <sl-dialog>; here we render
   on a full HTML page, so we need to give the layout its own width/height
   constraints rather than borrowing from the dialog. */

.pp-page {
  position: relative;
  margin: 60px auto 50px;
  max-width: 1250px;
  width: min(95vw, 1250px);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 36, 0.08);
  overflow: hidden;
  min-height: 600px;
}

/* Live owner-quote in the header right slot. The MiniQuote class
   (ASX-primary owners) renders its own card; the qmod widget (NA-primary)
   is wider — we cap width here so the share button still fits. */
.pp-mini-quote {
  display: inline-flex;
  align-items: center;
  max-width: 260px;
  min-width: 0;
  font-size: 13px;
}
.pp-mini-quote:empty { display: none; }
.pp-mini-quote .pp-mini-quote-asx-host {
  width: 100%;
}
.pp-mini-quote .qmodii,
.pp-mini-quote .qtool {
  max-width: 240px;
}

/* Header meta strip — small chips under the project title */
.pp-header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.pp-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: #192342;
  background: #f0f5f5;
  border-radius: 11px;
  white-space: nowrap;
}
.pp-chip--owner {
  cursor: pointer;
  background: #e6f0fb;
  color: #005db5;
}
.pp-chip--owner:hover {
  background: #d3e4f5;
}
.pp-chip--ticker {
  background: #192342;
  color: #fff;
}

/* Project tab: split layout — left = polygon map, right = metadata table */
.pp-project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 24px;
}
@media (max-width: 900px) {
  .pp-project-grid {
    grid-template-columns: 1fr;
  }
}

.pp-map-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pp-map {
  height: 360px;
  background: #eef1f3;
  border-radius: 6px;
  overflow: hidden;
}
.pp-map-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #005db5;
  background: #fff;
  border: 1px solid #d8dde0;
  border-radius: 6px;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease;
  align-self: flex-start;
}
.pp-map-cta:hover {
  background: #f0f5fa;
  border-color: #b8c4cb;
}
.pp-map-cta .material-symbols-outlined {
  font-size: 18px;
}

.pp-meta-table {
  width: 100%;
  border-collapse: collapse;
}
.pp-meta-table th,
.pp-meta-table td {
  padding: 10px 12px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid #eef1f3;
}
.pp-meta-table th {
  width: 40%;
  font-weight: 600;
  color: #586064;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.4px;
}
.pp-meta-table td {
  font-weight: 600;
  color: #192342;
}
.pp-meta-table a {
  color: #005db5;
  text-decoration: none;
}
.pp-meta-table a:hover {
  text-decoration: underline;
}

/* Project profile narrative — comes from volta.project_profile via the
   /api/companies/projects/editor/retrieve endpoint. The body is editor-
   produced HTML, so we apply some sensible reading defaults but keep it
   permissive (images, headings, lists). */
.pp-editor-content {
  padding: 0 24px 32px;
}
.pp-editor-title {
  margin: 8px 0 12px;
  font-size: 22px;
  font-weight: 700;
  color: #192342;
  border-top: 1px solid #eef1f3;
  padding-top: 24px;
}
.pp-editor-body {
  font-size: 14px;
  line-height: 1.6;
  color: #2c3550;
}
.pp-editor-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 12px 0;
}
.pp-editor-body p { margin: 0 0 12px; }
.pp-editor-body h1, .pp-editor-body h2, .pp-editor-body h3, .pp-editor-body h4 {
  margin: 18px 0 8px;
  color: #192342;
}
.pp-editor-body a { color: #005db5; }
.pp-editor-body ul, .pp-editor-body ol { padding-left: 22px; margin: 0 0 12px; }

/* "View details" pill that opens a small modal with the relationship's
   long-form comments. Sits inline next to the company name in the meta
   table. */
.pp-details-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 22px;
  margin-left: 6px;
  padding: 0 8px 0 10px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: #005db5;
  background: #e6f0fb;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
  white-space: nowrap;
}
.pp-details-btn:hover {
  background: #d3e4f5;
  border-color: #b8c4cb;
}
.pp-details-btn .material-symbols-outlined {
  margin-left: 2px;
}

/* The pp-details-dialog is appended to <body>, NOT inside the component, so
   selectors are page-level (no #pp-root prefix). */
.pp-details-dialog {
  width: min(560px, 92vw);
  max-height: 70vh;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: #192342;
  box-shadow: 0 16px 48px rgba(15, 23, 36, 0.25);
  font-family: Avenir, "Century Gothic", Roboto, Arial, sans-serif;
}
.pp-details-dialog::backdrop {
  background: rgba(15, 23, 36, 0.45);
  backdrop-filter: blur(2px);
}
.pp-details-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #eef1f3;
}
.pp-details-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.pp-details-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #586064;
  cursor: pointer;
}
.pp-details-close:hover {
  background: #f0f5f5;
}
.pp-details-body {
  padding: 16px 18px 22px;
  font-size: 14px;
  line-height: 1.55;
  color: #2c3550;
  white-space: pre-wrap;
  overflow-y: auto;
  max-height: calc(70vh - 60px);
}

/* Empty / fallback states */
.pp-empty {
  padding: 40px 20px;
  text-align: center;
  color: #586064;
  font-size: 14px;
}

/* Tooltip classes lifted from advanced-map/styles/map-page-new.css (the only
   pieces ProjectsLayer.generateTooltip needs). Kept inline here so the project
   profile page doesn't have to load the full Pro-map stylesheet. */
.news-tooltip {
  width: max-content;
}
.drilling-tooltip-total-grade {
  font-weight: 700;
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  line-height: 16px;
  margin-bottom: 2px;
}
.drilling-tooltip-project-name,
.tooltip-title {
  color: #30a5bf;
  margin-right: 4px;
}
.drilling-tooltip-company {
  font-size: 12px;
}

/* Toggle button used in News/Articles/Drilling tab headers to switch
   between "this project only" and "all company X". */
.pp-toggle {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: #192342;
  background: #fff;
  border: 1px solid #d8dde0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.pp-toggle:hover {
  background: #f0f5fa;
  border-color: #b8c4cb;
}

/* Tabs other than Project use cp-* table classes from companyProfileComponent.css.
   Give them breathing room when active. The base .cp-tab-panel rules from
   companyProfileComponent.css already handle display:none when inactive — we
   only override display + padding when the panel is active. */
#pp-tab-news.active,
#pp-tab-articles.active,
#pp-tab-drilling.active,
#pp-tab-company.active {
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Company tab — owner snapshot + sibling-projects table */
.pp-company-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid #eef1f3;
  margin-bottom: 16px;
}
.pp-company-head-left {
  flex: 1 1 auto;
  min-width: 0;
}
.pp-company-name {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: #192342;
}
.pp-company-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.pp-section-title {
  margin: 24px 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: #192342;
}
.pp-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: #586064;
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease;
}
.pp-social-link:hover {
  background: #f0f5fa;
  color: #005db5;
}

/* Simple list-card layout for News/Articles/Drilling tabs */
.pp-list {
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pp-list-item {
  padding: 12px 14px;
  border: 1px solid #eef1f3;
  border-radius: 6px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.pp-list-item:hover {
  background: #f8fafa;
  border-color: #d8dde0;
}
.pp-list-item .pp-list-title {
  font-weight: 600;
  color: #192342;
  font-size: 14px;
  margin-bottom: 4px;
}
.pp-list-item .pp-list-sub {
  font-size: 12px;
  color: #586064;
}
