/* =========================================================
   ghorbani-m — Personal Digital Magazine Design System
   RTL · Mobile-first · Light / Dark
   ========================================================= */

:root {
  --gm-bg: #f3efe6;
  --gm-bg-elevated: #efe8da;
  --gm-card: #fffdf8;
  --gm-ink: #14201c;
  --gm-muted: #5b6b64;
  --gm-accent: #0b3d2e;
  --gm-secondary: #1f6b52;
  --gm-accent-soft: #d7ebe2;
  --gm-line: rgba(20, 32, 28, 0.12);
  --gm-success: #1b7f5a;
  --gm-warning: #b7791f;
  --gm-error: #b42318;
  --gm-overlay: rgba(14, 22, 19, 0.55);
  --gm-shadow: 0 8px 28px rgba(20, 32, 28, 0.08);
  --gm-shadow-sm: 0 2px 10px rgba(20, 32, 28, 0.06);
  --gm-font: "Vazirmatn", Tahoma, sans-serif;
  --gm-radius-sm: 8px;
  --gm-radius-md: 12px;
  --gm-radius-lg: 16px;
  --gm-space-1: 4px;
  --gm-space-2: 8px;
  --gm-space-3: 12px;
  --gm-space-4: 16px;
  --gm-space-5: 24px;
  --gm-space-6: 32px;
  --gm-space-7: 48px;
  --gm-max: 1160px;
  --gm-prose: 42rem;
  --gm-header-h: 56px;
  --gm-bottom-nav-h: 64px;
  --gm-focus: 0 0 0 3px rgba(31, 107, 82, 0.35);
}

[data-theme="dark"] {
  --gm-bg: #0e1613;
  --gm-bg-elevated: #121c18;
  --gm-card: #16201c;
  --gm-ink: #e8efe9;
  --gm-muted: #a8b5ae;
  --gm-accent: #3d9a78;
  --gm-secondary: #5cb892;
  --gm-accent-soft: rgba(61, 154, 120, 0.18);
  --gm-line: rgba(232, 239, 233, 0.12);
  --gm-success: #3ecf8e;
  --gm-warning: #e0a84a;
  --gm-error: #f97066;
  --gm-overlay: rgba(0, 0, 0, 0.72);
  --gm-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
  --gm-shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.28);
  --gm-focus: 0 0 0 3px rgba(61, 154, 120, 0.45);
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--gm-bg);
  color: var(--gm-ink);
  font-family: var(--gm-font);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }

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

a {
  color: var(--gm-secondary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--gm-focus);
}

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

/* ---------- Typography ---------- */
.gm-display { font-size: clamp(1.75rem, 5.5vw, 2.5rem); font-weight: 800; line-height: 1.3; letter-spacing: -0.01em; }
.gm-h1 { font-size: clamp(1.5rem, 4.5vw, 2rem); font-weight: 800; line-height: 1.35; margin: 0; }
.gm-h2 { font-size: clamp(1.25rem, 3.5vw, 1.5rem); font-weight: 700; line-height: 1.4; margin: 0; }
.gm-h3 { font-size: clamp(1.1rem, 3vw, 1.25rem); font-weight: 700; line-height: 1.45; margin: 0; }
.gm-body { font-size: 1rem; font-weight: 400; line-height: 1.85; }
.gm-caption { font-size: 0.8125rem; font-weight: 500; line-height: 1.5; color: var(--gm-muted); }
.gm-meta { font-size: 0.78rem; font-weight: 500; line-height: 1.4; color: var(--gm-muted); }

/* ---------- Shell ---------- */
.gm-news {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 90% 45% at 100% 0%, rgba(11, 61, 46, 0.10), transparent 55%),
    linear-gradient(180deg, var(--gm-bg-elevated) 0%, var(--gm-bg) 32%, var(--gm-bg) 100%);
  color: var(--gm-ink);
  font-family: var(--gm-font);
  padding-bottom: calc(var(--gm-bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 1rem);
}

[data-theme="dark"] .gm-news {
  background:
    radial-gradient(ellipse 80% 40% at 0% 0%, rgba(61, 154, 120, 0.12), transparent 50%),
    linear-gradient(180deg, #0c1411 0%, var(--gm-bg) 40%);
}

.gm-container {
  width: min(100% - 2rem, var(--gm-max));
  margin-inline: auto;
}

.gm-section {
  padding: var(--gm-space-5) 0;
}

.gm-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--gm-space-3);
  margin-bottom: var(--gm-space-4);
}

.gm-section-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.gm-section-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gm-secondary);
  text-decoration: none;
}

