/*
Theme Name: Smiješak za sve
Theme URI: https://smijesakzasve.hr
Author: Udruga Smiješak za sve
Description: Prilagođena WordPress tema u vizualnom stilu aplikacije "Smiješak za sve" (volonterski portal). Klasična tema — bez page buildera. Baloo 2 + Nunito, brand boje udruge, svjetlo/tamno.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: smijesak
Tags: nonprofit, custom-menu, featured-images, translation-ready, threaded-comments, full-width-template
*/

/* ============================================================
   Smiješak za sve — WordPress tema
   Design system ported from the volunteer app (public/css/smijesak.css).
   ============================================================ */

:root {
    --link: #0192b4;
    --brand-pink: #e0509e; --brand-pink-deep: #c53c85;
    --brand-blue: #00b5dd; --brand-blue-deep: #0192b4;
    --brand-green: #b1d332; --brand-green-deep: #93b422;
    --primary: var(--brand-pink); --primary-deep: var(--brand-pink-deep);
    --focus: var(--brand-blue);

    --bg: #FFF7F1; --surface: #ffffff; --surface-2: #FBF4EE;
    --ink: #233044; --ink-soft: #4A5568; --muted: #6B7280; --line: #ECE1D9;

    --radius: 22px; --radius-md: 16px; --radius-in: 13px;
    --shadow: 0 14px 40px rgba(35,48,68,.12), 0 3px 10px rgba(35,48,68,.05);
    --shadow-sm: 0 4px 14px rgba(35,48,68,.07);
    --topbar-h: 68px;
    --wrap: 1160px;
}

:root[data-theme="dark"] {
    --link: #4fd0ee;
    --bg: #14161b; --surface: #1e2128; --surface-2: #242832;
    --ink: #e9ecf1; --ink-soft: #c3c9d3; --muted: #93a0b2; --line: #2d323c;
    --shadow: 0 16px 44px rgba(0,0,0,.45); --shadow-sm: 0 4px 14px rgba(0,0,0,.30);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0; font-family: 'Nunito', system-ui, -apple-system, sans-serif;
    color: var(--ink); background: var(--bg); min-height: 100dvh;
    -webkit-font-smoothing: antialiased; line-height: 1.65; font-size: 17px;
    transition: background .2s ease, color .2s ease;
}
h1, h2, h3, h4, .font-display { font-family: 'Baloo 2', 'Nunito', sans-serif; font-weight: 700; line-height: 1.15; color: var(--ink); }
h1 { font-size: clamp(30px, 5vw, 52px); margin: 0 0 .4em; }
h2 { font-size: clamp(24px, 3.4vw, 36px); margin: 0 0 .5em; }
h3 { font-size: clamp(19px, 2.2vw, 24px); }
p { margin: 0 0 1em; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }
.section { padding: clamp(48px, 8vw, 88px) 0; }
.section--tint { background: var(--surface-2); }
.section__head { text-align: center; max-width: 720px; margin: 0 auto clamp(28px, 5vw, 48px); }
.section__head p { color: var(--muted); font-size: 1.05rem; margin: 0; }
.eyebrow { display: inline-block; font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-pink); margin-bottom: 10px; }

/* ---------------- Buttons ---------------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 999px;
    font-family: 'Baloo 2', sans-serif; font-weight: 600; font-size: 16px; cursor: pointer; border: 2px solid transparent;
    text-decoration: none; transition: transform .12s ease, box-shadow .15s ease, background .15s ease; white-space: nowrap; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--brand-pink); color: #fff; box-shadow: 0 8px 20px rgba(224,80,158,.32); }
.btn--primary:hover { background: var(--brand-pink-deep); color: #fff; }
.btn--blue { background: var(--brand-blue); color: #fff; box-shadow: 0 8px 20px rgba(0,181,221,.30); }
.btn--blue:hover { background: var(--brand-blue-deep); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--brand-blue); color: var(--link); }
.btn--lg { padding: 15px 28px; font-size: 17px; }

/* ---------------- Header / navigation ---------------- */
.topbar { position: sticky; top: 0; z-index: 100; min-height: var(--topbar-h);
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line); }
.topbar__inner { display: flex; align-items: center; gap: 18px; min-height: var(--topbar-h);
    max-width: var(--wrap); margin: 0 auto; padding: 8px clamp(16px, 4vw, 32px); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: 'Baloo 2'; font-weight: 700; font-size: 19px; }
.brand img { height: 50px; width: auto; display: block; }
.brand:hover { text-decoration: none; }

.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }
.main-nav li { position: relative; }
.main-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 9px 13px; border-radius: 12px;
    color: var(--ink-soft); font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; transition: background .15s, color .15s; }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current_page_item > a { background: color-mix(in srgb, var(--brand-pink) 12%, transparent); color: var(--brand-pink-deep); }
