/* ==========================================================================
   Alfa Keşif — Çalışma Kağıdı PDF Şablonu (A4)
   Kullanım: yazdırma görünümü (calisma-kagidi-yazdir.php), ürün sayfası önizlemesi, admin canlı önizleme
   Tema renkleri .cks üzerindeki --c1 --c2 --c3 --soft --ink değişkenlerinden gelir.
   ========================================================================== */

/* Çalışma kağıdı yazı tipleri — siteye gömülü (Türkçe ğ ş İ ı tam destek). Kaynak: Google Fonts, SIL Open Font License */

@font-face {
    font-family: 'CK Baloo';
    font-style: normal;
    font-weight: 500 800;
    font-display: block;
    src: url('../fonts/calisma-kagidi/baloo2-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'CK Baloo';
    font-style: normal;
    font-weight: 500 800;
    font-display: block;
    src: url('../fonts/calisma-kagidi/baloo2-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'CK Nunito';
    font-style: normal;
    font-weight: 500 900;
    font-display: block;
    src: url('../fonts/calisma-kagidi/nunito-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'CK Nunito';
    font-style: normal;
    font-weight: 500 900;
    font-display: block;
    src: url('../fonts/calisma-kagidi/nunito-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.cks {
    --c1: #4f46e5;
    --c2: #7c3aed;
    --c3: #f59e0b;
    --soft: #eef2ff;
    --ink: #1e1b4b;
    --grade: #1a3aa8;
    --line: #cbd5e1;
    --ok: #16a34a;
    --no: #e11d48;
    --fh: 'CK Baloo', 'CK Nunito', 'Segoe UI', Arial, sans-serif;
    --fb: 'CK Nunito', 'Segoe UI', Arial, sans-serif;

    position: relative;
    box-sizing: border-box;
    width: 210mm;
    height: 297mm;
    margin: 0 auto;
    padding: 11mm 11mm 8.5mm;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    color: var(--ink);
    font-family: var(--fb);
    font-size: 11pt;
    line-height: 1.38;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    text-align: left;
}

.cks-body {
    position: relative;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

/* İçerik sığmazsa calisma-kagidi-fit.js bu katmana zoom uygular */
.cks-fit {
    zoom: var(--ck-zoom, 1);
}

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

.cks svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* Renkli kesik çizgili sayfa çerçevesi */
.cks-frame {
    position: absolute;
    inset: 5mm;
    border: 2.2px dashed color-mix(in srgb, var(--c1) 45%, transparent);
    border-radius: 7mm;
    pointer-events: none;
}

.cks-frame::before,
.cks-frame::after {
    content: '';
    position: absolute;
    width: 9mm;
    height: 9mm;
    border-radius: 50%;
    background: var(--c3);
    opacity: .9;
}

.cks-frame::before {
    top: -4.5mm;
    left: -4.5mm;
}

.cks-frame::after {
    bottom: -4.5mm;
    right: -4.5mm;
    background: var(--c2);
}

/* ---------- Başlık bandı ---------- */
.cks-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5mm;
    min-height: 23mm;
    padding: 3.2mm 6mm;
    border-radius: 6mm;
    color: #fff;
    background:
        radial-gradient(circle at 12% 120%, rgba(255, 255, 255, .18) 0 18mm, transparent 18.2mm),
        radial-gradient(circle at 88% -30%, rgba(255, 255, 255, .14) 0 22mm, transparent 22.2mm),
        radial-gradient(rgba(255, 255, 255, .22) 1.1px, transparent 1.3px) 0 0 / 5mm 5mm,
        linear-gradient(115deg, var(--c1), var(--c2));
    overflow: hidden;
    box-shadow: 0 1.4mm 0 color-mix(in srgb, var(--c1) 35%, #000 10%);
}

.cks-head-sm {
    min-height: 24mm;
}

.cks-grade {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    width: 18mm;
    height: 18mm;
    border-radius: 50%;
    background: #fff;
    color: var(--grade);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1.3mm solid var(--c3);
    transform: rotate(-6deg);
}

.cks-grade b {
    font-family: var(--fh);
    font-size: 22pt;
    font-weight: 700;
}

.cks-grade small {
    font-family: var(--fh);
    font-size: 6.5pt;
    font-weight: 700;
    letter-spacing: .12em;
    margin-top: .6mm;
}

.cks-head-txt {
    position: relative;
    z-index: 2;
    min-width: 0;
    flex: 1;
}

.cks-kicker {
    display: inline-block;
    font-family: var(--fh);
    font-weight: 600;
    font-size: 9pt;
    letter-spacing: .04em;
    padding: .8mm 3mm;
    border-radius: 99px;
    background: rgba(255, 255, 255, .22);
    margin-bottom: 1.6mm;
}

.cks-title {
    font-family: var(--fh);
    font-weight: 700;
    font-size: 18pt;
    line-height: 1.05;
    margin: 0;
    color: #fff;
    text-shadow: 0 .6mm 0 rgba(0, 0, 0, .12);
    letter-spacing: -.01em;
}

.cks-key-sub {
    font-size: 9.5pt;
    opacity: .9;
    margin-top: 1mm;
    font-weight: 700;
}

.cks-teacher-badge {
    position: relative;
    z-index: 2;
    font-family: var(--fh);
    font-weight: 700;
    font-size: 7.5pt;
    line-height: 1.2;
    text-align: center;
    padding: 2mm 3mm;
    border-radius: 3mm;
    background: #fff;
    color: var(--no);
    transform: rotate(4deg);
    border: .6mm dashed var(--no);
}

/* Dekorlar */
.cks-deco {
    position: absolute;
    z-index: 1;
    color: rgba(255, 255, 255, .9);
    pointer-events: none;
}

.cks-deco-a {
    width: 22mm;
    height: 22mm;
    right: 9mm;
    bottom: -4mm;
    opacity: .38;
    transform: rotate(-12deg);
}

.cks-deco-b {
    width: 13mm;
    height: 13mm;
    right: 34mm;
    top: 2.5mm;
    opacity: .3;
    transform: rotate(14deg);
}

.cks-deco-star {
    color: var(--c3);
}

.cks-deco-star.s1 {
    width: 6mm;
    height: 6mm;
    right: 5mm;
    top: 4mm;
}

.cks-deco-star.s2 {
    width: 4mm;
    height: 4mm;
    right: 52mm;
    bottom: 4mm;
    color: #fff;
    opacity: .7;
}

.cks-deco-star.s3 {
    width: 3.5mm;
    height: 3.5mm;
    right: 27mm;
    bottom: 13mm;
    opacity: .9;
}

/* ---------- Öğrenci alanı ---------- */
.cks-student {
    display: grid;
    grid-template-columns: 2.1fr 1fr 1fr 1.25fr;
    gap: 3mm;
    margin: 3mm 0 2.4mm;
}

.cks-field,
.cks-score {
    border: .45mm solid color-mix(in srgb, var(--c1) 22%, #fff);
    background: var(--soft);
    border-radius: 3.5mm;
    padding: 1.2mm 3mm 1.6mm;
    min-height: 11mm;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cks-field label,
.cks-score label {
    font-family: var(--fh);
    font-weight: 600;
    font-size: 7.5pt;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--c1);
}

.cks-field span {
    display: block;
    border-bottom: .4mm dotted color-mix(in srgb, var(--ink) 45%, #fff);
    height: 5mm;
}

.cks-stars {
    display: flex;
    gap: 1.2mm;
    height: 5.2mm;
}

.cks-stars svg {
    width: 5.2mm;
    height: 5.2mm;
    fill: #fff;
    stroke: var(--c3);
    stroke-width: 1.8;
}

/* ---------- Yönerge kutusu ---------- */
.cks-note {
    display: flex;
    align-items: center;
    gap: 3mm;
    padding: 1.6mm 4mm;
    border-radius: 3.5mm;
    border: .5mm dashed var(--c3);
    background: color-mix(in srgb, var(--c3) 9%, #fff);
    margin-bottom: 2.4mm;
}

.cks-note p {
    margin: 0;
    font-weight: 700;
    font-size: 10pt;
}

.cks-note-ic {
    font-size: 14pt;
    line-height: 1;
}

/* ---------- Bölümler ---------- */
.cks-sec {
    margin-top: 2.6mm;
}

.cks-sec-title {
    display: flex;
    align-items: center;
    gap: 2.5mm;
    font-family: var(--fh);
    font-weight: 600;
    font-size: 11.5pt;
    color: var(--c1);
    margin: 0 0 1.8mm;
    padding-bottom: 1mm;
    border-bottom: .5mm solid color-mix(in srgb, var(--c1) 18%, #fff);
    break-after: avoid;
    page-break-after: avoid;
}

.cks-sec-title em {
    font-style: normal;
    margin-left: auto;
    font-size: 13pt;
}

.cks-sec-l {
    width: 6.4mm;
    height: 6.4mm;
    flex: 0 0 auto;
    border-radius: 2mm;
    background: var(--c3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11pt;
    transform: rotate(-5deg);
}

.cks-qs {
    display: flex;
    flex-direction: column;
    gap: 1.8mm;
}

.cks-qs.is-compact {
    gap: 1.4mm;
}

.cks-qs.is-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.6mm 2.6mm;
}

.cks-qs.is-2col .cks-opts.cols-4 {
    grid-template-columns: repeat(2, 1fr);
}

.cks-qs.is-2col .cks-q {
    padding-right: 2.5mm;
}

.cks-qs.is-2col .cks-tf {
    gap: 2.5mm;
}

.cks-qs.is-2col .cks-tf-box {
    width: 8mm;
    height: 8mm;
}

/* ---------- Soru kartı ---------- */
.cks-q {
    position: relative;
    display: flex;
    gap: 3mm;
    padding: 2mm 3mm 2.2mm 2.6mm;
    border-radius: 3.5mm;
    background: #fff;
    border: .45mm solid color-mix(in srgb, var(--c1) 16%, #fff);
    border-left: 1.6mm solid var(--c1);
    break-inside: avoid;
    page-break-inside: avoid;
}

.cks-q:nth-child(3n+2) {
    border-left-color: var(--c2);
}

.cks-q:nth-child(3n+3) {
    border-left-color: var(--c3);
}

.cks-qs.is-compact .cks-q {
    padding-top: 1.5mm;
    padding-bottom: 1.6mm;
}

.cks-qno {
    flex: 0 0 auto;
    width: 6.6mm;
    height: 6.6mm;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c1), var(--c2));
    color: #fff;
    font-family: var(--fh);
    font-weight: 700;
    font-size: 10.5pt;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 .6mm 0 color-mix(in srgb, var(--c1) 40%, #000 15%);
}

.cks-qbody {
    flex: 1;
    min-width: 0;
}

.cks-qtext {
    font-weight: 700;
    font-size: 11pt;
    line-height: 1.42;
    padding-top: .3mm;
}

.cks-qtext strong {
    color: var(--c1);
    font-weight: 800;
}

.cks-qimg {
    margin: 2mm 0 1mm;
    text-align: center;
}

.cks-qimg img {
    max-width: 100%;
    max-height: 62mm;
    border-radius: 2.5mm;
    display: inline-block;
}

/* Çoktan seçmeli */
.cks-opts {
    list-style: none;
    margin: 1.4mm 0 0;
    padding: 0;
    display: grid;
    gap: 1mm 4mm;
}

.cks-opts.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.cks-opts.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.cks-opts.cols-1 {
    grid-template-columns: 1fr;
}

.cks-opts li {
    display: flex;
    align-items: center;
    gap: 2.2mm;
    font-weight: 600;
    padding: .4mm 2mm .4mm .6mm;
    border-radius: 99px;
}

.cks-optl {
    flex: 0 0 auto;
    width: 5.8mm;
    height: 5.8mm;
    border-radius: 50%;
    border: .5mm solid var(--c1);
    color: var(--c1);
    font-family: var(--fh);
    font-weight: 700;
    font-size: 9pt;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.cks-opts li.is-on {
    background: color-mix(in srgb, var(--ok) 12%, #fff);
}

.cks-opts li.is-on .cks-optl {
    background: var(--ok);
    border-color: var(--ok);
    color: #fff;
}

/* Doğru / Yanlış */
.cks-tf {
    display: flex;
    align-items: center;
    gap: 4mm;
}

.cks-tf .cks-qtext {
    flex: 1;
}

.cks-tf-boxes {
    display: flex;
    gap: 2mm;
    flex: 0 0 auto;
}

.cks-tf-box {
    width: 9mm;
    height: 9mm;
    border-radius: 2.4mm;
    border: .55mm solid;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.cks-tf-box i {
    font-style: normal;
    font-family: var(--fh);
    font-weight: 700;
    font-size: 7pt;
    opacity: .7;
    align-self: flex-start;
    margin: .6mm 0 0 .8mm;
    margin-right: auto;
}

.cks-tf-box.d {
    border-color: var(--ok);
    color: var(--ok);
    background: color-mix(in srgb, var(--ok) 6%, #fff);
}

.cks-tf-box.y {
    border-color: var(--no);
    color: var(--no);
    background: color-mix(in srgb, var(--no) 6%, #fff);
}

.cks-tf-box.is-on {
    position: relative;
}

.cks-tf-box.is-on::after {
    content: '✔';
    position: absolute;
    font-size: 15pt;
    font-weight: 900;
    line-height: 1;
}

.cks-tf-box.d.is-on {
    background: var(--ok);
    color: #fff;
}

.cks-tf-box.y.is-on {
    background: var(--no);
    color: #fff;
}

/* Boşluk doldurma */
.cks-blank {
    display: inline-block;
    height: 1.15em;
    vertical-align: -0.2em;
    border-bottom: .55mm dashed var(--c1);
    margin: 0 1mm;
    border-radius: 0;
}

.cks-blank-filled {
    height: auto;
    vertical-align: baseline;
    padding: 0 1.5mm;
    color: var(--ok);
    font-family: var(--fh);
    font-weight: 700;
    text-align: center;
    border-bottom-style: solid;
    border-bottom-color: var(--ok);
    background: color-mix(in srgb, var(--ok) 9%, #fff);
    border-radius: 1.4mm 1.4mm 0 0;
}

/* Eşleştirme */
.cks-match {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16mm;
    margin-top: 1.6mm;
}

.cks-match ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.3mm;
}

.cks-match li {
    display: flex;
    align-items: center;
    gap: 2mm;
    min-height: 7mm;
    padding: .6mm 2.2mm;
    border-radius: 2.6mm;
    background: var(--soft);
    font-weight: 700;
}

.cks-mt {
    flex: 1;
}

.cks-match-r .cks-mt {
    text-align: left;
}

.cks-mn {
    flex: 0 0 auto;
    width: 6mm;
    height: 6mm;
    border-radius: 1.6mm;
    background: var(--c1);
    color: #fff;
    font-family: var(--fh);
    font-weight: 700;
    font-size: 8.5pt;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cks-mn.alt {
    background: var(--c3);
}

.cks-dot {
    flex: 0 0 auto;
    width: 3.4mm;
    height: 3.4mm;
    border-radius: 50%;
    background: #fff;
    border: .7mm solid var(--c1);
}

/* Açık uçlu: ilkokul defter çizgisi */
.cks-lines {
    margin-top: .5mm;
}

/* Her satır: düz taban çizgisi + kesik orta çizgi (ilkokul yazı defteri) */
.cks-lines span {
    display: block;
    height: 8mm;
    border-bottom: .45mm solid var(--line);
    background-image: repeating-linear-gradient(to right, #e2e8f0 0 2mm, transparent 2mm 3.5mm);
    background-size: 100% .35mm;
    background-position: 0 50%;
    background-repeat: no-repeat;
}

.cks-inline-ans {
    margin-top: 2mm;
    padding: 2mm 3mm;
    border-radius: 2.5mm;
    background: color-mix(in srgb, var(--ok) 9%, #fff);
    border-left: 1mm solid var(--ok);
    color: color-mix(in srgb, var(--ok) 75%, #000);
    font-weight: 700;
    font-size: 10pt;
}

/* Kapanış */
.cks-cheer {
    margin: 5mm auto 3mm;
    text-align: center;
    font-family: var(--fh);
    font-weight: 600;
    font-size: 11pt;
    color: var(--c1);
    padding: 2.6mm 5mm;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--soft), color-mix(in srgb, var(--c3) 12%, #fff), var(--soft));
    width: fit-content;
    max-width: 100%;
    break-inside: avoid;
}

/* Alt bilgi */
.cks-foot {
    flex: 0 0 auto;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4mm;
    margin-top: 3mm;
    padding-top: 2.2mm;
    border-top: .4mm dashed color-mix(in srgb, var(--c1) 30%, #fff);
    font-size: 8pt;
    color: color-mix(in srgb, var(--ink) 65%, #fff);
    font-weight: 700;
}

.cks-foot-brand {
    display: flex;
    align-items: center;
    gap: 2.2mm;
    font-family: var(--fh);
    font-weight: 700;
    font-size: 12pt;
    line-height: 1;
    color: var(--c2);
}

.cks-foot-brand img {
    width: 10mm;
    height: 10mm;
    border-radius: 2.4mm;
    display: block;
}

.cks-foot-brand b {
    color: var(--c1);
    font-weight: 800;
}

.cks-foot-brand small {
    display: block;
    font-family: var(--fb);
    font-size: 6.5pt;
    font-weight: 700;
    letter-spacing: .03em;
    color: color-mix(in srgb, var(--ink) 55%, #fff);
    margin-top: .8mm;
}

.cks-foot-mid {
    text-align: center;
}

.cks-foot-url {
    color: var(--c1);
}

/* Cevap anahtarı şeridi (sayfa içinde, kesilebilir) */
.cks-keystrip {
    margin-top: 4mm;
    padding: 2.2mm 3mm 2.4mm;
    border: .45mm dashed color-mix(in srgb, var(--ink) 40%, #fff);
    border-radius: 3mm;
    background: #fafafa;
    break-inside: avoid;
}

.cks-keystrip-t {
    font-family: var(--fh);
    font-weight: 700;
    font-size: 8.5pt;
    color: var(--c1);
    margin-bottom: 1mm;
}

.cks-keystrip-t small {
    font-family: var(--fb);
    font-weight: 700;
    font-size: 6.5pt;
    color: color-mix(in srgb, var(--ink) 50%, #fff);
}

.cks-keystrip ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .6mm 4mm;
    font-size: 7.5pt;
    font-weight: 700;
    color: color-mix(in srgb, var(--ink) 80%, #fff);
}

.cks-keystrip b {
    color: var(--c1);
}

/* Öğretmen nüshası */
.cks-teacher .cks-head {
    background:
        radial-gradient(rgba(255, 255, 255, .22) 1.1px, transparent 1.3px) 0 0 / 5mm 5mm,
        linear-gradient(115deg, var(--c1), var(--c2));
}

/* Admin canlı önizleme: kâğıt dış kutusu olmadan */
.cks.cks-preview-only {
    width: auto;
    height: auto;
    min-height: 0;
    padding: 0;
    font-size: 11pt;
    display: block;
    overflow: visible;
}

/* ==========================================================================
   Ekran görünümü (yazdırma sayfası)
   ========================================================================== */
.cks-screen .cks {
    box-shadow: 0 12px 40px rgba(15, 23, 42, .18), 0 2px 6px rgba(15, 23, 42, .08);
    border-radius: 4px;
    margin-bottom: 10mm;
}

/* ==========================================================================
   Baskı / PDF
   ========================================================================== */
@page {
    size: A4 portrait;
    margin: 0;
}

@media print {

    html,
    body {
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .cks-noprint {
        display: none !important;
    }

    /* Tam olarak bir A4 sayfa: taşma ikinci sayfaya geçmez */
    .cks {
        width: 210mm;
        height: 296.5mm;
        margin: 0;
        box-shadow: none !important;
        border-radius: 0 !important;
        break-after: avoid;
        page-break-after: avoid;
        break-inside: avoid;
    }
}

/* Kesirler: pay üstte, payda altta (2026-12-04) */
.cks-frac {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    vertical-align: middle;
    line-height: 1.08;
    margin: .1em .14em;
    font-size: 1.02em;
    font-variant-numeric: lining-nums tabular-nums;
}

.cks-frac .cks-num {
    align-self: stretch;
    text-align: center;
    padding: 0 .2em .06em;
    border-bottom: .13em solid currentColor;
}

.cks-frac .cks-den {
    padding: .06em .2em 0;
}

.cks-frac .cks-blank {
    min-width: 2.6em !important;
    height: 1.35em;
    margin: 0 .05em;
    vertical-align: baseline;
}

.cks-mixed {
    white-space: nowrap;
}

.cks-mixed > .cks-blank {
    min-width: 2.8em !important;
    height: 1.5em;
}

.cks-mixed > .cks-frac {
    margin-left: .12em;
}

.cks-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
