
/*
 * RadaFood PWA
 * Stile generale responsive - versione grafica 2
 *
 * Sfondo neutro.
 * Schede ricette più corpose.
 * Immagini più grandi.
 * Palette coerente con RadaFood.
 */

:root {
  font-family: -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;

  color: #243648;
  background: #f5f5f5;

  --red: #b62635;
  --blue: #146b94;
  --text: #243648;
  --muted: #657786;
  --light: #f7f7f7;
  --line: #e7e7e7;

  --surface: #ffffff;
  --surface-soft: #fafafa;
  --shadow-card: 0 5px 15px rgba(0, 0, 0, .07),
                 0 15px 30px rgba(0, 0, 0, .035);
}

* {
  box-sizing: border-box;
}

html {
  background: #f5f5f5;
}

body {
  margin: 0;
  background: #f5f5f5;
}

a {
  color: var(--blue);
}

button,
input {
  font: inherit;
}

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

button {
  cursor: pointer;
}

button:disabled {
  opacity: .6;
  cursor: wait;
}

[hidden] {
  display: none !important;
}

/* Contenitore principale */

.app {
  width: 100%;
  max-width: 1120px;
  min-height: 100dvh;
  margin: 0 auto;
  background: #fff;
  padding-bottom: calc(
    96px + env(safe-area-inset-bottom)
  );

  box-shadow: 0 0 45px rgba(0, 0, 0, .035);
}

/* Ambiente staging */

.test-banner {
  padding: 7px 16px;
  text-align: center;
  background: #f3f3f3;
  color: #666;
  font-size: 11px;
  letter-spacing: .06em;
  border-bottom: 1px solid #e9e9e9;
}

/* Header */

header {
  height: 112px;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  padding: 0 32px;
  border-bottom: 1px solid #ededed;
  background: #fff;
}

.brand {
  text-align: center;
  text-decoration: none;
}

.brand img {
  max-width: 100%;
  object-fit: contain;
}

.brand strong {
  font-size: 32px;
  color: var(--red);
  letter-spacing: -1.5px;
}

.brand strong span {
  color: var(--blue);
}

.header-side {
  text-align: center;
  text-decoration: none;
  font-size: 25px;
}

/* Contenuto */

main {
  padding: 30px 36px;
  outline: none;
}

main:focus-visible {
  outline: none;
}

h1 {
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: -.9px;
  margin: 5px 0 22px;
  line-height: 1.2;
}

h2 {
  font-size: 23px;
  letter-spacing: -.5px;
  margin: 26px 0 15px;
}

p {
  line-height: 1.6;
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.intro {
  color: #71808b;
  font-size: 14px;
  margin: -8px 0 22px;
}

/* Ricetta in evidenza */

.hero {
  display: flex;
  min-height: 420px;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: var(--text);
  text-decoration: none;
  color: white;
  align-items: end;
  box-shadow: var(--shadow-card);
}

.hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    rgba(16, 32, 43, .92),
    transparent 85%
  );
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding: 36px;
}

.hero-label {
  display: inline-block;
  background: var(--red);
  padding: 7px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.hero h2 {
  font-size: clamp(28px, 4vw, 42px);
  max-width: 560px;
  line-height: 1.12;
  margin: 14px 0 12px;
  color: #fff;
}

.hero small {
  font-size: 13px;
}

/* Ricerca */

.search-box {
  display: flex;
  align-items: center;
  background: #fafafa;
  border: 1px solid #e4e4e4;
  border-radius: 12px;
  padding: 0 16px;
  margin: 22px 0;
  color: var(--blue);
  gap: 10px;
}

.search-box span {
  font-size: 28px;
}

.search-box input {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 17px 0;
  outline: none;
  color: var(--text);
  font-size: 14px;
}

.search-box:focus-within {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head a {
  font-size: 12px;
  text-decoration: none;
  color: var(--red);
  font-weight: 600;
}

/* Categorie */

.categories {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.category {
  position: relative;
  min-width: 0;
  aspect-ratio: 1.15;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;

  box-shadow: var(--shadow-card);

  transition:
    transform .15s ease,
    box-shadow .15s ease;
}

.category:active {
  transform: translateY(2px);
}

.category img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.category:hover img {
  transform: scale(1.04);
}

.category-copy {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;

  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);

  border-top: 1px solid #ededed;
  padding: 16px 13px;

  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  column-gap: 8px;
}

.category-copy i {
  grid-row: span 2;
  font-style: normal;
  color: var(--red);
  font-size: 20px;
}

.category-copy strong {
  font-size: 17px;
  color: var(--text);
}

.category-copy small {
  font-size: 11px;
  color: #596b78;
  margin-top: 3px;
}

/*
 * Elenco ricette
 *
 * Due colonne per dare più spazio
 * alle fotografie e ai titoli.
 */

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

.recipe-card {
  min-width: 0;
  overflow: hidden;

  border: 1px solid #ededed;
  border-radius: 15px;
  background: #fff;

  display: flex;
  flex-direction: column;

  box-shadow: var(--shadow-card);

  transition:
    transform .18s ease,
    box-shadow .18s ease;
}

.recipe-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, .09),
    0 20px 35px rgba(0, 0, 0, .045);
}

.recipe-card > a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.recipe-card img {
  width: 100%;
  height: 245px;
  object-fit: cover;
  object-position: center;

  display: block;

  border-bottom: 1px solid #ededed;
}

.recipe-card h2 {
  color: var(--blue);
  font-size: 20px;
  font-weight: 650;

  padding: 0 18px;
  margin: 18px 0 12px;
  line-height: 1.35;
}

