: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(820px, 96vw);
  margin: 0 auto;
  max-width: 96vw;
}

.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) */
  top: 7.5%;
  left: 9%;
  width: 82%;
  height: 85%;

  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:22px; }
.caption p { margin:0; opacity:.9; }

/* Fullscreen ONLY the photo frame container */
#photoFrame:fullscreen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  padding: 0;
  background:#000;
  display:flex;
  align-items:center;
  justify-content:center;
}
#photoFrame:fullscreen .slide { padding:0; }
#photoFrame:fullscreen .frame-container{
  width: 100vw;
  max-width: 100vw;
}
#photoFrame:fullscreen .frame-overlay{
  width: 100vw;
  height: 100vh;
  object-fit: contain;
}
#photoFrame:fullscreen .frame-photo{
  top: 8%;
  left: 9%;
  width: 82%;
  height: 84%;
  object-fit: contain; /* TV safe */
}
#photoFrame:fullscreen .caption{
  position: absolute;
  left: 20px; right: 20px; 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; }

