:root {
  --ocean: #0e4d64;
  --ocean-deep: #093846;
  --sand: #e7dccb;
  --sand-light: #f6f1e8;
  --terracotta: #d98a3d;
  --ink: #1b2a36;
  --muted: #6f8088;
  --line: #e3ddd1;
  --white: #fffdfa;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(14, 77, 100, .10);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: var(--sand-light);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ocean); }

/* ---------- Brand ---------- */
.brand-name { font-family: 'Cormorant Garamond', serif; font-weight: 700; letter-spacing: 6px; font-size: 30px; }
.brand-sub { font-size: 11px; letter-spacing: 5px; color: var(--terracotta); margin-top: 2px; }
.brand.small .brand-name { font-size: 22px; letter-spacing: 4px; }
.brand.small .brand-sub { font-size: 9px; letter-spacing: 3px; }

/* ---------- Gate ---------- */
.gate {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    linear-gradient(rgba(9, 56, 70, .42), rgba(9, 56, 70, .62)),
    url('/assets/home.jpg') center/cover no-repeat;
}
.gate-card {
  background: var(--white); border-radius: 20px; padding: 44px 38px; width: 100%; max-width: 420px;
  text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.gate .brand { margin-bottom: 22px; color: var(--ocean); }
.gate-text { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 24px; }
#gateForm { display: flex; flex-direction: column; gap: 12px; }
.gate-langs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 22px 0 14px; }

input, textarea, select {
  font-family: inherit; font-size: 15px; padding: 13px 15px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--white); color: var(--ink); width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ocean); box-shadow: 0 0 0 3px rgba(14, 77, 100, .12); }
textarea { resize: vertical; }

button {
  font-family: inherit; cursor: pointer; border: none; border-radius: 10px;
  background: var(--ocean); color: #fff; font-size: 15px; font-weight: 600; padding: 13px 18px;
  transition: background .15s, transform .05s;
}
button:hover { background: var(--ocean-deep); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .6; cursor: default; }

.link-btn { background: none; color: var(--ocean); padding: 6px; font-weight: 500; }
.link-btn:hover { background: none; text-decoration: underline; }
.link-btn.small { font-size: 13px; color: var(--muted); margin-top: 8px; }

.error { color: #b3261e; font-size: 13px; margin: 4px 0 0; }
.msg { font-size: 14px; padding: 10px 12px; border-radius: 8px; margin-top: 12px; }
.msg.ok { background: #e7f4ec; color: #1d6b3f; }
.msg.err { background: #fdeceb; color: #b3261e; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255, 253, 250, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 920px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; flex-wrap: wrap; }
.topbar .brand { color: var(--ocean); }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lang-switch { display: flex; gap: 4px; margin-right: 6px; }
.lang-pill { background: transparent; color: var(--muted); border: 1px solid var(--line); padding: 6px 10px; font-size: 12px; font-weight: 600; border-radius: 20px; }
.lang-pill.active { background: var(--ocean); color: #fff; border-color: var(--ocean); }
.lang-pill:hover { background: var(--sand); color: var(--ink); }
.lang-pill.active:hover { background: var(--ocean-deep); color: #fff; }
.icon-btn { background: var(--terracotta); padding: 9px 14px; font-size: 13px; }
.icon-btn:hover { background: #c2772e; }
.icon-btn.ghost { background: transparent; color: var(--ocean); border: 1px solid var(--ocean); }
.icon-btn.ghost:hover { background: var(--ocean); color: #fff; }

/* ---------- Feed ---------- */
.feed-wrap { max-width: 720px; margin: 0 auto; padding: 0 20px 80px; }
.hero { text-align: center; padding: 56px 10px 30px; }
.hero h1 { font-family: 'Cormorant Garamond', serif; font-size: 44px; font-weight: 700; color: var(--ocean); margin: 0 0 10px; }
.hero p { color: var(--muted); font-size: 16px; max-width: 520px; margin: 0 auto; line-height: 1.6; }

.feed { display: flex; flex-direction: column; gap: 28px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; }
.card-head time { color: var(--terracotta); font-size: 13px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; }
.card-title { font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 700; color: var(--ink); margin: 8px 0 14px; line-height: 1.2; }
.card-body { font-size: 16px; line-height: 1.7; color: #2c3e48; }

.del-btn { background: transparent; color: #b3261e; border: 1px solid #f0c9c6; padding: 5px 10px; font-size: 12px; }
.del-btn:hover { background: #b3261e; color: #fff; }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 18px; }
.shot { position: relative; margin: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--sand); }
.shot img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; transition: transform .3s; }
.shot:hover img { transform: scale(1.05); }
.shot .dl {
  position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(14, 77, 100, .85); color: #fff; display: grid; place-items: center;
  text-decoration: none; font-size: 16px; opacity: 0; transition: opacity .2s;
}
.shot:hover .dl { opacity: 1; }

.empty { text-align: center; color: var(--muted); padding: 50px; }
.sentinel { height: 1px; }
.loader { text-align: center; color: var(--muted); padding: 20px; letter-spacing: 4px; }

.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 20px 50px; border-top: 1px solid var(--line); }

/* ---------- Modali ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(9, 56, 70, .55); display: grid; place-items: center; padding: 20px; }
.modal-card { background: var(--white); border-radius: 18px; padding: 32px 30px; width: 100%; max-width: 440px; position: relative; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); max-height: 90vh; overflow: auto; }
.modal-card.wide { max-width: 600px; }
.modal-card h2 { font-family: 'Cormorant Garamond', serif; color: var(--ocean); font-size: 28px; margin: 0 0 6px; }
.modal-card p { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.modal-card form { display: flex; flex-direction: column; gap: 6px; }
.modal-card label { font-size: 13px; font-weight: 600; color: var(--ink); margin-top: 10px; }
.modal-card button[type=submit] { margin-top: 18px; }
.modal-close { position: absolute; top: 14px; right: 16px; background: none; color: var(--muted); font-size: 26px; line-height: 1; padding: 4px 8px; }
.modal-close:hover { background: none; color: var(--ink); }
.modal-card hr { border: none; border-top: 1px solid var(--line); margin: 22px 0 8px; }

.post-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.post-preview img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; }

.subs-list { margin-top: 12px; max-height: 240px; overflow: auto; }
.subs-list table { width: 100%; border-collapse: collapse; font-size: 13px; }
.subs-list th, .subs-list td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.subs-list th { color: var(--muted); font-weight: 600; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .9); display: grid; place-items: center; padding: 30px; }
.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: 8px; }
.lightbox-close { position: absolute; top: 18px; right: 22px; background: none; font-size: 34px; color: #fff; }
.lightbox-close:hover { background: none; }
.lightbox-download {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--terracotta); color: #fff; text-decoration: none; padding: 11px 24px; border-radius: 24px; font-weight: 600; font-size: 14px;
}
.lightbox-download:hover { background: #c2772e; }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .hero h1 { font-size: 34px; }
  .card { padding: 20px; }
  .card-title { font-size: 24px; }
  .topbar-inner { padding: 10px 14px; }
  .brand.small .brand-name { font-size: 18px; }
}
