import { css } from 'lit';
import componentStyles from '../../styles/component.styles.mjs';

const styles = css`
  ${componentStyles}

  :host {
    display: block;

    --border-color: var(--flow-ui-card-border-color);
    --border-radius: var(--flow-ui-card-border-radius);
    --border-width: var(--flow-ui-card-border-width);
    --padding: var(--flow-ui-card-padding);

    --background-color: var(--flow-ui-card-background-color);
    --color: var(--flow-ui-card-color);
  }

  .card {
    display: flex;
    flex-direction: column;
    background-color: var(--background-color);
    color: var(--color);
    border: solid var(--border-width) var(--border-color);
    border-radius: var(--border-radius);
  }

  .card__header {
    padding: calc(var(--padding) / 2) var(--padding);
    padding-bottom: 0;
  }

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

  /* Remove margin from first and last child of default slot */
  ::slotted(:nth-child(1 of :not([slot]))) {
    margin-top: 0;
  }

  ::slotted(:nth-last-child(1 of :not([slot]))) {
    margin-bottom: 0;
  }
`;

export { styles as default };
