/* =========================================================================
   iDrive — blog post (single-post.php)
   Sve je pod .post-page, da ne utiče na ostatak sajta.
   ========================================================================= */

.post-page {
    --brand: #FFBD59;
    --brand-deep: #F28F49;
    --brand-soft: #FFF3E0;
    --ink: #1a1a1a;
    --muted: #6b6b6b;
    --line: #e8e4dd;
    --bg: #f7f6f4;
    --card: #ffffff;
    --green: #25D366;
    --green-ink: #128C4A;
    --red: #d94141;
    --red-soft: #fdeeee;

    background: #fff;
    color: var(--ink);
    line-height: 1.65;
}

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

.post-wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 22px;
}

/* ===== ZAŠTITA OD GLOBALNIH STILOVA SAJTA =====
   (header{position:sticky}, h2{text-align:center}, p{max-width}, details/summary…) */
.post-page h1,
.post-page h2,
.post-page h3,
.post-page h4 {
    text-align: left;
}

.post-page p {
    max-width: none;
}

/* <header>/<footer> unutar posta (npr. footer.comment-meta u komentarima)
   ne smeju da nasleđuju sticky header i tamni footer sajta */
.post-page header,
.post-page footer {
    position: static;
    top: auto;
    z-index: auto;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    color: inherit;
    font-size: inherit;
}

/* ===== BREADCRUMBS ===== */
.post-crumbs {
    padding-top: 14px;
    padding-bottom: 14px;
    font-size: 13px;
    color: var(--muted);
}

.post-crumbs a {
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--brand);
}

.post-crumbs a:hover {
    color: var(--brand-deep);
}

.post-crumbs > span:not([aria-current]) {
    margin: 0 7px;
    color: #c5beb2;
}
.post-crumbs{font-size:13px;color:var(--muted);padding:14px 0}
  .post-crumbs a{padding:0;font-weight:600;color:var(--ink);border-bottom:1px solid var(--brand); border-radius: 0;}
  .post-wrap.post-crumbs {
      margin-left:0}
  .post-crumbs span{margin:0 7px;color:#c5beb2}

/* ===== HERO ===== */
.post-hero {
    position: static;
    top: auto;
    z-index: auto;
    background: var(--bg);
    padding: 44px 0;
    border-bottom: 1px solid var(--line);
}

.post-hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 40px;
    align-items: center;
}

.post-hero-grid.no-img {
    grid-template-columns: 1fr;
}

.post-hero-grid.no-img > div {
    max-width: 860px;
}

a.post-tag {
    display: inline-block;
    margin-bottom: 14px;
    padding: 5px 14px;
    background: var(--brand);
    color: var(--ink);
    border-radius: 50px;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background .15s;
}

a.post-tag:hover {
    background: var(--brand-deep);
    color: #fff;
}

.post-hero h1 {
    margin: 0;
    font-size: clamp(28px, 4.2vw, 42px);
    font-weight: 900;
    line-height: 1.14;
    letter-spacing: -.01em;
    color: var(--ink);
}

p.post-lead {
    max-width: 620px;
    margin: 14px 0 0;
    font-size: 17px;
    color: var(--muted);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
}

.post-meta span:first-of-type {
    color: #c5beb2;
}

.post-hero-img {
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #fff;
}

.post-hero-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== RASPORED: SADRŽAJ SA STRANE + TEKST ===== */
.post-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 48px;
    padding: 44px 0;
}

.post-layout.no-toc {
    grid-template-columns: minmax(0, 1fr);
    max-width: 760px;
    margin: 0 auto;
}

/* ===== SADRŽAJ SA STRANE (TOC) ===== */
.post-toc {
    position: sticky;
    top: 100px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.post-toc details {
    margin: 0;
    background: none;
    border: 0;
    border-radius: 0;
    overflow: visible;
}

.post-toc summary {
    display: block;
    margin: 0 0 14px;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--line);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    list-style: none;
    cursor: default;
    pointer-events: none;   /* na desktopu se ne zatvara */
}

.post-toc summary::-webkit-details-marker {
    display: none;
}

.post-toc details summary::after,
.post-toc details[open] summary::after {
    content: none;
}

.post-toc ol {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: toc;
}

.post-toc li {
    margin: 0 0 2px;
    counter-increment: toc;
}

.post-toc a {
    display: block;
    padding: 7px 10px;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--muted);
    text-decoration: none;
    border-left: 2px solid transparent;
    border-radius: 8px;
    transition: background .15s, color .15s;
}

.post-toc a::before {
    content: counter(toc) ". ";
    font-weight: 700;
    color: #c5beb2;
}

