/*
Theme Name: HOS Ops Theme
Theme URI: https://houseofsarault.com/
Author: Sarault Incorporated
Description: Responsive application presentation for HOS Operations. Requires HOS Ops Core.
Version: 0.3.1
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: hos-ops-theme
*/

* { box-sizing: border-box; }

html { background: var(--hos-paper); color: var(--hos-ink); font-family: var(--hos-font); }
body { margin: 0; background: var(--hos-paper); color: var(--hos-ink); }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, .hos-button { touch-action: manipulation; }

.hos-site-shell { min-height: 100vh; }

.hos-app {
    display: grid;
    grid-template-columns: var(--hos-sidebar) minmax(0, 1fr);
    min-height: 100vh;
}

.hos-sidebar {
    background: var(--hos-black);
    border-top: 3px solid var(--hos-orange);
    color: var(--hos-surface);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 28px 20px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.hos-brand { border-bottom: 1px solid rgba(255,255,255,.12); display: block; margin: 0 0 20px; padding: 4px 0 22px; text-decoration: none; }
.hos-brand__logo { display: block; height: auto; max-width: 100%; object-fit: contain; object-position: center; width: 212px; }
.hos-brand__division { color: var(--hos-orange); display: block; font-family: var(--hos-mono); font-size: 9px; font-weight: 800; letter-spacing: .24em; margin-top: 11px; text-align: center; text-transform: uppercase; }

.hos-nav { display: grid; gap: 5px; }
.hos-nav__label { color: var(--hos-steel); font-family: var(--hos-mono); font-size: 10px; font-weight: 800; letter-spacing: .14em; margin: 20px 13px 6px; text-transform: uppercase; }
.hos-nav a {
    align-items: center;
    border-radius: var(--hos-radius-sm);
    color: var(--hos-bg);
    display: flex;
    font-size: 14px;
    font-weight: 750;
    gap: 11px;
    padding: 11px 13px;
    position: relative;
    text-decoration: none;
}
.hos-nav a::after { background: var(--hos-orange); bottom: 4px; content: ""; height: 2px; left: 13px; position: absolute; right: 13px; transform: scaleX(0); transform-origin: left; transition: transform .18s ease; }
.hos-nav a:hover, .hos-nav a:focus-visible { background: rgba(255, 255, 255, .06); color: var(--hos-white); outline: none; }
.hos-nav a:hover::after, .hos-nav a:focus-visible::after, .hos-nav a[aria-current="page"]::after { transform: scaleX(1); }
.hos-nav a[aria-current="page"] { color: var(--hos-white); }
.hos-nav__icon { font-size: 17px; line-height: 1; width: 20px; }

.hos-sidebar__footer { border-top: 1px solid rgba(255,255,255,.12); margin-top: auto; padding: 18px 9px 2px; }
.hos-sidebar__user { font-size: 13px; font-weight: 700; margin: 0; }
.hos-sidebar__meta { color: var(--hos-steel); font-size: 11px; margin: 5px 0 12px; }
.hos-sidebar__footer a { color: var(--hos-bg); font-size: 12px; }

.hos-main { min-width: 0; padding: 42px clamp(22px, 4vw, 64px) 72px; }
.hos-main__inner { margin: 0 auto; max-width: var(--hos-max); }
.hos-page-head { align-items: flex-end; display: flex; gap: 24px; justify-content: space-between; margin-bottom: 28px; }
.hos-page-head h1 { font-family: var(--hos-font); font-size: clamp(32px, 4vw, 50px); font-weight: 700; letter-spacing: -.04em; line-height: 1.02; margin: 5px 0 0; }
.hos-page-head p { color: var(--hos-ink-soft); margin: 8px 0 0; max-width: 650px; }
.hos-kicker { color: var(--hos-orange); display: block; font-family: var(--hos-mono); font-size: 11px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }

.hos-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 9px; }
.hos-button {
    align-items: center;
    background: transparent;
    border: 2px solid var(--hos-orange);
    border-radius: 999px;
    color: var(--hos-black);
    cursor: pointer;
    display: inline-flex;
    font-size: 13px;
    font-weight: 850;
    gap: 10px;
    justify-content: center;
    min-height: 50px;
    line-height: 1;
    padding: 0 22px;
    text-decoration: none;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.hos-button::after { content: "→"; font-size: 1.08em; }
.hos-button:hover, .hos-button:focus-visible { background: var(--hos-orange); border-color: var(--hos-orange); color: var(--hos-white); outline: none; transform: translateY(-1px); }
.hos-button--secondary { background: transparent; border-color: var(--hos-black); color: var(--hos-ink); }
.hos-button--secondary:hover, .hos-button--secondary:focus-visible { background: var(--hos-black); border-color: var(--hos-black); color: var(--hos-white); }
.hos-button--back::after { content: ""; display: none; }
.hos-button--danger { background: transparent; border-color: #dfaaa2; color: var(--hos-danger); }
.hos-button--danger::after { content: ""; display: none; }
.hos-button--small { font-size: 12px; min-height: 40px; padding: 0 16px; }

.hos-notice { border-radius: var(--hos-radius); font-size: 14px; padding: 13px 16px; }
.hos-notice--success {
    animation: hos-success-toast 4s cubic-bezier(.22, .72, .3, 1) both;
    background: var(--hos-success-pale);
    border: 1px solid var(--hos-success-line);
    border-left: 4px solid var(--hos-success);
    box-shadow: 0 16px 38px rgba(23, 23, 23, .18);
    color: #214f32;
    left: calc(var(--hos-sidebar) + 24px);
    margin: 0 auto;
    max-width: 560px;
    pointer-events: none;
    position: fixed;
    right: 24px;
    top: max(18px, env(safe-area-inset-top));
    z-index: 1000;
}
.hos-notice--error { background: var(--hos-danger-pale); border: 1px solid #e6b0a7; color: #7f2f28; margin: 0 0 22px; }

@keyframes hos-success-toast {
    0% {
        opacity: 0;
        transform: translateY(calc(-100% - 28px));
        visibility: visible;
    }
    10%, 82% {
        opacity: 1;
        transform: translateY(0);
        visibility: visible;
    }
    100% {
        opacity: 0;
        transform: translateY(calc(-100% - 28px));
        visibility: hidden;
    }
}

.hos-card {
    background: var(--hos-paper-strong);
    border: 1px solid var(--hos-line);
    border-radius: var(--hos-radius);
    box-shadow: none;
}
.hos-card--padded { padding: 24px; }
.hos-card h2, .hos-card h3 { margin-top: 0; }

.hos-dashboard-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .8fr); }
.hos-progress-card { background: var(--hos-black); border: 0; color: var(--hos-white); overflow: hidden; padding: 30px; position: relative; }
.hos-progress-card::after {
    background: radial-gradient(circle, rgba(255,255,255,.15) 0, rgba(255,255,255,0) 68%);
    content: "";
    height: 330px;
    position: absolute;
    right: -150px;
    top: -160px;
    width: 330px;
}
.hos-progress-card__top { align-items: center; display: flex; justify-content: space-between; position: relative; z-index: 1; }
.hos-progress-card .hos-kicker { color: var(--hos-orange); }
.hos-progress-card h2 { font-family: var(--hos-font); font-size: clamp(28px, 4vw, 44px); font-weight: 700; letter-spacing: -.04em; line-height: 1.02; margin: 8px 0 22px; position: relative; z-index: 1; }
.hos-progress-number { align-items: baseline; display: flex; font-family: var(--hos-font); font-size: 54px; font-weight: 700; gap: 9px; letter-spacing: -.04em; line-height: 1; }
.hos-progress-number small { color: var(--hos-steel); font-family: var(--hos-font); font-size: 14px; letter-spacing: 0; word-spacing: .18em; }
.hos-progress-track { background: rgba(255,255,255,.18); border-radius: 999px; height: 8px; margin-top: 17px; overflow: hidden; }
.hos-progress-track span { background: var(--hos-orange); border-radius: inherit; display: block; height: 100%; }
.hos-progress-meta { color: var(--hos-steel); display: flex; font-size: 12px; justify-content: space-between; margin-top: 9px; }

.hos-week-focus { padding: 26px; }
.hos-week-focus__number { color: var(--hos-orange); font-family: var(--hos-font); font-size: 42px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.hos-week-focus h2 { font-family: var(--hos-font); font-size: 25px; font-weight: 700; letter-spacing: -.04em; margin: 10px 0 9px; }
.hos-week-focus p { color: var(--hos-ink-soft); font-size: 13px; line-height: 1.55; }

.hos-section { margin-top: 28px; }
.hos-section-head { align-items: center; display: flex; gap: 16px; justify-content: space-between; margin-bottom: 13px; }
.hos-section-head h2 { font-family: var(--hos-font); font-size: 25px; font-weight: 700; letter-spacing: -.04em; margin: 0; }
.hos-section-head p { color: var(--hos-ink-soft); font-size: 13px; margin: 3px 0 0; }

.hos-action-list { display: grid; gap: 10px; }
.hos-action-row { align-items: center; display: grid; gap: 14px; grid-template-columns: 44px minmax(0, 1fr) auto; padding: 16px 18px; text-decoration: none; }
.hos-action-row:hover { border-color: var(--hos-orange); box-shadow: var(--hos-shadow); transform: translateY(-1px); }
.hos-action-row__number { align-items: center; background: var(--hos-bg); border-radius: var(--hos-radius-sm); display: flex; font-family: var(--hos-font); font-size: 17px; font-weight: 700; height: 40px; justify-content: center; }
.hos-action-row h3 { font-size: 14px; margin: 0 0 5px; }
.hos-action-row p { color: var(--hos-ink-soft); font-size: 12px; margin: 0; }

.hos-pill { border-radius: var(--hos-radius-sm); display: inline-flex; font-family: var(--hos-mono); font-size: 9px; font-weight: 800; letter-spacing: .07em; padding: 6px 9px; text-transform: uppercase; white-space: nowrap; }
.hos-pill--backlog { background: #e9e2d8; color: #5d5750; }
.hos-pill--ready_to_capture { background: var(--hos-orange-pale); color: #8a3517; }
.hos-pill--captured { background: #e3ddd3; color: #3e3a35; }
.hos-pill--editing { background: #f0d8cc; color: #78331b; }
.hos-pill--ready_to_publish { background: #ffd5be; color: #713011; }
.hos-pill--published { background: var(--hos-black); color: var(--hos-white); }
.hos-pill--reviewed { background: var(--hos-white); border: 1px solid var(--hos-black); color: var(--hos-black); }
.hos-pill--blocked { background: var(--hos-danger-pale); color: var(--hos-danger); }

.hos-status-grid { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hos-stat { padding: 17px; }
.hos-stat strong { display: block; font-family: var(--hos-font); font-size: 28px; font-weight: 700; letter-spacing: -.04em; }
.hos-stat span { color: var(--hos-ink-soft); font-size: 11px; font-weight: 700; }

.hos-week { margin-bottom: 26px; }
.hos-week__head { align-items: start; background: var(--hos-bg-band); border: 1px solid var(--hos-line); border-radius: var(--hos-radius) var(--hos-radius) 0 0; display: grid; gap: 22px; grid-template-columns: 72px minmax(0, 1fr) minmax(220px, .55fr); padding: 20px 22px; }
.hos-week__number { color: var(--hos-orange); font-family: var(--hos-font); font-size: 46px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.hos-week__head h2 { font-family: var(--hos-font); font-size: 25px; font-weight: 700; letter-spacing: -.04em; margin: 0 0 5px; }
.hos-week__head p { color: var(--hos-ink-soft); font-size: 12px; line-height: 1.45; margin: 0; }
.hos-week__belief { border-left: 1px solid var(--hos-line); padding-left: 20px; }
.hos-week__belief strong { display: block; font-family: var(--hos-mono); font-size: 10px; letter-spacing: .12em; margin-bottom: 6px; text-transform: uppercase; }
.hos-card-grid { background: var(--hos-line-soft); border: 1px solid var(--hos-line); border-radius: 0 0 var(--hos-radius) var(--hos-radius); border-top: 0; display: grid; gap: 1px; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; }
.hos-content-card { background: var(--hos-paper-strong); min-height: 168px; padding: 20px; position: relative; text-decoration: none; }
.hos-content-card:hover { background: #fff; }
.hos-content-card__top { align-items: center; display: flex; gap: 10px; justify-content: space-between; }
.hos-content-card__number { color: var(--hos-orange); font-family: var(--hos-mono); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.hos-content-card h3 { font-size: 15px; line-height: 1.35; margin: 16px 0 8px; max-width: 88%; }
.hos-content-card p { color: var(--hos-ink-soft); font-size: 12px; line-height: 1.45; margin: 0; }
.hos-content-card__next { border-top: 1px solid var(--hos-line-soft); font-size: 11px; margin-top: 15px; padding-top: 11px; }

.hos-filter { align-items: end; display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.hos-field { display: grid; gap: 6px; }
.hos-field label, .hos-field__label { color: var(--hos-black); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.hos-field input, .hos-field textarea, .hos-field select {
    background: var(--hos-bg-light);
    border: 1px solid var(--hos-line);
    border-radius: var(--hos-radius);
    color: var(--hos-ink);
    font-size: 16px;
    min-height: 52px;
    padding: 14px 16px;
    width: 100%;
}
.hos-field textarea { line-height: 1.5; min-height: 104px; resize: vertical; }
.hos-field input:focus, .hos-field textarea:focus, .hos-field select:focus { border-color: var(--hos-orange); box-shadow: 0 0 0 3px var(--hos-orange-soft); outline: 0; }
.hos-field--wide { grid-column: 1 / -1; }
.hos-field-grid { display: grid; gap: 17px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hos-field-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.hos-detail-grid { display: grid; gap: 22px; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .65fr); }
.hos-form-section { border-bottom: 1px solid var(--hos-line); padding: 25px; }
.hos-form-section:last-child { border-bottom: 0; }
.hos-form-section h2 { font-family: var(--hos-font); font-size: 23px; font-weight: 700; letter-spacing: -.04em; margin: 0 0 17px; }
.hos-strategy-note { background: var(--hos-orange-pale); border-left: 4px solid var(--hos-orange); padding: 22px; }
.hos-strategy-note h2 { font-family: var(--hos-font); font-size: 21px; font-weight: 700; letter-spacing: -.04em; margin: 0 0 14px; }
.hos-strategy-note dl { margin: 0; }
.hos-strategy-note dt { font-family: var(--hos-mono); font-size: 9px; font-weight: 850; letter-spacing: .11em; margin-top: 13px; text-transform: uppercase; }
.hos-strategy-note dd { color: var(--hos-charcoal); font-size: 12px; line-height: 1.5; margin: 5px 0 0; }
.hos-sticky { position: sticky; top: 24px; }

.hos-table-wrap { border: 1px solid var(--hos-line); border-radius: var(--hos-radius); overflow-x: auto; }
.hos-table { border-collapse: collapse; min-width: 720px; width: 100%; }
.hos-table th { background: var(--hos-bg-band); color: var(--hos-ink-soft); font-family: var(--hos-mono); font-size: 10px; letter-spacing: .09em; padding: 12px 14px; text-align: left; text-transform: uppercase; }
.hos-table td { background: var(--hos-paper-strong); border-top: 1px solid var(--hos-line); font-size: 13px; padding: 14px; vertical-align: top; }

.hos-empty { color: var(--hos-ink-soft); padding: 44px 24px; text-align: center; }
.hos-empty h2 { color: var(--hos-ink); font-family: var(--hos-font); font-size: 27px; font-weight: 700; letter-spacing: -.04em; }

.hos-check-list { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 330px; overflow: auto; }
.hos-check { align-items: start; background: var(--hos-bg); border-radius: var(--hos-radius); display: flex; font-size: 12px; gap: 8px; padding: 10px; }
.hos-check input { margin-top: 2px; }

.hos-review-grid, .hos-idea-grid { display: grid; gap: 20px; }
.hos-review-card > summary { cursor: pointer; list-style: none; padding: 20px 24px; }
.hos-review-card > summary::-webkit-details-marker { display: none; }
.hos-review-card[open] > summary { border-bottom: 1px solid var(--hos-line); }
.hos-review-card summary h2 { font-family: var(--hos-font); font-size: 22px; font-weight: 700; letter-spacing: -.04em; margin: 0; }
.hos-review-card summary p { color: var(--hos-ink-soft); font-size: 12px; margin: 6px 0 0; }
.hos-review-card form { padding: 24px; }

.hos-ops-columns { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hos-record-stack { display: grid; gap: 8px; margin-top: 16px; }
.hos-record { background: var(--hos-bg); border-radius: var(--hos-radius); padding: 12px 14px; }
.hos-record strong { display: block; font-size: 13px; }
.hos-record span { color: var(--hos-ink-soft); display: block; font-size: 11px; }
.hos-record form { margin-top: 12px; }
.hos-record__details { border-top: 1px solid var(--hos-line); margin-top: 12px; padding-top: 10px; }
.hos-record__details > summary { color: var(--hos-orange-dark); cursor: pointer; font-size: 11px; font-weight: 800; text-transform: uppercase; }

.hos-access { align-items: center; background: var(--hos-black); display: flex; min-height: 100vh; padding: 24px; }
.hos-access__card { background: var(--hos-paper-strong); border: 1px solid var(--hos-line); border-radius: var(--hos-radius); box-shadow: var(--hos-shadow); margin: auto; max-width: 520px; padding: clamp(30px, 6vw, 58px); width: 100%; }
.hos-access__card h1 { font-family: var(--hos-font); font-size: 40px; font-weight: 700; letter-spacing: -.04em; }
.hos-access__card p { color: var(--hos-ink-soft); line-height: 1.6; margin-bottom: 28px; }

.hos-mobile-nav { display: none; }

@media (max-width: 980px) {
    .hos-app { display: block; }
    .hos-sidebar { display: none; }
    .hos-main { padding: 28px 20px 96px; }
    .hos-dashboard-grid, .hos-detail-grid { grid-template-columns: 1fr; }
    .hos-sticky { position: static; }
    .hos-mobile-nav {
        background: rgba(23,23,23,.98);
        bottom: 0;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        left: 0;
        padding: 8px max(8px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
        position: fixed;
        right: 0;
        z-index: 20;
    }
    .hos-mobile-nav a { align-items: center; color: var(--hos-steel); display: flex; flex-direction: column; font-size: 9px; gap: 4px; padding: 5px 2px; text-decoration: none; }
    .hos-mobile-nav a[aria-current="page"] { color: var(--hos-orange); }
    .hos-mobile-nav span { font-size: 17px; }
    .hos-notice--success {
        left: max(12px, env(safe-area-inset-left));
        right: max(12px, env(safe-area-inset-right));
        top: max(12px, env(safe-area-inset-top));
    }
}

@media (max-width: 720px) {
    .hos-page-head { align-items: start; flex-direction: column; }
    .hos-page-head h1 { font-size: 36px; }
    .hos-status-grid { grid-template-columns: repeat(2, 1fr); }
    .hos-week__head { grid-template-columns: 50px 1fr; }
    .hos-week__belief { border-left: 0; border-top: 1px solid var(--hos-line); grid-column: 1 / -1; padding: 14px 0 0; }
    .hos-card-grid { grid-template-columns: 1fr; }
    .hos-field-grid, .hos-field-grid--3, .hos-ops-columns { grid-template-columns: 1fr; }
    .hos-action-row { grid-template-columns: 40px minmax(0, 1fr); }
    .hos-action-row .hos-pill { grid-column: 2; justify-self: start; }
    .hos-check-list { grid-template-columns: 1fr; }
    .hos-main { padding-left: 15px; padding-right: 15px; }
    .hos-form-section { padding: 20px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .hos-notice--success {
        animation-name: hos-success-toast-reduced;
    }
}

@keyframes hos-success-toast-reduced {
    0%, 82% {
        opacity: 1;
        transform: none;
        visibility: visible;
    }
    100% {
        opacity: 0;
        transform: none;
        visibility: hidden;
    }
}

@media print {
    .hos-sidebar, .hos-mobile-nav, .hos-actions, .hos-filter, .hos-notice { display: none !important; }
    .hos-app { display: block; }
    .hos-main { padding: 0; }
    .hos-card { box-shadow: none; }
}
