/*
Theme Name: CloudShelter
Description: The storefront's «sea» look for the blog at /blog — tokens, buttons and cards copied from apps/web/src/app/globals.css (`.sea`), header and footer built from the app's live menu and site settings. Persian, RTL. WPBLOG.
Version: 1.0.0
Requires PHP: 8.1
Text Domain: cloudshelter
*/

/* The site's own Vazirmatn file — same origin, served by the app; nothing to keep in sync. */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/vazirmatn-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

/* ── Tokens: a copy of the storefront's `.sea` block (light) and its dark override ─────────────── */
.sea {
  --sea-steel: #14b8a6;
  --sea-steel-2: #2dd4bf;
  --sea-steel-deep: #0f766e;
  --sea-bg: #f0faf7;
  --sea-text: #134e4a;
  --sea-dim: #4e7c74;
  --sea-glass: rgba(255, 255, 255, 0.62);
  --sea-glass-deep: rgba(255, 255, 255, 0.85);
  --sea-card: rgba(255, 255, 255, 0.7);
  --sea-card-hover: #ffffff;
  --sea-edge: rgba(19, 78, 74, 0.1);
  --sea-hair: rgba(19, 78, 74, 0.12);
  --sea-link-hover: rgba(15, 118, 110, 0.08);
  --sea-em: var(--sea-steel-deep);
  --sea-sh-1: 0 8px 30px rgba(19, 78, 74, 0.08);
  --sea-r-s: 12px;
  --sea-r-m: 18px;
  --sea-r-l: 26px;
  --sea-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sea-t: 220ms var(--sea-ease);

  color-scheme: light;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(45, 212, 191, 0.16), transparent 60%),
    var(--sea-bg);
  background-attachment: fixed;
  color: var(--sea-text);
  caret-color: var(--sea-steel);
}
html[data-sea-theme='dark'] .sea {
  --sea-bg: #03100e;
  --sea-text: #effcf8;
  --sea-dim: #9cc9c1;
  --sea-glass: rgba(10, 22, 44, 0.42);
  --sea-glass-deep: rgba(6, 13, 28, 0.62);
  --sea-card: rgba(6, 13, 28, 0.4);
  --sea-card-hover: rgba(10, 46, 41, 0.55);
  --sea-edge: rgba(94, 143, 135, 0.16);
  --sea-hair: rgba(94, 143, 135, 0.18);
  --sea-link-hover: rgba(45, 212, 191, 0.12);
  --sea-em: var(--sea-steel-2);
  --sea-sh-1: 0 8px 32px rgba(2, 8, 20, 0.45);
  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.8;
}
a {
  color: inherit;
}
img {
  max-width: 100%;
  height: auto;
}
.dim {
  color: var(--sea-dim);
}
.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 16px;
}
.wrap-narrow {
  width: 100%;
  max-width: 46rem;
  margin-inline: auto;
  padding-inline: 16px;
}
.site-main {
  flex: 1;
  padding-block: 28px 56px;
}
.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--sea-r-s);
  background: var(--sea-steel-deep);
  color: #fff;
}
.skip-link:focus {
  top: 12px;
}
:focus-visible {
  outline: 2px solid var(--sea-steel);
  outline-offset: 2px;
}

/* ── Buttons: the storefront's two actions ────────────────────────────────────────────────────── */
.sea-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  border-radius: 999px;
  padding: 10px 26px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--sea-t),
    box-shadow var(--sea-t),
    background var(--sea-t),
    border-color var(--sea-t);
}
.sea-btn-steel {
  background: linear-gradient(120deg, #115e59, var(--sea-steel-deep));
  color: #fff;
  box-shadow: 0 6px 22px rgba(20, 184, 166, 0.3);
}
.sea-btn-steel:hover {
  transform: translateY(-2px);
}
.sea-btn-ghost {
  background: rgba(19, 78, 74, 0.03);
  color: var(--sea-text);
  border-color: var(--sea-edge);
}
html[data-sea-theme='dark'] .sea .sea-btn-ghost {
  background: rgba(240, 253, 250, 0.05);
}
.sea-btn-ghost:hover {
  border-color: var(--sea-steel);
  background: var(--sea-link-hover);
}
.sea-btn-sm {
  min-height: 38px;
  padding: 7px 18px;
  font-size: 14px;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--sea-edge);
  background: transparent;
  color: var(--sea-text);
  cursor: pointer;
}

