/*
Theme Name: Twenty Twenty-Four Child
Theme URI: https://wordpress.org/themes/twentytwentyfour/
Author: Andy
Requires at least: 6.4
Tested up to: 6.4
Requires PHP: 7.0
Version: 1.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Template: twentytwentyfour
Description: MSIKS theme - styled to match the admin-suite design system.
*/

/* ===== ADMIN-SUITE COLOR VARIABLES ===== */
:root {
    --wp--preset--color--base: #f9fafb;
    --wp--preset--color--base-2: #ffffff;
    --wp--preset--color--contrast: #111827;
    --wp--preset--color--contrast-2: #6b7280;
    --wp--preset--color--contrast-3: #9ca3af;
    --wp--preset--color--accent: #0da6dd;
    --wp--preset--color--accent-2: #0978b3;
    --wp--preset--color--accent-3: #ec4899;
    --wp--preset--color--accent-4: #dbeafe;
    --wp--preset--color--accent-5: #fce7f3;
}

/* ===== GLOBAL ===== */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: #fbcfe8;
    color: #0f172a;
}

/* Heading weight override - admin-suite uses 600/700 */
h1, h2, h3, h4, h5, h6,
.wp-block-heading {
    font-weight: 600;
}

h1, h1.wp-block-heading {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
* {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

/* ===== SUBTLE BACKGROUND ===== */
.wp-site-blocks {
    background:
        radial-gradient(ellipse at 10% 0%, rgba(13, 166, 221, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 100%, rgba(236, 72, 153, 0.03) 0%, transparent 50%);
}

/* ===== LINKS ===== */
.wp-site-blocks a:not(.wp-block-button__link):not(.wp-block-navigation-item__content) {
    color: #0da6dd;
    text-decoration-color: rgba(13, 166, 221, 0.3);
    text-underline-offset: 2px;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.wp-site-blocks a:not(.wp-block-button__link):not(.wp-block-navigation-item__content):hover {
    color: #0978b3;
    text-decoration-color: #0978b3;
}

/* ===== LINKS ON COLORED BACKGROUNDS ===== */
/* Links inside blocks with accent/dark backgrounds need contrast */
.has-accent-background-color a:not(.wp-block-button__link),
.has-accent-2-background-color a:not(.wp-block-button__link),
.has-contrast-background-color a:not(.wp-block-button__link),
.wp-block-group.has-background a:not(.wp-block-button__link) {
    color: #ffffff;
    text-decoration-color: rgba(255, 255, 255, 0.5);
}
.has-accent-background-color a:not(.wp-block-button__link):hover,
.has-accent-2-background-color a:not(.wp-block-button__link):hover,
.has-contrast-background-color a:not(.wp-block-button__link):hover,
.wp-block-group.has-background a:not(.wp-block-button__link):hover {
    color: #ffffff;
    text-decoration-color: #ffffff;
}

/* ===== BREADCRUMBS ===== */
.yoast-breadcrumbs a,
.wp-block-yoast-seo-breadcrumbs a,
[class*="breadcrumb"] a {
    color: #6b7280;
    text-decoration: none;
}
.yoast-breadcrumbs a:hover,
.wp-block-yoast-seo-breadcrumbs a:hover,
[class*="breadcrumb"] a:hover {
    color: #374151;
    text-decoration: underline;
}
.yoast-breadcrumbs,
.wp-block-yoast-seo-breadcrumbs,
[class*="breadcrumb"] {
    color: #9ca3af;
}

/* ===== NAVIGATION ===== */
/* Top-level nav items on the blue header: hover to white */
.wp-block-navigation > .wp-block-navigation__container > .wp-block-navigation-item > a:hover,
.wp-block-navigation > .wp-block-navigation__container > .wp-block-navigation-item > button:hover {
    color: #ffffff !important;
}
/* Submenu items on white dropdown: hover to accent blue */
.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item a {
    color: #111827 !important;
}
.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item a:hover {
    color: #0da6dd !important;
}

/* ===== BUTTONS — gradient style like admin-suite ===== */
.wp-block-button__link,
.wp-element-button {
    border-radius: 8px !important;
    font-weight: 500;
    transition: all 0.15s ease;
    padding: 0.625rem 1.25rem;
}

.wp-block-button:not(.is-style-outline) .wp-block-button__link {
    background: linear-gradient(135deg, #0da6dd, #0978b3) !important;
    border: 1px solid #0978b3;
    color: #fff !important;
    box-shadow: 0 1px 3px rgba(9, 120, 179, 0.3);
}
.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
    background: linear-gradient(135deg, #0978b3, #065a8c) !important;
    box-shadow: 0 3px 8px rgba(9, 120, 179, 0.35);
    transform: translateY(-1px);
}
.wp-block-button:not(.is-style-outline) .wp-block-button__link:active {
    transform: scale(0.98);
}

.wp-block-button.is-style-outline .wp-block-button__link {
    border: 1px solid #0da6dd;
    color: #0da6dd;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
    background: #eff6ff;
    border-color: #0978b3;
    color: #0978b3;
}

/* ===== CARDS / GROUP BLOCKS ===== */
.wp-block-group.has-background {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.wp-block-group.has-background:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-color: #bfdbfe;
}

/* ===== IMAGES ===== */
.wp-block-image img,
.wp-block-post-featured-image img,
.wp-block-latest-posts__featured-image img {
    border-radius: 12px;
}

/* ===== FORMS ===== */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="date"],
textarea,
select {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #f472b6;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

/* ===== SEPARATOR ===== */
.wp-block-separator {
    border-color: #e5e7eb !important;
}

/* ===== QUOTES ===== */
.wp-block-quote {
    border-left-color: #0da6dd !important;
}
.wp-block-pullquote {
    border-color: #ec4899 !important;
}

/* ===== POST TERMS / TAGS — pill style ===== */
.wp-block-post-terms a {
    background: #eff6ff;
    color: #065a8c;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none !important;
    transition: background-color 0.15s ease;
    display: inline-block;
    margin: 2px;
}
.wp-block-post-terms a:hover {
    background: #dbeafe;
    color: #054a73;
}

/* ===== FOCUS RING ===== */
:where(.wp-site-blocks) *:focus-visible {
    outline: 2px solid #0da6dd;
    outline-offset: 2px;
}

/* ===== TABLES ===== */
.wp-block-table table {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}
.wp-block-table th {
    background-color: #f3f4f6;
    font-weight: 600;
}
.wp-block-table td,
.wp-block-table th {
    border-color: #e5e7eb;
    padding: 0.75rem 1rem;
}

/* ===== CODE BLOCKS ===== */
.wp-block-code {
    border-radius: 12px !important;
    border-color: #e5e7eb !important;
}

/* ===== HEADER & FOOTER ===== */
footer.wp-block-template-part,
.wp-block-template-part footer {
    border-top: 1px solid #e5e7eb;
}
header.wp-block-template-part,
.wp-block-template-part header {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
header.wp-block-template-part .wp-block-group.has-background,
.wp-block-template-part header .wp-block-group.has-background {
    border-radius: 0;
}

/* ===== SEARCH ===== */
.wp-block-search .wp-block-search__input {
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}
.wp-block-search .wp-block-search__input:focus {
    border-color: #0da6dd;
    box-shadow: 0 0 0 3px rgba(13, 166, 221, 0.1);
}
.wp-block-search .wp-block-search__button {
    border-radius: 8px !important;
    background: linear-gradient(135deg, #0da6dd, #0978b3);
    color: white;
}

/* ===== LATEST POSTS ===== */
.wp-block-latest-posts__post-title {
    font-weight: 600;
    color: #0da6dd;
    text-decoration: none !important;
}
.wp-block-latest-posts__post-title:hover {
    color: #0978b3;
}
.wp-block-latest-posts__post-date {
    color: #9ca3af;
    font-size: 0.8rem;
}

/* ===== SMART SLIDER ===== */
/* Override hardcoded Schibsted Grotesk stored in slider database */
div[id^="n2-ss-"] [class*="n2-font-"] {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* ===== SITE TITLE ===== */
.wp-block-site-title {
    font-weight: 700;
}

/* ===== SMOOTH TRANSITIONS ===== */
a,
button,
.wp-block-button__link {
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
