/*
Theme Name: MI Prompt
Theme URI: https://example.com/
Author: OpenAI
Author URI: https://openai.com/
Description: A modern WordPress theme designed to pair with the UX360 Prompt Library plugin, using a clean MI Prompt product UI with rounded inputs, soft shells, and pill filters.
Version: 1.3.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: mi-prompt
Tags: custom-logo, custom-menu, featured-images, one-column, two-columns, blog, education, light, responsive-layout
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

:root {
    --mi-bg: #f5f7fb;
    --mi-surface: #ffffff;
    --mi-surface-muted: #eef3f9;
    --mi-border: #d9e2ef;
    --mi-border-strong: #c8d5e6;
    --mi-text: #192335;
    --mi-text-soft: #62718e;
    --mi-primary: #2563eb;
    --mi-primary-hover: #1d4ed8;
    --mi-shadow: 0 12px 40px rgba(31, 55, 93, 0.08);
    --mi-radius: 14px;
    --mi-radius-pill: 999px;
    --mi-container: 1360px;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--mi-text);
    background: var(--mi-bg);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--mi-primary); text-decoration: none; }
a:hover { color: var(--mi-primary-hover); }
button, input, select, textarea { font: inherit; }
.screen-reader-text { position: absolute; left: -9999px; }

body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) {
    body.admin-bar .site-header { top: 46px; }
}

.site { min-height: 100vh; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: color-mix(in srgb, var(--mi-surface) 92%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--mi-border);
}

.site-header__inner,
.site-main,
.site-footer__inner,
.page-shell,
.hero-shell,
.section-shell {
    width: min(calc(100% - 48px), var(--mi-container));
    margin: 0 auto;
}

.site-header__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 24px;
    align-items: center;
    min-height: 84px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--mi-text);
    font-weight: 700;
    font-size: 18px;
}

.brand__mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--mi-primary);
    color: #fff;
    display: inline-grid;
    place-items: center;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.02em;
    box-shadow: 0 6px 18px color-mix(in srgb, var(--mi-primary) 24%, transparent);
}

.brand__logo-image {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.primary-nav { justify-self: center; }
.primary-nav ul {
    display: flex;
    gap: 28px;
    margin: 0;
    padding: 0;
    list-style: none;
    align-items: center;
}
.primary-nav a {
    color: var(--mi-text-soft);
    font-weight: 500;
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a {
    color: var(--mi-text);
}

.header-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.header-actions .signin-link {
    color: var(--mi-text);
    font-weight: 500;
}

.mi-button,
button,
input[type="submit"],
input[type="button"],
.wp-block-button__link,
.wp-element-button {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 10px;
    min-height: 48px;
    padding: 0 18px;
    background: #fff;
    color: var(--mi-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.mi-button:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.wp-block-button__link:hover,
.wp-element-button:hover {
    transform: translateY(-1px);
}

.mi-button--primary,
.header-actions .signup-link,
button[type="submit"],
input[type="submit"],
.wp-block-button__link,
.wp-element-button {
    background: var(--mi-primary);
    color: #fff;
    border-color: var(--mi-primary);
    box-shadow: 0 12px 24px rgba(37,99,235,0.18);
}

.mi-button--primary:hover,
.header-actions .signup-link:hover,
button[type="submit"]:hover,
input[type="submit"]:hover,
.wp-block-button__link:hover,
.wp-element-button:hover {
    background: var(--mi-primary-hover);
    color: #fff;
    border-color: var(--mi-primary-hover);
}

.mi-button--secondary,
button:not([type="submit"]),
input[type="button"] {
    background: #fff;
    color: var(--mi-text);
    border-color: var(--mi-border-strong);
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
select,
textarea {
    width: 100%;
    border: 1px solid var(--mi-border-strong);
    border-radius: var(--mi-radius);
    background: #fff;
    color: var(--mi-text);
    min-height: 48px;
    padding: 12px 14px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

textarea {
    min-height: 160px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #9eb8f6;
    box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
}

label {
    display: inline-block;
    font-weight: 600;
    color: var(--mi-text);
    margin-bottom: 8px;
}

.site-main { padding: 44px 0 72px; }

.entry-card,
.surface-card,
.feature-card {
    background: var(--mi-surface);
    border: 1px solid var(--mi-border);
    border-radius: 20px;
    box-shadow: var(--mi-shadow);
}

.entry-card { padding: 32px; }

.entry-title,
.page-title,
.hero-title {
    margin: 0 0 10px;
    font-size: clamp(2.2rem, 4vw, 4rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
    color: var(--mi-text);
    font-weight: 800;
}

.entry-title--small,
.page-title {
    font-size: clamp(2rem, 3vw, 3rem);
}

.hero-subtitle,
.page-lead,
.entry-summary {
    max-width: 840px;
    color: var(--mi-text-soft);
    font-size: clamp(1rem, 1.6vw, 1.35rem);
    margin: 0;
}

.hero { padding: 56px 0 40px; }
.hero-shell { text-align: center; }

.hero-panel {
    background: linear-gradient(180deg, #f5f8fd 0%, #f3f7fb 100%);
    border: 1px solid var(--mi-border);
    border-radius: 28px;
    padding: clamp(48px, 7vw, 92px) 24px;
}

.hero-search {
    margin: 34px auto 0;
    max-width: 620px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.hero-stats {
    margin-top: 46px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.hero-stat {
    padding: 18px 16px;
    border-top: 1px solid var(--mi-border);
    color: var(--mi-text-soft);
}

.hero-stat strong {
    display: block;
    font-size: 1rem;
    color: var(--mi-text);
    margin-bottom: 4px;
}

.mi-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 14px;
    border-radius: var(--mi-radius-pill);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    border: 1px solid transparent;
    background: #eef3f8;
    color: #31415b;
}

.mi-chip--active {
    background: var(--mi-primary);
    color: #fff;
    border-color: var(--mi-primary);
}

.site-footer {
    padding: 18px 0 34px;
    color: var(--mi-text-soft);
}

.site-footer__inner {
    padding-top: 12px;
    border-top: 1px solid var(--mi-border);
}

.stack > * + * { margin-top: 16px; }

.mi-prompt-sticky-header-off .site-header {
    position: relative;
    top: 0 !important;
}

.mi-forum-landing__card {
    display: grid;
    gap: 24px;
}

.mi-forum-landing__intro {
    margin: 0;
    max-width: 780px;
    color: var(--mi-text-soft);
    font-size: 18px;
    line-height: 1.7;
}

.mi-forum-landing__filters,
.mi-forum-landing__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mi-forum-landing__actions {
    margin-top: 8px;
    margin-bottom: 22px;
}

@media (max-width: 1100px) {
    .site-header__inner {
        grid-template-columns: 1fr;
        justify-items: start;
        padding: 14px 0;
    }
    .primary-nav,
    .header-actions {
        justify-self: start;
    }
    .hero-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .site-header__inner,
    .site-main,
    .site-footer__inner,
    .page-shell,
    .hero-shell,
    .section-shell {
        width: min(calc(100% - 28px), var(--mi-container));
    }

    .hero-search {
        grid-template-columns: 1fr;
    }

    .entry-card {
        padding: 22px;
    }
}


/* Landing page refinements */
.hero--landing {
    padding: 38px 0 28px;
}

