/*
Theme Name: Paysable Blog
Theme URI: https://blog.paysable.com/
Author: Able Union
Author URI: https://paysable.com/
Description: Custom theme for the Paysable blog (blog.paysable.com). Reader-focused long-form layout with a Paysable-branded header/footer, designed to funnel search traffic toward paysable.com. Built as a standalone classic theme.
Version: 1.0.27
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: paysable-blog
*/

/* =========================================================================
   Design tokens
   ========================================================================= */

:root {
  /* Brand colors */
  --color-brand: #3062EF;
  --color-brand-strong: #1E48C7;
  --color-brand-soft: #EAF0FE;
  --color-accent: #2ACDE8;

  /* Neutrals */
  --color-ink-900: #0E1B36;
  --color-ink-700: #2E3A52;
  --color-ink-500: #6B7280;
  --color-ink-400: #9AA3B2;
  --color-line: #E5E8EE;
  --color-line-soft: #EFF1F5;
  --color-bg: #FFFFFF;
  --color-bg-soft: #F7F9FC;

  /* Footer palette (mirrors paysable.com) */
  --color-footer-bg: #E4E8EC;
  --color-footer-divider: #AFB9C5;
  --color-footer-muted: #7A8A9F;
  --color-footer-text: #0E1B36;

  /* Typography */
  --font-sans: "Poppins", "Pretendard Variable", "Pretendard",
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
    Arial, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;

  /* Sizing */
  --container: 1200px;
  --article: 720px;
  --radius-btn: 10px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(14, 27, 54, 0.06);
  --shadow-md: 0 6px 24px rgba(14, 27, 54, 0.08);
  --shadow-lg: 0 24px 48px rgba(14, 27, 54, 0.12);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink-900);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-brand);
  text-decoration: none;
}

a:hover { color: var(--color-brand-strong); text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

button { font-family: inherit; cursor: pointer; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #fff;
  color: var(--color-brand);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* =========================================================================
   Header
   ========================================================================= */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.95);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-line);
}

.header__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand__logo-link {
  display: inline-flex;
  align-items: center;
}

.brand__img {
  height: 24px;
  width: auto;
  display: block;
}

.brand__divider {
  width: 1px;
  height: 20px;
  background: var(--color-line);
}

.brand__sub {
  color: var(--color-ink-500);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
}

.brand__sub:hover {
  color: var(--color-ink-900);
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav__item {
  position: relative;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  color: var(--color-ink-700);
  font-weight: 500;
  font-size: 15px;
  border-radius: 8px;
  background: transparent;
  border: 0;
}

.nav__link:hover {
  color: var(--color-ink-900);
  background: var(--color-bg-soft);
  text-decoration: none;
}

.nav__chevron {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  opacity: 0.6;
}

/* Mega menu */
.megamenu {
  position: absolute;
  top: 100%;
  left: -16px;
  margin-top: 8px;
  min-width: 480px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  transition-delay: 0.12s;
}

.megamenu::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

.megamenu--store {
  min-width: 560px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 4px;
}

.nav-toggle:checked ~ .megamenu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}

.nav__link--toggle { cursor: pointer; }

.nav-toggle:checked ~ .nav__link--toggle .nav__chevron {
  transform: rotate(-135deg) translate(-2px, -2px);
}

/* Desktop: open mega-menu on hover (hover-capable pointers only) */
@media (hover: hover) and (min-width: 961px) {
  .nav__item:hover .megamenu,
  .nav__item:focus-within .megamenu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
  }
  .nav__item:hover .nav__link--toggle .nav__chevron,
  .nav__item:focus-within .nav__link--toggle .nav__chevron {
    transform: rotate(-135deg) translate(-2px, -2px);
  }
}

.megamenu__item {
  display: block;
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--color-ink-900);
}

.megamenu__item:hover {
  background: var(--color-bg-soft);
  text-decoration: none;
}

.megamenu__title {
  display: block;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 2px;
}

