/*
Theme Name: Smart Work
Theme URI: https://smartwork.hr/
Author: Smart Work j.d.o.o.
Description: Tema za Smart Work – klupe, stolovi i decking od drva Kebony i čelika, Žminj (Istra). Block tema, lokalni fontovi, obrazac za upit, LocalBusiness i FAQ schema, llms.txt.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: smartwork
*/

/* ---------- Osnove ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
:where(a) { text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--wp--preset--color--ink); outline-offset: 3px; }
[id] { scroll-margin-top: 96px; }
img { height: auto; }
.screen-reader-text:focus { clip: auto !important; }

/* ---------- Zaglavlje ---------- */
.sw-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--wp--preset--color--line); }
.admin-bar .sw-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .sw-header { top: 0; position: relative; } }
.sw-header .wp-block-site-title a { text-decoration: none; color: inherit; }
.sw-header .wp-block-site-title { font-family: var(--wp--preset--font-family--archivo); font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.sw-header .wp-block-navigation a { text-decoration: none; }
.sw-header .wp-block-navigation a:hover { text-decoration: underline; }
.sw-header .wp-block-navigation__responsive-container.is-menu-open { padding: 1.5rem; }
.sw-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { font-size: 1.25rem; padding: 0.4rem 0; }
@media (max-width: 600px) { .sw-header .sw-header-cta { display: none; } }

/* ---------- Tipografski detalji ---------- */
.sw-eyebrow { font-size: 0.8125rem !important; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--wp--preset--color--kebony); margin-bottom: 0.25rem !important; }
.has-steel-background-color .sw-eyebrow { color: var(--wp--preset--color--brass); }
.sw-lead { font-size: var(--wp--preset--font-size--large); color: var(--wp--preset--color--ink-soft); max-width: 36em; }
.has-steel-background-color .sw-lead, .has-steel-background-color p { color: var(--wp--preset--color--steel-text); }
.has-steel-background-color h1, .has-steel-background-color h2, .has-steel-background-color h3 { color: var(--wp--preset--color--stone); }
.has-steel-background-color a:not(.wp-element-button) { color: var(--wp--preset--color--stone); }
.has-kebony-background-color p, .has-kebony-background-color h2 { color: #fff; }
.sw-note { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }

/* ---------- Hero ---------- */
.sw-hero .wp-block-image { margin: 0; }
.sw-hero .wp-block-image img { width: 100%; aspect-ratio: 4 / 3.4; object-fit: cover; }
.sw-hero .wp-block-image figcaption { margin: 0; padding: 0.6rem 0.9rem; background: var(--wp--preset--color--sand); color: var(--wp--preset--color--ink); font-weight: 600; font-size: 0.8125rem; }

/* ---------- Traka prednosti ---------- */
.sw-strip p { font-weight: 500; font-size: var(--wp--preset--font-size--small); margin: 0; padding-left: 1.1rem; position: relative; }
.sw-strip p::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 0.45rem; height: 0.45rem; background: var(--wp--preset--color--kebony); }

/* ---------- Kartice ---------- */
.sw-card { background: var(--wp--preset--color--paper); height: 100%; display: flex; flex-direction: column; }
.sw-card > .wp-block-image { margin: 0; }
.sw-card > .wp-block-image img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.sw-card-body { padding: 1.5rem 1.6rem 1.75rem; display: flex; flex-direction: column; gap: 0.75rem; flex-grow: 1; }
.sw-card-body > * { margin: 0 !important; }
.sw-card-body ul { padding-left: 1.1rem; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--ink-soft); }
.sw-card-body .sw-more { margin-top: auto !important; font-weight: 600; }
.sw-card-body .sw-more a { text-decoration: none; }
.sw-card-body .sw-more a:hover { text-decoration: underline; }
.sw-cards.wp-block-columns { align-items: stretch !important; }
.sw-cards > .wp-block-column { display: flex; flex-direction: column; }

/* Proizvod (vodoravna kartica) */
.sw-product { background: var(--wp--preset--color--paper); }
.sw-product .wp-block-image { margin: 0; height: 100%; }
.sw-product .wp-block-image img { width: 100%; height: 100%; min-height: 260px; object-fit: cover; display: block; }
.sw-product ul { padding-left: 1.1rem; color: var(--wp--preset--color--ink-soft); }
.sw-section-title { border-bottom: 2px solid var(--wp--preset--color--ink); padding-bottom: 0.75rem; }

