/* ===== PREMIUM CONTACT & BRANCHES — Kahramana Baghdad ===== */

/* 1. Branch Cards — Bento 2.0 Style */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem;
}

.card {
  background: var(--col-deep);
  border-radius: 2.5rem;
  /* Bento 2.0 spec */
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.6s var(--ease-magnetic);
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.card:hover {
  transform: translateY(-10px);
  border-color: var(--col-gold-dim);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.card-body {
  padding: 3.5rem;
  /* Generous P-8/10 internal padding */
}

/* ===== BRANCH LOCATOR ===== */
.locator-map-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: var(--col-deep);
}

.locator-map {
  width: 100%;
  min-height: 240px;
  /* explicit height — avoids the classic blank-map/CLS pitfall */
  height: 45vh;
}

@media (min-width: 769px) {
  .locator-map {
    height: 420px;
  }
}

/* Graceful no-map state: toggled by locator.js on load failure, auth
   failure, or an unconfigured API key — collapses the empty/errored map
   region entirely, leaving the cards as the sole, fully-functional content. */
.locator--no-map .locator-map-wrap {
  display: none;
}

/* No map to pan to — the locate-button's only job is gone with it. Hiding
   it (rather than leaving a dead click target) is safe: it's the sole
   trigger for activateBranch(), which itself no-ops without a map, and the
   card's real content (address/phone/WhatsApp/Directions/GBP links) needs
   no button to be fully usable. */
.locator--no-map .locate-btn {
  display: none;
}

/* The copy/share buttons reuse .locate-btn's circular styling but have
   nothing to do with the map — unlike the pin/locate button, they must
   stay usable even when Maps fails to load (referrer mismatch, quota,
   network, ad blocker). Restores their normal display, overriding the
   blanket .locator--no-map .locate-btn rule above for just these two. */
.locator--no-map .branch-copy-btn,
.locator--no-map .branch-share-btn {
  display: inline-flex;
}

.branch-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Live status badge + rating badge — populated by contact-enhancements.js,
   hidden (native [hidden]) until then so a JS-disabled/slow visitor never
   sees an empty placeholder. */
.branch-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.branch-status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.branch-status-badge.is-open {
  color: var(--col-success);
  background: rgba(74, 222, 128, 0.12);
}

/* var(--col-error) text on a var(--col-error)-tinted background fails WCAG
   AA (~2.6:1) at any opacity — text and background converge toward the same
   hue's luminance ceiling, so no amount of opacity tuning fixes it. Using
   --col-cream (an existing token, not a new one) as the text color against
   a slightly stronger error tint clears AA with a wide margin (~11:1) while
   the background still carries the "closed" red cue. */
.branch-status-badge.is-closed {
  color: var(--col-cream);
  background: rgba(192, 57, 43, 0.22);
}

.branch-rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--col-gold);
  background: rgba(209, 159, 81, 0.1);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  text-decoration: none;
}

.branch-rating-badge .rating-count {
  font-weight: 400;
  opacity: 0.75;
}

/* Author-origin `display` on a class always beats the UA-origin [hidden]
   default at equal specificity, regardless of source order — without this,
   the badge/buttons below would stay visible (empty) before JS populates
   them, defeating the progressive-enhancement `hidden` attribute entirely. */
.branch-rating-badge[hidden],
.locate-btn[hidden] {
  display: none;
}

/* Copy/share utility buttons — reuse .locate-btn's existing circular style
   and reduced-motion coverage (see the @media block below); no new CSS
   needed for the buttons themselves. */
.branch-utility-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.locate-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.5px solid var(--col-gold-dim);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s var(--ease-magnetic);
}

.locate-btn svg {
  width: 16px;
  height: 16px;
  stroke: var(--col-gold);
}

.locate-btn:hover,
.locate-btn[aria-pressed="true"] {
  background: var(--col-gold);
  border-color: var(--col-gold);
}

.locate-btn[aria-pressed="true"] svg {
  stroke: var(--col-dark);
}

.card.is-active {
  border-color: var(--col-gold);
  box-shadow: 0 0 0 2px var(--col-gold), 0 20px 40px rgba(0, 0, 0, 0.3);
  /* transition already inherited from .card's own `transition: all 0.6s var(--ease-magnetic);` */
}

.branch-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .card.is-active,
  .locate-btn,
  .faq-item summary::after {
    transition: none !important;
  }
}

/* 2. Tactical Contact Form — Split Screen Layout */
.grid-form {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 6rem;
  align-items: center;
  margin-top: 4rem;
}

