/* ===== Kabala Quotes – Green soft theme, mobile-first ===== */
:root{
  --bg:#f6faf7;              /* nền tổng thể xanh lá nhạt */
  --card:#ffffff;            /* nền thẻ */
  --ink:#0b2d1f;             /* màu chữ chính */
  --muted:#6a7c73;           /* chữ phụ */
  --line:#e3eee7;            /* viền nhạt */
  --accent:#3bb26b;          /* xanh lá chủ đạo */
  --accent-600:#2b9558;
  --accent-50:#e8f7ee;       /* nền nhạt cho hover */
  --warn:#b00020;

  --radius-lg:16px;
  --radius:12px;
  --radius-sm:10px;

  --pad:14px;

  --shadow-sm:0 1px 2px rgba(0,0,0,.04);
  --shadow-md:0 8px 24px rgba(26,121,78,.10);
  --shadow-lg:0 16px 48px rgba(26,121,78,.14);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body.body{
  font-family: "Inter","Be Vietnam Pro",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Header & Nav ===== */
.site-header{
  position: sticky; top:0; z-index:30;
  display:flex; align-items:center; gap:10px;
  padding:10px 12px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.brand{
  font-weight:800; letter-spacing:.2px;
  text-decoration:none; color: var(--ink);
  padding:6px 10px; border-radius: var(--radius-sm);
}
.brand:hover{ background: var(--accent-50); }
.nav{ margin-left:auto; display:flex; gap:10px; }
.nav a{
  text-decoration:none; color: var(--ink);
  padding:8px 12px; border-radius: var(--radius-sm);
  transition: background .2s ease, color .2s ease;
}
.nav a:hover{ background: var(--accent-50); color:#0a2a1d; }

.main{ padding: 12px; }

/* ===== Cards ===== */
.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(12px,2.5vw,18px);
  margin: 10px auto;
  box-shadow: var(--shadow-sm);
  max-width: 980px;
}
/* CHỌN 2: Gạch chân gradient */
.card h2, .card h3{
  position: relative;
  color: #2e6e48;
}
.card h2::after, .card h3::after{
  content: "";
  display: block;
  height: 3px;
  width: 180px;
  margin-top: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #3bb26b, #b0edca 60%, #f3fff8);
  box-shadow: 0 2px 8px rgba(26,121,78,.18);
}

/* ===== Form & Controls ===== */
.row{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 680px){
  .row{ grid-template-columns: repeat(3, minmax(0,1fr)); }
  .row .field[style*="flex-basis:100%"]{ grid-column: 1 / -1; }
}
.field{ display:flex; flex-direction:column; gap:6px; }
.field label{ font-size: 13px; color: var(--muted); }

input,
select,
textarea{
  width:100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  box-shadow: inset 0 0 0 rgba(0,0,0,0);
}

textarea{ min-height: 130px; resize: vertical; }
input[type="color"]{ padding: 6px; height: 44px; }

input:focus, select:focus, textarea:focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,178,107,.18);
}

select{
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 18px) calc(1em + 3px),
    calc(100% - 13px) calc(1em + 3px),
    calc(100% - 2.5em) .5em;
  background-size: 6px 6px, 6px 6px, 1px 1.5em;
  background-repeat: no-repeat;
  appearance:none;
}
button {
    padding: 16px !important;
}
/* ===== Buttons ===== */
button, .btn{
  appearance: none;
  border: none;
  border-radius: 14px;
  padding: 11px 16px;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-md);
  transition: transform .02s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease;
  text-decoration: none;
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
}
button:hover, .btn:hover{ background: var(--accent-600); box-shadow: var(--shadow-lg); }
button:active, .btn:active{ transform: translateY(1px); }

.btn-outline{
  background: #fff;
  color: var(--accent-600);
  border: 1px solid var(--accent);
  box-shadow: none;
}
.btn-outline:hover{
  background: var(--accent-50);
  color: var(--accent-600);
}

.actions{
  display: flex;
  gap: 10px;
  justify-content: center;   /* Căn giữa ngang */
  align-items: center;        /* (tuỳ chọn) căn giữa dọc */
  flex-wrap: wrap;
  width: 100%;
  margin-top: 8px;            /* (tuỳ chọn) tạo khoảng cách trên */
}

/* ===== Preview / Thumbs ===== */
.preview{
  position: relative;
  width: 100%;
  margin: 8px auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #dfe9e3;
  aspect-ratio: 1200 / 628;      /* luôn đúng tỉ lệ 1200x628 */
  box-shadow: var(--shadow-md);
}
.preview .bg{
  position:absolute; inset:0;
  background-size: cover; background-position: center;
  filter: var(--blur, none);
  transform: translateZ(0);       /* render mượt trên mobile */
}
.preview .overlay{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  padding: clamp(16px, 4vw, 28px);
  text-align:center;
  background: linear-gradient(to bottom, rgba(255,255,255,.0), rgba(255,255,255,.04));
}
.preview .quote{
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.25;
  margin: 0;
  text-shadow:
    0 1px 1px rgba(0,0,0,.06),
    0 2px 12px rgba(0,0,0,.06);
}

/* ===== Grid for items ===== */
.grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}
@media (min-width: 560px){
  .grid{ grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (min-width: 900px){
  .grid{ grid-template-columns: repeat(4, minmax(0,1fr)); }
}
.thumb{
  aspect-ratio: 1200 / 628;
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #eef5f0;
}

/* ===== Helpers ===== */
.meta{ font-size:12px; color: var(--muted); text-align:center; }
.small{ font-size:12px; color: var(--muted);text-align: center; }
a{ color: var(--accent-600); }
a:hover{ color: var(--accent); }

/* ===== Footer ===== */
.site-footer{
  margin: 10px auto 18px;
  text-align:center;
  color: var(--muted);
}

/* ===== Error / notices ===== */
.notice-error{ color: var(--warn); }

/* Giữ tỉ lệ khung 1200x628 để không méo */
.preview{
  position: relative;
  width: 100%;
  margin: 0 auto;
  aspect-ratio: 1200 / 628;
  border-radius: 16px;
  overflow: hidden;
  background: #eef3ef;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.preview .bg,
.preview .overlay{ position:absolute; inset:0; }
.preview .bg{ background-position:center; background-size:cover; }
.preview .overlay{
  display:flex; align-items:center; justify-content:center;
  padding:20px; text-align:center;
}
.preview .quote{ line-height:1.35; white-space:pre-line; word-break:break-word; }
.preview .bg{ background-position:center; background-size:cover; }

/* Mobile: ép font nhỏ lại, GHI ĐÈ inline bằng !important */
@media (max-width: 480px){
  .preview{ max-width: 100%; border-radius: 14px; }
  .preview .overlay{ padding: 14px; }
  .preview .quote{
    font-size: min(6vw, 26px) !important;  /* ép nhỏ chữ */
    line-height: 1.3;
  }
}