.megamenu__desc {
  display: block;
  color: var(--color-ink-500);
  font-size: 13.5px;
  line-height: 1.45;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Language switcher — dropdown (native names), always visible per policy */
.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-right: 4px;
}
.lang-switch__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--color-ink-500);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: color .15s ease, background-color .15s ease;
}
.lang-switch__toggle:hover { color: var(--color-ink-900); background: var(--color-bg-soft); }
.lang-switch__chevron {
  width: 7px;
  height: 7px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg);
  margin-top: -3px;
  transition: transform .15s ease;
}
.lang-switch.is-open .lang-switch__chevron {
  transform: rotate(-135deg);
  margin-top: 2px;
}
.lang-switch__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 168px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
  z-index: 200;
}
.lang-switch.is-open .lang-switch__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.lang-switch__opt {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-ink-700);
  text-decoration: none;
  white-space: nowrap;
  font-size: 14px;
}
.lang-switch__opt:hover {
  background: var(--color-bg-soft);
  color: var(--color-ink-900);
  text-decoration: none;
}
.lang-switch__opt.is-active {
  color: var(--color-ink-900);
  font-weight: 600;
}

/* Buttons — radius matches paysable.com signup button (10px) */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-btn);
  font-weight: 500;
  font-size: 14.5px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
}

.btn--primary {
  background: var(--color-brand);
  color: #fff;
}

.btn--primary:hover {
  background: var(--color-brand-strong);
  color: #fff;
  text-decoration: none;
}

.btn--ghost {
  background: transparent;
  color: var(--color-ink-700);
  border-color: var(--color-line);
}

.btn--ghost:hover {
  background: var(--color-bg-soft);
  border-color: var(--color-ink-400);
  color: var(--color-ink-900);
  text-decoration: none;
}

.nav__link--mobile { display: none; }

/* =========================================================================
   Article (single post)
   ========================================================================= */

.article {
  max-width: var(--article);
  margin: 0 auto;
  padding: 56px 24px 24px;
}

.article__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-brand);
  font-weight: 600;
  margin-bottom: 16px;
}

.article__eyebrow:hover {
  color: var(--color-brand-strong);
  text-decoration: none;
}

.article__eyebrow::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
}

.article__title {
  font-size: clamp(32px, 4.4vw, 44px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--color-ink-900);
  margin: 0 0 20px;
}

.article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  color: var(--color-ink-500);
  font-size: 14px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--color-line);
  margin-bottom: 40px;
}

.article__meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-ink-400);
}

.article__meta-notice {
  color: var(--color-ink-500);
}

/* Body */
.article__body {
  font-size: 17.5px;
  line-height: 1.75;
  color: var(--color-ink-700);
}

.article__body > *:first-child { margin-top: 0; }

.article__body p { margin: 0 0 1.4em; }

.article__body strong { color: var(--color-ink-900); font-weight: 600; }

.article__body a {
  color: var(--color-brand-strong);
  text-decoration: underline;
  text-decoration-color: rgba(48, 98, 239, 0.35);
  text-underline-offset: 3px;
}

.article__body a:hover {
  text-decoration-color: var(--color-brand-strong);
}

/* Links that open in a new tab get a small "opens in new tab" icon. */
.article__body a[target="_blank"]::after {
  content: "";
  display: inline-block;
  width: 0.72em;
  height: 0.72em;
  margin-left: 0.2em;
  vertical-align: -0.03em;
  background-color: currentColor;
  opacity: 0.65;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6'/%3E%3Cpath d='M10 14 20 4'/%3E%3Cpath d='M19 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h5'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6'/%3E%3Cpath d='M10 14 20 4'/%3E%3Cpath d='M19 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h5'/%3E%3C/svg%3E") no-repeat center / contain;
}

.article__body h2 {
  margin: 2.4em 0 0.7em;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--color-ink-900);
  font-weight: 700;
  scroll-margin-top: 100px;
}

.article__body h3 {
  margin: 2em 0 0.6em;
  font-size: 21px;
  line-height: 1.35;
  color: var(--color-ink-900);
  font-weight: 600;
}

.article__body h4 {
  margin: 1.8em 0 0.5em;
  font-size: 18px;
  color: var(--color-ink-900);
  font-weight: 600;
}

.article__body ul,
.article__body ol {
  margin: 0 0 1.4em;
  padding-left: 1.4em;
}