.form-container {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  padding: 4rem;
  border-radius: var(--radius);
  min-height: 650px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.form-group {
  margin-bottom: 2rem;
}

/* Label above input — SKILL.md Rule 6 */
.form-group label {
  display: block;
  font-family: var(--font-primary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--col-gold-dim);
  margin-bottom: 0.8rem;
  font-weight: 700;
}

.form-input {
  width: 100%;
  padding: 1.2rem 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--col-cream);
  font-family: var(--font-primary);
  font-size: 1rem;
  border-color: rgba(209, 159, 81, 0.3);
  transition: all 0.3s var(--ease-magnetic);
}

.form-input:focus {
  outline: none;
  border-color: var(--col-gold);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 4px rgba(209, 159, 81, 0.1);
}

/* Tactile Feedback for Buttons — SKILL.md Rule 5 */
.btn-primary:active,
.btn-outline:active {
  transform: scale(0.96) translateY(1px);
}

/* 3. Quick Links — Minimalist Labels below cards */
.quick-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 6rem;
}



.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 3rem;
  text-decoration: none;
  transition: all 0.5s var(--ease-magnetic);
  text-align: center;
}

.quick-link svg {
  width: 32px;
  height: 32px;
  stroke: var(--col-gold);
  stroke-width: 1.5;
  transition: all 0.5s var(--ease-magnetic);
}

/* Snapchat's official mark (unlike its stroke-line siblings above) is a
   solid single-path fill, not an outline — .quick-link svg's `stroke` rule
   doesn't apply color to it, and would draw an unwanted outline around the
   solid shape if left on, so it's cancelled here. */
.quick-link .icon-brand-fill {
  fill: var(--col-gold);
  stroke: none;
}

.quick-link:hover .icon-brand-fill {
  fill: var(--col-cream);
}

.quick-link:hover svg {
  transform: scale(1.2) rotate(5deg);
  stroke: var(--col-cream);
}

.quick-link .info-card h3 {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: var(--text-card-title);
  color: var(--col-cream);
  margin-bottom: 0.8rem;
}

.quick-link .ql-text {
  font-family: var(--font-drama);
  font-size: 1.2rem;
  color: var(--col-cream);
  font-weight: 700;
  font-style: italic;
}

.quick-link .ql-sub {
  font-size: 0.8rem;
  color: var(--col-gold-dim);
  opacity: 0.6;
}

/* 4. Trust Bar — lightweight signals; deliberately not .quick-link so it
   neither inherits the magnetic mousemove hover effect nor track-outbound
   GA4 semantics (these are non-linked badges, not outbound CTAs). */
.trust-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2rem 3rem;
  padding: 1.5rem 0;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.9rem;
  color: var(--col-parchment);
  opacity: 0.85;
}

.trust-item svg {
  width: 20px;
  height: 20px;
  stroke: var(--col-gold);
  flex-shrink: 0;
}

/* 5. FAQ */
.faq-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.5rem 0;
}

.faq-item summary {
  cursor: pointer;
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--col-cream);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '';
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-inline-end: 2px solid var(--col-gold);
  border-block-end: 2px solid var(--col-gold);
  transform: rotate(45deg);
  transition: transform 0.3s var(--ease-magnetic);
}

.faq-item[open] summary::after {
  transform: rotate(-135deg);
}

.faq-item p {
  margin-top: 1rem;
  color: var(--col-parchment);
  opacity: 0.8;
  line-height: 1.7;
}

/* Responsive Overrides */
@media (max-width: 1024px) {
  .grid-form {
    grid-template-columns: 1fr;
    gap: 4rem;
  }

  .quick-links {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .form-container {
    padding: 2.5rem;
  }

  .quick-links {
    grid-template-columns: 1fr;
  }
}

/* ===== FORM ERROR OVERRIDES ===== */
.form-group.has-error input,
.form-group.has-error textarea {
  border-color: var(--col-error) !important;
}

.form-group.has-error .form-error {
  display: block;
}

.form-error {
  display: block;
  font-size: 0.8rem;
  color: var(--col-error) !important;
  margin-top: 0.25rem;
}

/* ===== BRANCH-PAGE PROSE (/riffa, /galali) =====
   shared.css:156 applies a global `*, *::before, *::after { margin: 0 }` reset,
   so consecutive <p> elements have NO separation and multi-paragraph prose
   renders as one dense block. Every existing page sidesteps this by carrying at
   most one paragraph per block with an inline margin; the branch pages are the
   first with real multi-paragraph body copy, so they need the rule.

   Scoped to .branch-prose rather than bare `p` on purpose: a global paragraph
   margin here would reflow contact.html (which also loads this file) and every
   other page's inline-margin paragraphs. Inert on any page without the class. */
.branch-prose p {
  margin-bottom: 1.25rem;
}

.branch-prose p:last-child {
  margin-bottom: 0;
}

/* Landmark sub-headings inside the prose column. The gold colour and top
   spacing were inline per-heading in the first draft; consolidated here so the
   two pages stay consistent and the markup stays readable. */
.branch-prose h3 {
  color: var(--col-gold);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}