/* ── Header: a glass bar, the admin's menu ────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  /* The pill floats inside a 16px gutter, like the storefront's — never edge to edge on a phone. */
  padding: 12px 16px;
}
.header-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
  padding-block: 8px;
  background: var(--sea-glass-deep);
  border: 1px solid var(--sea-edge);
  border-radius: 999px;
  box-shadow: var(--sea-sh-1);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  max-width: calc(72rem - 32px);
  padding-inline: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  font-weight: 800;
  font-size: 18px;
}
.brand-logo {
  height: 36px;
  width: auto;
}
.brand-logo-dark,
html[data-sea-theme='dark'] .brand-logo-light {
  display: none;
}
html[data-sea-theme='dark'] .brand-logo-dark {
  display: block;
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  /* The menu is the admin's data — more items than fit wrap to a second row instead of pushing the
     account buttons out of the bar. Not overflow scrolling: that would clip the dropdowns. */
  flex-wrap: wrap;
}
.nav-link,
.nav-sub-link {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
.nav-link:hover,
.nav-link.is-here {
  background: var(--sea-link-hover);
  color: var(--sea-em);
}
.nav-group {
  position: relative;
}
.nav-sub {
  display: none;
  position: absolute;
  inset-inline-start: 0;
  top: 100%;
  min-width: 200px;
  padding: 8px;
  border-radius: var(--sea-r-m);
  background: var(--sea-glass-deep);
  border: 1px solid var(--sea-edge);
  box-shadow: var(--sea-sh-1);
}
.nav-group:hover .nav-sub,
.nav-group:focus-within .nav-sub {
  display: grid;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.i-sun,
html[data-sea-theme='dark'] .i-moon {
  display: none;
}
html[data-sea-theme='dark'] .i-sun {
  display: block;
}
.when-in,
.cs-signed-in .when-out {
  display: none;
}
.cs-signed-in .when-in {
  display: inline-flex;
}
.menu-btn {
  display: none;
}
.mobile-nav {
  max-width: calc(72rem - 32px);
  margin: 8px auto 0;
  padding: 8px;
  border-radius: var(--sea-r-l);
  background: var(--sea-glass-deep);
  border: 1px solid var(--sea-edge);
}
.mobile-nav:not([hidden]) {
  display: grid;
}
.mobile-link {
  padding: 12px 14px;
  border-radius: var(--sea-r-s);
  text-decoration: none;
  font-weight: 600;
}
.mobile-link.is-here {
  background: var(--sea-link-hover);
  color: var(--sea-em);
}
.mobile-sub {
  padding-inline-start: 28px;
  font-weight: 500;
  color: var(--sea-dim);
}
@media (max-width: 860px) {
  .nav,
  .nav-actions .when-out,
  .nav-actions .when-in {
    display: none !important;
  }
  .menu-btn {
    display: inline-grid;
  }
  .header-row {
    justify-content: space-between;
  }
}

/* ── Listing + cards: the storefront's post card ──────────────────────────────────────────────── */
.listing-head {
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
  margin-bottom: 28px;
}
.listing-head h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 900;
  line-height: 1.5;
}
.listing-head p {
  margin: 0;
}
.search-form {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 28rem;
}
.search-form label {
  flex: 1;
}
.search-field {
  width: 100%;
  min-height: 44px;
  padding: 8px 16px;
  font: inherit;
  color: var(--sea-text);
  background: var(--sea-card);
  border: 1px solid var(--sea-edge);
  border-radius: 999px;
}
.search-submit {
  min-height: 44px;
  padding: 8px 20px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--sea-steel-deep);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.cards {
  display: grid;
  gap: 16px;
}
@media (min-width: 768px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-decoration: none;
  border-radius: var(--sea-r-m);
  border: 1px solid var(--sea-edge);
  background: var(--sea-card);
  transition:
    transform var(--sea-t),
    background var(--sea-t),
    box-shadow var(--sea-t);
}
.card:hover {
  transform: translateY(-4px);
  background: var(--sea-card-hover);
  box-shadow: var(--sea-sh-1);
}
.card-cover {
  position: relative;
  height: 148px;
  overflow: hidden;
}
.card-cover img,
.card-gradient {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chip {
  position: absolute;
  top: 12px;
  inset-inline-start: 14px;
  padding: 1px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.chip-inline {
  position: static;
  display: inline-block;
  color: var(--sea-em);
  background: rgba(20, 184, 166, 0.08);
  border-color: rgba(20, 184, 166, 0.25);
}
.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px;
}
.card-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.75;
}
.card:hover .card-title {
  color: var(--sea-em);
}
.card-excerpt {
  margin: 8px 0 14px;
  font-size: 13px;
  line-height: 1.95;
  color: var(--sea-dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--sea-hair);
  font-size: 12px;
  color: var(--sea-dim);
}
.card-read {
  font-weight: 700;
  color: var(--sea-em);
}
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
}
.pager .page-numbers {
  min-width: 40px;
  padding: 6px 12px;
  text-align: center;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid var(--sea-edge);
}
.pager .current {
  background: var(--sea-steel-deep);
  border-color: transparent;
  color: #fff;
}
.empty {
  text-align: center;
  color: var(--sea-dim);
}