.recipe-card p {
  padding: 0 18px;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 18px;
  line-height: 1.6;
}

.recipe-card button {
  margin: auto 18px 18px;
  align-self: flex-start;
}

/* Pulsanti */

.primary,
button {
  background: var(--red);
  border: 0;
  border-radius: 10px;
  color: #fff;
  padding: 12px 16px;
  font-size: 13px;
}

/* Scheda ricetta base */

.detail-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  background: #fafafa;
  border-radius: 16px;
  margin: 20px 0 24px;
}

.detail {
  max-width: 900px;
  margin: 24px auto;
}

.detail h2 {
  font-size: 22px;
  color: var(--text);
}

.detail article {
  padding: 0;
}

.detail pre,
.detail p {
  overflow-wrap: anywhere;
  line-height: 1.8;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  line-height: 1.75;
}

/* Pannelli e Profilo */

.panel {
  background: #fafafa;
  border: 1px solid #e9e9e9;
  border-radius: 16px;
  padding: 26px;
  margin: 20px 0;
}

.panel a {
  display: inline-block;
  margin: 8px;
}

/* Dati utente: leggibili e ordinati */

.rf-profile h2 {
  margin-top: 0;
}

.rf-profile-details {
  margin: 18px 0;
}

.rf-profile-detail {
  padding: 8px 0;
  margin: 0;
  border-bottom: 1px solid #ececec;
  overflow-wrap: anywhere;
}

.rf-profile-detail:last-child {
  border-bottom: 0;
}

.rf-profile-detail strong {
  color: var(--text);
}

.rf-profile-links {
  margin-top: 12px;
}

/* Avvisi staging */

.auth-note {
  padding: 12px 16px;
  border-radius: 12px;
  background: #f5f5f5;
  border: 1px solid #eaeaea;
  font-size: 13px;
}

/* Immagini segnaposto */

.recipe-card img[src$="placeholder.svg"] {
  object-fit: contain;
  background: #f5f5f5;
  padding: 15px;
}

/* Navigazione */

nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);

  width: min(1120px, 100%);

  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(16px);

  border-top: 1px solid #ededed;

  display: grid;
  grid-template-columns: repeat(5, 1fr);

  padding:
    10px 8px
    calc(12px + env(safe-area-inset-bottom));

  z-index: 10;
}

nav a {
  text-align: center;
  text-decoration: none;
  font-size: 11px;
  color: #72808c;
  padding: 4px 0;
}

nav a span {
  display: block;
  font-size: 26px;
  line-height: 30px;
  margin-bottom: 4px;
}

nav a[aria-current] {
  color: var(--red);
  font-weight: 700;
}

/* Footer */

footer {
  text-align: center;
  color: #7c8b96;
  font-size: 12px;
  padding: 15px;
}

/* Stato */

#status {
  padding: 0 22px;
  color: var(--muted);
  font-size: 13px;
}

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 4px;
}

/* Tablet */

@media (max-width: 900px) {
  .app {
    max-width: 760px;
  }

  header {
    padding-inline: 24px;
  }

  main {
    padding: 24px;
  }

  .categories {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .recipe-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .hero {
    min-height: 340px;
  }

  .recipe-card img {
    height: 220px;
  }

  nav {
    width: min(760px, 100%);
  }
}

/* iPhone e smartphone */

@media (max-width: 600px) {
  html,
  body {
    background: #fff;
  }

  .app {
    max-width: 100%;
    box-shadow: none;
  }

  header {
    height: 112px;
    grid-template-columns: 48px 1fr 48px;
    padding-inline: 20px;
  }

  main {
    padding: 20px 18px;
  }

  h1 {
    font-size: 29px;
    margin-bottom: 16px;
  }

  .hero {
    min-height: 290px;
    border-radius: 17px;
  }

  .hero-copy {
    padding: 22px;
  }

  .hero h2 {
    font-size: 29px;
  }

  .categories {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  /*
   * Una ricetta per riga su smartphone:
   * foto più visibili, titolo più leggibile.
   */
  .recipe-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .category {
    aspect-ratio: 1.03;
    border-radius: 15px;
  }

  .category-copy {
    padding: 10px 8px;
    grid-template-columns: 21px 1fr;
    column-gap: 5px;
  }

  .category-copy strong {
    font-size: 14px;
  }

  .category-copy small {
    font-size: 9px;
  }

  .recipe-card {
    border-radius: 15px;
  }

  .recipe-card img {
    height: 245px;
  }

  .recipe-card h2 {
    font-size: 20px;
    padding-inline: 16px;
  }

  .recipe-card p {
    padding-inline: 16px;
    font-size: 13px;
  }

  .recipe-card button {
    margin: auto 16px 16px;
  }

  .detail-image {
    max-height: 380px;
    border-radius: 14px;
  }

  .detail {
    margin-block: 20px;
  }

  .detail h2 {
    font-size: 20px;
  }

  .panel {
    padding: 20px;
  }

  nav {
    width: 100%;
  }

  nav a {
    font-size: 10px;
  }

  nav a span {
    font-size: 25px;
  }
}

/* iPhone piccoli */

@media (max-width: 360px) {
  main {
    padding: 18px 14px;
  }

  .categories {
    gap: 10px;
  }

  .category-copy {
    padding: 10px 7px;
  }

  .category-copy strong {
    font-size: 13px;
  }

  .recipe-card img {
    height: 215px;
  }

  .hero {
    min-height: 270px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}