.post-toc a:hover {
    background: var(--bg);
    color: var(--ink);
}

.post-toc a.is-active {
    background: var(--brand-soft);
    color: var(--ink);
    border-left-color: var(--brand-deep);
}

/* ===== TEKST (Gutenberg sadržaj) ===== */
.post-content {
    max-width: 760px;
    min-width: 0;
    font-size: 17px;
    color: var(--ink);
}

.post-content > *:first-child {
    margin-top: 0;
}

.post-content h2 {
    margin: 40px 0 12px;
    font-size: clamp(23px, 3vw, 30px);
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -.01em;
    color: var(--ink);
    scroll-margin-top: 100px;
}

.post-content h3 {
    margin: 26px 0 8px;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.3;
    color: var(--ink);
    scroll-margin-top: 100px;
}

.post-content h4 {
    margin: 22px 0 8px;
    font-size: 17px;
    font-weight: 800;
}

.post-content p {
    margin: 0 0 16px;
}

.post-content a {
    font-weight: 700;
    color: var(--brand-deep);
    text-decoration: none;
    border-bottom: 2px solid var(--brand);
    transition: color .15s;
}

.post-content a:hover {
    color: var(--ink);
}

.post-content strong,
.post-content b {
    font-weight: 800;
}

/* Liste */
.post-content ul,
.post-content ol {
    margin: 0 0 18px;
    padding-left: 24px;
}

.post-content li {
    margin-bottom: 8px;
}

.post-content ul li::marker {
    color: var(--brand-deep);
}

.post-content ol li::marker {
    font-weight: 800;
    color: var(--brand-deep);
}

/* Slike */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
}

.post-content figure {
    margin: 24px 0;
}

.post-content figcaption {
    margin-top: 8px;
    font-size: 13.5px;
    color: var(--muted);
    text-align: center;
}

/* Citat → istaknut okvir */
.post-content blockquote,
.post-content .wp-block-quote {
    margin: 24px 0;
    padding: 18px 22px;
    background: var(--brand-soft);
    border-left: 5px solid var(--brand-deep);
    border-radius: 0 12px 12px 0;
    font-size: 17px;
    font-style: normal;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

.post-content blockquote cite {
    display: block;
    margin-top: 8px;
    font-size: 13.5px;
    font-style: normal;
    color: var(--muted);
}

/* Okviri iz editora: paragraf → Styles */
.post-content p.is-style-info,
.post-content p.is-style-warn,
.post-content p.is-style-ok {
    margin: 22px 0;
    padding: 16px 20px;
    border-left: 5px solid;
    border-radius: 0 12px 12px 0;
    font-size: 16px;
}

.post-content p.is-style-info {
    background: var(--brand-soft);
    border-color: var(--brand-deep);
}
.post-content p.is-style-info strong { color: var(--brand-deep); }

.post-content p.is-style-warn {
    background: var(--red-soft);
    border-color: var(--red);
}
.post-content p.is-style-warn strong { color: var(--red); }

.post-content p.is-style-ok {
    background: #eafaf0;
    border-color: var(--green-ink);
}
.post-content p.is-style-ok strong { color: var(--green-ink); }

/* Tabele */
.post-tbl-scroll {
    margin: 20px 0;
    overflow-x: auto;
}

.post-content figure.wp-block-table {
    margin: 20px 0;
}

.post-content figure.wp-block-table .post-tbl-scroll {
    margin: 0;
}

.post-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    font-size: 14.5px;
}

.post-content th,
.post-content thead td {
    padding: 12px 14px;
    background: var(--ink);
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-align: left;
    text-transform: uppercase;
    border: 0;
}

.post-content td {
    padding: 12px 14px;
    border: 0;
    border-top: 1px solid var(--line);
    vertical-align: middle;
}

.post-content tr:hover td {
    background: var(--brand-soft);
}

.post-content .wp-block-table thead {
    border-bottom: 0;
}

/* FAQ — Gutenberg blok "Details" */
.post-content details {
    margin-bottom: 10px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}

.post-content details summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.post-content details summary::-webkit-details-marker {
    display: none;
}

.post-content details summary::after {
    content: "+";
    flex-shrink: 0;
    font-size: 22px;
    font-weight: 900;
    color: var(--brand-deep);
}

.post-content details[open] summary::after {
    content: "–";
}

.post-content details > *:not(summary) {
    margin: 0 20px 16px;
    font-size: 15px;
    color: var(--muted);
}

/* Separator */
.post-content hr {
    margin: 36px 0;
    border: 0;
    border-top: 1px solid var(--line);
}

