/* Persian Directory Australia – one stylesheet, works left-to-right and right-to-left
   (uses logical properties: margin-inline-start etc.) */
:root {
  --brand: #1d4ed8; --brand-dark: #1e40af; --brand-soft: #eff6ff; --brand-100: #dbeafe; --brand-200: #bfdbfe;
  --hero-a: #172554; --hero-b: #1d4ed8; --hero-c: #2563eb; --footer-bg: #172554;
  --accent: #b45309; --accent-soft: #fffbeb;
  --ink: #111827; --muted: #6b7280; --line: #e5e7eb; --bg: #f8fafc; --card: #fff;
  --danger: #b91c1c; --ok: #15803d; --radius: 12px;
  --input-border: #d1d5db; --accent-line: #fde68a; --featured-bg: #fffdf5;
  --ok-soft: #f0fdf4; --ok-line: #bbf7d0; --danger-soft: #fef2f2; --danger-line: #fecaca;
  color-scheme: light;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
/* Dark mode: follows the device setting, or the toggle in the header (saved in the browser) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --ink: #e5e7eb; --muted: #9ca3af; --line: #253047; --bg: #0b1220; --card: #121a2b;
  --input-border: #334155; --shadow: 0 1px 2px rgba(0,0,0,.4);
  --brand: var(--dk-brand); --brand-dark: var(--dk-brand-dark); --brand-soft: var(--dk-soft); --brand-200: var(--dk-200);
  --accent: #fbbf24; --accent-soft: #261d0b; --accent-line: #5c4813; --featured-bg: #171409;
  --ok: #4ade80; --ok-soft: #0d2418; --ok-line: #166534; --danger: #f87171; --danger-soft: #2a1214; --danger-line: #7f1d1d;
  --footer-bg: #060b16; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #e5e7eb; --muted: #9ca3af; --line: #253047; --bg: #0b1220; --card: #121a2b;
  --input-border: #334155; --shadow: 0 1px 2px rgba(0,0,0,.4);
  --brand: var(--dk-brand); --brand-dark: var(--dk-brand-dark); --brand-soft: var(--dk-soft); --brand-200: var(--dk-200);
  --accent: #fbbf24; --accent-soft: #261d0b; --accent-line: #5c4813; --featured-bg: #171409;
  --ok: #4ade80; --ok-soft: #0d2418; --ok-line: #166534; --danger: #f87171; --danger-soft: #2a1214; --danger-line: #7f1d1d;
  --footer-bg: #060b16; color-scheme: dark;
}
html[lang="fa"] { --font: "Vazirmatn", "Inter", system-ui, sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* Header */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1000; }
.site-header .container { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 1.15rem; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.logo:hover { text-decoration: none; }
.logo .mark { width: 44px; height: 44px; object-fit: contain; flex: none; filter: drop-shadow(0 1px 2px rgb(0 0 0 / .25)); transition: transform .2s; }
.logo:hover .mark { transform: scale(1.06); }
.footer-logo { display: block; width: 72px; height: 72px; object-fit: contain; margin-block-end: 8px; }
@media (max-width: 600px) { .logo .mark { width: 38px; height: 38px; } }
.nav { display: flex; gap: 4px; align-items: center; margin-inline-start: auto; flex-wrap: wrap; }
.nav a, .nav button.linkish { padding: 8px 10px; border-radius: 8px; color: var(--ink); font-size: .95rem; }
.nav a:hover { background: var(--bg); text-decoration: none; }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-switch button { border: 0; background: var(--card); color: var(--ink); padding: 6px 12px; cursor: pointer; font: inherit; font-size: .85rem; }
.lang-switch button[aria-current="true"] { background: var(--brand); color: #fff; }

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--brand); background: var(--brand); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn.secondary { background: var(--card); color: var(--brand); }
.btn.secondary:hover { background: var(--brand-soft); }
.btn.small { padding: 6px 12px; font-size: .875rem; }
.btn.danger { background: var(--card); color: var(--danger); border-color: var(--danger-line); }
input[type=text], input[type=email], input[type=url], input[type=tel], input[type=password], input[type=number],
input[type=time], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--input-border); border-radius: 10px; font: inherit; background: var(--card); color: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-200); border-color: var(--brand); }
label { font-weight: 600; font-size: .92rem; display: block; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field .help { font-size: .82rem; color: var(--muted); margin-top: 3px; }
.errorlist { color: var(--danger); list-style: none; padding: 0; margin: 4px 0; font-size: .88rem; }
.checks ul, ul.checks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks label, ul.checks label { font-weight: 400; display: inline-flex; gap: 6px; align-items: center; }
.inline-check label { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* Hero search */
.hero { background: linear-gradient(135deg, var(--hero-a), var(--hero-b) 60%, var(--hero-c)); color: #fff; padding: 48px 0 56px; }
.hero h1 { color: #fff; }
/* Banner image: the picture, then a blue shade on top so text stays readable */
.hero.has-image { position: relative; padding: 72px 0 80px; background-color: var(--hero-a);
  background-image:
    linear-gradient(to bottom, rgb(0 0 0 / calc(var(--hero-shade) * 1%)), rgb(0 0 0 / calc(var(--hero-shade) * 0.6%))),
    linear-gradient(135deg, color-mix(in srgb, var(--hero-a) 75%, transparent), color-mix(in srgb, var(--hero-b) 25%, transparent)),
    var(--hero-img);
  background-size: cover; background-position: center 30%; }
.hero.has-image h1, .hero.has-image p { text-shadow: 0 2px 10px rgb(0 0 0 / .6); }
.hero.has-image p { color: #fff; }
@media (max-width: 720px) { .hero.has-image { padding: 48px 0 56px; } }
.hero p { color: var(--brand-100); margin-top: 0; }
.searchbar { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 8px; background: var(--card); padding: 8px; border-radius: 14px; box-shadow: var(--shadow); margin-top: 20px; }
.searchbar input { border: 0; background: var(--bg); }
.searchbar .near { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; font-size: .9rem; color: var(--muted); padding: 0 4px; }
@media (max-width: 720px) { .searchbar { grid-template-columns: 1fr; } }
.linkish { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; padding: 0; }

/* Cards & sections */
.section { padding: 32px 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.cat-tile { display: flex; flex-direction: column; gap: 6px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); }
.cat-tile:hover { border-color: var(--brand); text-decoration: none; box-shadow: var(--shadow); }
.cat-tile .icon { font-size: 1.6rem; }
.biz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.pill.featured { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.pill.warn { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.stars { color: #f59e0b; letter-spacing: 1px; }

/* Results layout */
.results-layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
.results-layout.with-map { grid-template-columns: 260px 1fr 380px; }
@media (max-width: 1100px) { .results-layout.with-map { grid-template-columns: 260px 1fr; } .results-layout.with-map .map-col { grid-column: 1 / -1; order: -1; } }
@media (max-width: 760px) { .results-layout, .results-layout.with-map { grid-template-columns: 1fr; } }
.filters { position: sticky; top: 80px; }
.filters summary { cursor: pointer; font-weight: 700; }
@media (min-width: 761px) { .filters summary { pointer-events: none; list-style: none; } .filters summary::-webkit-details-marker { display: none; } .filters-toggle { display: none; } }
/* Mobile: filters fold into a "Filters" button, closed by default */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 760px) {
  .results-layout > aside:first-child { order: -2; }
  .filters { position: static; padding: 0; }
  .filters summary { list-style: none; display: flex; align-items: center; padding: 12px 14px; min-height: 48px; -webkit-tap-highlight-color: transparent; }
  .filters summary::-webkit-details-marker { display: none; }
  .filters .filters-title { display: none; }
  .filters-toggle { display: flex; align-items: center; gap: 8px; width: 100%; color: var(--brand); }
  .filters-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: .8rem; line-height: 1; }
  .filters-toggle .chev { margin-inline-start: auto; transition: transform .2s; }
  .filters[open] .filters-toggle .chev { transform: rotate(180deg); }
  .filters[open] summary { border-bottom: 1px solid var(--line); }
  .filters form { margin-top: 0 !important; padding: 12px 14px 14px; }
}
.result { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
.result.featured { border-color: var(--accent-line); background: var(--featured-bg); }
.result h3 { margin: 0 0 2px; }
.result .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .9rem; color: var(--muted); }
.result .actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
@media (max-width: 560px) { .result { grid-template-columns: 48px 1fr; } .result .actions { grid-column: 1 / -1; flex-direction: row; } }
.avatar { width: 64px; height: 64px; border-radius: 12px; background: var(--brand-soft); display: grid; place-items: center; font-size: 1.6rem; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 560px) { .avatar { width: 48px; height: 48px; font-size: 1.2rem; } }
#map { height: 420px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 1; }
.map-col #map { position: sticky; top: 80px; height: calc(100vh - 110px); min-height: 360px; }
@media (max-width: 1100px) { .map-col #map { position: relative; top: auto; height: 300px; min-height: 0; } }

.pagination { display: flex; gap: 6px; justify-content: center; margin: 20px 0; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }

.breadcrumbs { font-size: .88rem; color: var(--muted); margin: 18px 0 10px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs span.sep { margin: 0 6px; }

.az { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0; }
.az a { min-width: 34px; text-align: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); text-transform: uppercase; }
.az a.on { background: var(--brand); color: #fff; }

/* Listing page */
.biz-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.biz-head .avatar { width: 96px; height: 96px; font-size: 2.4rem; }
.biz-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; margin-top: 20px; align-items: start; }
@media (max-width: 900px) { .biz-layout { grid-template-columns: 1fr; } }
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.contact-list li:last-child { border-bottom: 0; }
.contact-list .k { width: 24px; flex: none; text-align: center; }
.hours { width: 100%; border-collapse: collapse; font-size: .93rem; }
.hours td { padding: 5px 0; }
.hours tr.today { font-weight: 700; color: var(--brand-dark); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; }
.review { padding: 14px 0; border-bottom: 1px solid var(--line); }
.review .reply { margin-top: 8px; padding: 10px 12px; background: var(--bg); border-radius: 10px; border-inline-start: 3px solid var(--brand); }
.rating-input ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; margin: 0; }
.rating-input label { font-weight: 400; color: #f59e0b; font-size: 1.1rem; display: inline-flex; gap: 6px; }
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Messages */
.messages { list-style: none; padding: 0; margin: 16px 0; }
.messages li { padding: 12px 16px; border-radius: 10px; margin-bottom: 8px; background: var(--brand-soft); border: 1px solid var(--brand-200); }
.messages li.error { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.messages li.warning, .messages li.info { background: var(--accent-soft); border-color: var(--accent-line); }

/* Dashboard */
.table { width: 100%; border-collapse: collapse; background: var(--card); }
.table th, .table td { text-align: start; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.stat { display: inline-block; margin-inline-end: 14px; }
.stat b { font-size: 1.1rem; }

/* Footer */
.site-footer { margin-top: 48px; background: var(--footer-bg); color: #cbd5e1; padding: 32px 0; font-size: .92rem; }
.site-footer a { color: #e2e8f0; }
.site-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 4px 0; }
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.4em; }
.empty { text-align: center; padding: 40px 16px; }

.theme-toggle { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; width: 36px; height: 34px; cursor: pointer; font-size: 1rem; line-height: 1; }
.theme-toggle .moon { display: inline; } .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; } :root[data-theme="dark"] .theme-toggle .sun { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .sun { display: inline; }
}

/* Map pins, clusters and popups */
.map-pin { background: none; border: 0; }
.map-pin svg { display: block; filter: drop-shadow(0 2px 3px rgb(0 0 0 / .35)); transition: transform .15s; transform-origin: 50% 100%; }
.map-pin .pin-body { fill: var(--brand); stroke: #fff; stroke-width: 2; }
.map-pin .pin-emoji { position: absolute; top: 5px; left: 0; width: 32px; text-align: center; font-size: 15px; line-height: 22px; }
.map-pin .pin-emoji:empty { top: 10px; left: 11px; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.map-pin:hover svg, .map-pin.active svg { transform: scale(1.25); }
.map-pin.active .pin-body { fill: #ea4335; }
.map-cluster { background: none; }
.map-cluster span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; font-size: .95rem; box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 30%, transparent), 0 2px 6px rgb(0 0 0 / .3); }
.map-cluster.big span { width: 44px; height: 44px; margin: -2px; }
.leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: 0 6px 24px rgb(0 0 0 / .2); }
.leaflet-popup-content { margin: 12px 14px; font-family: inherit; }
.map-popup { display: grid; gap: 4px; font-size: .9rem; color: #1f2937; }
.map-popup-title { font-weight: 800; font-size: 1rem; }
.map-popup-cat, .map-popup-addr { color: #6b7280; }
.map-popup-rating { color: #b45309; font-weight: 600; }
.map-popup-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.map-popup-actions .btn { color: #fff; }
.map-popup-actions .btn.secondary { color: var(--brand); }
#map { background: #e5e3df; }
.site-footer .credits { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Map: click-to-focus cards, full screen, resizable */
.result.has-pin { cursor: pointer; }
.result.selected { outline: 2px solid var(--brand); outline-offset: -1px; }
#map { resize: vertical; overflow: hidden; }
.map-col #map { max-height: none; }
#map.is-fullscreen { position: fixed !important; inset: 0; width: 100vw; height: 100vh !important; max-height: none; z-index: 1000; border-radius: 0; border: 0; resize: none; top: 0 !important; }
.map-fs-open, .map-fs-open body { overflow: hidden; }
.map-fs a { font-size: 18px; line-height: 30px; text-decoration: none; color: #333; }
.map-fs .fs-close, #map.is-fullscreen .map-fs .fs-open { display: none; }
#map.is-fullscreen .map-fs .fs-close { display: inline; }

/* See-through search box on the banner (transparency set in Site settings) */
.hero.has-image .searchbar { background: color-mix(in srgb, var(--card) calc(var(--search-opacity, 100) * 1%), transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid rgb(255 255 255 / .35); box-shadow: 0 8px 30px rgb(0 0 0 / .25); }
.hero.has-image .searchbar input { background: color-mix(in srgb, var(--card) 92%, transparent); color: var(--ink); }
.hero.has-image .searchbar .near, .hero.has-image .searchbar .near .linkish { color: #fff; text-shadow: 0 1px 4px rgb(0 0 0 / .7); }

/* Visitor location (v22) */
.place-pill { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px !important; padding: 5px 12px !important; font-size: .88rem !important; max-width: 46vw; }
.place-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.near-you .near-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.near-you .near-head h2 { margin: 0; }
.near-you .near-head p { margin: 2px 0 0; }
.suburb-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: .88rem; cursor: pointer; }
.chip:hover { border-color: var(--brand); text-decoration: none; }
.chip.on { background: var(--accent-soft); border-color: var(--accent-line); }
.chip .n { font-size: .75rem; color: var(--muted); }
.near-ask { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--accent-soft); border-color: var(--accent-line); }
.near-ask-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.near-ask-actions form { margin: 0; }
.near-note { margin: -4px 0 10px; color: var(--muted); }
.location-picker { padding-block: 24px 40px; max-width: 760px; }
.location-picker .card { margin-bottom: 16px; }
.location-picker h2 { font-size: 1.1rem; }
.place-now { display: flex; flex-direction: column; gap: 4px; }
.city-country { margin-top: 6px; }
.city-picks .suburb-chips { margin: 6px 0 10px; }
.place-more { display: flex; flex-direction: column; gap: 12px; }
.place-more form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0; }
.place-reset { gap: 18px !important; }
@media (max-width: 600px) { .near-ask-actions, .near-ask-actions form, .near-ask-actions .btn { width: 100%; } .near-ask-actions .btn { justify-content: center; text-align: center; } }
@media (max-width: 600px) { .near-you .suburb-chips a.chip:nth-of-type(n+9) { display: none; } }