.hero-panel--landing {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--mi-primary) 12%, transparent), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f5f8fd 100%);
    padding: clamp(52px, 7vw, 96px) clamp(22px, 5vw, 72px);
    box-shadow: var(--mi-shadow);
}

.hero-panel--landing::before,
.hero-panel--landing::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.hero-panel--landing::before {
    width: 280px;
    height: 280px;
    right: -120px;
    top: -120px;
    background: color-mix(in srgb, var(--mi-primary) 10%, transparent);
}

.hero-panel--landing::after {
    width: 220px;
    height: 220px;
    left: -110px;
    bottom: -120px;
    background: rgba(25, 35, 53, 0.04);
}

.hero-panel--landing > * {
    position: relative;
    z-index: 1;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid var(--mi-border);
    border-radius: var(--mi-radius-pill);
    background: rgba(255, 255, 255, 0.78);
    color: var(--mi-primary);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.hero-subtitle--center {
    margin-left: auto;
    margin-right: auto;
}

.hero-search--landing {
    max-width: 760px;
    grid-template-columns: minmax(0, 1fr) auto;
    background: #fff;
    border: 1px solid var(--mi-border);
    border-radius: calc(var(--mi-radius) + 8px);
    padding: 8px;
    box-shadow: 0 18px 45px rgba(31, 55, 93, 0.10);
}

.hero-search--landing input[type="search"] {
    border-color: transparent;
    box-shadow: none;
    background: transparent;
    min-height: 54px;
    font-size: 17px;
}

.hero-search--landing input[type="search"]:focus {
    border-color: transparent;
    box-shadow: none;
}

.hero-search--landing button[type="submit"] {
    min-height: 54px;
    border-radius: calc(var(--mi-radius) + 2px);
    white-space: nowrap;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.mi-button--ghost {
    background: transparent;
    border-color: transparent;
    color: var(--mi-text-soft);
    box-shadow: none;
}

.mi-button--ghost:hover {
    background: rgba(255, 255, 255, 0.72);
    border-color: var(--mi-border);
    color: var(--mi-text);
}

.hero-note {
    max-width: 760px;
    margin: 18px auto 0;
    color: var(--mi-text-soft);
    font-size: 15px;
}

.hero-quick-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 28px;
}

.hero-quick-links a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: var(--mi-radius-pill);
    background: color-mix(in srgb, var(--mi-surface-muted) 76%, #fff);
    border: 1px solid var(--mi-border);
    color: var(--mi-text-soft);
    font-size: 14px;
    font-weight: 700;
}

.hero-quick-links a:hover {
    color: var(--mi-text);
    border-color: var(--mi-border-strong);
    background: #fff;
}

.landing-section {
    padding: 34px 0;
}

.landing-section--compact {
    padding-top: 14px;
}

.landing-section--cta {
    padding-bottom: 0;
}

.landing-section__header {
    max-width: 780px;
    margin: 0 auto 24px;
    text-align: center;
}

.landing-section__header h2,
.landing-split__content h2,
.landing-cta-panel h2 {
    margin: 0 0 10px;
    color: var(--mi-text);
    font-size: clamp(1.7rem, 2.6vw, 2.5rem);
    line-height: 1.12;
    letter-spacing: -0.035em;
}

.landing-section__header p,
.landing-split__content p,
.landing-cta-panel p {
    margin: 0;
    color: var(--mi-text-soft);
    font-size: 17px;
}

.landing-grid {
    display: grid;
    gap: 18px;
}

.landing-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.landing-card {
    background: var(--mi-surface);
    border: 1px solid var(--mi-border);
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 10px 32px rgba(31, 55, 93, 0.06);
}

.landing-card__icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--mi-primary) 10%, #fff);
    color: var(--mi-primary);
    font-weight: 800;
    margin-bottom: 18px;
}