/* ===== CTA NA KRAJU TEKSTA ===== */
.post-cta {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
    margin: 44px 0 0;
    padding: 28px 30px;
    background: var(--ink);
    border-radius: 18px;
    color: #fff;
}

.post-content h2.post-cta-title {
    margin: 0 0 6px;
    font-size: 21px;
    color: #fff;
    scroll-margin-top: 0;
}

.post-cta p {
    margin: 0;
    font-size: 14.5px;
    color: #c5beb2;
}

.post-cta-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.post-content a.post-btn {
    display: inline-block;
    padding: 13px 24px;
    border: 0;
    border-radius: 50px;
    font-size: 14.5px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    text-decoration: none;
    transition: background .15s, color .15s, transform .15s;
}

.post-content a.post-btn-wa {
    background: var(--green);
    color: #fff;
}

.post-content a.post-btn-wa:hover {
    background: #1EBE5B;
    color: #fff;
    transform: translateY(-2px);
}

.post-content a.post-btn-dark {
    background: var(--brand);
    color: var(--ink);
}

.post-content a.post-btn-dark:hover {
    background: var(--brand-deep);
    color: #fff;
}

/* ===== POVEZANI ČLANCI ===== */
.post-related {
    padding: 48px 0;
    background: var(--bg);
    border-top: 1px solid var(--line);
}

.post-page .post-related h2 {
    margin: 0 0 24px;
    font-size: clamp(23px, 3vw, 30px);
    font-weight: 900;
    text-align: center;
    color: var(--ink);
}

.post-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

a.post-related-card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    color: var(--ink);
    text-decoration: none;
    transition: border-color .15s, transform .15s, box-shadow .15s;
}

a.post-related-card:hover {
    border-color: var(--brand-deep);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .08);
}

.post-related-img {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg);
}

.post-related-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-related-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 18px 20px 20px;
}

.post-related-body time {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
}

.post-related-body h3 {
    margin: 6px 0 12px;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.35;
}

.post-go {
    margin-top: auto;
    font-size: 14px;
    font-weight: 800;
    color: var(--brand-deep);
}

/* ===== KOMENTARI ===== */
.post-page .post-comments {
    max-width: 760px;
    padding-top: 48px;
    padding-bottom: 56px;
}

/* Naslovi: "Leave a Reply" i "X komentara" */
.post-comments .comments-title,
.post-comments .comment-reply-title {
    margin: 0 0 8px;
    font-size: clamp(22px, 2.6vw, 26px);
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: -.01em;
    color: var(--ink);
}

.post-comments .comment-reply-title small {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
}

.post-comments .comment-reply-title small a {
    color: var(--brand-deep);
    text-decoration: none;
    border-bottom: 1px solid var(--brand);
}

/* Lista komentara */
.post-comments .comment-list,
.post-comments .comment-list .children {
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.post-comments .comment-list .children {
    margin-left: 28px;
}

.post-comments .comment-body {
    margin-bottom: 14px;
    padding: 20px 22px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-left: 4px solid var(--brand);
    border-radius: 0 14px 14px 0;
}

.post-comments .comment-author {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 800;
}

.post-comments .comment-author .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.post-comments .comment-author .says {
    display: none;
}

.post-comments .comment-meta {
    margin-bottom: 10px;
}

.post-comments .comment-metadata {
    margin-top: 4px;
    font-size: 12.5px;
}

.post-comments .comment-metadata a {
    color: var(--muted);
    text-decoration: none;
}

.post-comments .comment-content p {
    margin: 0 0 10px;
    font-size: 15.5px;
}

.post-comments .reply a {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--brand-deep);
    text-decoration: none;
}

/* Forma "Leave a Reply" */
.post-comments .comment-respond {
    margin-top: 32px;
    padding: 28px 30px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .03);
}

.post-comments .comment-list + .comment-respond,
.post-comments .comments-title + .comment-respond {
    margin-top: 24px;
}

.post-comments .comment-notes,
.post-comments .logged-in-as {
    margin: 0 0 18px;
    font-size: 14px;
    color: var(--muted);
}

.post-comments .logged-in-as a,
.post-comments .comment-notes a {
    color: var(--brand-deep);
    text-decoration: none;
}

.post-comments .required {
    color: var(--red);
}

.post-comments .comment-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

.post-comments .comment-form > p {
    grid-column: 1 / -1;
    margin: 0 0 16px;
}

.post-comments .comment-form .comment-form-author,
.post-comments .comment-form .comment-form-email {
    grid-column: auto;
}

