/* ==========================================================================
   kirelloslibrary.com — shared theme
   Palette from Colors.pdf: cream #fff4e2, yellow #fcce70, orange #f4a462, burgundy #7d2d3c
   ========================================================================== */
:root {
  --cream:    #fff4e2;
  --yellow:   #fcce70;
  --orange:   #f4a462;
  --burgundy: #7d2d3c;
  --burgundy-deep: #5e1f2c;

  --bg:        var(--cream);
  --glow-1:    rgba(252, 206, 112, 0.55);
  --glow-2:    rgba(244, 164, 98, 0.35);
  --ink:       #3b1a21;
  --muted:     rgba(125, 45, 60, 0.78);
  --heading:   var(--burgundy);
  --accent:    var(--orange);
  --card:      #ffffff;
  --card-ink:  var(--burgundy);
  --line:      rgba(125, 45, 60, 0.16);
  --shadow:    0 10px 30px rgba(125, 45, 60, 0.12);
  --shadow-lg: 0 16px 38px rgba(125, 45, 60, 0.22);

  --btn-primary-bg:   var(--burgundy);
  --btn-primary-ink:  var(--cream);
  --btn-primary-hover: var(--burgundy-deep);
  --btn-secondary-bg: var(--yellow);
  --btn-secondary-ink: var(--burgundy);
  --btn-secondary-hover: var(--orange);
  --btn-secondary-hover-ink: #fff;
  --chip:      rgba(125, 45, 60, 0.08);
  --toast-bg:  var(--burgundy);
  --toast-ink: var(--cream);
}

:root[data-theme="dark"] {
  --bg:        #1d0d12;
  --glow-1:    rgba(125, 45, 60, 0.55);
  --glow-2:    rgba(244, 164, 98, 0.18);
  --ink:       #fff4e2;
  --muted:     rgba(255, 244, 226, 0.72);
  --heading:   var(--yellow);
  --accent:    var(--orange);
  --card:      #2a1319;
  --card-ink:  var(--cream);
  --line:      rgba(252, 206, 112, 0.18);
  --shadow:    0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 38px rgba(0, 0, 0, 0.5);

  --btn-primary-bg:   var(--yellow);
  --btn-primary-ink:  var(--burgundy-deep);
  --btn-primary-hover: var(--orange);
  --btn-secondary-bg: #3a1a22;
  --btn-secondary-ink: var(--cream);
  --btn-secondary-hover: var(--burgundy);
  --btn-secondary-hover-ink: var(--cream);
  --chip:      rgba(255, 244, 226, 0.1);
  --toast-bg:  var(--yellow);
  --toast-ink: var(--burgundy-deep);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #1d0d12;
    --glow-1:    rgba(125, 45, 60, 0.55);
    --glow-2:    rgba(244, 164, 98, 0.18);
    --ink:       #fff4e2;
    --muted:     rgba(255, 244, 226, 0.72);
    --heading:   var(--yellow);
    --card:      #2a1319;
    --card-ink:  var(--cream);
    --line:      rgba(252, 206, 112, 0.18);
    --shadow:    0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 38px rgba(0, 0, 0, 0.5);
    --btn-primary-bg:   var(--yellow);
    --btn-primary-ink:  var(--burgundy-deep);
    --btn-primary-hover: var(--orange);
    --btn-secondary-bg: #3a1a22;
    --btn-secondary-ink: var(--cream);
    --btn-secondary-hover: var(--burgundy);
    --btn-secondary-hover-ink: var(--cream);
    --chip:      rgba(255, 244, 226, 0.1);
    --toast-bg:  var(--yellow);
    --toast-ink: var(--burgundy-deep);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100svh;
  font-family: "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 50% -10%, var(--glow-1), transparent 65%),
    radial-gradient(700px 400px at 50% 110%, var(--glow-2), transparent 65%),
    var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 32px;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s ease, color .35s ease;
}
a { color: inherit; }

