/* ===========================================================================
   Uputstva (manuals)

   Loaded globally from layout.ejs, but everything is namespaced under
   .uputstvo-* / .uputstva-* so it cannot reach the shop, the blog or the cart.

   Palette is the store's own: brand blue #3998fd, ink #29292b, greys #e4e7ec /
   #f5f8fc, and the shop's red #c0392b for the one callout that has to stop a
   reader.
   =========================================================================== */

/* ── List page ─────────────────────────────────────────────────────────── */

.uputstva-intro {
    color: #4a4a52;
    max-width: 62ch;
    margin-bottom: 1.75rem;
}

.uputstvo-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: #29292b;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.uputstvo-card:hover,
.uputstvo-card:focus {
    border-color: #3998fd;
    box-shadow: 0 6px 20px rgba(57, 152, 253, 0.14);
    transform: translateY(-2px);
    color: #29292b;
    text-decoration: none;
}

.uputstvo-card-img {
    height: 170px;
    background: #f5f8fc;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #eef1f5;
}

.uputstvo-card-img img {
    max-width: 88%;
    max-height: 88%;
    object-fit: contain;
}

.uputstvo-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 1rem 1.1rem 1.1rem;
}

.uputstvo-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #29292b;
    margin: 0 0 0.5rem;
    line-height: 1.35;
}

.uputstvo-card-desc {
    font-size: 0.9rem;
    color: #5c5c66;
    margin: 0 0 1rem;
    flex: 1 1 auto;
}

.uputstvo-card-more {
    font-size: 0.85rem;
    font-weight: 600;
    color: #3998fd;
}

/* ── A manual ──────────────────────────────────────────────────────────── */

.uputstvo-title {
    font-size: 1.9rem;
    font-weight: 700;
    color: #29292b;
    margin-bottom: 0.5rem;
    line-height: 1.25;
}

.uputstvo-summary {
    font-size: 1.05rem;
    color: #4a4a52;
    border-left: 3px solid #3998fd;
    padding-left: 0.9rem;
    margin-bottom: 1.75rem;
}

.uputstvo-body {
    font-size: 1rem;
    color: #33333a;
    line-height: 1.65;
}

.uputstvo-body p {
    margin-bottom: 1rem;
}

.uputstvo-body .manual-heading {
    color: #29292b;
    font-weight: 600;
    margin: 1.9rem 0 0.75rem;
    line-height: 1.3;
}

.uputstvo-body h2.manual-heading { font-size: 1.35rem; }
.uputstvo-body h3.manual-heading { font-size: 1.15rem; }
.uputstvo-body h4.manual-heading { font-size: 1rem; }

.uputstvo-body .manual-list {
    margin: 0 0 1rem 1.15rem;
    padding: 0;
}

.uputstvo-body .manual-list li {
    margin-bottom: 0.35rem;
}

/* Steps: a numbered procedure, so the marker has to be obvious — it is the
   difference between "do this" and "do this, in this order". */
.uputstvo-body .manual-steps {
    margin: 1.25rem 0 1.5rem;
}

.uputstvo-body .manual-steps-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #29292b;
    margin-bottom: 0.6rem;
}

.uputstvo-body .manual-steps ol {
    counter-reset: korak;
    list-style: none;
    margin: 0;
    padding: 0;
}

.uputstvo-body .manual-steps li {
    position: relative;
    counter-increment: korak;
    padding: 0.55rem 0 0.55rem 2.6rem;
    border-top: 1px solid #eef1f5;
}

.uputstvo-body .manual-steps li:last-child {
    border-bottom: 1px solid #eef1f5;
}

.uputstvo-body .manual-steps li::before {
    content: counter(korak);
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: #eef4ff;
    color: #2f86e8;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.uputstvo-body .manual-figure {
    margin: 1.5rem 0;
    text-align: center;
}

.uputstvo-body .manual-figure img {
    max-width: 100%;
    height: auto;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
    background: #fff;
}

/* A drawing may be scaled up to fill the column: vectors stay sharp, and an SVG
   that declares a small intrinsic size would otherwise render as a sliver. */
.uputstvo-body .manual-figure img.manual-figure-vector {
    width: 100%;
    max-width: 420px;
}

.uputstvo-body .manual-figure img.manual-figure-wide {
    max-width: 100%;
}

/* Platform selector bar (iPhone / Android quick switch & jump) */
.uputstvo-body .manual-platforms {
    margin: 1.5rem 0 1.85rem;
    padding: 1.15rem 1.2rem;
    background: #f5f8fc;
    border: 1px solid #dce4f0;
    border-radius: 12px;
}

.uputstvo-body .manual-platforms-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #29292b;
    margin: 0 0 0.8rem;
}

