/* =========================
   Jaraliem Mall Theme
   ========================= */

/* ---------- Design Tokens ---------- */
:root {
  --jr-bg: #f6f3ef;
  --jr-surface: #ffffff;
  --jr-surface-soft: #f7f2ec;
  --jr-text: #1f2126;
  --jr-muted: #666a71;
  --jr-border: #e6ded5;
  --jr-accent: #1b635f;
  --jr-accent-strong: #154f4c;
  --jr-shadow: 0 16px 32px rgba(15, 20, 24, 0.08);
  --jr-radius: 18px;
}

/* ---------- Base Overrides ---------- */
body,
body.w3-content {
  margin: 0;
  max-width: none !important;
  width: 100% !important;
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif !important;
  color: var(--jr-text);
  line-height: 1.55;
  background: linear-gradient(
    180deg,
    #f8f4ef 0%,
    var(--jr-bg) 68%,
    #f5f7fa 100%
  ) !important;
}

/* ---------- Announcement ---------- */
.jr-announcement {
  background: #16181b;
  color: #f6f7f8;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.55rem 0;
}

/* ---------- Navigation ---------- */
nav {
  position: sticky;
  top: 0;
  z-index: 40;
}

nav > .w3-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem !important;
  background: rgba(248, 244, 239, 0.92) !important;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--jr-border);
}

nav .w3-col {
  width: auto !important;
  background: transparent !important;
  padding: 0 !important;
}

nav .w3-col:nth-child(n+3) {
  display: none;
}

.mall-directory-list {
  min-width: 260px;
  max-height: 320px;
  overflow-y: auto;
}

.mall-directory-list a {
  display: block;
  padding: 8px 10px;
  text-decoration: none;
  color: #111;
  border-bottom: 1px solid #f2f2f2;
}

.mall-directory-list a:last-child {
  border-bottom: none;
}

.mall-directory-list a:hover {
  background: #f7f7f7;
}

/* ---------- Header ---------- */
header {
  text-align: center;
  padding: 1.5rem 0.9rem 1rem !important;
}

header h1 {
  margin: 0;
  font-size: clamp(1.4rem, 5vw, 2.4rem) !important;
}

header p {
  margin: 0.55rem 0 0;
  font-size: clamp(0.98rem, 3.8vw, 1.08rem);
  color: var(--jr-muted);
}

/* ---------- Directory Tools ---------- */
.directory-tools {
  width: min(100% - 1.5rem, 1120px);
  margin: 0.9rem auto 0;
  padding: 0.85rem;
  border: 1px solid var(--jr-border);
  border-radius: 14px;
  background: var(--jr-surface);
  box-shadow: var(--jr-shadow);
}

.directory-search {
  width: 100%;
  border: 1px solid var(--jr-border);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
}

.directory-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.directory-chip {
  border: 1px solid var(--jr-border);
  border-radius: 999px;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.25rem 0.58rem;
  cursor: pointer;
}

/* ---------- Cards ---------- */
.jr-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: min(100% - 1.5rem, 1120px);
  margin: 0.75rem auto 0;
}

.card {
  background: var(--jr-surface);
  border: 1px solid var(--jr-border);
  border-radius: var(--jr-radius);
  box-shadow: var(--jr-shadow);
  overflow: hidden;
  transition: transform 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
}

.card img {
  width: 100%;
  object-fit: contain;
}

/* ---------- Footer ---------- */
footer {
  width: min(100% - 1.5rem, 1120px);
  margin: 0.9rem auto 0;
  text-align: center;
  color: var(--jr-muted);
  padding: 1.2rem 0 2.1rem;
}

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .jr-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 940px) {
  .jr-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}