/* Top bar: theme + share ------------------------------------------------ */
.topbar {
  width: 100%;
  max-width: 520px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.iconbtn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--card-ink);
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, background .25s ease;
}
.iconbtn:hover, .iconbtn:focus-visible { transform: translateY(-2px) rotate(-6deg); box-shadow: var(--shadow-lg); outline: none; }
.iconbtn:active { transform: scale(.94); }
.iconbtn svg { width: 22px; height: 22px; fill: currentColor; }
.iconbtn .sun, .iconbtn .moon { transition: transform .4s cubic-bezier(.4,0,.2,1), opacity .3s; position: absolute; }
.iconbtn { position: relative; }
.iconbtn .moon { opacity: 0; transform: rotate(90deg) scale(.5); }
:root[data-theme="dark"] .iconbtn .moon { opacity: 1; transform: none; }
:root[data-theme="dark"] .iconbtn .sun  { opacity: 0; transform: rotate(-90deg) scale(.5); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .iconbtn .moon { opacity: 1; transform: none; }
  :root:not([data-theme="light"]) .iconbtn .sun  { opacity: 0; transform: rotate(-90deg) scale(.5); }
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 16px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--card-ink);
  font: inherit; font-weight: 700; font-size: .95rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.pill:hover, .pill:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-lg); outline: none; }
.pill:active { transform: scale(.96); }
.pill svg { width: 20px; height: 20px; fill: currentColor; }

/* Main column ----------------------------------------------------------- */
main {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 1;
}
.logo {
  width: 176px; height: 176px;
  margin-bottom: 8px;
  display: grid; place-items: center;
  position: relative;
}
.logo img {
  width: 100%; height: 100%;
  display: block;
  border-radius: 50%;
  filter: drop-shadow(0 10px 24px rgba(125, 45, 60, 0.22));
}
.logo::before {
  content: "";
  position: absolute; inset: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow-1), transparent 70%);
  z-index: -1;
  animation: breathe 5s ease-in-out infinite;
}
h1 {
  margin: 8px 0 0;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--heading);
  text-align: center;
  line-height: 1.3;
}
.subtitle {
  margin: 0;
  font-size: .95rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
  text-align: center;
  direction: ltr;
}
.tagline {
  margin: 4px 0 14px;
  font-size: 1rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

/* Link buttons ---------------------------------------------------------- */
.links {
  list-style: none; margin: 0; padding: 0;
  width: 100%;
  display: flex; flex-direction: column; gap: 14px;
}
.link {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 64px;
  padding: 12px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 1.1rem; font-weight: 700;
  border: 2px solid transparent;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease, background .2s ease, color .2s ease;
}
.link::after {            /* shine sweep on hover */
  content: "";
  position: absolute; top: 0; bottom: 0; width: 40%;
  right: -60%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-18deg);
  pointer-events: none;
}
.link:hover::after, .link:focus-visible::after { animation: shine .8s ease forwards; }
.link:hover, .link:focus-visible {
  transform: translateY(-3px) scale(1.015);
  box-shadow: var(--shadow-lg);
  outline: none;
}
.link:active { transform: translateY(0) scale(.985); }
.link--primary { background: var(--btn-primary-bg); color: var(--btn-primary-ink); }
.link--primary:hover { background: var(--btn-primary-hover); }
.link--secondary { background: var(--btn-secondary-bg); color: var(--btn-secondary-ink); }
.link--secondary:hover { background: var(--btn-secondary-hover); color: var(--btn-secondary-hover-ink); }
.link--outline { background: var(--card); color: var(--card-ink); border-color: var(--line); }
.link--outline:hover { border-color: var(--accent); }
.link .icon {
  flex: 0 0 40px; width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.18);
  transition: transform .25s ease;
}
.link:hover .icon { transform: rotate(-10deg) scale(1.08); }
.link--secondary .icon, .link--outline .icon { background: var(--chip); }
.link .icon svg { width: 22px; height: 22px; fill: currentColor; }
.link .label { flex: 1; text-align: center; }
.link .sub { display: block; font-size: .78rem; font-weight: 500; opacity: .8; margin-top: -2px; }
.link .chev { flex: 0 0 24px; opacity: .6; transition: transform .25s ease, opacity .25s; }
.link .chev svg { width: 18px; height: 18px; fill: currentColor; transform: scaleX(-1); }
.link:hover .chev { transform: translateX(-4px); opacity: 1; }

