:root{
    --bg:#f6f7fb;
    --card-bg: #fff;
    --accent: #0066ff;
    --radius: 14px;
    --gap: 18px;
    --max-width:1200px;
  }
  *{box-sizing: border-box}
  body{
    margin:0;
    font-family: "Tahoma",sans-serif;
    /* background:var(--bg); */
    color:#222;
    direction: rtl;
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
  }

  .page {
    max-width: var(--max-width);
    margin: 36px auto;
    padding: 18px;
  }

  h1{
    margin: 6px 0 18px;
    font-size: 28px;
    text-align: center;
    color:#111;
  }

  /* --- grid کلی موزاییک (responsive) --- */
  .categories-grid{
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--gap);
    align-items: stretch;
    margin-top: 35px;
  }

  /* هر کارت یک کلاس «area» دارد که چیدمان موزاییکی را مشخص می‌کند */
  .cat {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(18,35,63,0.07);
    background: linear-gradient(180deg, rgba(0,0,0,0.04), transparent);
    transition: transform .28s cubic-bezier(.2,.9,.3,1), box-shadow .28s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: flex-end;
    padding: 16px;
  }

  /* اندازه‌ها (mimic masonry) */
  .area-large{ grid-column: span 6; grid-row: span 2; min-height:260px; }
  .area-medium{ grid-column: span 4; grid-row: span 1; min-height:270px; }
  .area-small{ grid-column: span 2; grid-row: span 1; min-height:120px; }

  /* در موبایل همه یک ستون بشوند */
  @media (max-width: 900px){
    .categories-grid { grid-template-columns: repeat(6, 1fr); }
    .area-large{ grid-column: span 6; grid-row: span 1; min-height:180px; }
    .area-medium{ grid-column: span 3; }
    .area-small{ grid-column: span 3; }
  }
  @media (max-width: 520px){
    .categories-grid { grid-template-columns: repeat(2, 1fr); gap:12px; }
    .area-large{ grid-column: span 2; }
    .area-medium{ grid-column: span 2; }
    .area-small{ grid-column: span 2; }
  }

  /* تصویر داخل کارت — پوشش کامل */
  .cat .bg{
    position: absolute;
    inset:0;
    background-size: cover;
    background-position: center;
    filter: contrast(.95) saturate(.95);
    transform-origin:center;
    transition: transform .6s cubic-bezier(.2,.9,.3,1);
    border-radius: 15px;
    overflow: hidden;
  }

  /* overlay gradient برای خوانایی متن */
  .cat::before{
    content:"";
    position:absolute;
    inset:0;
    background: linear-gradient(180deg, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0.28) 70%);
    opacity:0.95;
    transition:opacity .25s;
    pointer-events:none;
  }
  .cat .bg::before {
    content: '';
    position: absolute;
    inset: 0; /* معادل top:0; right:0; bottom:0; left:0 */
    background: rgba(0, 0, 0, 0.35); /* رنگ مشکی با شفافیت 35% */
    z-index: 1;
}
  /* محتوای کارت */
  .cat .meta{
    position: relative;
    z-index: 2;
    bottom: 10px;
    left: 10px;
    color: #fff;
    width:100%;
  }
  .cat .label{
    font-size:18px;
    font-weight:700;
    color: #fff;
    text-shadow: 0 6px 18px rgba(0,0,0,0.35);
  }
  .cat .hint{
    color: rgba(255,255,255,0.92);
    font-size:13px;
    opacity:.95;
  }
  .cat .cta {
    margin-top:8px;
    align-self: flex-start;
    background: rgba(255,255,255,0.14);
    color: #fff;
    padding:8px 12px;
    border-radius: 10px;
    font-weight:600;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.08);
    transition: background .2s, transform .2s;
  }

  /* hover / focus effects */
  .cat:hover, .cat:focus{
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 18px 40px rgba(18,35,63,0.16);
    z-index:6;
  }
  .cat:hover .bg{ transform: scale(1.08) translateY(-4px) rotate(-1deg); }
  .cat:focus{ outline: 3px solid rgba(0,102,255,0.14); outline-offset: 4px; }

  /* افکت لبهٔ رنگی در گوشه‌ها برای کارت‌ها */
  .cat .corner {
    position:absolute;
    top:12px;
    left:12px;
    width:56px;
    height:56px;
    border-radius:10px;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
    display:flex;
    align-items:center;
    justify-content:center;
    z-index:4;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    transform: translateX(6px);
  }
  .cat .corner img { width:34px; height:34px; object-fit:contain; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2)); }

  /* استایل برای حالت خوانا وقتی عکس نیست (فقط گرادینت) */
  .cat.noimg{ background: linear-gradient(135deg,#4facfe,#00f2fe); color:#fff; }
  .cat.noimg .bg{ display:none; }
  .cat .meta .label.small{ font-size:15px; font-weight:700; }

  .label{
    width: 50%;
  }
  .cat.area-large,
.cat.area-medium {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.25);
  transition: transform 0.5s ease;
  box-shadow:
  0 4px 6px rgba(0,0,0,0.1),
  0 8px 12px rgba(0,0,0,0.08);
  transition: box-shadow 0.3s ease, transform 0.3s ease;

}
.cat.area-large:hover,
.cat.area-medium:hover{
    transform: rotate(2deg) scale(1.03);
    box-shadow:
    0 8px 14px rgba(0,0,0,0.15),
    0 16px 20px rgba(0,0,0,0.12);
  transform: translateY(-4px) rotate(1deg);
}