/*
 * "Câu hỏi thường gặp" of the Thành viên page (site/gmaster/sections/member-faq, member-faq.js), G.Master look: the
 * layout of the LONG WANG / TIAN LONG websites in the colours of gmasterbbq.vn (black, gold headings, red accents).
 * Same width as the other blocks of the website (the 1200 px .container, 20 px gutters).
 *
 * Wide screens, two columns: on the left the title, the introduction and a help card (hotline button in the gold of
 * "Đặt bàn"), in the same dark gold-edged card as the questions; it stays in view while the questions scroll and stops
 * at their end. On the right the questions in one panel, numbered, a thin rule between them. The note under both.
 * Tablets and phones: one column, the title and introduction centred above the questions, no help card.
 */
.gmaster-faq {
  --gm-faq-gold: #d1a04f;
  --gm-faq-gold-light: #f2be83;
  --gm-faq-red: #c8102e;
  --gm-faq-cream: #fff4e6;
  --gm-faq-ink: #e8e1d6;
  --gm-faq-muted: #b7ad9f;
  --gm-faq-card: #161616;
  --gm-faq-line: rgba(209, 160, 79, 0.18);
  --gm-faq-border: rgba(209, 160, 79, 0.32);
  position: relative;
  background: #000;
  padding: 88px 20px 104px;
  color: var(--gm-faq-ink);
  font-family: var(--font-primary, 'SVN-Helves', Arial, sans-serif);
}

.gmaster-faq-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "aside"
    "list"
    "note";
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
}

/* ------------------------------------------------------------------ heading (one column) */
.gmaster-faq-aside {
  grid-area: aside;
  min-width: 0;
}

.gmaster-faq-panel {
  position: relative;
  max-width: 760px;
  margin: 0 auto 40px;
  text-align: center;
}

.gmaster-faq-help {
  display: none;
}

.gmaster-faq-title {
  margin: 0;
  color: #fff;
  font-family: var(--font-secondary, 'helvetic', 'Arial Narrow', Impact, sans-serif);
  font-size: 48px;
  line-height: 1.05;
  font-weight: 400;
  text-transform: uppercase;
}

.gmaster-faq-intro {
  margin: 14px auto 0;
  color: var(--gm-faq-muted);
  font-size: 17px;
  line-height: 1.7;
  text-wrap: pretty;
}

/* ------------------------------------------------------------------ the panel of questions */
.gmaster-faq-list {
  grid-area: list;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--gm-faq-border);
  border-radius: 16px;
  background: var(--gm-faq-card);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.8);
}

.gmaster-faq-item {
  transition: background-color 0.3s ease;
}

.gmaster-faq-item + .gmaster-faq-item {
  border-top: 1px solid var(--gm-faq-line);
}

.gmaster-faq-question {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 22px;
  padding: 24px 32px;
  cursor: pointer;
  list-style: none;
}

.gmaster-faq-question::-webkit-details-marker {
  display: none;
}

.gmaster-faq-question:focus-visible {
  outline: 2px solid var(--gm-faq-gold);
  outline-offset: -6px;
  border-radius: 12px;
}

/* The number on its own (no disc around it), in the condensed heading font: gold, lighter when open. */
.gmaster-faq-num {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 44px;
  color: rgba(209, 160, 79, 0.7);
  font-family: var(--font-secondary, 'helvetic', 'Arial Narrow', Impact, sans-serif);
  font-size: 30px;
  line-height: 1;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  transition: color 0.25s ease;
}

.gmaster-faq-question:hover .gmaster-faq-num,
.gmaster-faq-item.is-open .gmaster-faq-num {
  color: var(--gm-faq-gold-light);
}

.gmaster-faq-q {
  color: var(--gm-faq-cream);
  font-size: 18px;
  line-height: 1.45;
  font-weight: 700;
  transition: color 0.2s ease;
}

/* Hover: the question and its button only. */
.gmaster-faq-question:hover .gmaster-faq-q {
  color: var(--gm-faq-gold-light);
}

/* The arrow on its own (no disc around it): gold, turned up and lighter when open. */
.gmaster-faq-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: 40px;
  height: 40px;
  color: var(--gm-faq-gold);
  transition: color 0.25s ease;
}