.gm-section-link:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.gm-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--gm-bg) 88%, transparent);
  border-bottom: 1px solid var(--gm-line);
  padding: max(0.65rem, env(safe-area-inset-top)) 0 0.65rem;
}

.gm-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gm-space-3);
  min-height: var(--gm-header-h);
  width: min(100% - 1.5rem, var(--gm-max));
  margin-inline: auto;
}

.gm-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  max-width: min(68vw, 320px);
}

.gm-logo {
  display: block;
  width: auto;
  height: clamp(40px, 9vw, 56px);
  max-width: 100%;
  object-fit: contain;
  object-position: right center;
}

.gm-brand-name {
  font-size: clamp(1.15rem, 4vw, 1.45rem);
  font-weight: 800;
  color: var(--gm-accent);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.gm-brand-tag {
  font-size: 0.7rem;
  color: var(--gm-muted);
  font-weight: 500;
}

.gm-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.gm-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid transparent;
  border-radius: var(--gm-radius-md);
  background: transparent;
  color: var(--gm-ink);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.gm-icon-btn:hover {
  background: var(--gm-accent-soft);
  border-color: var(--gm-line);
}

.gm-icon-btn svg { width: 22px; height: 22px; }

.gm-desktop-nav {
  display: none;
  align-items: center;
  gap: 0.15rem;
}

.gm-desktop-nav a {
  text-decoration: none;
  color: var(--gm-ink);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
}

.gm-desktop-nav a:hover,
.gm-desktop-nav a[aria-current="page"] {
  background: var(--gm-accent-soft);
  color: var(--gm-accent);
}

/* Mobile drawer */
.gm-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: var(--gm-overlay);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.gm-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.gm-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(86vw, 320px);
  background: var(--gm-card);
  z-index: 60;
  padding: max(1rem, env(safe-area-inset-top)) 1.25rem 1.5rem;
  transform: translateX(105%);
  transition: transform 0.25s ease;
  border-left: 1px solid var(--gm-line);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gm-drawer.is-open { transform: translateX(0); }

.gm-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.gm-drawer-nav a {
  text-decoration: none;
  color: var(--gm-ink);
  font-weight: 600;
  padding: 0.85rem 0.75rem;
  border-radius: var(--gm-radius-md);
}

.gm-drawer-nav a:hover,
.gm-drawer-nav a[aria-current="page"] {
  background: var(--gm-accent-soft);
  color: var(--gm-accent);
}

/* ---------- Bottom nav ---------- */
.gm-bottom-nav {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  background: color-mix(in srgb, var(--gm-card) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--gm-line);
  padding: 0.35rem 0.25rem max(0.35rem, env(safe-area-inset-bottom));
}

.gm-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  text-decoration: none;
  color: var(--gm-muted);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.4rem 0.2rem;
  min-height: 52px;
  border-radius: var(--gm-radius-sm);
}

.gm-bottom-nav a svg { width: 20px; height: 20px; }
.gm-bottom-nav a[aria-current="page"],
.gm-bottom-nav a:hover { color: var(--gm-accent); }

@media (min-width: 1024px) {
  .gm-bottom-nav { display: none; }
  .gm-news { padding-bottom: 2rem; }
}

/* ---------- Daily quote ---------- */
.gm-quote-bar {
  margin: 0.75rem auto 0;
  width: min(100% - 1.5rem, var(--gm-max));
  background: var(--gm-accent);
  color: #f4faf7;
  border-radius: var(--gm-radius-md);
  padding: 0.85rem 1rem;
  display: grid;
  gap: 0.25rem;
  box-shadow: var(--gm-shadow-sm);
}

[data-theme="dark"] .gm-quote-bar {
  background: #1a4d3c;
  color: #e8efe9;
}

.gm-quote-label {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.85;
  letter-spacing: 0.04em;
}

.gm-quote-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.7;
}

/* ---------- Featured ---------- */
.gm-featured {
  width: min(100% - 1.5rem, var(--gm-max));
  margin: 1rem auto 0;
}

.gm-featured-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--gm-card);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius-lg);
  overflow: hidden;
  box-shadow: var(--gm-shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  .gm-featured-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--gm-shadow);
  }
}

.gm-featured-media {
  aspect-ratio: 16 / 10;
  max-height: 420px;
  background: var(--gm-accent-soft);
  overflow: hidden;
}

.gm-featured-media img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
}

@media (hover: hover) {
  .gm-featured-card:hover .gm-featured-media img { transform: scale(1.03); }
}

.gm-featured-body { padding: 1rem 1.1rem 1.2rem; }

.gm-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gm-accent);
  background: var(--gm-accent-soft);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  text-decoration: none;
}

