/*
Theme Name: Ivan Turković
Theme URI: https://www.ivanturkovic.com/
Author: Ivan Turković
Description: Child theme of Ollie for "Signal Through the Noise". Essay-first layout with a sidebar (available for work, let's talk, Toptal, book, socials), newsletter signup and automatic light/dark mode that follows the visitor's system setting.
Template: ollie
Version: 1.0.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ivanturkovic
*/

/* ---------- Automatic dark mode ----------
   Ollie's colours are theme.json presets (CSS variables). In dark mode we
   redefine the same variables, so every block follows without extra rules. */
:root { color-scheme: light dark; }

@media (prefers-color-scheme: dark) {
  body {
    --wp--preset--color--primary: #8B80FF;
    --wp--preset--color--primary-accent: #26234A;
    --wp--preset--color--primary-alt: #3D386B;
    --wp--preset--color--primary-alt-accent: #DEC9FF;
    --wp--preset--color--main: #F2F2F5;
    --wp--preset--color--main-accent: #3A3A4A;
    --wp--preset--color--base: #111114;
    --wp--preset--color--secondary: #ABABBA;
    --wp--preset--color--tertiary: #1B1B21;
    --wp--preset--color--border-light: #2C2C35;
    --wp--preset--color--border-dark: #9A9AB0;
  }
  img:not([src$=".svg"]) { filter: brightness(0.92); }
}

/* ---------- Shared bits ---------- */
.it-wrap { max-width: 1160px; margin-left: auto !important; margin-right: auto !important; padding-left: 24px; padding-right: 24px; box-sizing: border-box; width: 100%; }
.it-muted { color: var(--wp--preset--color--secondary); }
.it-accent { color: var(--wp--preset--color--primary); }
.it-card { padding: 22px; border-radius: 16px; background: var(--wp--preset--color--tertiary); border: 1px solid var(--wp--preset--color--border-light); }
.it-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 10px; background: var(--wp--preset--color--primary); color: var(--wp--preset--color--base) !important; font-weight: 600; font-size: 15px; text-decoration: none !important; border: 0; cursor: pointer; }
.it-btn:hover { filter: brightness(1.08); }
.it-btn--outline { background: transparent; color: var(--wp--preset--color--main) !important; border: 1px solid var(--wp--preset--color--main); }
.it-btn--block { display: flex; width: 100%; }
.it-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.it-header { border-bottom: 1px solid var(--wp--preset--color--border-light); }
.it-header__bar { padding-top: 18px; padding-bottom: 18px; gap: 14px 28px; }
.it-brand { gap: 0 !important; }
.it-brand .wp-block-site-title { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.2; }
.it-brand .wp-block-site-title a { color: var(--wp--preset--color--main); text-decoration: none; }
.it-brand__by { margin: 0 !important; font-size: 13px; color: var(--wp--preset--color--secondary); }
.it-nav { font-size: 15px; font-weight: 500; }
.it-nav a { text-decoration: none; }

/* ---------- Hero ---------- */
.it-hero { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-end; justify-content: space-between; padding: 64px 0 40px; }
.it-hero__text { flex: 1 1 520px; }
.it-eyebrow { margin: 0 0 14px; font-size: 14px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--wp--preset--color--primary); }
.it-hero h1 { margin: 0; font-size: clamp(36px, 6vw, 56px); line-height: 1.05; font-weight: 800; letter-spacing: -1.6px; }
.it-hero .it-card { flex: 1 1 320px; }

/* ---------- Subscribe form ---------- */
.it-subscribe { display: flex; flex-direction: column; gap: 10px; }
.it-subscribe__label { font-size: 15px; font-weight: 600; }
.it-subscribe__row { display: flex; flex-wrap: wrap; gap: 8px; }
.it-subscribe input[type=email] { flex: 1 1 180px; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--wp--preset--color--border-light); border-radius: 10px; background: var(--wp--preset--color--base); color: var(--wp--preset--color--main); font: inherit; }
.it-subscribe__note { font-size: 13px; color: var(--wp--preset--color--secondary); }
.it-subscribe__consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--wp--preset--color--secondary); }
.it-subscribe__consent input { margin-top: 2px; }

/* ---------- Topics ---------- */
.it-topics { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0 0 32px; list-style: none; border-bottom: 1px solid var(--wp--preset--color--border-light); }
.it-topics a { display: inline-block; padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none; background: var(--wp--preset--color--tertiary); color: var(--wp--preset--color--main); border: 1px solid var(--wp--preset--color--border-light); }
.it-topics a[aria-current] { background: var(--wp--preset--color--main); color: var(--wp--preset--color--base); border-color: var(--wp--preset--color--main); }