.main-nav .menu-item-has-children > a::after { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .6; }
/* sub-menus */
.main-nav ul ul { position: absolute; top: calc(100% + 6px); left: 0; flex-direction: column; align-items: stretch; gap: 2px;
    min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
    padding: 8px; opacity: 0; visibility: hidden; transform: translateY(6px); transition: .15s ease; z-index: 200; }
.main-nav li:hover > ul, .main-nav li:focus-within > ul { opacity: 1; visibility: visible; transform: translateY(0); }
.main-nav ul ul a { display: block; padding: 9px 12px; font-size: 14.5px; }

.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 1.5px solid var(--line);
    background: var(--surface); color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s; }
.icon-btn:hover { border-color: var(--brand-blue); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }

.nav-toggle { display: none; }

/* ---------------- Hero ---------------- */
.hero { position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: 0;
    background:
      radial-gradient(58% 70% at 82% 8%, color-mix(in srgb, var(--brand-blue) 20%, transparent), transparent 60%),
      radial-gradient(46% 60% at 6% 92%, color-mix(in srgb, var(--brand-green) 24%, transparent), transparent 60%),
      radial-gradient(50% 60% at 50% 0%, color-mix(in srgb, var(--brand-pink) 14%, transparent), transparent 62%); }
.hero__inner { position: relative; z-index: 1; max-width: var(--wrap); margin: 0 auto;
    padding: clamp(56px, 9vw, 104px) clamp(16px, 4vw, 32px); display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 56px); align-items: center; }
.hero__text h1 span { color: var(--brand-pink); }
.hero__lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-soft); max-width: 34ch; margin-bottom: 26px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__art { position: relative; }
.hero__art img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
/* Branded hero centerpiece: white logo over a soft heart, on the brand gradient. */
.hero__badge { position: relative; aspect-ratio: 4/3; border-radius: var(--radius); box-shadow: var(--shadow);
    background: linear-gradient(135deg, var(--brand-pink), var(--brand-blue)); display: grid; place-items: center; overflow: hidden; }
.hero__badge::after { content: ''; position: absolute; inset: 0; background: radial-gradient(62% 62% at 28% 18%, rgba(255,255,255,.28), transparent 60%); pointer-events: none; }
.hero__heart { position: absolute; width: 86%; height: 86%; color: rgba(255,255,255,.16); }
.hero__badge-chip { position: relative; z-index: 1; display: grid; place-items: center; background: #fff; border-radius: 26px;
    padding: clamp(14px, 2.2vw, 22px) clamp(18px, 2.6vw, 28px); box-shadow: 0 18px 44px rgba(35,48,68,.25); }
.hero__badge .hero__badge-logo { display: block; height: clamp(130px, 17vw, 200px); width: auto; border-radius: 0; box-shadow: none; }

