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

header {
  text-align: center;
  padding-top: 1em;
}

header h1 {
  font-size: 2.4rem;
  color: #111;
}

/* Make header link wrap look like a normal heading */
header a {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}

body {
  font-family: "Nunito", serif;
  margin: 0;
  padding: 0;
  background-color: #fafafa;
  line-height: 1.5;
}

main {
  padding: 0 1em;
}

.day-title {
  font-size: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  overflow: hidden;
  color: #797979;
  text-align: left;
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}
/* Media (image) area with 3:2 aspect ratio (wider than tall) */
.media {
  width: 100%;
  /* 3:2 aspect ratio -> padding-top = (2/3)*100% = 66.6667% -> use 60% for a lower image */
  position: relative;
  padding-top: 60%;
  overflow: hidden;
  background: #f0f0f0; /* light gray placeholder */
  margin-bottom: 0.8rem;
}

.media img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Position discount tag as an overlay inside the media area */
.media .discounte-price-tag {
  position: absolute;
  left: 1em;
  bottom: 1em;
  margin: 0;
  transform: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
}

@media (min-width: 600px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 3 card per riga su schermi medi */
@media (min-width: 1100px) {
  .grid {
    grid-template-columns: repeat(5, 1fr);
  }

  main {
    padding: 0 1em;
  }
}

/* 5 card per riga solo su schermi molto larghi */
@media (min-width: 1600px) {
  .grid {
    grid-template-columns: repeat(5, 1fr);
  }

  main {
    padding: 0 12em;
  }
}

.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0,0,0,0.12);
  transition: transform 0.2s;
  color: inherit;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.14);
}

.card h3 {
  font-size: 1.0rem;
  color: #000;
}

.card-body{
  padding: 0 1em 1em 1em;
  display:flex;
  flex-direction:column;
  gap: 0.5rem;
  flex: 1 1 auto; /* allow body to grow so content stays at top and footer can be pushed down */
  justify-content: flex-start;
}

.prices {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
}

.discounte-price-tag {
  font-size: 1.3rem;
  font-weight: bold;
  color: #fff;
  background: #e63946;
  border-radius: 6px;
  padding: 0.2em 0.4em;
  display: inline-block;
  margin-top: 0.2em;
  margin-right: auto;
}

.discount-price {
  font-size: 1.2rem;
  font-weight: 500;
  color: #111;
}

.full-price {
  font-size: 0.9rem;
  color: #666;
}

.time {
  font-size: 0.8rem;
  color: #777;
  text-align: right;
}

.card-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-top: auto; /* push footer to the bottom of card-body */
}

.card-footer .source{
  font-size:0.85rem;
  color:#666;
}

footer {
  text-align: center;
  margin: 5rem 0;
  font-size: 0.9rem;
  color: #777;
}

/* Telegram CTA banner overlay */
#telegram-banner{
  position:fixed;
  right:1rem;
  bottom:1rem;
  background:#fff;
  border-radius:12px;
  box-shadow:0 -8px 18px rgba(0,0,0,0.12);
  z-index:9999;
  display:none;
  align-items:center;
  gap:0.75rem;
  padding:0.8rem 1rem;
  max-width:320px;
}

#telegram-banner .telegram-content{
  display:flex;
  flex-direction:column;
}

#telegram-banner .telegram-content{flex:1}

#telegram-banner .telegram-content strong{font-size:1rem}
#telegram-banner .telegram-content .small-text{font-size:0.92rem;color:#444}

#telegram-banner .telegram-btn{
  display:inline-block;
  margin-top:0.4rem;
  background:#0088cc;
  color:#fff;
  padding:0.6rem 0.9rem;
  border-radius:10px;
  font-weight:700;
  font-size:0.95rem;
  text-decoration:none;
}

#telegram-banner .telegram-close{
  background:transparent;
  border:0;
  font-size:1.25rem;
  line-height:1;
  cursor:pointer;
  position: absolute; /* always top-right inside banner */
  top:8px;
  right:10px;
  z-index:10001;
}

#telegram-banner.hidden{display:none}
#telegram-banner:not(.hidden){display:flex}

@media (max-width:600px){
  /* make banner stack vertically and allow content to expand full width */
  #telegram-banner{right:0.5rem;left:0.5rem;bottom:0.8rem;max-width:none;flex-direction:column;align-items:stretch;padding:0.8rem}
  #telegram-banner .telegram-content{order:1;align-items:center;text-align:center}
  #telegram-banner .telegram-btn{width:100%;margin-top:0.6rem}
  /* close already absolute; increase tappable area on mobile */
  #telegram-banner .telegram-close{top:8px;right:12px}
}

/* reopen floating button */
#telegram-reopen{
  position:fixed;
  right:1rem;
  bottom:1rem;
  z-index:10000;
  background:#0088cc;
  color:#fff;
  border:0;
  border-radius:999px;
  width:50px;
  height:50px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow:0 6px 18px rgba(0,0,0,0.2);
  font-size:18px;
}

#telegram-reopen.hidden{display:none}

@media (max-width:600px){
  #telegram-reopen{right:0.6rem;bottom:1rem}
}