/* The icon turns, not its box (the box sits against the right edge). */
.gmaster-faq-toggle svg {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.gmaster-faq-question:hover .gmaster-faq-toggle,
.gmaster-faq-item.is-open .gmaster-faq-toggle {
  color: var(--gm-faq-gold-light);
}

.gmaster-faq-item.is-open .gmaster-faq-toggle svg {
  transform: rotate(180deg);
}

/* ------------------------------------------------------------------ answers */
.gmaster-faq-answer {
  overflow: hidden;
}

/* Under the question text (after the number), the full width of the panel. */
.gmaster-faq-answer-in {
  padding: 0 40px 28px 98px;
  color: var(--gm-faq-ink);
  font-size: 16px;
  line-height: 1.75;
}

.gmaster-faq-answer-in p,
.gmaster-faq-answer-in ul,
.gmaster-faq-answer-in ol {
  margin: 0;
}

.gmaster-faq-answer-in p + p,
.gmaster-faq-answer-in ul + p,
.gmaster-faq-answer-in ol + p,
.gmaster-faq-answer-in p + ul,
.gmaster-faq-answer-in p + ol {
  margin-top: 10px;
}

.gmaster-faq-answer-in a {
  color: var(--gm-faq-gold-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* A list in an answer (the tiers, or a list written in the admin): one line each, a gold dot before it. */
.gmaster-faq-answer-in ul {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.gmaster-faq-answer-in ul > li {
  position: relative;
  padding-left: 20px;
}

.gmaster-faq-answer-in ul > li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gm-faq-gold);
}

.gmaster-faq-answer-in ol {
  display: grid;
  gap: 8px;
  padding-left: 22px;
}

.gmaster-faq-answer-in ol > li::marker {
  color: var(--gm-faq-gold);
  font-weight: 700;
}

.gmaster-faq-brand {
  color: var(--gm-faq-gold-light);
  font-weight: 700;
}

/* The lead of an answer or a list item ("Hạng Vàng", "Ngày hội thành viên (Member Day) vào thứ Tư hàng tuần:") and the
   percentages, in bold (laid out by site/gmaster/sections/member-faq from the plain text). */
.gmaster-faq-lead {
  color: #fff;
  font-weight: 700;
}

.gmaster-faq-em {
  color: var(--gm-faq-gold-light);
  font-weight: 700;
}

/* "Ưu đãi có hiệu lực sau 24h…": a small note with a clock under the answer. */
.gmaster-faq-answer-in .gmaster-faq-answer-note {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(209, 160, 79, 0.12);
  color: #ead3a6;
  font-size: 14px;
  line-height: 1.5;
}

.gmaster-faq-answer-note svg {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--gm-faq-gold);
}

/* ------------------------------------------------------------------ note */
.gmaster-faq-note {
  grid-area: note;
  margin: 30px auto 0;
  color: var(--gm-faq-muted);
  font-size: 15px;
  line-height: 1.65;
  text-align: center;
}

.gmaster-faq-note a {
  color: var(--gm-faq-gold);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(209, 160, 79, 0.45);
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.gmaster-faq-note a:hover {
  color: var(--gm-faq-gold-light);
  text-decoration-color: currentColor;
}

/* ------------------------------------------------------------------ wide screens: two columns */
@media (min-width: 1101px) {
  .gmaster-faq-inner {
    grid-template-columns: 380px minmax(0, 1fr);
    grid-template-areas:
      "aside list"
      "note note";
    column-gap: 56px;
    align-items: start;
  }

  /* The column runs down beside the questions; its content stays in view inside it. */
  .gmaster-faq-aside {
    align-self: stretch;
  }

  .gmaster-faq-panel {
    position: sticky;
    top: 124px;
    max-width: none;
    margin: 0;
    padding-top: 6px;
    text-align: left;
  }

  .gmaster-faq-title {
    font-size: 44px;
  }

  .gmaster-faq-intro {
    margin: 16px 0 0;
    font-size: 16px;
  }

  .gmaster-faq-help {
    display: block;
    margin-top: 32px;
    padding: 26px 28px 28px;
    border: 1px solid var(--gm-faq-border);
    border-radius: 16px;
    background: var(--gm-faq-card);
    box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.8);
  }

  .gmaster-faq-help-title {
    margin: 0;
    color: var(--gm-faq-gold);
    font-family: var(--font-secondary, 'helvetic', 'Arial Narrow', Impact, sans-serif);
    font-size: 22px;
    line-height: 1.2;
    font-weight: 400;
    text-transform: uppercase;
  }

  .gmaster-faq-help-text {
    margin: 8px 0 0;
    color: var(--gm-faq-muted);
    font-size: 15px;
    line-height: 1.6;
  }

  .gmaster-faq-help-actions {
    display: flex;
    margin-top: 20px;
  }

  /* As the gold "Đặt bàn" button of the header. */
  .gmaster-faq-call {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 24px 0 20px;
    border-radius: 4px;
    background: var(--gm-faq-gold);
    color: #1a1a1a;
    font-size: 18px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: transform 0.2s ease, background-color 0.2s ease;
  }

  .gmaster-faq-call:hover,
  .gmaster-faq-call:focus-visible {
    background: var(--gm-faq-gold-light);
    color: #1a1a1a;
    transform: translateY(-1px);
  }

  .gmaster-faq-call:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
  }

  .gmaster-faq-note {
    margin-top: 36px;
  }
}

/* ------------------------------------------------------------------ tablets */
@media (max-width: 1100px) {
  .gmaster-faq-question {
    padding: 22px 26px;
    gap: 18px;
  }

  .gmaster-faq-answer-in {
    padding: 0 32px 26px 88px;
  }
}

/* ------------------------------------------------------------------ phones */
@media (max-width: 767px) {
  .gmaster-faq {
    padding: 56px 16px 72px;
  }

  .gmaster-faq-panel {
    margin-bottom: 28px;
  }

  .gmaster-faq-title {
    font-size: clamp(32px, 9vw, 40px);
  }

  .gmaster-faq-intro {
    margin-top: 12px;
    font-size: 15px;
    line-height: 1.65;
  }

  .gmaster-faq-list {
    border-radius: 12px;
  }

  .gmaster-faq-question {
    grid-template-columns: 32px minmax(0, 1fr) 30px;
    gap: 12px;
    padding: 18px 16px;
  }

  .gmaster-faq-num {
    width: 32px;
    font-size: 24px;
  }

  .gmaster-faq-q {
    font-size: 16px;
    line-height: 1.5;
  }

  .gmaster-faq-toggle {
    width: 30px;
    height: 30px;
  }

  .gmaster-faq-toggle svg {
    width: 22px;
    height: 22px;
  }

  .gmaster-faq-answer-in {
    padding: 0 16px 20px 24px;
    font-size: 15px;
    line-height: 1.75;
  }

  .gmaster-faq-note {
    margin-top: 24px;
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gmaster-faq-item,
  .gmaster-faq-num,
  .gmaster-faq-q,
  .gmaster-faq-toggle,
  .gmaster-faq-toggle svg,
  .gmaster-faq-call {
    transition: none;
  }
}