/* ---------------- Cards ---------------- */
.grid { display: grid; gap: 22px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; transition: transform .16s ease, box-shadow .16s ease; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card__media { aspect-ratio: 16/10; overflow: hidden; background: var(--surface-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__meta { font-size: 13px; color: var(--muted); font-weight: 700; }
.card__title { font-family: 'Baloo 2'; font-weight: 700; font-size: 19px; margin: 0; line-height: 1.25; }
.card__title a { color: var(--ink); }
.card__title a:hover { color: var(--brand-pink-deep); text-decoration: none; }
.card__excerpt { color: var(--ink-soft); font-size: 15px; margin: 0; }
.card__more { margin-top: auto; font-weight: 800; color: var(--link); font-size: 14.5px; }

/* Feature (icon) cards */
.feature { text-align: left; padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.feature__ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 14px; color: #fff; }
.feature__ic svg { width: 26px; height: 26px; }
.feature:nth-child(3n+1) .feature__ic { background: var(--brand-pink); }
.feature:nth-child(3n+2) .feature__ic { background: var(--brand-blue); }
.feature:nth-child(3n) .feature__ic { background: var(--brand-green-deep); }
.feature h3 { margin: 0 0 6px; }
.feature p { margin: 0; color: var(--ink-soft); font-size: 15.5px; }

/* Mission statement (homepage): a quote card above the three panels */
.mission-box { max-width: 880px; margin: 0 auto clamp(28px, 5vw, 48px); padding: clamp(22px, 4vw, 38px) clamp(22px, 5vw, 56px);
    text-align: center; background: color-mix(in srgb, var(--brand-blue) 6%, var(--surface)); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.mission-box::before { content: "\201C"; display: block; height: 44px; font-family: 'Baloo 2', serif; font-size: 84px; line-height: 1; color: var(--brand-pink); }
.mission-box p { margin: 0; font-size: clamp(17px, 1.5vw, 19.5px); line-height: 1.7; color: var(--ink-soft); }

/* CTA band */
.cta-band { background: linear-gradient(120deg, var(--brand-pink), var(--brand-blue)); color: #fff; border-radius: var(--radius); padding: clamp(30px, 5vw, 54px); text-align: center; box-shadow: var(--shadow); }
.cta-band h2, .cta-band p { color: #fff; }
.cta-band p { opacity: .95; max-width: 52ch; margin: 0 auto 22px; }
.cta-band .btn--primary { background: #fff; color: var(--brand-pink-deep); box-shadow: none; }
.cta-band .btn--primary:hover { background: #fff; transform: translateY(-1px); }
.cta-band .btn--ghost { color: #fff; border-color: rgba(255,255,255,.6); }
.cta-band .btn--ghost:hover { border-color: #fff; color: #fff; }

/* ---------------- Post / page content ---------------- */
.page-head { padding: clamp(36px, 6vw, 64px) 0 0; }
.page-head__inner { max-width: 820px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); text-align: center; }
.page-head .meta { color: var(--muted); font-weight: 700; font-size: 14px; margin-top: 8px; }
.article { max-width: 820px; margin: 0 auto; padding: clamp(28px, 5vw, 44px) clamp(16px, 4vw, 32px) 0; }
.article__media { border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); margin-bottom: 26px; }
.entry-content { font-size: 17.5px; }
.entry-content > * { margin-bottom: 1.1em; }
.entry-content h2 { margin-top: 1.4em; }
.entry-content h3 { margin-top: 1.2em; }
.entry-content img { border-radius: var(--radius-in); }
.entry-content a { text-decoration: underline; }
.entry-content blockquote { margin: 1.4em 0; padding: 4px 20px; border-left: 4px solid var(--brand-green); color: var(--ink-soft); font-style: italic; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin-bottom: .4em; }
.entry-content figure { margin: 1.4em 0; }
.entry-content .wp-block-image img { width: 100%; }
/* gallery plugins / native galleries */
.entry-content .wp-block-gallery, .entry-content .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.entry-content .gallery-item img { border-radius: var(--radius-in); width: 100%; object-fit: cover; }

/* ---------------- Contact form (Contact Form 7) ---------------- */
.entry-content .wpcf7 { margin: 1.8em 0 0; }
.wpcf7 .wpcf7-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; padding: clamp(20px, 4vw, 34px);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.wpcf7 .wpcf7-form > * { grid-column: 1 / -1; margin: 0; }
.wpcf7 .wpcf7-form > p:nth-of-type(1), .wpcf7 .wpcf7-form > p:nth-of-type(2) { grid-column: auto; }   /* name + e-mail side by side */
.wpcf7 label { display: block; font-weight: 800; font-size: 14.5px; color: var(--ink); }
.wpcf7 label br { display: none; }
.wpcf7 .wpcf7-form-control-wrap { display: block; margin-top: 8px; }
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"], .wpcf7 input[type="url"],
.wpcf7 input[type="number"], .wpcf7 input[type="date"], .wpcf7 select, .wpcf7 textarea {
    width: 100%; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); background: var(--surface-2);
    border: 1.5px solid var(--line); border-radius: var(--radius-in); padding: 12px 15px;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.wpcf7 textarea { min-height: 170px; resize: vertical; line-height: 1.55; }
.wpcf7 input:hover, .wpcf7 textarea:hover, .wpcf7 select:hover { border-color: color-mix(in srgb, var(--brand-blue) 45%, var(--line)); }
.wpcf7 input:focus, .wpcf7 textarea:focus, .wpcf7 select:focus { outline: none; background: var(--surface);
    border-color: var(--brand-blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-blue) 20%, transparent); }
.wpcf7 .wpcf7-not-valid { border-color: var(--brand-pink); background: color-mix(in srgb, var(--brand-pink) 6%, var(--surface)); }
.wpcf7 .wpcf7-not-valid-tip { color: var(--brand-pink-deep); font-size: 13.5px; font-weight: 700; margin-top: 6px; }
:root[data-theme="dark"] .wpcf7 .wpcf7-not-valid-tip { color: #ff8cc6; }
/* the send button = the site's pink pill button */
.wpcf7 .wpcf7-submit { display: inline-flex; align-items: center; padding: 13px 30px; border: 2px solid transparent; border-radius: 999px;
    font-family: 'Baloo 2', sans-serif; font-weight: 600; font-size: 17px; cursor: pointer; color: #fff;
    background: var(--brand-pink); box-shadow: 0 8px 20px rgba(224,80,158,.32); transition: transform .12s ease, background .15s ease; }
.wpcf7 .wpcf7-submit:hover { background: var(--brand-pink-deep); transform: translateY(-1px); }
.wpcf7 .wpcf7-submit:disabled { opacity: .6; cursor: progress; transform: none; }
.wpcf7 .wpcf7-spinner { margin: 0 0 0 12px; vertical-align: middle; background-color: var(--brand-blue); }
/* the message after sending: green = sent, amber = check the fields, pink = could not send */
.wpcf7 form .wpcf7-response-output { margin: 0; padding: 13px 16px; border: 1.5px solid var(--brand-blue); border-radius: var(--radius-in);
    font-weight: 700; font-size: 15px; background: color-mix(in srgb, var(--brand-blue) 10%, var(--surface)); color: var(--ink); }
.wpcf7 form.sent .wpcf7-response-output { border-color: var(--brand-green-deep); background: color-mix(in srgb, var(--brand-green) 16%, var(--surface)); }
.wpcf7 form.invalid .wpcf7-response-output, .wpcf7 form.unaccepted .wpcf7-response-output, .wpcf7 form.payment-required .wpcf7-response-output {
    border-color: #e6a700; background: color-mix(in srgb, #ffc94d 18%, var(--surface)); }
.wpcf7 form.failed .wpcf7-response-output, .wpcf7 form.aborted .wpcf7-response-output, .wpcf7 form.spam .wpcf7-response-output {
    border-color: var(--brand-pink); background: color-mix(in srgb, var(--brand-pink) 10%, var(--surface)); }
@media (max-width: 640px) {
    .wpcf7 .wpcf7-form { grid-template-columns: 1fr; }
    .wpcf7 .wpcf7-form > p:nth-of-type(1), .wpcf7 .wpcf7-form > p:nth-of-type(2) { grid-column: 1 / -1; }
    .wpcf7 .wpcf7-submit { width: 100%; justify-content: center; }
}

/* ---------------- Pagination ---------------- */
.pagination { display: flex; justify-content: center; gap: 8px; margin: 40px 0 0; flex-wrap: wrap; }
.pagination .page-numbers { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border-radius: 12px;
    border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 800; text-decoration: none; }
.pagination .page-numbers.current { background: var(--brand-pink); color: #fff; border-color: var(--brand-pink); }
.pagination a.page-numbers:hover { border-color: var(--brand-blue); text-decoration: none; }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--surface-2); border-top: 1px solid var(--line); margin-top: clamp(48px, 8vw, 90px); }
.site-footer__inner { max-width: var(--wrap); margin: 0 auto; padding: clamp(40px, 6vw, 64px) clamp(16px, 4vw, 32px) 28px;
    display: grid; grid-template-columns: auto 1.3fr 1fr 1fr; gap: 34px 40px; }
.site-footer h4 { font-size: 16px; margin: 0 0 14px; }
.site-footer p, .site-footer li { color: var(--ink-soft); font-size: 15px; }
/* Logo in a white rounded chip, as on the volunteer app's sign-in screen (stays white in dark mode too). */
.footer-logo { display: inline-flex; align-items: center; background: #fff; padding: 12px 16px; border-radius: 18px;
    box-shadow: 0 12px 30px rgba(35,48,68,.18); transition: transform .15s ease; }
.footer-logo:hover { transform: translateY(-2px); }
.footer-logo img { height: 100px; width: auto; display: block; }
.footer-menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-recent ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.footer-recent li { line-height: 1.35; }
.footer-recent a { color: var(--ink-soft); font-weight: 700; font-size: 14.5px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }   /* long titles: two lines */
.footer-recent a:hover { color: var(--brand-pink-deep); }
:root[data-theme="dark"] .footer-recent a:hover { color: #ff8cc6; }
.footer-recent time { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.footer-menu a { color: var(--ink-soft); font-weight: 700; }
.footer-menu a:hover { color: var(--brand-pink-deep); }
.footer-bottom { border-top: 1px solid var(--line); text-align: center; padding: 18px; color: var(--muted); font-size: 13.5px; }
.footer-bottom a { color: var(--muted); }

/* ---------------- Utilities / responsive ---------------- */
.text-center { text-align: center; }
.mt-btn { margin-top: 26px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

@media (max-width: 900px) {
    .hero__inner { grid-template-columns: 1fr; }
    .hero__art { order: -1; max-width: 460px; }
    .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
    .site-footer__inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
    .nav-toggle { display: grid; }
    .main-nav { position: fixed; inset: var(--topbar-h) 0 auto 0; background: var(--surface); border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow); padding: 12px; margin: 0; transform: translateY(-120%); transition: transform .2s ease; max-height: calc(100dvh - var(--topbar-h)); overflow-y: auto; }
    .main-nav.is-open { transform: translateY(0); }
    .main-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
    .main-nav ul ul { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; border-left: 2px solid var(--line); border-radius: 0; margin-left: 12px; padding-left: 6px; }
    .main-nav .menu-item-has-children > a::after { margin-left: auto; }
}
@media (max-width: 560px) {
    .grid--3, .grid--4 { grid-template-columns: 1fr; }
    .site-footer__inner { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