.article__body li { margin-bottom: 0.5em; }

.article__body figure {
  margin: 2.2em 0;
}

.article__body figure img,
.article__body img {
  border-radius: var(--radius-md);
}

.article__body figcaption,
.article__body .wp-element-caption,
.article__body .wp-caption-text {
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--color-ink-500);
  text-align: center;
  line-height: 1.55;
}

.article__body blockquote {
  margin: 2em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--color-brand);
  color: var(--color-ink-900);
  font-style: italic;
}

.article__body hr {
  border: 0;
  border-top: 1px solid var(--color-line);
  margin: 2.4em 0;
}

/* Code / preformatted blocks */
.article__body pre,
.article__body pre.wp-block-code,
.article__body .wp-block-preformatted {
  background: var(--color-bg-soft);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin: 2em 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--color-ink-900);
  overflow-x: auto;
}
.article__body pre code,
.article__body pre.wp-block-code code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: inherit;
}
/* Inline code (not inside a pre) */
.article__body :not(pre) > code {
  background: var(--color-bg-soft);
  border: 1px solid var(--color-line);
  border-radius: 5px;
  padding: 0.08em 0.36em;
  font-size: 0.9em;
  color: var(--color-ink-900);
}

/* Button block (Gutenberg core/buttons) — the theme wasn't styling these, so
   the link rendered as a plain inline <a> with the body underline, and its
   vertical padding spilled outside the layout box and overlapped neighbours. */
.article__body .wp-block-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 2em 0;
}
.article__body .wp-block-buttons.is-content-justification-center { justify-content: center; }
.article__body .wp-block-buttons.is-content-justification-right { justify-content: flex-end; }
.article__body .wp-block-button { display: inline-block; margin: 0; }
.article__body .wp-block-button__link,
.article__body .wp-block-button .wp-element-button {
  display: inline-block;
  text-decoration: none;
  background: var(--color-brand);
  color: #fff;
  font-weight: 600;
  line-height: 1.4;
  padding: 12px 22px;
  border-radius: 10px;
  border: 0;
  transition: background-color 0.15s ease;
}
.article__body .wp-block-button__link:hover,
.article__body .wp-block-button .wp-element-button:hover {
  background: var(--color-brand-strong);
  color: #fff;
}
/* Buttons never get the external-link icon. */
.article__body .wp-block-button__link::after { content: none; }
.article__body .wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  color: var(--color-brand-strong);
  border: 1px solid var(--color-line);
}
.article__body .wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: var(--color-bg-soft);
  color: var(--color-brand-strong);
}

/* Tables */
.article__body figure.wp-block-table,
.article__body .wp-block-table {
  margin: 2em 0;
  overflow-x: auto;
}

.article__body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
  line-height: 1.55;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.article__body table thead { background: var(--color-bg-soft); }

.article__body table th {
  text-align: left;
  font-weight: 600;
  color: var(--color-ink-900);
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-line);
  vertical-align: top;
}

.article__body table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-line-soft);
  color: var(--color-ink-700);
  vertical-align: top;
}

.article__body table tr:last-child td { border-bottom: 0; }

.article__body table tbody tr:hover { background: var(--color-bg-soft); }

.article__body table strong { color: var(--color-ink-900); }

/* Easy Table of Contents override */
.article__body #ez-toc-container,
.article__body .ez-toc-v2_0_81 {
  background: var(--color-bg-soft);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin: 2.2em 0;
}

.article__body .ez-toc-title-container { display: none; }

.article__body .ez-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article__body .ez-toc-list li {
  margin: 0;
  padding: 6px 0;
  font-size: 15px;
  border-bottom: 1px dashed var(--color-line);
}

.article__body .ez-toc-list li:last-child { border-bottom: 0; }

