/* Cards, the restaurant card with the opening status, notes. */

@layer components {
  .card {
    margin: var(--s-3) var(--s-4);
    padding: var(--s-4);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-1);
  }

  .card > * + * {
    margin-top: var(--s-2);
  }

  .card__title {
    font-size: 1.1875rem;
  }

  /* The card on the menu: it overlaps the teal band (see .hero-band). */
  .resto__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--s-2);
  }

  /* Info and call: on the tablet in landscape, where there is no title bar to carry them. */
  .resto__actions {
    display: none;
    gap: var(--s-2);
    margin-left: auto;
  }

  @media (min-width: 1024px) {
    .resto__top {
      justify-content: flex-start;
      gap: var(--s-3);
    }

    .resto__actions {
      display: flex;
    }
  }

  /* The website has Info in the header and the phone in the footer. */
  @media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
    .resto__actions {
      display: none;
    }
  }

  .resto__name {
    font-size: 1.1875rem;
  }

  .meta {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: var(--muted);
    font-size: 0.875rem;
  }

  .meta > span {
    flex: 1;
    min-width: 0;
  }

  .meta .icon {
    margin-top: 0.15rem;
  }

  /* The opening status: green with a dot while open, turmeric while closed. */
  .pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--r-pill);
    background: var(--veg-soft);
    color: var(--veg);
    font-size: 0.8125rem;
    font-weight: 700;
  }

  .pill::before {
    content: '';
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
  }

  .pill--closed {
    background: var(--closed-soft);
    color: var(--closed);
  }

  /* On the restaurant card when ordering cannot be done right now: in the colours of the closed pill, a line wide. */
  .resto__notice {
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r-md);
    background: var(--closed-soft);
    color: var(--closed);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.4;
  }

  /* A short remark with an icon: the allergy note. */
  .note {
    display: flex;
    align-items: flex-start;
    gap: var(--s-2);
    margin: var(--s-3) var(--s-4);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.875rem;
    line-height: 1.45;
  }

  .note .icon {
    margin-top: 0.1rem;
    color: var(--primary);
  }

  .note a {
    font-weight: 700;
    white-space: nowrap;
  }

  /* The number in the note is a link (to call) everywhere but on the desktop website, where it is text: the footer has the link. */
  .note__number {
    display: none;
    font-weight: 700;
    white-space: nowrap;
  }

  @media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
    .note__call {
      display: none;
    }

    .note__number {
      display: inline;
    }
  }

  /* In a padded page the note and the cards are as wide as the text. */
  .page > .note,
  .page > .card {
    margin-inline: 0;
  }

  /* A page of a form or of text is a card in the middle of the screen from 600px wide. */
  @media (min-width: 600px) {
    main.narrow > .page {
      margin: var(--s-6) var(--s-4);
      padding: var(--s-6);
      border-radius: var(--r-lg);
      background: var(--surface);
      box-shadow: var(--shadow-1);
    }

    main.narrow > .empty {
      margin-top: var(--s-6);
    }
  }

  /* The info page: the restaurant and its hours side by side where there is room (a tablet in landscape, a desktop). */
  @media (min-width: 1024px) {
    main.info {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      grid-template-rows: auto auto auto 1fr;
      align-items: start;
      max-width: 960px;
    }

    main.info > .page-heading {
      grid-column: 1 / -1;
    }

    main.info > .info__hours {
      grid-column: 2;
      grid-row: 2 / span 3;
    }
  }
}
