/* ═══════════════════════════════════════════════
   global.css · Invincibile Famiglia
   Shared across: index.html, photos_index.html, recipes_index.html
   ═══════════════════════════════════════════════ */

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── DESIGN TOKENS ── */
:root {
  --green:   #009246;
  --green-d: #007a3d;
  --red:     #CE2B37;
  --red-d:   #a82230;
  --white:   #FFFFFF;
  --muted:   rgba(255,255,255,0.4);
  --border:  rgba(255,255,255,0.08);
  --bg:      #0f0f0f;
  --card:    #1a1a1a;
  --text:    #e8e8e8;
}

/* ── BASE ── */
html {
  min-height: 100vh;
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
}
body {
  min-height: 100vh;
  overflow-x: clip;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }

/* ── ANIMATIONS ── */
@keyframes fadeUp   { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
@keyframes fadeIn   { from{opacity:0} to{opacity:1} }
@keyframes scaleIn  { from{opacity:0;transform:scale(.95) translateY(12px)} to{opacity:1;transform:scale(1) translateY(0)} }
@keyframes spin     { to{transform:rotate(360deg)} }
@keyframes shake    { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-10px)} 40%,80%{transform:translateX(10px)} }
@keyframes slideUp  { from{opacity:0;transform:translateY(40px)} to{opacity:1;transform:translateY(0)} }
@keyframes pulse    { 0%,100%{box-shadow:0 0 0 8px rgba(206,43,55,.05)} 50%{box-shadow:0 0 0 18px rgba(206,43,55,0)} }

/* Animation utility classes */
.fu  { animation: fadeUp  .4s ease both; }
.fi  { animation: fadeIn  .3s ease both; }
.si  { animation: scaleIn .3s cubic-bezier(.34,1.56,.64,1) both; }
.su  { animation: slideUp .35s ease both; }
.au1 { animation: fadeUp .55s        ease both; }
.au2 { animation: fadeUp .55s  .08s  ease both; }
.au3 { animation: fadeUp .55s  .16s  ease both; }
.au4 { animation: fadeUp .55s  .24s  ease both; }
.au5 { animation: fadeUp .55s  .32s  ease both; }
.au6 { animation: fadeUp .55s  .40s  ease both; }
.au7 { animation: fadeUp .55s  .48s  ease both; }

/* ── BACKGROUND ── */
.bg {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse at 15% 55%, rgba(0,146,70,0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 20%, rgba(206,43,55,0.08) 0%, transparent 50%),
    #0f0f0f;
}
.bg-ring {
  position: fixed; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.04);
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  pointer-events: none; z-index: 0;
}

/* ── CREST WATERMARK (pseudo-element, all pages) ── */
body::before {
  content: '';
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 900px; height: 900px;
  background: url('/crest_watermark.png') center/contain no-repeat;
  opacity: 0.40;
  pointer-events: none; z-index: 1;
  filter: grayscale(100%) brightness(2);
}

/* ── WATERMARK TEXT ── */
.wm-text {
  position: fixed;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 60px 80px;
  pointer-events: none; z-index: 1;
  font-family: 'DM Sans', sans-serif;
  font-size: 1.05rem; line-height: 2.5;
  color: rgba(255,255,255,.06);
  text-align: justify;
  letter-spacing: .07em;
  overflow: hidden;
  word-spacing: .4em;
  user-select: none;
  box-sizing: border-box;
}

/* ── PAGE LAYOUT ── */
.page {
  position: relative; z-index: 2;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
#root {
  position: relative; z-index: 2;
  flex: 1; display: flex; flex-direction: column;
}

/* ── ITALIAN FLAG BAR ── */
.flag-bar {
  display: flex; height: 3px; width: 100%;
  position: fixed; top: 0; left: 0; z-index: 200;
}
.flag-bar div { flex: 1; }