/* ---------- Two columns ---------- */
.it-cols { display: flex !important; flex-wrap: wrap; gap: 48px; align-items: flex-start; padding-top: 40px; }
.it-cols__main { flex: 999 1 560px; min-width: 0; }
.it-cols__side { flex: 1 1 300px; min-width: 0; }
.it-cols--single .it-cols__main { max-width: 740px; }
@media (min-width: 960px) { .it-sticky { position: sticky; top: 24px; } }

/* ---------- Featured post ---------- */
.it-featured { padding: 36px !important; border-radius: 20px; background: var(--wp--preset--color--tertiary); border: 1px solid var(--wp--preset--color--border-light); margin-bottom: 40px; }
.it-featured .wp-block-post-title { margin: 12px 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.1; font-weight: 800; letter-spacing: -1px; }
.it-featured .wp-block-post-title a { color: var(--wp--preset--color--main); text-decoration: none; }
.it-featured .wp-block-post-excerpt { font-size: 18px; line-height: 1.65; color: var(--wp--preset--color--secondary); max-width: 720px; }
.it-featured .wp-block-read-more { font-weight: 600; color: var(--wp--preset--color--primary); text-decoration: none; }
.it-kicker { font-size: 13px; font-weight: 600; color: var(--wp--preset--color--primary); gap: 6px !important; }
.it-kicker > * { margin: 0 !important; }

/* ---------- Post list ---------- */
.it-list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.it-list-head h2 { margin: 0; font-size: 22px; font-weight: 700; }
.it-list-head a { font-size: 15px; font-weight: 600; text-decoration: none; }
.it-list { list-style: none; margin: 0; padding: 0; }
.it-list > li { border-top: 1px solid var(--wp--preset--color--border-light); margin: 0 !important; }
.it-row { display: flex !important; flex-wrap: wrap; gap: 8px 32px; padding: 26px 0; }
.it-row > *, .it-cols > *, .it-featured > *, .it-header__bar > * { margin-block-start: 0 !important; }
.it-hero p, .it-hero form, .it-sidebar form, .it-after form { margin: 0; }
.it-row__date { flex: 0 0 120px; font-size: 14px; color: var(--wp--preset--color--secondary); padding-top: 4px; margin: 0 !important; }
.it-row__body { flex: 1 1 420px; display: flex; flex-direction: column; gap: 8px !important; }
.it-row__body > * { margin: 0 !important; }
.it-row .wp-block-post-title { font-size: 22px; line-height: 1.3; font-weight: 700; letter-spacing: -0.3px; }
.it-row .wp-block-post-title a { color: var(--wp--preset--color--main); text-decoration: none; }
.it-row .wp-block-post-title a:hover { color: var(--wp--preset--color--primary); }
.it-row .wp-block-post-excerpt__excerpt { margin: 0; font-size: 16px; line-height: 1.6; color: var(--wp--preset--color--secondary); }
.it-meta { font-size: 13px; font-weight: 600; color: var(--wp--preset--color--primary); gap: 4px 10px !important; }
.it-meta > * { margin: 0 !important; }
.it-meta a { text-decoration: none; }
.wp-block-query-pagination { margin-top: 28px; font-weight: 600; }

/* ---------- Work band ---------- */
.it-work { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; margin: 56px 0 0; padding: 40px; border-radius: 20px; background: var(--wp--preset--color--primary); color: var(--wp--preset--color--base); }
.it-work h2 { margin: 0; font-size: 30px; line-height: 1.2; font-weight: 800; color: inherit; }
.it-work p { margin: 8px 0 0; font-size: 17px; line-height: 1.6; opacity: 0.9; }
.it-work__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.it-work .it-btn { background: var(--wp--preset--color--base); color: var(--wp--preset--color--primary) !important; }
.it-work .it-btn--outline { background: transparent; color: var(--wp--preset--color--base) !important; border-color: var(--wp--preset--color--base); }

/* ---------- Single ---------- */
.it-single-terms { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px !important; }
.it-single-terms a { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--wp--preset--color--tertiary); border: 1px solid var(--wp--preset--color--border-light); font-size: 13px; font-weight: 600; color: var(--wp--preset--color--primary); text-decoration: none; }
.it-single-terms .wp-block-post-terms__separator { display: none; }
.it-single-title { margin: 0 !important; font-size: clamp(32px, 5vw, 46px) !important; line-height: 1.1 !important; font-weight: 800 !important; letter-spacing: -1.2px; }
.it-single-meta { margin: 18px 0 40px !important; font-size: 15px; color: var(--wp--preset--color--secondary); gap: 6px !important; }
.it-single-meta > * { margin: 0 !important; }
.it-content { font-size: 19px; line-height: 1.75; }
.it-content h2 { font-size: 28px; line-height: 1.25; font-weight: 800; letter-spacing: -0.5px; margin-top: 44px; }
.it-content h3 { font-size: 22px; font-weight: 700; margin-top: 32px; }
.it-content a { color: var(--wp--preset--color--primary); }
.it-content :not(pre) > code { padding: 2px 6px; border-radius: 6px; background: var(--wp--preset--color--tertiary); border: 1px solid var(--wp--preset--color--border-light); font-size: 0.85em; }
.it-content pre, .it-content .wp-block-code { border-radius: 14px; font-size: 15px; line-height: 1.65; overflow-x: auto; }
.it-content img { border-radius: 10px; }