/* ---------- Galerija ---------- */
.sw-gallery.wp-block-gallery figure.wp-block-image img { aspect-ratio: 1; object-fit: cover; }
.sw-gallery.wp-block-gallery figure figcaption { font-size: 0.8125rem; font-weight: 500; }

/* ---------- Koraci ---------- */
.sw-step-no { font-family: var(--wp--preset--font-family--archivo); font-weight: 800; font-size: 2.75rem !important; line-height: 1 !important; color: var(--wp--preset--color--kebony); margin-bottom: 0.5rem !important; }
.sw-steps h3 { font-size: 1.1875rem; margin: 0 0 0.35rem; font-family: var(--wp--preset--font-family--inter); font-weight: 600; letter-spacing: 0; }
.sw-steps p:not(.sw-step-no) { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--ink-soft); margin: 0; }

/* ---------- Značajke na tamnom ---------- */
.sw-feature { border-top: 2px solid var(--wp--preset--color--brass); padding-top: 1.1rem; }
.sw-feature h3 { font-size: 1.3125rem; margin: 0 0 0.4rem; }
.sw-feature p { font-size: var(--wp--preset--font-size--small); margin: 0; }

/* ---------- Kupci ---------- */
.sw-clients .wp-block-image { margin: 0; }
.sw-clients .wp-block-image img { max-height: 72px; width: auto; object-fit: contain; filter: grayscale(1); opacity: 0.85; }
.sw-clients figcaption { text-align: center; margin-top: 0.4rem; }

/* ---------- FAQ ---------- */
.sw-faq .wp-block-details { border-top: 1px solid var(--wp--preset--color--line); padding: 1.1rem 0; margin: 0; }
.sw-faq .wp-block-details:last-child { border-bottom: 1px solid var(--wp--preset--color--line); }
.sw-faq .wp-block-details summary { font-weight: 600; font-size: var(--wp--preset--font-size--large); cursor: pointer; list-style: none; position: relative; padding-right: 2rem; }
.sw-faq .wp-block-details summary::-webkit-details-marker { display: none; }
.sw-faq .wp-block-details summary::after { content: "+"; position: absolute; right: 0.25rem; top: -0.1em; font-size: 1.6rem; font-weight: 400; color: var(--wp--preset--color--kebony); }
.sw-faq .wp-block-details[open] summary::after { content: "–"; }
.sw-faq .wp-block-details p { color: var(--wp--preset--color--ink-soft); margin-top: 0.75rem; }

/* ---------- Tablica ---------- */
.sw-table table { border-collapse: collapse; width: 100%; background: var(--wp--preset--color--paper); font-size: var(--wp--preset--font-size--small); }
.sw-table th, .sw-table td { border: 1px solid var(--wp--preset--color--line); padding: 0.7rem 0.9rem; text-align: left; vertical-align: top; }
.sw-table thead th { background: var(--wp--preset--color--sand); }
.sw-table.wp-block-table { overflow-x: auto; }

/* ---------- Kontakt kartica ---------- */
.sw-contact-card a { color: var(--wp--preset--color--stone); }
.sw-contact-card .wp-block-button__link { width: 100%; text-align: left; }