/* ── HEADER ── */
header {
  padding: 20px 40px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,10,.97); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.logo {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: 1.12rem; letter-spacing: -.02em;
  cursor: pointer; text-decoration: none;
}
.logo .inv { color: #ffffff; }
.logo .fam { color: var(--red); }

/* ── HAMBURGER (Italian flag stripes) ── */
.ham-btn {
  display: flex; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 8px 10px; border-radius: 9px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  transition: background .2s, border-color .2s;
  position: relative; z-index: 110;
}
.ham-btn:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.2); }
.ham-btn .stripe { height: 3px; width: 26px; border-radius: 2px; transition: transform .28s ease, opacity .28s ease; transform-origin: center; }
.ham-btn .s1 { background: #009246; }
.ham-btn .s2 { background: #ffffff; }
.ham-btn .s3 { background: #CE2B37; }
.ham-btn.open .s1 { transform: translateY(8px) rotate(45deg); }
.ham-btn.open .s2 { opacity: 0; transform: scaleX(0); }
.ham-btn.open .s3 { transform: translateY(-8px) rotate(-45deg); }

/* ── SITE FOOTER ── */
.site-footer {
  background: #080808; border-top: 1px solid var(--border);
  text-align: center; padding: 28px 24px;
  margin-top: auto;
}
.site-footer .footer-flag {
  display: flex; justify-content: center; gap: 3px; margin-bottom: 12px;
}
.site-footer .footer-flag span {
  display: block; height: 2px; width: 26px; border-radius: 2px;
}
.site-footer .footer-text {
  font-family: 'DM Sans', sans-serif;
  font-size: .73rem; letter-spacing: .05em;
  color: rgba(255,255,255,.2);
}
.site-footer .footer-text strong {
  font-family: 'Syne', sans-serif; font-weight: 800;
  color: rgba(255,255,255,.45); letter-spacing: -.01em;
}

/* ── NAV OVERLAY ── */
.nav-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  z-index: 150; opacity: 0; pointer-events: none;
  transition: opacity .3s; backdrop-filter: blur(5px);
}
.nav-overlay.open { opacity: 1; pointer-events: all; }

/* ── NAV DRAWER ── */
.nav-drawer {
  position: fixed; top: 0; right: -320px; width: 290px; height: 100vh;
  background: #111111; border-left: 1px solid var(--border);
  z-index: 160; transition: right .32s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.nav-drawer.open { right: 0; }
.nav-drawer-flag { display: flex; height: 3px; flex-shrink: 0; }
.nav-drawer-flag div { flex: 1; }
.nav-drawer-head {
  padding: 28px 28px 22px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.nav-drawer-title { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1rem; letter-spacing: -.02em; }
.nav-drawer-title .inv { color: #ffffff; }
.nav-drawer-title .fam { color: var(--red); }
.nav-drawer-sub { font-size: .7rem; color: var(--muted); font-style: italic; margin-top: 3px; }
.nav-links { padding: 16px 0; flex: 1; overflow-y: auto; }
.nav-section-label {
  padding: 18px 28px 8px; font-size: .62rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255,255,255,.2);
}
.nav-tile {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 12px; padding: 12px 16px;
  text-decoration: none; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07);
  border-left-width: 3px;
  color: rgba(255,255,255,.75); font-size: .88rem; font-weight: 500;
  transition: all .2s;
}
.nav-tile:hover { background: rgba(255,255,255,.09); color: #fff; transform: translateX(3px); }
.nt-name { display: flex; align-items: center; }
.nav-link-arrow { font-size: .72rem; color: rgba(255,255,255,.25); }
.nt-green { border-left-color: var(--green); }
.nt-green:hover { background: rgba(0,146,70,.1); }
.nt-red { border-left-color: var(--red); }
.nt-red:hover { background: rgba(206,43,55,.1); }
.nt-white { border-left-color: rgba(255,255,255,.35); }
.nav-footer {
  padding: 20px 28px; border-top: 1px solid var(--border);
  font-size: .72rem; color: rgba(255,255,255,.2); flex-shrink: 0;
}

/* ── INPUTS ── */
.fi-base {
  width: 100%; padding: 11px 15px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-family: 'DM Sans', sans-serif; font-size: .9rem;
  color: var(--text); background: rgba(255,255,255,.05);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.fi-base::placeholder { color: rgba(255,255,255,.25); }
.fi-base:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(0,146,70,.15); }
.fi-base option { background: #1c1c1c; color: #fff; }

/* ── BUTTONS ── */
.btn-g {
  background: var(--green); color: #fff; border: none;
  border-radius: 10px; padding: 11px 22px;
  font-family: 'DM Sans', sans-serif; font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: background .2s, transform .1s; white-space: nowrap;
}
.btn-g:hover  { background: var(--green-d); }
.btn-g:active { transform: scale(.97); }
.btn-r {
  background: var(--red); color: #fff; border: none;
  border-radius: 10px; padding: 11px 22px;
  font-family: 'DM Sans', sans-serif; font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: background .2s, transform .1s; white-space: nowrap;
}
.btn-r:hover  { background: var(--red-d); }
.btn-r:active { transform: scale(.97); }
.btn-ghost {
  background: transparent; border: 1.5px solid var(--border); border-radius: 9px;
  padding: 9px 18px; font-family: 'DM Sans', sans-serif; font-size: .82rem;
  color: var(--muted); cursor: pointer; transition: all .2s; white-space: nowrap;
}
.btn-ghost:hover { border-color: var(--green); color: var(--green); }

/* ── PIN KEYPAD ── */
.pin-k {
  width: 72px; height: 72px; border-radius: 50%; border: none;
  font-family: 'Syne', sans-serif; font-size: 1.35rem; font-weight: 700;
  cursor: pointer; transition: background .15s, transform .1s;
}
.pin-k:active { transform: scale(.9); }

/* ── PILL / FILTER TAGS ── */
.pill {
  padding: 7px 16px; border-radius: 100px;
  border: 1.5px solid var(--border); background: rgba(255,255,255,.04);
  font-family: 'DM Sans', sans-serif; font-size: .8rem; font-weight: 500;
  color: var(--muted); cursor: pointer; white-space: nowrap; transition: all .2s;
}
.pill:hover { border-color: var(--green); color: var(--green); }
.pill.on { background: var(--green); border-color: var(--green); color: #fff; }

/* ── MODAL ── */
.backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.82);
  z-index: 250; display: flex; align-items: flex-start; justify-content: center;
  padding: 20px 16px 60px; overflow-y: auto; backdrop-filter: blur(8px);
}
.modal {
  background: #1c1c1c; border: 1px solid var(--border);
  border-radius: 20px; width: 100%; max-width: 580px;
  margin-top: 20px; overflow: hidden; box-shadow: 0 40px 100px rgba(0,0,0,.5);
}
.modal-bar { height: 3px; background: linear-gradient(to right,#009246,#fff,#CE2B37); }
.modal-head {
  padding: 24px 28px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.15rem; }
.modal-body { padding: 20px 28px 32px; }
.close-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.07); border: none;
  color: var(--muted); font-size: .9rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.close-btn:hover { background: rgba(255,255,255,.14); color: #fff; }

/* ── MISC ── */
input[type=file] { display: none; }
