/*
 * Shared styles for the pages built from the Stitch frames.
 *
 * 1. Tokens and stitch-* component classes, shared with the homepage (Frame 01).
 * 2. The base and reset for a frame page body (.stitch-frame).
 *
 * The utility classes used inside a frame body are generated into stitch-frames.css
 * (npm run build:stitch). Nothing in this file redefines a Bootstrap or Tailwind
 * utility name, so it is safe to load on every page.
 *
 * This file exists twice and both copies must match: css/ is served in production
 * (the web root is the project root) and public/css/ under `php artisan serve`.
 */

/* Stitch Design System Color Tokens & Utilities */
:root {
    --stitch-primary: #b20015;
    --stitch-primary-container: #d92228;
    --stitch-primary-fixed: #ffdad6;
    --stitch-surface: #f8f9fb;
    --stitch-surface-low: #f3f4f6;
    --stitch-surface-lowest: #ffffff;
    --stitch-inverse-surface: #111827;
    --stitch-inverse-on: #f0f1f3;
    --stitch-on-surface: #191c1e;
    --stitch-secondary: #575e70;
    --stitch-border: #e5e7eb;

    /* Shared component tokens, from the "mm" variable collection in
       docs/design/shared-components.figcraft. New CSS reads these instead of
       repeating hex values. */
    --mm-color-primary: #b20015;
    --mm-color-primary-hover: #d92228;
    --mm-color-primary-soft: #ffdad6;
    --mm-color-ink: #191c1e;
    --mm-color-ink-muted: #575e70;
    --mm-color-dark: #111827;
    --mm-color-surface: #f8f9fb;
    --mm-color-surface-low: #f3f4f6;
    --mm-color-card: #ffffff;
    --mm-color-border: #e5e7eb;
    --mm-color-success: #047857;
    --mm-radius-sm: 4px;
    --mm-radius-md: 8px;
    --mm-control-height: 36px;
    --mm-control-height-touch: 44px;
}