/* ---------- Obrazac za upit ---------- */
.sw-form { display: flex; flex-direction: column; gap: 1.5rem; }
.sw-form fieldset { border: 0; margin: 0; padding: 0; }
.sw-form legend { font-weight: 600; margin-bottom: 0.75rem; padding: 0; }
.sw-form .sw-chips { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.sw-form .sw-chips label { display: inline-flex; align-items: center; gap: 0.5rem; border: 1px solid #A8A399; background: #fff; padding: 0.6rem 1rem; min-height: 44px; box-sizing: border-box; font-size: var(--wp--preset--font-size--small); font-weight: 500; cursor: pointer; }
.sw-form .sw-chips label:has(input:checked) { border: 2px solid var(--wp--preset--color--kebony); padding: calc(0.6rem - 1px) calc(1rem - 1px); }
.sw-form .sw-chips input { accent-color: var(--wp--preset--color--kebony); width: 18px; height: 18px; margin: 0; }
.sw-form .sw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.1rem; }
.sw-form .sw-field { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 600; font-size: var(--wp--preset--font-size--small); }
.sw-form input[type=text], .sw-form input[type=email], .sw-form input[type=tel], .sw-form input[type=number], .sw-form textarea {
  font: inherit; font-weight: 400; font-size: 1rem; padding: 0.75rem 0.85rem; border: 1px solid #A8A399; background: #fff; color: var(--wp--preset--color--ink); min-height: 48px; box-sizing: border-box; border-radius: 0; width: 100%;
}
.sw-form textarea { resize: vertical; min-height: 140px; }
.sw-form input:focus, .sw-form textarea:focus { outline: 2px solid var(--wp--preset--color--kebony); outline-offset: 0; border-color: var(--wp--preset--color--kebony); }
.sw-form .sw-file { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; border: 1px dashed #8C877D; background: #fff; padding: 1rem; font-weight: 400; color: var(--wp--preset--color--muted); }
.sw-form .sw-consent { display: flex; gap: 0.75rem; align-items: flex-start; font-weight: 400; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--ink-soft); }
.sw-form .sw-consent input { width: 20px; height: 20px; margin: 0.15rem 0 0; accent-color: var(--wp--preset--color--kebony); flex-shrink: 0; }
.sw-form .sw-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.sw-form button[type=submit] { font: inherit; font-weight: 600; background: var(--wp--preset--color--kebony); color: #fff; border: 0; padding: 1rem 2rem; min-height: 52px; cursor: pointer; }
.sw-form button[type=submit]:hover { background: var(--wp--preset--color--kebony-dark); }
.sw-form button[disabled] { opacity: 0.6; cursor: progress; }
.sw-form-msg { padding: 1rem 1.25rem; font-weight: 500; }
.sw-form-msg.is-ok { background: #E6EFE3; color: #1F3D1A; border-left: 4px solid #3F7A33; }
.sw-form-msg.is-err { background: #F6E3DF; color: #5A1D12; border-left: 4px solid #A33A26; }

/* ---------- Podnožje ---------- */
.sw-footer a { color: var(--wp--preset--color--stone); }
.sw-footer .sw-legal { font-size: 0.8125rem; color: #B9B5AC; }
.sw-footer .sw-esif img { background: #fff; padding: 6px; max-width: 220px; }

/* ---------- Mobilna traka za poziv ---------- */
.sw-mobilebar { display: none !important; }
@media (max-width: 781px) {
  .sw-mobilebar { display: flex !important; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; margin: 0 !important; box-shadow: 0 -2px 10px rgba(0,0,0,.12); }
  .sw-mobilebar .wp-block-button { flex: 1 1 0; margin: 0; }
  .sw-mobilebar .wp-block-button__link { width: 100%; border-radius: 0; padding: 1rem 0.5rem; text-align: center; }
  .sw-mobilebar .wp-block-button:first-child .wp-block-button__link { background: var(--wp--preset--color--steel); }
  body { padding-bottom: 58px; }
}

/* ---------- Ispis ---------- */
@media print { .sw-header, .sw-mobilebar, .sw-footer { display: none !important; } }

/* Pune sekcije se slažu bez razmaka */
.wp-block-post-content > .alignfull { margin-block-start: 0; margin-block-end: 0; }
.wp-block-post-content > .alignfull + * { margin-block-start: 0; }
.wp-block-post-content > :last-child:not(.alignfull) { margin-block-end: var(--wp--preset--spacing--60); }

/* Zaglavlje: gumb samo na širim ekranima (ispod toga je donja traka za poziv) */
@media (max-width: 960px) { .sw-header .sw-header-cta { display: none; } }

/* Galerija: natpisi ispod fotografija, bez preklapanja */
.wp-block-gallery.has-nested-images.sw-gallery figure.wp-block-image { flex-direction: column; align-items: stretch; justify-content: flex-start; }
.wp-block-gallery.has-nested-images.sw-gallery figure.wp-block-image:has(figcaption)::before { display: none; }
.wp-block-gallery.has-nested-images.sw-gallery figure.wp-block-image img { flex: none; height: auto; }
.wp-block-gallery.has-nested-images.sw-gallery figure.wp-block-image figcaption { position: static; background: none; color: var(--wp--preset--color--muted); padding: 0.45rem 0 0; margin: 0; text-align: left; max-height: none; overflow: visible; text-shadow: none; font-size: 0.8125rem; font-weight: 500; }
