:host {
  --space-s: var(--wa-space-l);
  --space-m: var(--wa-space-xl);
  --space-l: var(--wa-space-2xl);

  --spacing: var(--wa-space);
  --border-width: var(--wa-panel-border-width);
  --border-color: var(--wa-color-surface-border);
  --border-radius: var(--wa-panel-border-radius);

  --inner-border-radius: calc(var(--border-radius) - var(--border-width));

  display: flex;
  flex-direction: column;
  background-color: var(--wa-color-surface-default);
  border-color: var(--border-color);
  border-radius: var(--border-radius);
  border-style: var(--wa-panel-border-style);
  box-shadow: var(--wa-shadow-s);
  border-width: var(--border-width);
  color: var(--wa-color-text-normal);
}

/* Take care of top and bottom radii */
.image,
:host(:not([with-image])) .header,
:host(:not([with-image], [with-header])) .body {
  border-start-start-radius: var(--inner-border-radius);
  border-start-end-radius: var(--inner-border-radius);
}

:host(:not([with-footer])) .body,
.footer {
  border-end-start-radius: var(--inner-border-radius);
  border-end-end-radius: var(--inner-border-radius);
}

.image {
  display: flex;

  &::slotted(img) {
    display: block;
    width: 100%;
    border-start-start-radius: inherit !important;
    border-start-end-radius: inherit !important;
  }
}

.header {
  display: block;
  border-block-end-style: inherit;
  border-block-end-color: var(--border-color);
  border-block-end-width: var(--border-width);
  padding: calc(var(--spacing) / 2) var(--spacing);
}

.body {
  display: block;
  padding: var(--spacing);
}

.footer {
  display: block;
  border-block-start-style: inherit;
  border-block-start-color: var(--border-color);
  border-block-start-width: var(--border-width);
  padding: var(--spacing);
}

:host(:not([with-header])) .header,
:host(:not([with-footer])) .footer,
:host(:not([with-image])) .image {
  display: none;
}