.it-after { margin-top: 56px; display: flex; flex-direction: column; gap: 28px; }
.it-after h2 { margin: 0; font-size: 22px; font-weight: 800; }
.it-author { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding: 24px 0; border-top: 1px solid var(--wp--preset--color--border-light); border-bottom: 1px solid var(--wp--preset--color--border-light); }
.it-author__who { display: flex; gap: 14px; align-items: center; }
.it-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--wp--preset--color--primary); color: var(--wp--preset--color--base); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; flex: 0 0 auto; }
.it-postnav { display: flex !important; flex-wrap: wrap; gap: 16px; margin-top: 28px; }
.it-postnav .wp-block-post-navigation-link { flex: 1 1 260px; margin: 0; padding: 20px; border-radius: 14px; border: 1px solid var(--wp--preset--color--border-light); }
.it-postnav .wp-block-post-navigation-link a { font-weight: 700; text-decoration: none; color: var(--wp--preset--color--main); }
.it-postnav .post-navigation-link__label { display: block; font-size: 13px; font-weight: 400; color: var(--wp--preset--color--secondary); }
.it-postnav .post-navigation-link-next { text-align: right; }

/* ---------- Sidebar ---------- */
.it-sidebar { display: flex; flex-direction: column; gap: 18px; }
.it-sidebar h2 { margin: 0; font-size: 18px; font-weight: 700; }
.it-sidebar p { margin: 0; }
.it-status { display: flex; align-items: center; gap: 8px; margin-bottom: 12px !important; font-size: 13px; font-weight: 600; }
.it-status__dot { width: 10px; height: 10px; border-radius: 50%; background: #22A35A; box-shadow: 0 0 0 4px rgba(34,163,90,0.18); }
.it-name { font-size: 18px; font-weight: 700; }
.it-role { margin: 2px 0 10px !important; font-size: 14px; color: var(--wp--preset--color--secondary); }
.it-small { font-size: 14px; line-height: 1.6; color: var(--wp--preset--color--secondary); margin-bottom: 16px !important; }
.it-tiny { font-size: 12px; line-height: 1.5; color: var(--wp--preset--color--secondary); margin-top: 10px !important; }
.it-toptal { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px; border-radius: 16px; background: #0B1F44; text-decoration: none !important; }
.it-toptal__top { display: block; font-size: 12px; letter-spacing: 1.5px; font-weight: 700; color: #7FB3FF; }
.it-toptal__by { display: block; font-size: 15px; color: #FFFFFF; }
.it-toptal__by b { font-weight: 800; }
.it-toptal__cta { padding: 9px 14px; border-radius: 8px; background: #FFFFFF; color: #0B1F44; font-size: 13px; font-weight: 700; }
.it-book { display: flex; gap: 16px; align-items: center; text-decoration: none !important; color: var(--wp--preset--color--main); }
.it-book img { width: 72px; height: 90px; object-fit: cover; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.18); flex: 0 0 auto; filter: none !important; }
.it-book__label { display: block; font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--wp--preset--color--secondary); }
.it-book__title { display: block; font-size: 16px; font-weight: 700; line-height: 1.3; margin: 4px 0; }
.it-book__by { display: block; font-size: 13px; color: var(--wp--preset--color--secondary); }
.it-socials { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.it-social { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--wp--preset--color--border-light); font-size: 15px; font-weight: 500; color: var(--wp--preset--color--main) !important; text-decoration: none !important; }
.it-social__name { flex: 1; }
.it-social__handle { color: var(--wp--preset--color--secondary); }

/* ---------- Archive heads ---------- */
.it-page-head { padding: 48px 0 8px; }
.it-page-head h1 { margin: 0; font-size: clamp(30px, 4vw, 42px); font-weight: 800; letter-spacing: -1px; }
.it-page-head .wp-block-term-description { color: var(--wp--preset--color--secondary); }

/* ---------- Footer ---------- */
.it-footer { margin-top: 64px; border-top: 1px solid var(--wp--preset--color--border-light); }
.it-footer__bar { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; padding: 28px 0; font-size: 14px; color: var(--wp--preset--color--secondary); }
.it-footer__bar nav { display: flex; flex-wrap: wrap; gap: 18px; }
.it-footer__bar a { color: inherit; text-decoration: none; }
.it-footer__bar a:hover { color: var(--wp--preset--color--main); }
