/* ==========================================
   AMANA TRAVEL — UNIVERSAL ARTICLE TABLES
   Applies to every table inside .single-content
   ========================================== */

.single-content {
  --at-navy: #14243F;
  --at-navy-dark: #0B1729;
  --at-gold: #B99253;
  --at-gold-soft: rgba(185, 146, 83, 0.14);
  --at-white: #FFFFFF;
  --at-row-alt: #F7F8FA;
  --at-border: #E5E9F0;
  --at-border-soft: #EDF0F4;
  --at-text: #252B36;
  --at-muted: #697386;
  --at-radius: 14px;
  --at-shadow: 0 10px 30px rgba(20, 36, 63, 0.06);
}

/* ---------- Wrapper / scroll container ---------- */
.single-content .article-table-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 32px 0;
  border-radius: var(--at-radius);
  background: var(--at-white);
  box-shadow: var(--at-shadow);
  border: 1px solid var(--at-border);
  overflow: hidden;
}

/* When used as horizontal-scroll fallback (complex/wide tables) */
.single-content .article-table-wrap.is-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.single-content .article-table-wrap.is-scroll:focus {
  outline: 2px solid var(--at-gold);
  outline-offset: 2px;
}

/* Scroll hint */
.single-content .article-table-wrap.is-scroll::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 28px;
  pointer-events: none;
  background: linear-gradient(to right, rgba(255,255,255,0), rgba(20,36,63,0.06));
  opacity: 1;
  transition: opacity .2s ease;
}
.single-content .article-table-wrap.is-scroll.is-scrolled-end::after { opacity: 0; }

.single-content .article-table-scroll-hint {
  display: none;
  margin: -20px 0 28px;
  padding: 0 4px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--at-muted);
  letter-spacing: 0.01em;
}
.single-content .article-table-scroll-hint::before {
  content: "↔";
  display: inline-block;
  margin-right: 6px;
  color: var(--at-gold);
  font-weight: 700;
}
.single-content .article-table-scroll-hint.is-visible { display: block; }

/* ---------- Base table ---------- */
.single-content .article-table-wrap > table,
.single-content .article-table-wrap > figure.table,
.single-content .article-table-wrap > figure.table > table,
.single-content figure.table > table,
.single-content table {
  width: 100%;
  max-width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--at-white);
  color: var(--at-text);
  font-size: 15px;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
}

/* CKEditor figure.table inside our wrapper: neutralize its default */
.single-content .article-table-wrap > figure.table {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}
.single-content figure.table {
  margin: 32px 0;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Standalone tables (no wrapper yet, or before JS) get safe defaults */
.single-content > table,
.single-content > figure.table {
  margin: 32px 0;
  border-radius: var(--at-radius);
  overflow: hidden;
  border: 1px solid var(--at-border);
  box-shadow: var(--at-shadow);
}

/* ---------- Cells ---------- */
.single-content .article-table-wrap th,
.single-content .article-table-wrap td,
.single-content table th,
.single-content table td {
  padding: 16px 20px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--at-border-soft);
  border-right: 1px solid var(--at-border-soft);
  background-clip: padding-box;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: auto;
}
.single-content .article-table-wrap tr > *:last-child,
.single-content table tr > *:last-child {
  border-right: 0;
}

/* ---------- Header ---------- */
.single-content .article-table-wrap thead th,
.single-content .article-table-wrap thead td,
.single-content table thead th,
.single-content table thead td {
  background: var(--at-navy);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 18px 20px;
  border-bottom: 2px solid var(--at-gold);
  border-right-color: rgba(255,255,255,0.08);
  white-space: normal;
  vertical-align: middle;
}
.single-content .article-table-wrap thead th:last-child,
.single-content .article-table-wrap thead td:last-child,
.single-content table thead th:last-child { border-right: 0; }

/* First-column header cells in body (row headers) */
.single-content .article-table-wrap tbody th[scope="row"],
.single-content table tbody th[scope="row"] {
  background: #FBFCFD;
  color: var(--at-navy);
  font-weight: 600;
}

/* ---------- Body rows ---------- */
.single-content .article-table-wrap tbody td,
.single-content table tbody td {
  color: var(--at-text);
  background: var(--at-white);
}
.single-content .article-table-wrap tbody tr:nth-child(even) > td,
.single-content .article-table-wrap tbody tr:nth-child(even) > th,
.single-content table tbody tr:nth-child(even) > td,
.single-content table tbody tr:nth-child(even) > th {
  background: var(--at-row-alt);
}
.single-content .article-table-wrap tbody tr:last-child > td,
.single-content .article-table-wrap tbody tr:last-child > th,
.single-content table tbody tr:last-child > td,
.single-content table tbody tr:last-child > th {
  border-bottom: 0;
}

/* Hover (desktop pointer) */
@media (hover: hover) {
  .single-content .article-table-wrap tbody tr:hover > td,
  .single-content .article-table-wrap tbody tr:hover > th,
  .single-content table tbody tr:hover > td,
  .single-content table tbody tr:hover > th {
    background: #FFFDF8;
  }
  .single-content .article-table-wrap tbody tr:nth-child(even):hover > td,
  .single-content .article-table-wrap tbody tr:nth-child(even):hover > th {
    background: #FBF8F1;
  }
}

/* ---------- Links inside tables ---------- */
.single-content .article-table-wrap a,
.single-content table a {
  color: var(--at-navy);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(185,146,83,0.45);
  text-underline-offset: 3px;
  transition: color .2s ease, text-decoration-color .2s ease;
}
.single-content .article-table-wrap a:hover,
.single-content table a:hover {
  color: var(--at-gold);
  text-decoration-color: var(--at-gold);
}

