/* /haram-gates — gate finder, gate tables, busiest-gate cards.
   Loaded after umrah-maps.css (crumbs, hero chips, gate list, honest list). */

.hg-glance { max-width: 56rem; }
.hg-glance .iv-facts__list > div { grid-template-columns: 11rem minmax(0, 1fr); }
@media (max-width: 480px) { .hg-glance .iv-facts__list > div { grid-template-columns: 1fr; } }

/* Number finder */
.hg-chips { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; grid-template-columns: repeat(auto-fill, minmax(3.1rem, 1fr)); }
.hg-chip {
    display: flex; align-items: center; justify-content: center; min-height: 2.5rem; padding: .2rem .3rem;
    border-radius: 8px; border: var(--border); background: var(--surface);
    font: 500 .9rem/1 var(--font-mono, "JetBrains Mono", ui-monospace, monospace); color: var(--ink-2); text-decoration: none;
}
.hg-chip:hover { border-color: var(--primary); color: var(--primary); }
.hg-chip--named { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.hg-chips li:last-child .hg-chip { font-family: var(--font-body); font-size: .78rem; text-align: center; }
.hg-subhead { margin: 2.2rem 0 1rem; font: 600 1.08rem/1.3 var(--font-display); color: var(--ink); }
.hg-named-list a { color: var(--ink-2); text-decoration: underline; text-decoration-color: rgba(10, 79, 60, .3); text-underline-offset: 3px; }
.hg-named-list a:hover { color: var(--primary); }

/* Gate tables */
.hg-table-wrap { border: var(--border); border-radius: var(--radius); background: var(--surface); overflow: clip; }
.hg-table { width: 100%; border-collapse: collapse; font-size: .9rem; line-height: 1.45; }
.hg-table caption { padding: .8rem 1rem; text-align: start; font-size: .82rem; color: var(--muted); caption-side: bottom; border-top: var(--border); }
.hg-table th, .hg-table td { padding: .6rem .8rem; text-align: start; vertical-align: top; border-bottom: var(--border); }
.hg-table thead th { position: sticky; top: 0; background: var(--surface-2); font: 600 .72rem/1.4 var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); z-index: 1; }
.hg-table tbody tr:last-child th, .hg-table tbody tr:last-child td { border-bottom: 0; }
.hg-gate { white-space: nowrap; font-weight: 600; color: var(--ink); }
.hg-named .hg-gate { color: var(--primary); }
.hg-table tbody tr:target { background: var(--gold-soft); }
.hg-table tbody tr { scroll-margin-top: 6rem; }
.hg-hotels ul, .hg-busy__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.hg-walk { white-space: nowrap; font-size: .8rem; color: var(--muted); }
.hg-tag { display: inline-block; margin: 0 .25rem .2rem 0; padding: .1rem .45rem; border-radius: 999px; font-size: .76rem; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.hg-tag--wheelchair { background: var(--info-soft); color: var(--info); }
.hg-tag--women_only { background: var(--violet-soft); color: var(--violet); }
.hg-tag--entry_only, .hg-tag--exit_only { background: var(--gold-soft); color: var(--gold-deep); }

/* Small screens: each gate becomes a card, labels from data-label. */
@media (max-width: 760px) {
    .hg-table caption { display: block; width: auto; }
    .hg-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .hg-table, .hg-table tbody, .hg-table tr, .hg-table th, .hg-table td { display: block; width: 100%; }
    .hg-table tr { padding: .7rem .9rem; border-bottom: var(--border); }
    .hg-table th, .hg-table td { padding: .15rem 0; border: 0; }
    .hg-table .hg-gate { font-size: 1.05rem; margin-bottom: .2rem; }
    .hg-table td { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .6rem; }
    .hg-table td > span { justify-self: start; }
    .hg-table td::before { content: attr(data-label); font: 600 .68rem/1.9 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
}

/* Busiest gates */
.hg-busy { list-style: none; padding: 0; margin: 0; }
.hg-busy .um-places__title a { color: var(--ink); text-decoration: none; }
.hg-busy .um-places__title a:hover { color: var(--primary); }
.hg-busy__count { margin: -.5rem 0 .8rem; font-size: .85rem; color: var(--gold); }
.hg-busy__list li { font-size: .9rem; color: var(--ink-2); }

/* Gate map (inline SVG from the app's gate coordinates) */
.hg-map { margin: 0; }
.hg-map__frame { border: var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; max-width: 760px; margin-inline: auto; }
.hg-map__svg { display: block; width: 100%; height: auto; font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace); direction: ltr; }
.hg-map__bg { fill: var(--paper, #f8f3e6); }
.hg-map__ring { fill: none; stroke: rgba(10, 79, 60, .10); stroke-width: 1; stroke-dasharray: 3 4; }
.hg-map__kaaba { fill: var(--ink, #0d1714); }
.hg-map__centre { font: 600 12px/1 var(--font-body, system-ui, sans-serif); fill: var(--muted, #5a6660); }
.hg-map__gate circle { fill: var(--surface, #fff); stroke: var(--ink-2, #2b3632); stroke-width: 1.4; }
.hg-map__gate text { font-size: 10px; font-weight: 500; fill: var(--ink-2, #2b3632); }
.hg-map__gate--named circle { fill: var(--primary, #0a4f3c); stroke: var(--primary, #0a4f3c); }
.hg-map__gate--named text { fill: var(--primary, #0a4f3c); font-weight: 700; }
.hg-map__gate--wc circle { stroke: var(--info, #1f5f8b); stroke-width: 2.2; }
.hg-map__gate--women_only circle { fill: var(--violet, #5b3f8c); stroke: var(--violet, #5b3f8c); }
.hg-map__gate:hover circle, .hg-map__gate:focus circle { fill: var(--gold-bright, #a87a26); stroke: var(--gold-bright, #a87a26); }
.hg-map__gate:hover text, .hg-map__gate:focus text { fill: var(--gold-deep, #6d4e17); font-weight: 700; }
.hg-map__north path { fill: var(--ink, #0d1714); }
.hg-map__north text, .hg-map__scale text { font: 600 11px/1 var(--font-body, system-ui, sans-serif); fill: var(--ink-2, #2b3632); }
.hg-map__scale path { fill: none; stroke: var(--ink-2, #2b3632); stroke-width: 1.5; }
.hg-map__caption { max-width: 760px; margin: .8rem auto 0; font-size: .85rem; color: var(--muted); display: grid; gap: .5rem; }
.hg-map__legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; color: var(--ink-2); }
.hg-map__legend li { display: inline-flex; align-items: center; gap: .4rem; }
.hg-map__key { width: .7rem; height: .7rem; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--ink-2); display: inline-block; }
.hg-map__key--named { background: var(--primary); border-color: var(--primary); }
.hg-map__key--wc { border: 2.5px solid var(--info, #1f5f8b); }
.hg-map__key--women_only { background: var(--violet, #5b3f8c); border-color: var(--violet, #5b3f8c); }
#madinah .hg-map { margin-bottom: 2rem; }
.hg-print { max-width: 760px; margin: 1.2rem auto 0; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
.hg-print__hint { font-size: .85rem; color: var(--muted); }

/* Print / save as PDF: the gate map and the two gate tables, nothing else. */
@media print {
    .site-header, .site-footer, .um-crumbs, .um-hero__actions, .um-hero__chips, .page-hero__pattern,
    .hg-print, #finder, #hotels, #faq, .iv-related, .cta-band, [aria-labelledby="hgHonestTitle"],
    [aria-labelledby="hgRelatedTitle"], .um-gates__cta, .blog-float { display: none !important; }
    body { background: #fff !important; }
    .page-hero, .section--paper, .section--surface { background: #fff !important; color: #000 !important; padding-block: .6rem !important; }
    .page-hero *, .page-hero__title { color: #000 !important; }
    .hg-map__frame { border-color: #999; break-inside: avoid; }
    .hg-map { break-inside: avoid; }
    .hg-table thead th { position: static; }
    .hg-table tr { break-inside: avoid; }
    #makkah, #madinah { break-before: page; }
    a { text-decoration: none !important; }
}
/* Phones: keep gate numbers legible — the map scrolls sideways inside its frame. */
@media (max-width: 640px) {
    .hg-map__frame { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .hg-map__svg { min-width: 620px; }
}
@media print { .hg-map__svg { min-width: 0; } .hg-map__frame { overflow: visible; } }