.landing-card h3 {
    margin: 0 0 8px;
    color: var(--mi-text);
    font-size: 20px;
    line-height: 1.25;
}

.landing-card p {
    margin: 0;
    color: var(--mi-text-soft);
}

.landing-split,
.landing-cta-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: 24px;
    align-items: center;
    background: var(--mi-surface);
    border: 1px solid var(--mi-border);
    border-radius: 26px;
    padding: clamp(24px, 4vw, 42px);
    box-shadow: var(--mi-shadow);
}

.landing-access-list {
    display: grid;
    gap: 12px;
}

.landing-access-list div {
    display: grid;
    gap: 2px;
    padding: 14px 16px;
    border: 1px solid var(--mi-border);
    border-radius: 16px;
    background: var(--mi-surface-muted);
}

.landing-access-list strong {
    color: var(--mi-text);
}

.landing-access-list span {
    color: var(--mi-text-soft);
    font-size: 15px;
}

.landing-cta-panel {
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--mi-primary) 13%, transparent), transparent 32%),
        var(--mi-surface);
}

.landing-cta-panel__actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

.landing-page-content {
    margin-top: 24px;
}

@media (max-width: 1100px) {
    .landing-grid--three,
    .landing-split,
    .landing-cta-panel {
        grid-template-columns: 1fr;
    }

    .landing-cta-panel__actions {
        justify-content: flex-start;
    }
}