/* Cards (hours) ------------------------------------------- */
.card {
  width: 100%;
  background: var(--card);
  color: var(--card-ink);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  margin-top: 6px;
}
.card h2 {
  margin: 0 0 8px;
  font-size: .85rem; font-weight: 800;
  letter-spacing: .06em;
  color: var(--accent);
  display: flex; align-items: center; gap: 8px;
}
.card h2 svg { width: 18px; height: 18px; fill: currentColor; }
.card p { margin: 0; line-height: 1.75; font-size: .98rem; }
.card .meta { font-size: .8rem; opacity: .7; margin-top: 8px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.card .more { font-weight: 700; text-decoration: none; color: var(--accent); }
.card .more:hover { text-decoration: underline; }
details.card summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
details.card summary::-webkit-details-marker { display: none; }
details.card summary h2 { margin: 0; }
details.card summary .state { font-size: .85rem; font-weight: 700; }
.open-now { color: #2e7d32; } .closed-now { color: var(--burgundy); }
:root[data-theme="dark"] .closed-now { color: var(--orange); }
details.card[open] summary { margin-bottom: 10px; }
.hours { width: 100%; border-collapse: collapse; font-size: .95rem; direction: rtl; table-layout: fixed; }
.hours thead th { font-size: .75rem; font-weight: 700; opacity: .6; text-align: right; padding: 0 6px 6px; }
.hours thead th:first-child { width: 28%; }
.hours tbody th, .hours td { padding: 8px 6px; border-top: 1px solid var(--line); text-align: right; vertical-align: top; }
.hours tbody th { font-weight: 700; white-space: nowrap; }
.hours td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.hours .range { unicode-bidi: isolate; }
.hours td.closed { opacity: .6; }
.hours tr.today th, .hours tr.today td { font-weight: 800; color: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.effective { font-size: .85rem; color: var(--accent); font-weight: 700; margin: 0 0 8px !important; }
.address { margin-top: 10px; font-size: .9rem; opacity: .85; display: flex; gap: 8px; align-items: flex-start; }
.address svg { width: 18px; height: 18px; fill: currentColor; flex: 0 0 18px; margin-top: 3px; }

/* Footer, toast ---------------------------------------------------------- */
footer {
  margin-top: 28px;
  font-size: .8rem;
  color: var(--muted);
  text-align: center;
  display: flex; flex-direction: column; gap: 4px;
}
footer .cross { font-size: 1.1rem; opacity: .8; }
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translate(-50%, 20px);
  background: var(--toast-bg); color: var(--toast-ink);
  padding: 10px 18px; border-radius: 999px;
  font-weight: 700; font-size: .95rem;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 10;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Entrance animation ---------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise .6s cubic-bezier(.2,.8,.2,1) forwards;
  animation-delay: calc(var(--i, 0) * 90ms);
}
.logo.reveal { transform: scale(.85); animation-name: pop; }

@keyframes rise  { to { opacity: 1; transform: none; } }
@keyframes pop   { 60% { opacity: 1; transform: scale(1.04); } to { opacity: 1; transform: none; } }
@keyframes shine { to { right: 120%; } }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .8; } 50% { transform: scale(1.08); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .reveal, .logo.reveal { animation: none; opacity: 1; transform: none; }
  .logo::before { animation: none; }
  .link, .iconbtn, .pill, .link .icon, .link .chev { transition: none; }
  .link:hover, .iconbtn:hover, .pill:hover { transform: none; }
  .link:hover::after { animation: none; }
}
