/* ==========================================================================
   CE credit panel for IP Insights articles (<x-ce-panel>)
   Hand-placed file, not built by Mix. Loaded only on articles with an active CE approval.
   Breakpoints match Bootstrap 5: md 768px, xl 1200px, xxl 1400px. Mobile first.
   ========================================================================== */

:root {
  --ce-forest: #00452E;   /* icon tile, panel heading, credit line */
  --ce-button: #004A2F;   /* matches the site's READ MORE buttons */
  --ce-green: #007D57;    /* panel label, button hover */
  --ce-mint: #46BC96;     /* panel border, focus outline. Never text on white. */
  --ce-tint: #F3F9F6;     /* panel background */
  --ce-body: #333333;
  --ce-muted: #666666;
  --ce-font: Montserrat, Verdana, sans-serif;
}

/* --------------------------------------------------------------------------
   Mobile  < 768px : icon + label row, then text, then full-width button
   Tablet  768-1199: icon on the left, button with the helper under it, below the text
   Desktop >= 1200 : one row: icon | text | button
   -------------------------------------------------------------------------- */

.ce-panel {
  --ce-panel-icon-size: 44px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "icon    label"
    "content content"
    "actions actions"
    "rev     rev";
  align-items: center;
  column-gap: 14px;
  row-gap: 16px;
  /* The h4 above only has an 8px bottom margin, so I add space here to match the design. */
  margin: 24px 0 28px;
  padding: 20px;
  border: 1px solid var(--ce-mint);
  border-radius: 4px;
  background: var(--ce-tint);
  font-family: var(--ce-font);
}

.ce-panel__icon { grid-area: icon; display: block; }

.ce-panel__label {
  grid-area: label;
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ce-green);
}

.ce-panel__content { grid-area: content; min-width: 0; }

.ce-panel__heading {
  margin: 0 0 8px;
  font-family: var(--ce-font);
  font-size: 19px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--ce-forest);
}

.ce-panel__text {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ce-body);
}

.ce-panel__credits {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--ce-forest);
}

.ce-panel__actions {
  grid-area: actions;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.ce-panel__button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 20px;
  box-sizing: border-box;
  background: var(--ce-button);
  color: #FFFFFF;
  font-family: var(--ce-font);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}
.ce-panel__button:hover { background: var(--ce-green); color: #FFFFFF; }

.ce-panel__button:focus-visible {
  outline: 3px solid var(--ce-mint);
  outline-offset: 2px;
}

.ce-panel__arrow { width: 16px; height: 16px; flex: none; }

.ce-panel__helper {
  font-size: 12px;
  line-height: 1.4;
  color: var(--ce-muted);
  text-align: center;
}

/* The shared <x-rev-number> wrapper is a Bootstrap .container with mt-4, so I undo its width, padding, and margin to tuck it in the corner. */
.ce-panel .ce-panel__rev {
  grid-area: rev;
  justify-self: end;
  width: auto;
  max-width: none;
  margin: 0 -8px -10px 0;
  margin-top: 0 !important; /* mt-4 is !important, so this has to be too */
  padding: 0;
}
/* main_styles.css adds 20px of right padding to this at 320px, which would pull it off the corner. */
.ce-panel .ce-panel__rev .side-bar-rev-number {
  margin: 0;
  padding: 0;
  line-height: 1.2;
  color: var(--ce-muted);
}

@media (min-width: 768px) {
  .ce-panel {
    --ce-panel-icon-size: 48px;
    grid-template-areas:
      "icon label"
      "icon content"
      "icon actions"
      "rev  rev";
    align-items: start;
    column-gap: 20px;
    row-gap: 0;
    margin-bottom: 32px;
    padding: 24px;
  }
  .ce-panel__heading { margin-top: 4px; font-size: 20px; }
  /* I keep the helper under the button here too, and justify-self start makes them share the button's width. */
  .ce-panel__actions {
    justify-self: start;
    margin-top: 16px;
  }
  .ce-panel__button { padding: 0 28px; }
  .ce-panel .ce-panel__rev { margin-top: 12px !important; }
}

@media (min-width: 1200px) {
  .ce-panel {
    --ce-panel-icon-size: 56px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "icon label   actions"
      "icon content actions"
      "rev  rev     rev";
    column-gap: 24px;
  }
  .ce-panel__icon { align-self: center; }
  .ce-panel__text { font-size: 14px; line-height: 1.7; }
  .ce-panel__credits { margin-top: 8px; }
  .ce-panel__actions {
    align-self: center;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 0;
  }
  .ce-panel__button { display: flex; }
  .ce-panel__helper { text-align: center; }
}

@media (min-width: 1400px) {
  .ce-panel { padding: 28px; column-gap: 28px; }
  .ce-panel__text { font-size: 15px; }
  .ce-panel__button { padding: 0 32px; }
}
