/**
 * @file
 * @author Fabrice Schaller, Noé Bersier
 * @version 1.0.0
 * @date 2026-09-21
 * @description Consolidated responsive styles for the Fribourguide application shell and views.
 */

:root {
  --page-background: #fafaf8;
  --surface: #ffffff;
  --soft-surface: #f3f3ef;
  --text: #242428;
  --muted-text: #6d6d73;
  --border: #e5e5e1;
  --red: #d7193f;
  --blue: #2476b8;
  --orange: #e59a00;
  --bottom-navigation-height: 74px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #eeeeeb;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: #eeeeeb;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.4;
}

button,
a {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(36, 118, 184, 0.35);
  outline-offset: 2px;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-shell {
  width: 100%;
  max-width: 560px;
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: var(--bottom-navigation-height);
  background: var(--page-background);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  min-height: 48px;
  gap: 9px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.98);
}

.back-button,
.brand,
.lang,
.tab {
  border: 0;
  cursor: pointer;
}

.back-button {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  padding: 0;
  border-radius: 7px;
  background: var(--soft-surface);
  color: var(--text);
}

.back-button svg {
  width: 18px;
  height: 18px;
}

.back-button[hidden] {
  display: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.brand-mark {
  width: 19px;
  height: 19px;
  color: var(--red);
}

.brand-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.language-switcher {
  display: flex;
  margin-left: auto;
  padding: 2px;
  border-radius: 7px;
  background: var(--soft-surface);
}

.lang {
  min-width: 26px;
  padding: 4px 6px;
  border-radius: 5px;
  background: transparent;
  color: var(--muted-text);
  font-size: 10px;
  font-weight: 700;
}

.lang.active {
  background: var(--red);
  color: #fff;
}

main {
  min-height: calc(100vh - var(--bottom-navigation-height));
  padding: 19px 16px 28px;
}

.app-header[data-route="home"] + main {
  padding-top: 17px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow.orange {
  color: var(--orange);
}

.eyebrow.red {
  color: var(--red);
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0 0 5px;
  font-size: 20px;
  line-height: 1.18;
}

h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
}

h3 {
  margin: 0 0 4px;
  font-size: 12px;
  line-height: 1.3;
}

p {
  margin: 0;
}

.intro {
  max-width: 48em;
  margin: 0 0 16px;
  color: var(--muted-text);
  font-size: 11px;
  line-height: 1.4;
}

.home-grid,
.list {
  display: grid;
  gap: 11px;
  margin-top: 19px;
}

.home-card,
.feature,
.card,
.notice {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: inherit;
}

.home-card,
.feature {
  text-align: left;
}

.home-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 13px;
  cursor: pointer;
}

.home-card.transport {
  border-color: #75aada;
}

.home-card:not(.transport) {
  border-color: #e9b94d;
}

.home-card h2 {
  margin-bottom: 3px;
  font-size: 13px;
}

.home-card p,
.feature p,
.card p,
.notice p {
  color: var(--muted-text);
  font-size: 10.5px;
  line-height: 1.35;
}

.icon,
.feature-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--soft-surface);
}

.icon {
  width: 34px;
  height: 34px;
  color: var(--blue);
}

.feature.daily-feature .feature-icon {
  color: var(--orange);
}

.home-card:not(.transport) .icon {
  color: var(--orange);
}

.icon svg {
  width: 19px;
  height: 19px;
}

.feature {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 10px;
  cursor: pointer;
}

.feature + .feature {
  margin-top: 9px;
}

.feature-icon {
  width: 32px;
  height: 32px;
  color: var(--blue);
}

.feature-icon svg {
  width: 18px;
  height: 18px;
}

.feature h2 {
  margin-bottom: 2px;
  font-size: 12px;
}

.feature-arrow {
  display: grid;
  place-items: center;
  color: #a2a2a7;
}

.feature-arrow svg {
  width: 16px;
  height: 16px;
}

.feature.highlight {
  border-color: var(--orange);
}

.detail-group {
  margin-top: 17px;
}

.detail-group > h2 {
  margin: 0 0 8px;
  font-size: 13px;
}

.card {
  display: block;
  padding: 12px;
}

.card + .card {
  margin-top: 8px;
}

.card ul,
.card ol {
  margin: 0;
  padding-left: 18px;
}

.health-guidance {
  border-color: var(--orange);
}

.shopping-hours-notice {
  margin-top: 8px;
  border-color: var(--orange);
}

.shopping-hours-notice h3 {
  margin-bottom: 4px;
}

.instruction-list {
  display: grid;
  gap: 0;
  padding-left: 0 !important;
  list-style: none;
  counter-reset: instruction-step;
}

.instruction-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  margin: 0 !important;
  padding: 9px 0;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 10.5px;
  line-height: 1.4;
}

.instruction-list li:first-child {
  padding-top: 0;
  border-top: 0;
}

.instruction-list li::before {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  background: var(--soft-surface);
  color: var(--blue);
  content: counter(instruction-step);
  counter-increment: instruction-step;
  font-size: 10px;
  font-weight: 700;
}

.card li + li {
  margin-top: 9px;
}

.card li h3 {
  margin-bottom: 2px;
}

.card li p {
  margin-top: 2px;
}

.notice {
  padding: 12px;
}

.notice h2,
.card h2 {
  margin-bottom: 5px;
}

.link-list .card {
  color: var(--blue);
  font-weight: 700;
}

.external-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

a.card.external-link {
  display: flex;
  justify-content: flex-start;
}

.external-link svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.daily-link {
  color: var(--orange);
}

.link-list .card.daily-link {
  color: var(--orange);
}

.daily-link svg {
  color: var(--orange);
}

.info-row {
  margin-top: 6px;
  padding: 9px;
  border-radius: 7px;
  background: var(--soft-surface);
  font-size: 10.5px;
}

.info-row strong {
  display: block;
  margin-bottom: 2px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 10px;
  line-height: 1.35;
}

th,
td {
  padding: 8px 5px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  overflow-wrap: anywhere;
  text-align: left;
}

th {
  font-weight: 700;
}

thead th {
  background: var(--soft-surface);
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

td a,
th a {
  font-weight: 700;
}

.bottom-tabs {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(100%, 560px);
  height: var(--bottom-navigation-height);
  margin: 0 auto;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.98);
}

.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--bottom-navigation-height);
  padding: 7px 4px 8px;
  background: transparent;
  color: #92929a;
  font-size: 9px;
}

.tab b {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  font-weight: 400;
}

.tab b svg {
  width: 20px;
  height: 20px;
}

.tab.active {
  color: var(--red);
  font-weight: 700;
}

.tab.active::after {
  position: absolute;
  right: 50%;
  bottom: 0;
  width: 34px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: currentColor;
  content: "";
  transform: translateX(50%);
}

@media (min-width: 600px) {
  .app-shell {
    box-shadow: 0 0 0 1px #e2e2df;
  }

  main {
    padding-right: 24px;
    padding-left: 24px;
  }
}

@media (min-width: 900px) {
  .app-shell {
    max-width: 620px;
  }

  .bottom-tabs {
    width: min(100%, 620px);
  }
}