.post-comments .comment-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}

.post-comments .comment-form input[type="text"],
.post-comments .comment-form input[type="email"],
.post-comments .comment-form input[type="url"],
.post-comments .comment-form textarea {
    display: block;
    width: 100%;
    margin: 0;
    padding: 14px 16px;
    font-family: inherit;
    font-size: 15.5px;
    line-height: 1.5;
    color: var(--ink);
    background: #fff;
    border: 2px solid var(--line);
    border-radius: 12px;
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
    appearance: none;
}

.post-comments .comment-form textarea {
    min-height: 150px;
    resize: vertical;
}

.post-comments .comment-form input:hover,
.post-comments .comment-form textarea:hover {
    border-color: var(--brand);
}

.post-comments .comment-form input:focus,
.post-comments .comment-form textarea:focus {
    outline: none;
    border-color: var(--brand-deep);
    box-shadow: 0 0 0 4px rgba(255, 189, 89, .25);
}

/* Checkbox "Save my name…" */
.post-comments .comment-form-cookies-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.post-comments .comment-form-cookies-consent input {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--brand-deep);
}

.post-comments .comment-form-cookies-consent label {
    margin: 0;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--muted);
}

/* Dugme */
.post-comments .form-submit {
    margin: 4px 0 0;
}

.post-comments .comment-form input[type="submit"],
.post-comments .comment-form .submit {
    display: inline-block;
    width: auto;
    padding: 14px 30px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    background: var(--brand);
    border: 0;
    border-radius: 50px;
    cursor: pointer;
    transition: background .15s, color .15s, transform .15s;
    -webkit-appearance: none;
    appearance: none;
}

.post-comments .comment-form input[type="submit"]:hover,
.post-comments .comment-form .submit:hover {
    background: var(--brand-deep);
    color: #fff;
    transform: translateY(-2px);
}

.post-comments .comment-form input[type="submit"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 189, 89, .35);
}

/* ===== PLUTAJUĆE WHATSAPP DUGME ===== */
.post-page a.wa_link {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 60;
}

.post-page a.wa_link img {
    display: block;
    width: 52px;
    animation: postPulse 1.5s infinite;
}

.post-page a.wa_link:hover img {
    animation: none;
}

@keyframes postPulse {
    0%   { transform: scale(1);   opacity: 1; }
    50%  { transform: scale(1.1); opacity: .75; }
    100% { transform: scale(1);   opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .post-page a.wa_link img {
        animation: none;
    }
    .post-page * {
        transition: none !important;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .post-hero {
        padding: 32px 0;
    }

    .post-hero-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .post-hero-img {
        order: -1;
        aspect-ratio: 16 / 9;
    }

    .post-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
        padding: 28px 0 40px;
    }

    /* Sadržaj sa strane postaje sklopiv blok iznad teksta */
    .post-toc {
        position: static;
        max-height: none;
        padding: 16px 18px;
        background: var(--bg);
        border-radius: 14px;
    }

    .post-toc summary {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin: 0;
        padding: 0;
        border: 0;
        font-size: 12px;
        color: var(--ink);
        cursor: pointer;
        pointer-events: auto;
    }

    .post-toc details summary::after {
        content: "+";
        font-size: 20px;
        font-weight: 900;
        color: var(--brand-deep);
    }

    .post-toc details[open] summary {
        margin-bottom: 10px;
    }

    .post-toc details[open] summary::after {
        content: "–";
    }

    .post-content {
        font-size: 16px;
    }

    .post-cta {
        grid-template-columns: 1fr;
        padding: 24px 22px;
    }

    .post-cta-btns {
        flex-direction: column;
    }

    .post-page a.wa_link {
        right: 18px;
        bottom: 18px;
    }

    .post-comments .comment-form {
        grid-template-columns: 1fr;
    }

    .post-comments .comment-respond {
        padding: 22px 18px;
    }

    .post-comments .comment-list .children {
        margin-left: 14px;
    }
}

@media (max-width: 480px) {
    .post-wrap {
        padding: 0 16px;
    }

    .post-content h2 {
        margin-top: 32px;
    }

    .post-content a.post-btn {
        white-space: normal;
    }

    /* Povezani članci: slika levo, tekst desno */
    .post-related-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    a.post-related-card {
        flex-direction: row;
    }

    .post-related-img {
        flex: 0 0 110px;
        aspect-ratio: auto;
    }

    .post-related-body {
        padding: 14px 16px;
    }

    .post-related-body h3 {
        margin: 4px 0 8px;
        font-size: 15px;
    }
}