    :root{
      --bg: #eff2f9;
      --text: #1e2532;
      --muted: #6b7280;
      --muted2: #828ba1;
      --card: #ffffff;
      --border: rgba(30, 37, 50, 0.10);
      --shadow: 0 8px 24px rgba(30, 37, 50, 0.10);
      --shadow2: 0 12px 34px rgba(30, 37, 50, 0.14);
      --primary: #1a91f0;
      --primary2: #eaf6ff;
      --radius: 12px;
      --radius2: 14px;
      --focus: rgba(26, 145, 240, 0.35);
    }

    *{ box-sizing: border-box; }
    html, body{ height: 100%; }

    body{
      margin: 0;
      background-color: var(--bg);
      color: var(--text);
      font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", Arial, sans-serif;
      font-size: 18px;
      line-height: 1.45;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      overflow-x: hidden;
    }

    a{
      color: inherit;
      text-decoration: none;
    }

    .templates-container{
      margin: 0 auto;
      max-width: 1440px;
      padding-left: clamp(16px, 3.5vw, 44px);
      padding-right: clamp(16px, 3.5vw, 44px);
      padding-top: 18px;
      padding-bottom: 28px;
    }

    .templates-breadcrumbs-container{
      margin-bottom: 12px;
    }

    ol.templates-breadcrumbs{
      list-style: none;
      margin: 0;
      padding: 0;
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      color: var(--muted2);
      font-size: 14px;
      line-height: 1.2;
    }

    li.templates-breadcrumbs-item{
      display: inline-flex;
      align-items: center;
      gap: 10px;
      max-width: 100%;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    li.templates-breadcrumbs-item + li.templates-breadcrumbs-item::before{
      content: "›";
      color: rgba(130, 139, 161, 0.9);
    }

    .templates-header{
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      text-align: center;
      margin: 0 auto 26px;
      max-width: 780px;
      padding: 18px 0 6px;
    }

    .templates-header-title{
      margin: 0 0 10px;
      font-size: clamp(30px, 3.8vw, 54px);
      line-height: 1.05;
      font-weight: 800;
      letter-spacing: -0.02em;
    }

    .templates-header-subtitle{
      margin: 0;
      color: var(--muted);
      font-size: clamp(16px, 1.3vw, 18px);
      line-height: 1.5;
      max-width: 66ch;
    }

    .templates-header-buttons{
      margin-top: 18px;
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      align-items: center;
      justify-content: center;
    }

    .templates-btn{
      appearance: none;
      border: 0;
      border-radius: 10px;
      padding: 12px 18px;
      font-size: 16px;
      font-weight: 700;
      line-height: 1.1;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease, color .12s ease;
      user-select: none;
      min-height: 44px;
    }

    .templates-btn-primary{
      background: var(--primary);
      color: #fff;
      box-shadow: 0 8px 18px rgba(26, 145, 240, 0.20);
    }

    .templates-btn-secondary{
      background: var(--primary2);
      color: var(--primary);
      box-shadow: 0 8px 18px rgba(26, 145, 240, 0.10);
    }

    .templates-btn:hover{
      transform: translateY(-1px);
      box-shadow: 0 12px 26px rgba(30, 37, 50, 0.14);
    }

    .templates-btn:active{
      transform: translateY(0);
    }

    .templates-btn:focus-visible{
      outline: 3px solid var(--focus);
      outline-offset: 3px;
    }

    .templates-grids{
      position: relative;
    }

    /* VIENS GRID, VISAS KARTĪTES IEKŠĀ */
    .templates-grid{
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 22px;
      align-items: stretch;
    }

    @media (max-width: 1024px){
      .templates-grid{
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
      }
    }

    @media (max-width: 680px){
      .templates-grid{
        grid-template-columns: 1fr;
        gap: 16px;
      }
    }

    .templates-card{
      display: flex;
      flex-direction: column;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius2);
      overflow: hidden;
      box-shadow: var(--shadow);
      transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
      min-height: 100%;
    }

    .templates-card:hover{
      transform: translateY(-2px);
      box-shadow: var(--shadow2);
      border-color: rgba(26, 145, 240, 0.25);
    }

    .templates-card:focus-visible{
      outline: 3px solid var(--focus);
      outline-offset: 4px;
    }

    .templates-card-body{
      padding: 14px;
      background: linear-gradient(180deg, rgba(239,242,249,0.55), rgba(239,242,249,0));
    }

    .templates-card-preview{
      background: #fff;
      border-radius: var(--radius);
      border: 1px solid rgba(30, 37, 50, 0.10);
      overflow: hidden;
      aspect-ratio: 210 / 297; /* A4 sajūta */
      position: relative;
    }

    .templates-card-preview img{
      width: 100%;
      height: 100%;
      display: block;
      object-fit: cover; /* ja gribi redzēt visu pilnībā, nomaini uz contain */
    }

    .templates-card-footer{
      padding: 14px 16px 16px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .templates-card-name{
      margin: 0;
      font-size: 18px;
      line-height: 1.25;
      font-weight: 800;
      letter-spacing: -0.01em;
    }

    .templates-card-caption{
      margin: 0;
      color: var(--muted);
      font-size: 14px;
      line-height: 1.35;
    }

    .templates-card-meta{
      margin-top: 10px;
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      color: rgba(30, 37, 50, 0.75);
      font-size: 13px;
      line-height: 1.2;
    }

    .templates-chip{
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 7px 10px;
      border-radius: 999px;
      background: rgba(26, 145, 240, 0.08);
      border: 1px solid rgba(26, 145, 240, 0.14);
      color: rgba(26, 145, 240, 0.95);
      font-weight: 700;
    }

    .templates-chip:hover {
      background: rgba(26, 145, 240, 0.95);
      color: var(--text);
    }

 .templates-card-cta{
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%) scale(0.98);
padding: 12px 16px;
border-radius: 12px;
font-size: 14px;
font-weight: 800;
letter-spacing: 0.02em;

color: #ffffff;
background: rgba(30, 37, 50, 0.78);
border: 1px solid rgba(255, 255, 255, 0.18);
box-shadow: 0 14px 34px rgba(30, 37, 50, 0.25);
backdrop-filter: blur(6px);

opacity: 0;
visibility: hidden;
pointer-events: none; /* lai visa kartīte paliek klikšķināma */
transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}
/* CTA parādās tikai ierīcēm ar hover (desktop) */
@media (hover: hover) and (pointer: fine){
.templates-card:hover .templates-card-cta,
.templates-card:focus-visible .templates-card-cta{
opacity: 1;
visibility: visible;
transform: translate(-50%, -50%) scale(1);
}

/* neliels “dim” fonam, kad CTA parādās */
.templates-card:hover::after,
.templates-card:focus-visible::after{
content: "";
position: absolute;
inset: 0;
background: rgba(15, 18, 28, 0.08);
pointer-events: none;
}
}

/* Ja lietotājs ir atslēdzis animācijas */
@media (prefers-reduced-motion: reduce){
.templates-card-cta{
transition: none;
}
}   