.gm-featured-title {
  margin: 0.55rem 0 0.45rem;
  font-size: clamp(1.35rem, 5vw, 1.85rem);
  font-weight: 800;
  line-height: 1.35;
}

.gm-featured-summary {
  margin: 0 0 0.75rem;
  color: var(--gm-muted);
  font-size: 0.95rem;
  line-height: 1.8;
}

.gm-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  align-items: center;
}

/* ---------- Article card ---------- */
.gm-card-grid {
  display: grid;
  gap: 0.85rem;
}

.gm-article-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
  background: var(--gm-card);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius-md);
  padding: 0.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gm-article-card:active { transform: scale(0.985); }

@media (hover: hover) {
  .gm-article-card:hover {
    box-shadow: var(--gm-shadow-sm);
    transform: translateY(-1px);
  }
}

.gm-article-card.is-stack {
  grid-template-columns: 1fr;
}

.gm-article-thumb {
  width: 96px;
  height: 96px;
  border-radius: var(--gm-radius-sm);
  overflow: hidden;
  background: var(--gm-accent-soft);
}

.gm-article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gm-article-card.is-stack .gm-article-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
}

.gm-article-body {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
  align-content: start;
}

.gm-article-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gm-article-excerpt {
  margin: 0;
  font-size: 0.82rem;
  color: var(--gm-muted);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Ranked list ---------- */
.gm-ranked {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.gm-ranked-item {
  display: grid;
  grid-template-columns: 2.25rem 64px 1fr;
  gap: 0.75rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
  background: var(--gm-card);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius-md);
  padding: 0.65rem 0.75rem;
}

.gm-rank {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gm-accent);
  font-variant-numeric: tabular-nums;
}

.gm-ranked-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--gm-radius-sm);
  overflow: hidden;
  background: var(--gm-accent-soft);
}

.gm-ranked-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gm-ranked-title {
  margin: 0 0 0.25rem;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.5;
}

/* ---------- Category / link cards ---------- */
.gm-cat-grid,
.gm-link-grid,
.gm-gallery-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
}

.gm-cat-card,
.gm-link-card {
  display: grid;
  gap: 0.35rem;
  text-decoration: none;
  color: inherit;
  background: var(--gm-card);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius-md);
  padding: 1rem 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gm-cat-card:hover,
.gm-link-card:hover {
  border-color: color-mix(in srgb, var(--gm-accent) 40%, var(--gm-line));
  box-shadow: var(--gm-shadow-sm);
}

.gm-cat-card strong,
.gm-link-card strong {
  font-size: 0.95rem;
}

.gm-link-card .gm-ext {
  font-size: 0.72rem;
  color: var(--gm-secondary);
  font-weight: 600;
}

.gm-gallery-item {
  position: relative;
  border-radius: var(--gm-radius-md);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--gm-accent-soft);
  border: none;
  padding: 0;
  cursor: pointer;
}

.gm-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Video embeds (Aparat) ---------- */
.gm-video-grid {
  display: grid;
  gap: 1.25rem;
}

.gm-video-card {
  background: var(--gm-card);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius-lg);
  padding: 1rem;
}

.gm-video-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
}

.gm-video-desc {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--gm-secondary);
  line-height: 1.6;
}

.gm-video-date {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: var(--gm-secondary);
}

.gm-video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--gm-radius-md);
  overflow: hidden;
  background: #0f172a;
}

.gm-video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.gm-prose-content .gm-video-embed {
  margin: 1rem 0;
}

/* ---------- About teaser ---------- */
.gm-about-teaser {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 1rem;
  align-items: center;
  background: var(--gm-card);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius-lg);
  padding: 1rem;
}

.gm-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--gm-accent-soft);
  border: 2px solid var(--gm-accent-soft);
}

.gm-about-teaser p {
  margin: 0.35rem 0 0;
  color: var(--gm-muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

/* ---------- Footer ---------- */
.gm-footer {
  margin-top: var(--gm-space-6);
  border-top: 1px solid var(--gm-line);
  padding: var(--gm-space-6) 0 calc(1rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--gm-bg-elevated) 70%, transparent);
}

.gm-footer-grid {
  display: grid;
  gap: 1.5rem;
}

.gm-footer h3 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}

.gm-footer-brand {
  display: inline-block;
  margin-bottom: 0.75rem;
  text-decoration: none;
}

.gm-footer-logo {
  display: block;
  height: 48px;
  width: auto;
  max-width: min(100%, 260px);
  object-fit: contain;
  object-position: right center;
}

.gm-footer p {
  margin: 0;
  color: var(--gm-muted);
  font-size: 0.88rem;
  line-height: 1.75;
}