.article__body .ez-toc-list a {
  text-decoration: none;
  color: var(--color-ink-700);
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.article__body .ez-toc-list a:hover { color: var(--color-brand-strong); }

/* Easy TOC anchor spans: keep them in flow (zero-width, invisible) so the
   browser can scroll to the heading id that lives on this span — but offset
   for the sticky header, matching .article__body h2 above. Must NOT be
   display:none, otherwise TOC links land at the top of the page. */
.article__body .ez-toc-section,
.article__body .ez-toc-section-end {
  display: inline-block;
  width: 0;
  scroll-margin-top: 100px;
}

/* =========================================================================
   Post grid (home / archive / search)
   ========================================================================= */

.post-list {
  padding: 64px 24px;
}

.post-list__inner {
  max-width: var(--container);
  margin: 0 auto;
}

.archive-header {
  margin-bottom: 40px;
}

.archive-header__title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--color-ink-900);
}

.archive-header__desc {
  color: var(--color-ink-500);
  font-size: 16px;
  margin: 0;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 28px;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: var(--color-ink-900);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-ink-400);
}

.post-card__link {
  color: inherit;
}

.post-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}

.post-card__link:hover { text-decoration: none; }

.post-card__media {
  aspect-ratio: 16 / 10;
  background: var(--color-bg-soft);
  overflow: hidden;
}

.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.post-card:hover .post-card__media img {
  transform: scale(1.03);
}

.post-card--no-image .post-card__body {
  padding-top: 32px;
}

.post-card--no-image {
  background: linear-gradient(180deg, var(--color-brand-soft) 0%, #fff 60%);
}

.post-card__body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--color-ink-500);
}

.post-card__category {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background: var(--color-brand-soft);
  color: var(--color-brand-strong);
  border-radius: 999px;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.post-card__category:hover {
  background: var(--color-brand);
  color: #fff;
  text-decoration: none;
}

.post-card__date {
  color: var(--color-ink-500);
}

.post-card__title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--color-ink-900);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__excerpt {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--color-ink-500);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.no-results {
  max-width: var(--article);
  margin: 0 auto;
  padding: 80px 24px;
  text-align: center;
  color: var(--color-ink-500);
}

.no-results h1 {
  font-size: clamp(28px, 4vw, 40px);
  color: var(--color-ink-900);
  margin: 0 0 12px;
}

/* Pagination (output of the_posts_pagination()) */
.pagination {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--color-line);
  display: flex;
  justify-content: center;
}

.pagination .nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-btn);
  color: var(--color-ink-700);
  font-weight: 500;
  font-size: 14.5px;
}

.pagination .page-numbers:hover {
  background: var(--color-bg-soft);
  border-color: var(--color-ink-400);
  color: var(--color-ink-900);
  text-decoration: none;
}

.pagination .page-numbers.current {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: #fff;
}

.pagination .page-numbers.dots {
  border: 0;
  min-width: auto;
}

/* =========================================================================
   CTA section (pre-footer)
   ========================================================================= */

.cta-section {
  margin-top: 96px;
  padding: 80px 24px;
  background: linear-gradient(180deg, var(--color-bg-soft) 0%, #FFFFFF 100%);
  border-top: 1px solid var(--color-line);
}

.cta-section__inner {
  max-width: var(--container);
  margin: 0 auto;
}

.cta-section__intro {
  text-align: center;
  margin-bottom: 48px;
}

.cta-section__eyebrow {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-brand);
  font-weight: 600;
  margin-bottom: 12px;
}

.cta-section__title {
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--color-ink-900);
  margin: 0;
  font-weight: 700;
}

.cta-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.cta-card {
  position: relative;
  padding: 36px 36px 32px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.cta-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-ink-400);
  text-decoration: none;
}

.cta-card--primary {
  background: linear-gradient(135deg, var(--color-brand) 0%, #4D7AF3 70%, var(--color-accent) 130%);
  border-color: transparent;
  color: #fff;
}

.cta-card--primary:hover { border-color: transparent; }

.cta-card__label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-ink-500);
}

.cta-card--primary .cta-card__label {
  color: rgba(255,255,255,0.85);
}

.cta-card__title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0;
  color: inherit;
}

.cta-card__desc {
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--color-ink-500);
  margin: 0;
}

.cta-card--primary .cta-card__desc {
  color: rgba(255,255,255,0.92);
}

.cta-card__action {
  margin-top: auto;
  padding-top: 12px;
}

.cta-card__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-btn);
  font-weight: 500;
  font-size: 15px;
  background: #fff;
  color: var(--color-brand);
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease;
}

