:root { font-family: system-ui, Arial; }
body { margin:0; background:#f7f7f7; color:#111; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 16px; }
.topbar { background:#fff; border-bottom:1px solid #e5e5e5; position:sticky; top:0; z-index:10;}
.topbar .wrap { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.brand a { font-weight:700; text-decoration:none; color:#111; }
nav a { margin-left:10px; text-decoration:none; color:#333; }
nav .danger { color:#b00020; }
.pill { background:#eee; padding:6px 10px; border-radius:999px; font-size:12px; margin-left:10px; }
.card { background:#fff; border:1px solid #e5e5e5; border-radius:14px; padding:16px; box-shadow: 0 1px 8px rgba(0,0,0,.04); }
.grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap:14px; }
.thumb img { width:100%; height:220px; object-fit:cover; border-radius:12px; background:#ddd; }
.btn { display:inline-block; border:1px solid #ddd; background:#fff; padding:10px 12px; border-radius:10px; text-decoration:none; color:#111; cursor:pointer;}
.btn.primary { background:#111; color:#fff; border-color:#111; }
.btn.danger { background:#b00020; color:#fff; border-color:#b00020; }
.row { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.table { width:100%; border-collapse:collapse; }
.table th,.table td { padding:10px; border-bottom:1px solid #eee; text-align:left; vertical-align:middle; }
input, textarea, select { width:100%; padding:10px; border-radius:10px; border:1px solid #ddd; }
label { display:block; margin:10px 0 6px; font-weight:600; }
h1,h2 { margin: 6px 0 14px; }
.error { padding:10px 12px; border-radius:12px; background:#ffebee; border:1px solid #ffcdd2; }


.slideshow {
  height: calc(100vh - 70px);
  display:flex;
  align-items:center;
  justify-content:center;
}
.slide {
  width: min(920px, 98vw);
  border-radius:18px;
  overflow:hidden;
  position:relative;
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
  background:#000;
  padding: 14px;
}

/* ===== Real frame overlay (responsive, mobile-safe) ===== */
/* The overlay image stays in the normal flow to define container height. */
.frame-container{
  position: relative;
  width: min(920px, 100vw);
  margin: 0 auto;
  max-width: 110vw;
}

.frame-overlay{
  display:block;
  width:100%;
  height:auto;
  position:relative;
  z-index: 3;
  pointer-events:none;
}

/* Photo placed inside the frame opening */
.frame-photo{
  position:absolute;
  z-index: 2;

  /* Opening box (tuned for your gold frame) not full screen SN*/
  top: 10%;
  left: 13%;
  width: 75%;
  height: 78%;

  object-fit: cover; /* change to contain if you don't want cropping */
  background:#000;
}

.caption {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,.6);
  color:#fff;
}
.caption h2 { margin:0 0 4px; font-size:24px; }
.caption p { margin:0; opacity:.9; }

/* Fullscreen ONLY the photo frame container */
#photoFrame:fullscreen {
  width: 100vw;
  height: 50vh;
  border-radius: 0;
  padding: 0;
  background:#000;
  display:flex;
  align-items:center;
  justify-content:center;
}
#photoFrame:fullscreen .slide { padding:3; }
#photoFrame:fullscreen .frame-container{
  width: 110vw;
  max-width:110vw;
}
#photoFrame:fullscreen .frame-overlay{  /* frame position  SN*/
  width: 20vw;
  height:20vh;
  object-fit: contain;
}
#photoFrame:fullscreen .frame-photo{  /* photo position  SN*/
  top: 30%;
  left: 30%;
  width: 40%;
  height: 40%;
  object-fit: contain; /* TV safe */
}
#photoFrame:fullscreen .caption{
  position: absolute;
  left: 10px; right: 10px; bottom: 20px;
  margin: 0;
}

/* Kiosk start overlay */
.kiosk-start{
  position: fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,.75);
  z-index: 9999;
}
.kiosk-start .panel{
  width: min(520px, 92vw);
  text-align:center;
}
.kiosk-start h1{ color:#fff; margin:0 0 10px; }
.kiosk-start p{ color:#ddd; margin:0 0 14px; }


/* ===== Caption centered at bottom ===== */

.caption-bottom{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding-bottom: 18px;
  z-index: 5;
  pointer-events: none;
}

/* black translucent box */
.caption-box{
  max-width: 90%;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  border-radius: 14px;
  padding: 14px 22px;
  text-align: center;
  color: #fff;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
}

/* title */
.caption-box h2{
  margin: 0;
  font-size: clamp(18px, 3.8vw, 28px);
  font-weight: 700;
  line-height: 1.2;
}

/* description */
.caption-box p{
  margin: 6px 0 0;
  font-size: clamp(13px, 3.2vw, 18px);
  opacity: .9;
  line-height: 1.4;
}


/* ===== Arabic RTL Global ===== */
html, body {
  direction: rtl;
}

body {
  font-family: "Tajawal", system-ui, Arial, sans-serif;
}

/* Top nav: reverse spacing */
.topbar .wrap {
  flex-direction: row-reverse;
}

nav a { margin-left: 0; margin-right: 10px; }

/* Tables align right */
.table th, .table td { text-align: right; }

/* Forms */
label { text-align: right; }

/* Pills & rows alignment */
.row { justify-content: flex-start; }
.pill { margin-left: 0; margin-right: 10px; }

/* Caption (slideshow bottom center stays centered) */
.caption-box { direction: rtl; text-align: center; }

/* Inputs feel better in RTL */
input, textarea, select { direction: rtl; text-align: right; }



.searchbar{display:flex;gap:10px;align-items:center;justify-content:flex-start;flex-wrap:wrap}
.searchbar input{min-width:220px;flex:1;max-width:420px;padding:10px 12px;border:1px solid #ddd;border-radius:10px;font-family:inherit;font-size:16px}


/* Death date + description in cards */
.death-date{font-weight:700;margin-top:6px;color:#444;font-size:14px}
.description{margin-top:6px;color:#666;font-size:14px;line-height:1.6}