.gm-footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.gm-footer-nav a {
  text-decoration: none;
  color: var(--gm-ink);
  font-size: 0.88rem;
  font-weight: 500;
}

.gm-footer-nav a:hover { color: var(--gm-accent); }

.gm-footer-bottom {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gm-line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--gm-muted);
}

.gm-social {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.gm-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--gm-line);
  text-decoration: none;
  color: var(--gm-ink);
  font-size: 0.8rem;
  font-weight: 600;
}

/* ---------- Article page ---------- */
.gm-article-page {
  width: min(100% - 1.5rem, var(--gm-prose));
  margin: 1.25rem auto 2rem;
}

.gm-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.8rem;
  color: var(--gm-muted);
  margin-bottom: 1rem;
}

.gm-breadcrumb a {
  color: var(--gm-muted);
  text-decoration: none;
}

.gm-breadcrumb a:hover { color: var(--gm-accent); }
.gm-breadcrumb span[aria-hidden] { opacity: 0.5; }

.gm-article-hero-img {
  width: 100%;
  max-height: 420px;
  border-radius: var(--gm-radius-lg);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  margin: 1rem 0 1.25rem;
  background: var(--gm-accent-soft);
}

.gm-article-summary {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  background: var(--gm-accent-soft);
  border-radius: var(--gm-radius-md);
  border-right: 3px solid var(--gm-accent);
  color: var(--gm-ink);
  font-size: 1.02rem;
  line-height: 1.85;
}

.gm-prose-content {
  font-size: 1.05rem;
  line-height: 2;
  color: var(--gm-ink);
}

.gm-prose-content h2,
.gm-prose-content h3 {
  margin: 1.75rem 0 0.75rem;
  line-height: 1.4;
}

.gm-prose-content p { margin: 0 0 1.1rem; }

.gm-prose-content blockquote {
  margin: 1.25rem 0;
  padding: 0.85rem 1rem;
  border-right: 3px solid var(--gm-accent);
  background: var(--gm-card);
  border-radius: 0 var(--gm-radius-sm) var(--gm-radius-sm) 0;
  color: var(--gm-muted);
  font-style: normal;
}

.gm-prose-content ul,
.gm-prose-content ol {
  padding-right: 1.25rem;
  margin: 0 0 1.1rem;
}

.gm-prose-content img {
  border-radius: var(--gm-radius-md);
  margin: 1rem 0;
}

.gm-prose-content pre,
.gm-prose-content code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.9em;
  direction: ltr;
  text-align: left;
}

.gm-prose-content pre {
  background: var(--gm-card);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius-sm);
  padding: 0.85rem 1rem;
  overflow-x: auto;
}

.gm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.5rem 0;
}

.gm-tag {
  display: inline-flex;
  text-decoration: none;
  color: var(--gm-ink);
  background: var(--gm-card);
  border: 1px solid var(--gm-line);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.gm-tag:hover {
  border-color: var(--gm-accent);
  color: var(--gm-accent);
}

/* Share / action bar */
.gm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0;
}

.gm-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--gm-line);
  background: var(--gm-card);
  color: var(--gm-ink);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.gm-action-btn:hover { border-color: var(--gm-accent); color: var(--gm-accent); }
.gm-action-btn.is-active {
  background: var(--gm-accent-soft);
  border-color: var(--gm-accent);
  color: var(--gm-accent);
}

.gm-sticky-actions {
  position: sticky;
  bottom: calc(var(--gm-bottom-nav-h) + env(safe-area-inset-bottom));
  z-index: 25;
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem;
  margin: 1rem -0.25rem 0;
  background: color-mix(in srgb, var(--gm-card) 90%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--gm-line);
  border-radius: 999px;
  box-shadow: var(--gm-shadow-sm);
}

@media (min-width: 1024px) {
  .gm-sticky-actions {
    bottom: 1rem;
    position: static;
    justify-content: flex-start;
    border-radius: var(--gm-radius-md);
    margin: 1.25rem 0;
  }
}

/* Comments */
.gm-comments {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gm-line);
}

.gm-comment-form {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  background: var(--gm-card);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius-md);
  padding: 1rem;
}

.gm-field {
  display: grid;
  gap: 0.35rem;
}

.gm-field label {
  font-size: 0.82rem;
  font-weight: 600;
}

.gm-field input,
.gm-field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--gm-radius-sm);
  border: 1px solid var(--gm-line);
  background: var(--gm-bg);
  color: var(--gm-ink);
}

.gm-field textarea { min-height: 110px; resize: vertical; }

