/* GERAL */
:root {
  --font-sans: 'Rubik', sans-serif;
  --font-serif: 'Cardo', serif;
  --primary-color: #222831;
  --secondary-color: #566479;
  --past-time-color: #909090;
  --table-stripe-color: #f2f2f2;
  --white: #EEEEEE;
  --gray-highlight: #393E46;
  --table-highlight: #DDD;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--white);
  color: var(--primary-color);
  font-family: var(--font-sans);
}

.container {
  padding: 0 0.5rem;
}

/* TEXTO */
h1,
h2,
h3,
h4,
p,
ul {
  margin-bottom: 0.75rem;
}

p {
  line-height: 1.5rem;
}

h2,
h3,
h4 {
  margin-top: 3rem;
}

ul {
  margin-left: 1rem;
}

/* LINKS */
a {
  text-decoration: none;
  color: var(--secondary-color);
}

.main-links {
  width: 100%;
  background-color: var(--primary-color);
  color: var(--white);
  text-align: center;
  padding: 1rem;
  font-size: 1rem;
  border-top: 1rem solid var(--white);
}

.main-links p {
  margin-bottom: 0;
}

.main-links .btn {
  background-color: var(--white);
  color: var(--primary-color);
  font-size: 0.8rem;
  width: 70%;
  margin: 1rem 1rem 0 1rem;
}

/* HEADER */
header {
  background-color: var(--primary-color);
  color: var(--white);
}

/* NAVBAR */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 20px 0;
}

.menu-btn {
  display: block;
  width: 30px;
  height: 30px;
  position: relative;
  cursor: pointer;
  border: none;
}

.menu-btn::before,
.menu-btn::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 3px;
  background-color: var(--white);
  transition: all 0.3s ease;
}

.menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background-color: var(--primary-color);
  width: 100%;
  padding: 10px 0;
}

.menu ul {
  list-style: none;
  padding: 0;
}

.menu li {
  margin-bottom: 10px;
}

.menu a {
  color: var(--white);
  text-decoration: none;
  display: block;
  padding: 5px 20px;
}

.menu a:hover {
  background-color: var(--gray-highlight);
}

.menu-btn::after {
  top: 16px;
}

.menu-btn::before {
  top: 0;
}

.menu-btn.open::before {
  transform: rotate(45deg);
  top: 0;
}

.menu-btn.open::after {
  transform: rotate(-45deg);
  top: 0;
}

.menu-btn.open+nav.menu {
  display: block;
}

.page-title {
  color: var(--white);
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.page-title h1 {
  margin-bottom: 0 !important;
}

.img-inverted {
  filter: invert(1);
  margin-right: 0.75rem;
}

/* BANNER E BUSCA */
.banner {
  height: 400px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner:not(+ .main-links) {
  margin-bottom: 1rem;
}

/* BUTTONS */
.btn {
  cursor: pointer;
  padding: 0.75rem 1.5rem;
  font-size: 0.65rem;
  font-weight: bold;
  letter-spacing: 0.025rem;
  text-transform: uppercase;
  color: var(--white);
  background-color: var(--primary-color);
  border: none;
}

/* TABLES */
#arrivals, #departures {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 960px;
  margin: 0 -0.5rem;
}

#arrivals h2,
#departures h2 {
  margin: 1rem 0.5rem 0 0.5rem;
}

.arrivals-departures-container {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.table-header {
  font-weight: 700;
  font-size: 0.9rem;
  background-color: var(--table-highlight);
}

.table-header-time {
  flex: 1;
  margin-left: 0.5rem;
}

.table-header-company {
  flex: 2;
  margin-left: 0.5rem;
}

.table-header-cities {
  flex: 2;
  margin: 0 0.5rem;
}

.table-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--primary-color);
  padding: 0.5rem 0;
}

.table-row:nth-child(even) {
  background-color: var(--table-stripe-color);
}

.table-row:hover {
  background-color: var(--table-highlight);
}