.cta-card__btn--ghost {
  background: transparent;
  color: var(--color-ink-900);
  border-color: var(--color-line);
}

.cta-card__btn--ghost:hover {
  background: var(--color-ink-900);
  color: #fff;
  border-color: var(--color-ink-900);
  text-decoration: none;
}

.cta-card__btn:hover { text-decoration: none; }

.cta-card__btn-arrow {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-top: 1.5px solid currentColor;
  transform: rotate(45deg);
}

/* =========================================================================
   Footer — mirrors paysable.com (#E4E8EC panel)
   ========================================================================= */

.footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: 56px 24px 28px;
  font-size: 14px;
}

.footer__inner {
  max-width: var(--container);
  margin: 0 auto;
}

.footer__top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 36px;
}

.footer__brand p {
  margin: 0;
  font-weight: 700;
  color: var(--color-footer-text);
  font-size: 18px;
  margin-bottom: 18px;
}

.footer__company-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 28px;
}

.footer__company-grid .field {
  display: block;
  font-size: 13px;
  line-height: 1.5;
}

.footer__company-grid .field-label {
  display: block;
  color: var(--color-footer-text);
  font-weight: 600;
  margin-bottom: 2px;
}

.footer__company-grid .field-value {
  display: block;
  color: var(--color-footer-text);
}

.footer__col-title {
  font-weight: 700;
  color: var(--color-footer-text);
  font-size: 15px;
  margin: 0 0 16px;
}

.footer__col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer__col li { margin-bottom: 10px; }

.footer__col a {
  color: var(--color-footer-muted);
  font-size: 14px;
}

.footer__col a:hover {
  color: var(--color-brand);
  text-decoration: none;
}

.footer__hours {
  font-size: 13.5px;
  color: var(--color-footer-text);
  line-height: 1.6;
  margin: 0;
}

.footer__bottom {
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer__social {
  display: flex;
  gap: 8px;
}

.footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--color-footer-text);
}

.footer__social a:hover {
  color: var(--color-brand);
  text-decoration: none;
}

.footer__social svg {
  width: 18px;
  height: 18px;
}

.footer__legal {
  flex: 1;
  text-align: right;
  font-size: 13px;
  color: var(--color-footer-muted);
}

.footer__legal-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 4px;
}

.footer__legal .copy {
  color: var(--color-footer-muted);
}

.footer__contact {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  color: var(--color-footer-text);
  margin-top: 4px;
}

/* =========================================================================
   WordPress core compat (alignments, captions, sticky, comments-off)
   ========================================================================= */

.alignleft { float: left; margin: 0.4em 1.5em 1em 0; }
.alignright { float: right; margin: 0.4em 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignwide { margin-left: calc((var(--article) - 100%) / 2 - 60px); margin-right: calc((var(--article) - 100%) / 2 - 60px); max-width: none; }
.alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; }
.article__body .wp-block-image.alignwide img,
.article__body .wp-block-image.alignfull img { width: 100%; }
.wp-caption { max-width: 100%; }
.wp-caption img { width: 100%; }
.sticky { /* no special styling for now */ }

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 1100px) and (min-width: 961px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
  .alignwide { margin-left: 0; margin-right: 0; }
}

