/* Note: the site's style.css sets "A:link { BACKGROUND: none }", so backgrounds on links below use !important. */
/* Shared design for the elad-g.org content pages (news, eulogies, songs, commemoration).
   Same look as ner.php / letters.php / add_ner.php. Works inside the site's 700px main table. */

.mp { direction: rtl; padding: 24px 20px 34px; font-family: Arial, Helvetica, sans-serif; color: #e9eef8; }
.mp a { font-family: Arial, Helvetica, sans-serif; }

/* header card */
.mp-head {
  max-width: 640px; margin: 0 auto 20px; padding: 20px 26px; text-align: center;
  background: linear-gradient(180deg, #14203a 0%, #0b1226 100%); border: 1px solid #2c3d63; border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.mp-head h1 { margin: 0; font-size: 22px; font-weight: normal; color: #ffd27a; }
.mp-sub { margin: 6px 0 0; font-size: 14px; color: #aab6cf; line-height: 1.5; }
.mp-head audio { width: 300px; max-width: 100%; height: 36px; margin-top: 14px; }

/* section titles */
.mp-sec { max-width: 660px; margin: 0 auto 22px; }
.mp-sec h2 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; font-size: 17px; font-weight: normal; color: #ffd27a; }
.mp-sec h2 small { font-size: 12px; color: #7f8cab; }
.mp-sec h2::after { content: ""; flex: 1; border-bottom: 1px solid #25355a; }

/* thumbnail grid (clippings, eulogies, songs) */
.mp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 660px; margin: 0 auto; }
.mp-item {
  margin: 0; display: block; text-decoration: none; cursor: zoom-in;
  background: linear-gradient(180deg, #141f38 0%, #0d1529 100%) !important; border: 1px solid #25355a; border-radius: 10px; padding: 8px;
  transition: border-color .15s, transform .15s;
}
.mp-item:hover, .mp-item:focus { border-color: #ffcc66; transform: translateY(-2px); outline: none; }
.mp-item .ph { height: 150px; border-radius: 6px; overflow: hidden; background: #f4f1ea; }
.mp-item img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.mp-item .t { font-size: 13px; color: #fff; font-weight: bold; margin-top: 7px; line-height: 1.35; }
.mp-item .s { font-size: 11px; color: #9fb0cf; margin-top: 3px; line-height: 1.35; }

/* timeline (commemoration page) */
.mp-tl { max-width: 640px; margin: 0 auto; position: relative; padding-right: 22px; }
.mp-tl::before { content: ""; position: absolute; top: 6px; bottom: 6px; right: 7px; width: 2px; background: linear-gradient(#ffcc66, #2c3d63); border-radius: 2px; }
.mp-ev {
  position: relative; display: flex; gap: 16px; align-items: flex-start; margin-bottom: 14px; padding: 14px 16px;
  background: linear-gradient(180deg, #141f38 0%, #0d1529 100%); border: 1px solid #25355a; border-radius: 12px;
}
.mp-ev::before { content: ""; position: absolute; right: -21px; top: 18px; width: 12px; height: 12px; border-radius: 50%; background: #ffcc66; box-shadow: 0 0 0 4px #0b1226; }
.mp-ev .tx { flex: 1; min-width: 0; }
.mp-ev .nm { display: inline-block; font-size: 11px; color: #1a1300; background: #ffcc66; border-radius: 10px; padding: 1px 8px; font-weight: bold; }
.mp-ev .dt { font-size: 12px; color: #ffd27a; margin-right: 8px; direction: rtl; }
.mp-ev p { margin: 8px 0 0; font-size: 14px; line-height: 1.7; color: #dfe6f3; }
.mp-ev .ph { flex: 0 0 110px; cursor: zoom-in; border-radius: 8px; overflow: hidden; border: 1px solid #2c3d63; background: #f4f1ea !important; }
.mp-ev .ph:hover { border-color: #ffcc66; }
.mp-ev .ph img { width: 110px; height: 140px; object-fit: cover; object-position: top; display: block; }
.mp-ev a.ph { cursor: pointer; }

/* full-size viewer */
.mp-box { position: fixed; inset: 0; z-index: 50; display: none; flex-direction: column; align-items: center; justify-content: center;
          background: rgba(3, 6, 15, .94); padding: 18px 60px; direction: rtl; font-family: Arial, Helvetica, sans-serif; }
.mp-box.on { display: flex; }
.mp-box img { max-width: 100%; max-height: calc(100vh - 90px); border-radius: 6px; background: #fff; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); }
.mp-box .cap { color: #fff; font-size: 15px; margin-top: 12px; text-align: center; }
.mp-box .cap small { color: #9fb0cf; margin-right: 8px; }
.mp-box button { position: absolute; background: rgba(255, 255, 255, .08); color: #fff; border: 0; border-radius: 50%;
                 width: 44px; height: 44px; font: 24px Arial, sans-serif; cursor: pointer; }
.mp-box button:hover { background: rgba(255, 204, 102, .3); }
.mp-box .x { top: 14px; left: 16px; }
.mp-box .nx { left: 8px; top: 50%; margin-top: -22px; }
.mp-box .pv { right: 8px; top: 50%; margin-top: -22px; }

@media (prefers-reduced-motion: reduce) { .mp-item { transition: none; } .mp-item:hover { transform: none; } }

/* ================= site frame: page, banner, menus, footer ================= */
body.site {
  margin: 0; padding: 18px 12px 10px; min-height: 100vh; box-sizing: border-box;
  background: #050a18 linear-gradient(180deg, #0c1a36 0%, #050a18 420px) no-repeat !important;
  font-family: Arial, Helvetica, sans-serif;
}
table.main {
  width: 100% !important; max-width: 940px; margin: 0 auto; border: 1px solid #1f2d4f !important; border-radius: 18px;
  background: #070d1f !important; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); border-collapse: separate; overflow: hidden;
  table-layout: fixed;   /* keep wide content from stretching the page on phones */
}
table.main img { max-width: 100%; height: auto; }
td.site-top { padding: 18px 18px 0; }
td.site-body { padding: 0 0 10px; }

/* banner: the photo strip at its real size, on a soft blurred copy of itself */
.site-banner {
  position: relative; display: flex; justify-content: center; align-items: center; height: 120px; overflow: hidden;
  border-radius: 12px; background: #1a1408 !important; isolation: isolate;
}
.site-banner::before {
  content: ""; position: absolute; inset: -20px; z-index: -1;
  background: url("images/banner3.jpg") center / cover; filter: blur(18px) brightness(.55) saturate(.9);
}
.site-banner::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 13, 31, 0) 55%, rgba(7, 13, 31, .55) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.site-banner img { display: block; height: 100px; width: auto; max-width: none; border-radius: 6px; box-shadow: 0 6px 24px rgba(0, 0, 0, .45); }

/* main menu */
.site-nav {
  direction: rtl; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-top: 12px; padding: 8px 14px; border-radius: 12px;
  background: linear-gradient(180deg, #131e37, #0d1529); border: 1px solid #22325a;
}
.site-nav a { font-family: Arial, Helvetica, sans-serif !important; text-decoration: none !important; }
.site-brand { display: flex; align-items: center; gap: 9px; color: #ffd27a !important; }
.site-brand img { height: 26px; width: auto; }
.site-brand span { display: flex; flex-direction: column; line-height: 1.15; }
.site-brand b { font-size: 15px; font-weight: bold; color: #ffd27a; }
.site-brand small { font-size: 11px; color: #9fb0cf; letter-spacing: 1px; text-align: right; }
.site-links { display: flex; flex-wrap: wrap; gap: 2px; }
.site-links a {
  font-size: 14px !important; color: #dfe6f3 !important; padding: 7px 12px; border-radius: 8px; white-space: nowrap;
  background: transparent !important; transition: background .15s, color .15s;
}
.site-links a:hover { color: #ffcc66 !important; background: rgba(255, 204, 102, .08) !important; }
.site-links a.on { color: #1a1300 !important; background: linear-gradient(180deg, #ffd88a, #f4b23e) !important; font-weight: bold; }

/* second-level menu */
.site-sub { direction: rtl; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 16px 18px 0; }
.site-sub a {
  font: 13px Arial, Helvetica, sans-serif !important; color: #cfd8ea !important; text-decoration: none !important;
  background: #0f1830 !important; border: 1px solid #2c3d63; border-radius: 16px; padding: 5px 14px;
}
.site-sub a:hover { border-color: #ffcc66; color: #fff !important; }
.site-sub a.on { background: #ffcc66 !important; border-color: #ffcc66; color: #1a1300 !important; font-weight: bold; }

.site-foot { direction: rtl; text-align: center; padding: 14px 0 6px; font: 12px Arial, Helvetica, sans-serif; color: #6f7fa3; }
.site-foot a { font-size: 12px !important; color: #9fb0cf !important; }
.site-foot a:hover { color: #ffcc66 !important; }

/* ================= wider layout ================= */
.mp-head { max-width: 780px; }
.mp-sec, .mp-grid { max-width: 880px; }
.mp-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.mp-tl { max-width: 780px; }

/* ================= phones and small tablets ================= */
@media (max-width: 760px) {
  body.site { padding: 0; }
  table.main { border-radius: 0; border-left: 0 !important; border-right: 0 !important; }
  td.site-top { padding: 10px 10px 0; }
  .site-banner { height: auto; padding: 10px 0; border-radius: 10px; }
  .site-banner img { height: auto; max-width: 100%; }
  .site-nav { padding: 8px 10px; }
  .site-links { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }   /* all seven items visible, 2 rows */
  .site-links a { padding: 8px 2px; font-size: 13px !important; text-align: center; white-space: normal; }
  .mp { padding: 16px 10px 24px; }
  .mp-head { padding: 16px; }
  .mp-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .mp-item .ph { height: 120px; }
  .mp-ev { flex-direction: column; }
  .mp-ev .ph { align-self: center; }
  .mp-box { padding: 10px; }
  .mp-box .nx, .mp-box .pv { top: auto; bottom: 14px; margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) { .site-links a { transition: none; } }