.gm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: 999px;
  background: var(--gm-accent);
  color: #f4faf7;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.gm-btn:hover { filter: brightness(1.08); }
.gm-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.gm-btn-ghost {
  background: transparent;
  color: var(--gm-ink);
  border: 1px solid var(--gm-line);
}

.gm-comment {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--gm-line);
}

.gm-comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gm-accent-soft);
  color: var(--gm-accent);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
}

.gm-comment-name { margin: 0; font-weight: 700; font-size: 0.92rem; }
.gm-comment-date { font-size: 0.75rem; color: var(--gm-muted); }
.gm-comment-text { margin: 0.45rem 0 0; line-height: 1.75; font-size: 0.92rem; }
.gm-comment-replies { margin-right: 1.25rem; margin-top: 0.25rem; }

/* Search / listing pages */
.gm-page-head {
  width: min(100% - 1.5rem, var(--gm-max));
  margin: 1.25rem auto 0.5rem;
}

.gm-search-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  width: min(100% - 1.5rem, 560px);
  margin: 1rem auto 1.5rem;
}

.gm-search-box input {
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid var(--gm-line);
  background: var(--gm-card);
  color: var(--gm-ink);
  padding: 0.65rem 1.1rem;
  font-family: inherit;
  font-size: 1rem;
}

.gm-page-list {
  width: min(100% - 1.5rem, var(--gm-max));
  margin: 0 auto 2rem;
  display: grid;
  gap: 0.85rem;
}

/* States */
.gm-skeleton {
  background: linear-gradient(90deg, var(--gm-line), transparent, var(--gm-line));
  background-size: 200% 100%;
  animation: gm-shimmer 1.2s linear infinite;
  border-radius: var(--gm-radius-md);
  min-height: 1rem;
}

.gm-empty,
.gm-error {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--gm-muted);
}

.gm-toast {
  position: fixed;
  bottom: calc(var(--gm-bottom-nav-h) + 1rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  background: var(--gm-ink);
  color: var(--gm-bg);
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--gm-shadow);
  max-width: min(90vw, 360px);
  text-align: center;
}

[data-theme="dark"] .gm-toast {
  background: var(--gm-card);
  color: var(--gm-ink);
  border: 1px solid var(--gm-line);
}

/* Lightbox */
.gm-lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.88);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.gm-lightbox img {
  max-height: min(82vh, 900px);
  max-width: 100%;
  object-fit: contain;
  border-radius: var(--gm-radius-sm);
}

.gm-lightbox-caption {
  color: #ddd;
  text-align: center;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.gm-lightbox-controls {
  position: absolute;
  inset-inline: 0;
  top: 50%;
  display: flex;
  justify-content: space-between;
  padding: 0 0.75rem;
  pointer-events: none;
}

.gm-lightbox-controls button {
  pointer-events: auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  font-size: 1.25rem;
}

.gm-lightbox-close {
  position: absolute;
  top: max(0.75rem, env(safe-area-inset-top));
  left: 0.75rem;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  font-size: 1.25rem;
}

/* Layout helpers */
.gm-home-main {
  width: min(100% - 1.5rem, var(--gm-max));
  margin-inline: auto;
}

.gm-home-layout {
  display: grid;
  gap: 1.5rem;
}

.gm-sidebar { display: none; }

.gm-sidebar-block {
  background: var(--gm-card);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius-lg);
  padding: 1rem;
  margin-bottom: 1rem;
}

/* Animations */
@keyframes gm-fade-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gm-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gm-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.gm-anim-in { animation: gm-rise 0.55s ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Breakpoints ---------- */
@media (min-width: 768px) {
  .gm-card-grid { grid-template-columns: 1fr 1fr; }
  .gm-cat-grid { grid-template-columns: repeat(3, 1fr); }
  .gm-link-grid { grid-template-columns: repeat(3, 1fr); }
  .gm-gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .gm-video-grid { grid-template-columns: 1fr 1fr; }
  .gm-footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .gm-article-card.is-stack { grid-template-columns: 1fr; }
}

@media (min-width: 1024px) {
  .gm-desktop-nav { display: flex; }
  .gm-menu-btn { display: none !important; }
  .gm-home-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
  .gm-sidebar { display: block; position: sticky; top: calc(var(--gm-header-h) + 1.5rem); }
  .gm-featured-editorial {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 0;
  }
  .gm-featured-editorial .gm-featured-media {
    aspect-ratio: auto;
    min-height: 240px;
    max-height: 420px;
    height: auto;
  }
  .gm-featured-editorial .gm-featured-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.5rem;
  }
  .gm-gallery-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1280px) {
  .gm-home-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; }
}