@media (max-width: 700px) {
    .hero--landing {
        padding-top: 18px;
    }

    .hero-search--landing {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .hero-search--landing button[type="submit"] {
        width: 100%;
    }

    .hero-actions .mi-button,
    .landing-cta-panel__actions .mi-button {
        width: 100%;
    }

    .landing-card,
    .landing-split,
    .landing-cta-panel {
        border-radius: 20px;
        padding: 20px;
    }
}

/* Prompt library page compact layout */
.page-shell--prompt-library {
    padding-top: 0;
}

.entry-card--prompt-library {
    padding: clamp(18px, 3vw, 28px);
}

.prompt-library-page-head {
    margin-bottom: 14px;
}

.page-title--prompt-library {
    margin: 0;
    font-size: clamp(2rem, 3.2vw, 3.1rem);
    line-height: 1.06;
}

.entry-content--prompt-library > *:first-child {
    margin-top: 0;
}

/* Final prompt-library page compaction */
.entry-card--prompt-library {
    padding: clamp(14px, 2vw, 22px);
}

.prompt-library-page-head {
    margin-bottom: 10px;
}

.page-title--prompt-library {
    font-size: clamp(1.55rem, 2.2vw, 2.25rem);
    line-height: 1.1;
}

.entry-card--prompt-library .ux360-pl-member-journey,
.entry-card--prompt-library .ux360-pl-toolbar--compact {
    max-width: none;
}

@media (max-width: 760px) {
    .entry-card--prompt-library {
        padding: 12px;
    }

    .page-title--prompt-library {
        font-size: 1.45rem;
    }
}


/* Shared layout system for theme + prompt plugins */
body.mi-layout--fixed .site-header__inner,
body.mi-layout--fixed .site-main,
body.mi-layout--fixed .site-footer__inner,
body.mi-layout--fixed .page-shell,
body.mi-layout--fixed .hero-shell,
body.mi-layout--fixed .section-shell {
    width: min(calc(100% - 48px), var(--mi-layout-container, var(--mi-container)));
    max-width: var(--mi-layout-container, var(--mi-container));
}

body.mi-layout--full .site-header__inner,
body.mi-layout--full .site-main,
body.mi-layout--full .site-footer__inner,
body.mi-layout--full .page-shell,
body.mi-layout--full .hero-shell,
body.mi-layout--full .section-shell {
    width: calc(100% - 48px);
    max-width: none;
}

body.mi-layout--theme .site-header__inner,
body.mi-layout--theme .site-main,
body.mi-layout--theme .site-footer__inner,
body.mi-layout--theme .page-shell,
body.mi-layout--theme .hero-shell,
body.mi-layout--theme .section-shell {
    width: min(calc(100% - 48px), var(--mi-container));
}

body.mi-card-density--compact .entry-card,
body.mi-card-density--compact .surface-card,
body.mi-card-density--compact .feature-card {
    padding: var(--mi-card-padding, 22px);
}

@media (max-width: 700px) {
    body.mi-layout--fixed .site-header__inner,
    body.mi-layout--fixed .site-main,
    body.mi-layout--fixed .site-footer__inner,
    body.mi-layout--fixed .page-shell,
    body.mi-layout--fixed .hero-shell,
    body.mi-layout--fixed .section-shell,
    body.mi-layout--full .site-header__inner,
    body.mi-layout--full .site-main,
    body.mi-layout--full .site-footer__inner,
    body.mi-layout--full .page-shell,
    body.mi-layout--full .hero-shell,
    body.mi-layout--full .section-shell {
        width: min(calc(100% - 28px), var(--mi-layout-container, var(--mi-container)));
    }
}