.bg-stitch-primary { background-color: #b20015 !important; }
.bg-stitch-primary-container { background-color: #d92228 !important; }
.text-stitch-primary { color: #b20015 !important; }
.border-stitch-primary { border-color: #b20015 !important; }
.bg-stitch-dark { background-color: #111827 !important; }
.text-stitch-dark { color: #111827 !important; }
.bg-stitch-surface-low { background-color: #f3f4f6 !important; }

/* Button Hover and Micro-interactions */
.btn-stitch-primary {
    background-color: #b20015;
    color: #ffffff !important;
    transition: all 0.2s ease-in-out;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
}
.btn-stitch-primary:hover {
    background-color: #d92228 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(178, 0, 21, 0.25);
    transform: translateY(-1px);
}

.btn-stitch-dark {
    background-color: #111827;
    color: #f0f1f3 !important;
    transition: all 0.2s ease-in-out;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
}
.btn-stitch-dark:hover {
    background-color: #374151 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

.btn-stitch-outline {
    background-color: transparent;
    border: 1px solid #111827;
    color: #111827 !important;
    transition: all 0.2s ease-in-out;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
}
.btn-stitch-outline:hover {
    background-color: #b20015 !important;
    border-color: #b20015 !important;
    color: #ffffff !important;
}

/* Hover Cards Lift */
.stitch-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.25s ease;
    text-decoration: none !important;
}
.stitch-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    border-color: #cbd5e1;
}

/* Search input reset */
.stitch-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(178, 0, 21, 0.2);
    border-color: #b20015;
}

/* Responsive spacing container */
.stitch-container {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}
@media (min-width: 768px) {
    .stitch-container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}
@media (min-width: 1280px) {
    .stitch-container {
        padding-left: 3rem;
        padding-right: 3rem;
    }
}

/* Section padding */
.stitch-section {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
}
@media (max-width: 767px) {
    .stitch-section {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

/* ================================================================== */
/* FRAME PAGE BODY                                                     */
/* A page rebuilt from a Stitch frame wraps its content in             */
/* <div class="stitch-frame" data-stitch-frame="NN">. The frames were  */
/* designed on Tailwind's reset; this restores it inside that wrapper  */
/* only, leaving the Bootstrap navbar and footer as they are.          */
/* ================================================================== */

.stitch-frame {
    background-color: #f8f9fb;
    color: #191c1e;
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* :where() keeps the reset at element-level specificity: it beats Bootstrap's
   reboot (loaded earlier) but any class, Bootstrap's or generated, still wins. */
:where(.stitch-frame),
:where(.stitch-frame) *,
:where(.stitch-frame) ::before,
:where(.stitch-frame) ::after {
    box-sizing: border-box;
    border-width: 0;
    border-style: solid;
    border-color: #e5e7eb;
    /* The site's Tailwind 4 bundle scans these views too and writes -translate-y-1/2,
       rotate-* and scale-* as the standalone translate / rotate / scale properties;
       the generated Tailwind 3 sheet writes the same classes as `transform`. Both
       would apply, moving every centred control twice. This rule is unlayered, so it
       beats the bundle's layered rules and leaves `transform` in charge. */
    translate: none;
    rotate: none;
    scale: none;
}

/* Tailwind 4 spaces `space-y-*` children with margin-block-end on all but the last
   child; the generated Tailwind 3 rule uses margin-top on all but the first. The
   first child would carry both in a flex or grid column, doubling the first gap. */
:where(.stitch-frame) :where([class*="space-y-"]) > :where(*) {
    margin-block-end: 0;
}
:where(.stitch-frame) :where([class*="space-x-"]) > :where(*) {
    margin-inline-end: 0;
}
:where(.stitch-frame) h1,
:where(.stitch-frame) h2,
:where(.stitch-frame) h3,
:where(.stitch-frame) h4,
:where(.stitch-frame) h5,
:where(.stitch-frame) h6 {
    margin: 0;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
}
:where(.stitch-frame) p,
:where(.stitch-frame) blockquote,
:where(.stitch-frame) dl,
:where(.stitch-frame) dd,
:where(.stitch-frame) figure,
:where(.stitch-frame) pre,
:where(.stitch-frame) label {
    margin: 0;
}
:where(.stitch-frame) ol,
:where(.stitch-frame) ul,
:where(.stitch-frame) menu {
    list-style: none;
    margin: 0;
    padding: 0;
}
:where(.stitch-frame) a {
    color: inherit;
    text-decoration: inherit;
}
:where(.stitch-frame) img,
:where(.stitch-frame) svg,
:where(.stitch-frame) video,
:where(.stitch-frame) canvas {
    display: block;
    vertical-align: middle;
}
:where(.stitch-frame) img,
:where(.stitch-frame) video {
    max-width: 100%;
    height: auto;
}
:where(.stitch-frame) button,
:where(.stitch-frame) input,
:where(.stitch-frame) select,
:where(.stitch-frame) textarea {
    font-family: inherit;
    font-size: 100%;
    font-weight: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    color: inherit;
    margin: 0;
    padding: 0;
}
:where(.stitch-frame) button {
    background-color: transparent;
    background-image: none;
    cursor: pointer;
}
:where(.stitch-frame) button:disabled {
    cursor: default;
}
:where(.stitch-frame) table {
    border-collapse: collapse;
    border-color: inherit;
    text-indent: 0;
}
:where(.stitch-frame) th {
    font-weight: inherit;
    text-align: inherit;
}
:where(.stitch-frame) hr {
    height: 0;
    margin: 0;
    color: inherit;
    border-top-width: 1px;
    opacity: 1;
}

.stitch-frame .material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
    display: inline-block;
    line-height: 1;
}
.stitch-frame .material-symbols-outlined.fill-current {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Keyboard focus. Many inputs carry `focus:outline-none`, which compiles to an
   !important rule; this one is more specific, so every control in a frame keeps a
   visible ring when it is reached with the keyboard. */
.stitch-frame[data-stitch-frame] :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid #b20015 !important;
    outline-offset: 2px !important;
}

/* The generated utilities are !important, so a bare [x-cloak] rule would lose to
   `flex` or `grid` on the same element. For the same reason frame views hide
   elements with x-show.important, never plain x-show. */
.stitch-frame[data-stitch-frame] [x-cloak] {
    display: none !important;
}

/* Page gutter used by every frame: 1440px max, 16 / 32 / 48px side padding. */
.stitch-shell {
    width: 100%;
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}
@media (min-width: 768px) {
    .stitch-shell {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}
@media (min-width: 1024px) {
    .stitch-shell {
        padding-left: 3rem;
        padding-right: 3rem;
    }
}