/* ---------- Numeric / price / date emphasis ---------- */
.single-content .article-table-wrap .is-numeric,
.single-content .article-table-wrap .is-date,
.single-content .article-table-wrap .is-price {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.single-content .article-table-wrap .is-price {
  font-weight: 700;
  color: var(--at-navy-dark);
  letter-spacing: 0.01em;
}
.single-content .article-table-wrap thead .is-price,
.single-content .article-table-wrap thead .is-numeric,
.single-content .article-table-wrap thead .is-date {
  color: #FFFFFF;
}

/* ---------- Caption ---------- */
.single-content .article-table-wrap caption,
.single-content table caption {
  caption-side: bottom;
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--at-muted);
  text-align: left;
  background: #FBFCFD;
  border-top: 1px solid var(--at-border-soft);
}

/* ---------- Focus / accessibility ---------- */
.single-content .article-table-wrap a:focus-visible,
.single-content table a:focus-visible {
  outline: 2px solid var(--at-gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ==========================================
   RESPONSIVE CARD MODE
   Applied by JS via .is-card-table on wrapper
   ========================================== */
@media (max-width: 768px) {
  .single-content .article-table-wrap.is-card-table {
    overflow: visible;
    border: 0;
    box-shadow: none;
    background: transparent;
    border-radius: 0;
  }
  .single-content .article-table-wrap.is-card-table::after { display: none; }
  .single-content .article-table-scroll-hint.is-card-table-hint { display: none !important; }

  .single-content .article-table-wrap.is-card-table table,
  .single-content .article-table-wrap.is-card-table thead,
  .single-content .article-table-wrap.is-card-table tbody,
  .single-content .article-table-wrap.is-card-table tr,
  .single-content .article-table-wrap.is-card-table th,
  .single-content .article-table-wrap.is-card-table td {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  .single-content .article-table-wrap.is-card-table thead {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  .single-content .article-table-wrap.is-card-table tbody tr {
    background: var(--at-white);
    border: 1px solid var(--at-border);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(20, 36, 63, 0.04);
    margin: 0 0 16px;
    overflow: hidden;
  }
  .single-content .article-table-wrap.is-card-table tbody tr:last-child { margin-bottom: 0; }

  .single-content .article-table-wrap.is-card-table tbody td,
  .single-content .article-table-wrap.is-card-table tbody th[scope="row"] {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 0;
    border-bottom: 1px solid var(--at-border-soft);
    background: transparent !important;
    font-size: 14px;
    line-height: 1.6;
    white-space: normal;
    text-align: right;
  }
  .single-content .article-table-wrap.is-card-table tbody tr > *:last-child {
    border-bottom: 0;
  }

  .single-content .article-table-wrap.is-card-table tbody td::before,
  .single-content .article-table-wrap.is-card-table tbody th[scope="row"]::before {
    content: attr(data-label);
    flex: 0 0 42%;
    max-width: 42%;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--at-navy);
    line-height: 1.5;
    text-align: left;
    padding-top: 2px;
  }

  /* First cell becomes card title */
  .single-content .article-table-wrap.is-card-table tbody tr > *:first-child {
    display: block;
    padding: 16px;
    background: linear-gradient(180deg, var(--at-navy) 0%, var(--at-navy-dark) 100%) !important;
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
    text-align: left;
    border-bottom: 2px solid var(--at-gold);
  }
  .single-content .article-table-wrap.is-card-table tbody tr > *:first-child::before {
    display: block;
    flex: none;
    max-width: none;
    margin: 0 0 4px;
    padding: 0;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.62);
    text-align: left;
  }
  .single-content .article-table-wrap.is-card-table tbody tr > *:first-child,
  .single-content .article-table-wrap.is-card-table tbody tr > *:first-child a {
    color: #FFFFFF;
    text-decoration-color: rgba(185,146,83,0.7);
  }
  .single-content .article-table-wrap.is-card-table tbody tr > *:first-child a:hover {
    color: #F0D9A8;
  }

  .single-content .article-table-wrap.is-card-table .is-price {
    color: var(--at-navy-dark);
    font-weight: 700;
  }
  .single-content .article-table-wrap.is-card-table tbody tr > *:first-child.is-price {
    color: #FFFFFF;
  }
}

/* ---------- Tablet tuning ---------- */
@media (max-width: 1024px) {
  .single-content .article-table-wrap th,
  .single-content .article-table-wrap td,
  .single-content table th,
  .single-content table td {
    padding: 14px 16px;
  }
  .single-content .article-table-wrap thead th,
  .single-content table thead th {
    padding: 15px 16px;
    font-size: 11px;
  }
  .single-content .article-table-wrap > table,
  .single-content table {
    font-size: 14px;
  }
}

/* ---------- Small mobile ---------- */
@media (max-width: 420px) {
  .single-content .article-table-wrap.is-card-table tbody td,
  .single-content .article-table-wrap.is-card-table tbody th[scope="row"] {
    padding: 13px 14px;
    gap: 12px;
    font-size: 13px;
  }
  .single-content .article-table-wrap.is-card-table tbody td::before,
  .single-content .article-table-wrap.is-card-table tbody th[scope="row"]::before {
    flex-basis: 40%;
    max-width: 40%;
    font-size: 10px;
  }
  .single-content .article-table-wrap.is-card-table tbody tr > *:first-child {
    padding: 14px;
    font-size: 14px;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .single-content .article-table-wrap *,
  .single-content .article-table-wrap::after {
    transition: none !important;
  }
}

/* ---------- Print ---------- */
@media print {
  .single-content .article-table-wrap {
    box-shadow: none !important;
    border: 1px solid #999 !important;
    overflow: visible !important;
  }
  .single-content .article-table-wrap thead th {
    background: #14243F !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