@media (max-width: 960px) {
  .header__inner {
    padding: 12px 16px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .brand { flex: 0 1 auto; }
  .brand__img { height: 22px; }
  .brand__sub { font-size: 14px; }

  .nav {
    flex: 1 1 100%;
    gap: 2px;
    flex-wrap: wrap;
    order: 2; /* brand(0) + lang-switch(1) 행 다음에 배치 */
  }

  .nav__link {
    padding: 6px 10px;
    font-size: 13.5px;
  }

  .nav__link--mobile { display: inline-flex; }

  .header__actions { display: none; }

  /* 모바일: 언어 전환기를 헤더 첫 줄(brand 행) 우측으로 끌어올림 */
  .lang-switch {
    margin-left: auto;
    margin-right: 0;
    order: 1; /* brand(0) 옆, nav(2)보다 앞 */
  }
  .lang-switch__toggle { font-size: 13.5px; padding: 4px 6px; }

  .nav__item { position: static; }
  .megamenu {
    left: 0;
    right: 0;
    min-width: 0;
    width: 100%;
    margin-top: 0;
    padding: 8px;
    border-left: 0;
    border-right: 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-md);
  }
  .megamenu__item { padding: 14px 12px; }
  .megamenu__title { font-size: 15.5px; }
  .megamenu__desc { font-size: 13px; }
  .megamenu--store { min-width: 0; grid-template-columns: 1fr; }

  .article { padding: 40px 20px 16px; }
  .article__body { font-size: 17px; line-height: 1.7; }
  .article__body h2 { font-size: 24px; }
  .article__body table th,
  .article__body table td { padding: 10px 12px; font-size: 14.5px; }

  .cta-section { padding: 56px 16px; margin-top: 64px; }
  .cta-grid { grid-template-columns: 1fr; }

  .post-list { padding: 40px 20px 48px; }
  .post-grid { grid-template-columns: 1fr; gap: 20px; }
  .pagination { margin-top: 36px; padding-top: 24px; }

  .footer { padding: 40px 16px 24px; }
  .footer__top { grid-template-columns: 1fr; gap: 32px; padding-bottom: 24px; }
  .footer__company-grid { grid-template-columns: 1fr; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
  .footer__legal { text-align: left; flex: none; width: 100%; }
  .footer__legal-row { justify-content: flex-start; }
  .footer__contact { justify-content: flex-start; }
}

/* =========================================================================
   RTL (Arabic) — full mirror.
   WordPress core outputs dir="rtl" on <html> automatically for RTL
   languages (via language_attributes() in header.php) once Polylang
   registers 'ar' as RTL — no PHP change needed for the attribute itself.
   This block only overrides the *physical* (non-logical) left/right
   properties the base stylesheet uses; flex/grid layouts already mirror
   on their own once dir="rtl" is set on the root.
   ========================================================================= */

html[dir="rtl"] body {
  font-family: "Noto Sans Arabic", var(--font-sans);
}

/* Skip link */
html[dir="rtl"] .skip-link {
  left: auto;
  right: -9999px;
  border-radius: 0 0 0 8px;
}
html[dir="rtl"] .skip-link:focus { right: 0; left: auto; }

/* Mega menu */
html[dir="rtl"] .megamenu {
  left: auto;
  right: -16px;
}

/* Language switcher */
html[dir="rtl"] .lang-switch {
  margin-right: 0;
  margin-left: 4px;
}
html[dir="rtl"] .lang-switch__menu {
  right: auto;
  left: 0;
}

/* Article body */
html[dir="rtl"] .article__body ul,
html[dir="rtl"] .article__body ol {
  padding-left: 0;
  padding-right: 1.4em;
}
html[dir="rtl"] .article__body blockquote {
  padding: 4px 22px 4px 0;
  border-left: 0;
  border-right: 3px solid var(--color-brand);
}
html[dir="rtl"] .article__body a[target="_blank"]::after {
  margin-left: 0;
  margin-right: 0.2em;
}
html[dir="rtl"] .article__body table th {
  text-align: right;
}

/* WP core alignment classes */
html[dir="rtl"] .alignleft { float: right; margin: 0.4em 0 1em 1.5em; }
html[dir="rtl"] .alignright { float: left; margin: 0.4em 1.5em 1em 0; }

/* Footer */
html[dir="rtl"] .footer__legal { text-align: left; }
html[dir="rtl"] .footer__legal-row { justify-content: flex-start; }
html[dir="rtl"] .footer__contact { justify-content: flex-start; }

/* CTA button arrow — mirror the direction-of-motion chevron */
html[dir="rtl"] .cta-card__btn-arrow {
  transform: scaleX(-1) rotate(45deg);
}

@media (max-width: 960px) {
  html[dir="rtl"] .lang-switch {
    margin-left: 0;
    margin-right: auto;
  }
  html[dir="rtl"] .footer__legal { text-align: right; }
  html[dir="rtl"] .footer__legal-row { justify-content: flex-end; }
  html[dir="rtl"] .footer__contact { justify-content: flex-end; }
}