/* ── A post: reading typography ───────────────────────────────────────────────────────────────── */
.post-head {
  display: grid;
  gap: 10px;
  justify-items: start;
  margin-bottom: 20px;
}
.post-head h1 {
  margin: 0;
  font-size: clamp(26px, 4.4vw, 38px);
  font-weight: 900;
  line-height: 1.55;
}
.post-meta {
  margin: 0;
  font-size: 14px;
  color: var(--sea-dim);
}
.post-cover {
  margin: 0 0 24px;
}
.post-cover img {
  width: 100%;
  border-radius: var(--sea-r-m);
}
.post-content {
  font-size: 17px;
  line-height: 2;
  overflow-wrap: anywhere;
}
.post-content h2,
.post-content h3 {
  line-height: 1.6;
  margin-top: 1.8em;
}
.post-content a {
  color: var(--sea-em);
}
.post-content pre,
.post-content code {
  direction: ltr;
  text-align: left;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
}
.post-content pre {
  overflow-x: auto;
  padding: 14px 16px;
  border-radius: var(--sea-r-s);
  background: rgba(19, 78, 74, 0.06);
  border: 1px solid var(--sea-edge);
}
.post-content :not(pre) > code {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(19, 78, 74, 0.08);
}
.post-content blockquote {
  margin: 1.4em 0;
  padding: 4px 16px;
  border-inline-start: 4px solid var(--sea-steel);
  color: var(--sea-dim);
}
.post-content table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
}
.post-content th,
.post-content td {
  padding: 8px 12px;
  border: 1px solid var(--sea-edge);
}
.post-foot {
  margin-top: 36px;
}
.notfound {
  display: grid;
  gap: 16px;
  justify-items: center;
  text-align: center;
}
.notfound h1 {
  margin: 0;
}
.notfound-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

/* ── Footer ───────────────────────────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--sea-hair);
  padding-block: 36px 20px;
  font-size: 14px;
}
.footer-grid {
  display: grid;
  gap: 28px;
}
@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr));
  }
}
.footer-blurb {
  margin: 0 0 12px;
  color: var(--sea-dim);
  line-height: 2;
}
.footer-contact,
.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.footer-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
}
.footer-col a,
.footer-contact a {
  text-decoration: none;
  color: var(--sea-dim);
}
.footer-col a:hover {
  color: var(--sea-em);
}
.enamad {
  display: inline-block;
  margin-top: 12px;
}
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--sea-hair);
  color: var(--sea-dim);
}
.footer-socials {
  display: flex;
  gap: 12px;
}

/* ── The live-chat frame: the bubble's corner while closed, the panel's room while open ───────── */
.chat-frame {
  position: fixed;
  bottom: 0;
  inset-inline-start: 0;
  z-index: 40;
  width: 96px;
  height: 96px;
  border: 0;
  background: transparent;
  color-scheme: normal;
}
.chat-frame.is-open {
  width: min(100vw, 440px);
  height: min(100dvh, 700px);
}
@media (max-width: 639px) {
  .chat-frame.is-open {
    width: 100vw;
    height: 100dvh;
  }
}

/* ── Screen-reader text (WordPress core's class) ──────────────────────────────────────────────── */
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}