.uputstvo-body .manual-platforms-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.uputstvo-body .manual-platform-btn {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    background: #fff;
    border: 2px solid #dfe6f0;
    border-radius: 10px;
    text-decoration: none;
    color: #29292b;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.uputstvo-body .manual-platform-btn:hover,
.uputstvo-body .manual-platform-btn:focus {
    border-color: #3998fd;
    box-shadow: 0 4px 14px rgba(57, 152, 253, 0.15);
    transform: translateY(-1px);
    color: #29292b;
    text-decoration: none;
}

.uputstvo-body .manual-platform-btn.is-active {
    border-color: #3998fd;
    background: #eef5ff;
    box-shadow: 0 4px 14px rgba(57, 152, 253, 0.16);
}

.uputstvo-body .manual-platform-btn-android.is-active {
    border-color: #188038;
    background: #eef9f2;
    box-shadow: 0 4px 14px rgba(24, 128, 56, 0.14);
}

.uputstvo-body .manual-platform-svg {
    width: 1.85rem;
    height: 1.85rem;
    flex-shrink: 0;
    color: #1f242d;
}

.uputstvo-body .manual-platform-btn-android .manual-platform-svg {
    color: #188038;
}

.uputstvo-body .manual-platform-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.uputstvo-body .manual-platform-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: #29292b;
    line-height: 1.25;
}

.uputstvo-body .manual-platform-sub {
    font-size: 0.82rem;
    color: #5c5c66;
    margin-top: 0.15rem;
    line-height: 1.3;
}

.uputstvo-body .manual-platform-reset {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #4a4a52;
    background: transparent;
    border: 1px solid #d0d7e3;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.uputstvo-body .manual-platform-reset:hover,
.uputstvo-body .manual-platform-reset.is-active {
    background: #fff;
    color: #1f6fd6;
    border-color: #3998fd;
}

/* Platform badges on section headings */
.uputstvo-body .manual-heading-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    margin-right: 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    vertical-align: middle;
    background: #e9eef6;
    color: #1f242d;
}

.uputstvo-body .manual-heading-badge .manual-platform-svg {
    width: 0.95rem;
    height: 0.95rem;
}

.uputstvo-body .manual-heading-badge-android {
    background: #e6f4ea;
    color: #137333;
}

.uputstvo-body h2.manual-heading[data-platforma] {
    padding-top: 1.1rem;
    border-top: 2px solid #eef1f5;
    scroll-margin-top: 1.25rem;
}

.uputstvo-body .manual-figure figcaption {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #6b6b75;
}

/* Code: the one element that can be wider than the page, so it scrolls inside
   its own box rather than pushing the layout sideways on a phone. */
.uputstvo-body .manual-code {
    margin: 1.5rem 0;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
    overflow: hidden;
    background: #1f2233;
}

.uputstvo-body .manual-code figcaption {
    background: #29292b;
    color: #c7cbd1;
    font-size: 0.78rem;
    font-family: "JetBrains Mono", "Courier New", monospace;
    padding: 0.45rem 0.8rem;
    border-bottom: 1px solid #33343d;
}

.uputstvo-body .manual-code pre {
    margin: 0;
    padding: 0.9rem 1rem;
    overflow-x: auto;
    max-width: 100%;
}

.uputstvo-body .manual-code code {
    color: #e4e7ec;
    font-family: "JetBrains Mono", "Courier New", monospace;
    font-size: 0.85rem;
    line-height: 1.55;
    white-space: pre;
}

/* Callouts */
.uputstvo-body .manual-note {
    display: block;
    margin: 1.4rem 0;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border-left: 4px solid #3998fd;
    background: #eef4ff;
    color: #22303f;
    font-size: 0.95rem;
}

.uputstvo-body .manual-note-title {
    display: block;
    margin-bottom: 0.2rem;
    color: #1f6fd6;
}

.uputstvo-body .manual-note-vazno {
    border-left-color: #2f86e8;
    background: #e7f0ff;
}

.uputstvo-body .manual-note-paznja {
    border-left-color: #c0392b;
    background: #fdf0ee;
    color: #4a2723;
}

.uputstvo-body .manual-note-paznja .manual-note-title {
    color: #c0392b;
}

/* Tables: specifications read better as a table than as a sentence. */
.uputstvo-body .manual-table-wrap {
    overflow-x: auto;
    margin: 1.4rem 0;
}

.uputstvo-body .manual-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.uputstvo-body .manual-table th,
.uputstvo-body .manual-table td {
    border: 1px solid #e4e7ec;
    padding: 0.5rem 0.7rem;
    text-align: left;
}

.uputstvo-body .manual-table th {
    background: #f5f8fc;
    color: #29292b;
    font-weight: 600;
}

/* Products the manual belongs to */
.uputstvo-products {
    margin-top: 2.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e4e7ec;
}

.uputstvo-products-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #29292b;
    margin-bottom: 0.6rem;
}

.uputstvo-products ul {
    margin: 0 0 0 1.15rem;
    padding: 0;
}

.uputstvo-back {
    display: inline-block;
    margin-top: 2rem;
    color: #3998fd;
    font-weight: 600;
}

/* The row the product page shows next to the Datasheet line. */
.product-uputstvo-link {
    font-weight: 600;
}

@media (max-width: 767px) {
    .uputstvo-title { font-size: 1.5rem; }
    .uputstvo-card-img { height: 140px; }
    .uputstvo-body .manual-platforms-grid { grid-template-columns: 1fr; }
}
