/*
 * Ajustes responsivos do painel (tema Default).
 *
 * Carregado no <body>, depois do web.js, para vir depois dos <style> que o
 * bundle injeta no <head> e assim sobrescrevê-los.
 *
 * O tema original define a senha com font-size:30vh e o Bulma aplica
 * word-break:break-word em .title; em retrato a fonte fica maior que a
 * largura disponível e a senha quebra em várias linhas ("A" / "G0" / "09").
 * O tamanho final da senha é ajustado à largura real por static/js/painel-fit.js;
 * aqui ficam o tamanho máximo, o nowrap e o layout de retrato.
 */

/* Sem barras de rolagem enquanto o painel estiver na tela
   (a classe é adicionada pelo painel-fit.js; a tela de configurações continua rolando). */
html.painel-ativo,
html.painel-ativo body {
  overflow: hidden;
}

.layout-content {
  overflow: hidden;
}

/* Bulma só aplica display:flex em .columns a partir de 769px; garante o mesmo
   comportamento em telas menores (ex.: 720x1280). */
.layout-content > .columns {
  display: flex;
}

.layout-content .featured-column header,
.layout-content .history-column header {
  overflow: hidden;
}

/* Senha, tipo de atendimento e local sempre em uma única linha */
.layout-content .featured-message .title,
.layout-content .featured-message .description,
.layout-content .featured-message .subtitle,
.layout-content .history .message .title,
.layout-content .history .message .subtitle {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.layout-content .history .message .title,
.layout-content .history .message .subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tamanho máximo da senha em paisagem: mantém os 30vh originais, limitado
   pela largura apenas em proporções muito estreitas. O fit-text reduz
   a partir daqui se o texto não couber na coluna. */
.layout-content .featured-column .featured-message .title {
  font-size: 30vh;
  font-size: min(30vh, 20vw);
}

/* ------------------------------------------------------------------ */
/* Retrato: histórico vai para baixo da senha, que ganha a largura toda */
/* ------------------------------------------------------------------ */
@media (orientation: portrait) {
  .layout-content > .columns {
    flex-direction: column;
  }

  .layout-content > .columns > .column.featured-column,
  .layout-content > .columns > .column.history-column {
    flex: none;
    width: 100%;
  }

  /* Senha atual */
  .layout-content .featured-column {
    height: 60vh;
  }

  .layout-content .featured-column header {
    height: 52vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .layout-content .featured-column header .featured-message {
    width: 100%;
  }

  .layout-content .featured-column .featured-message .title {
    font-size: 24vh;
    font-size: min(24vh, 30vw);
  }

  .layout-content .featured-column .featured-message .description,
  .layout-content .featured-column .featured-message .subtitle {
    font-size: 6vh;
    font-size: min(6vh, 9vw);
  }

  /* Logo */
  .layout-content .featured-column footer {
    height: 8vh;
    padding: 1.5vh;
    text-align: center;
  }

  .layout-content .featured-column footer img {
    height: 5vh;
  }

  /* Histórico */
  .layout-content .history-column {
    height: 40vh;
    display: flex;
    flex-direction: column;
  }

  .layout-content .history-column header {
    height: auto;
    flex: 1 1 auto;
    min-height: 0;
    padding: 1vh 2vw;
  }

  .layout-content .history-column header > .title {
    font-size: 3vh;
    font-size: min(3vh, 5vw);
    margin-bottom: 1vh;
  }

  .layout-content .history-column .history {
    display: flex;
    flex-wrap: wrap;
  }

  .layout-content .history-column .message {
    width: 31.33%;
    margin: 0 1% 1vh;
    padding-left: 2vw;
  }

  .layout-content .history-column .history .message .title {
    font-size: 5vh;
    font-size: min(5vh, 7vw);
    line-height: 1.2;
  }

  .layout-content .history-column .history .message .subtitle {
    font-size: 2.2vh;
    font-size: min(2.2vh, 3.5vw);
    line-height: 1.2;
  }

  /* Relógio */
  .layout-content .history-column footer {
    height: 11vh;
    flex: none;
    padding: 1vh 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .layout-content .clock {
    line-height: 1.2;
  }

  .layout-content .clock .time span {
    font-size: 7vw;
  }

  .layout-content .clock .date span {
    font-size: 3.5vw;
  }
}