.table-row.tomorrow.table-header {
  justify-content: center;
  padding: 30px;
}

.table-row.tomorrow.table-header span{
  padding-right: 5px;
}

.table-row.tomorrow .table-bus-time:after {
  content: "+1";
  position: absolute;
  font-size: 10px;
  margin-top: -6px;
  margin-left: -1px
}

.past-time {
  color: var(--past-time-color);
}

.table-bus-time {
  flex: 1;
  font-weight: bold;
  font-size: 1.4rem;
  margin-left: 0.5rem;
  margin-right: 0.5rem;
}

.table-row:not(.past-time) .table-bus-time,
.table-row:not(.past-time) .table-company-class {
  color: var(--secondary-color);
}

.table-company-class {
  flex: 2;
  flex-direction: column;
  margin-left: 0.5rem;
}

.table-operator {
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}

.table-class {
  font-size: 0.9rem;
}

.table-origins-destinations {
  flex: 2;
  margin: 0 0.5rem;
  font-size: 0.9rem;
}

/* FOOTER */
footer {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 10px;
  text-align: center;
  margin-top: 2rem;
}

/* FOOTER NAVBAR */
.footer-navbar {
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--white);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}

.footer-navbar ul {
  display: flex;
  flex-direction: column;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-navbar li {
  padding: 10px;
}

.footer-navbar a {
  color: var(--white);
  text-decoration: none;
}

.footer-navbar li:hover {
  background-color: var(--gray-highlight);
}

/* PROMOTION CARDS */
.box-promotion {
  display: grid;
  place-items: center;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-gap: 1rem;
  max-width: 1280px;
  margin: 0 auto;
  font-family: var(--font-sans);
  margin-bottom: 2rem;
}

.card-promotion {
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: 1rem;
  width: 100%;
  height: 350px;
  text-align: center;
  color: var(--primary-color);
  background-color: var(--primary-color);
  background-size: cover;
}

.card-promotion.highlight {
  grid-column: 1 / -1;
}

.card-promotion p,
.card-promotion h2 {
  margin: 0.2rem;
}

.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 1rem;
  margin: 0.2rem;
  border: 1px solid rgba(238, 238, 238, 0.7);
  background-color: rgba(238, 238, 238, 0.7);

  >*+* {
    margin-top: 1rem;
  }
}

.card-destination {
  font-size: 1rem;
  font-family: var(--font-sans);
  font-weight: bold;
  line-height: 1.2;
}

.card-price {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.35;
}

/* MAPA */
#map {
  height: 12rem;
  margin-bottom: 2rem;
}

/* IFRAME SEARCH WIDGET */
iframe {
  border: none;
}

iframe:focus {
  outline: none;
}

iframe[seamless] {
  display: block;
}

/* ABOUT US */
#about-us p {
  line-height: 2rem;
  margin-bottom: 2rem;
}

.logo {
  display: block;
  margin: 2rem auto;
}

/* RESPONSIVIDADE */
@media (min-width: 540px) {
  .menu {
    width: 45%;
  }

  .footer-navbar ul {
    flex-direction: row;
  }

  .box-promotion {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-promotion.highlight {
    & .card-destination {
      font-size: 1.5rem;
    }

    & .card-price {
      font-size: 1.5rem;
    }
  }

  .main-links {
    font-size: 1.1rem;
  }
  
  .main-links .btn {
    font-size: 1rem;
    width: 200px;

  }
}

@media (min-width: 769px) {
  .box-promotion {
    grid-template-columns: repeat(4, 1fr);
  }

  .container {
    max-width: 1280px;
    margin: 0 auto;
  }

  #arrivals, #departures {
    margin: 0 auto;
  }

  .table-header {
    font-size: 1rem;
  }
  
  .table-header-cities {
    flex: 3;
  }

  .table-origins-destinations {
    flex: 3;
  }

  .table-bus-time {
    font-size: 2rem;
  }

  .table-operator {
    font-size: 1.2rem;
  }
}