/* ==================================================
   BEACONCORE — COMPONENTS
   Shared visual behaviour: panels, plates, images, cards.
   All hover/focus/active states live here.
   ================================================== */

/* --------------------------------------------------
   PANEL SYSTEM — unified grammar
   panel-hero  (was: artifact-hero, protocol-hero)
   panel-body  (was: artifact-body, protocol-overview, protocol-artifacts)
   -------------------------------------------------- */

/* Base (light / no saber-on) */
.panel-hero,
.panel-body,
.artifact-hero,
.artifact-body,
.protocol-hero,
.protocol-overview,
.protocol-artifacts {
    border: 1px solid #e2e2e2;
    border-radius: 6px;
    padding: 1.75rem;
    margin-bottom: 2rem;
    background: transparent;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Saber-on: hero panels */
html.saber-on .panel-hero,
html.saber-on .artifact-hero,
html.saber-on .protocol-hero {
    background: #050608;
    color: #dff8ff;
    border: 1px solid rgba(0, 180, 255, 0.16);
    border-radius: 10px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Saber-on: body panels */
html.saber-on .panel-body,
html.saber-on .artifact-body,
html.saber-on .protocol-overview,
html.saber-on .protocol-artifacts {
    background: #050608;
    color: #dff8ff;
    border: 1px solid rgba(0, 180, 255, 0.16);
    border-radius: 10px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

/* --------------------------------------------------
   MAIN CONTAINER HOVER — soft blue glow
   Fires on direct hover OR when a child sub-container is hovered (:has)
   -------------------------------------------------- */
html.saber-on .panel-hero:hover,
html.saber-on .artifact-hero:hover,
html.saber-on .protocol-hero:hover,
html.saber-on .panel-body:hover,
html.saber-on .artifact-body:hover,
html.saber-on .protocol-overview:hover,
html.saber-on .protocol-artifacts:hover,
html.saber-on .codex-class:hover,
html.saber-on .protocol-doctrine:hover,
html.saber-on .panel-hero:has(.artifact-plate:hover),
html.saber-on .artifact-hero:has(.artifact-plate:hover),
html.saber-on .panel-body:has(.artifact-plate:hover),
html.saber-on .artifact-body:has(.artifact-plate:hover),
html.saber-on .protocol-overview:has(.artifact-plate:hover),
html.saber-on .protocol-artifacts:has(.artifact-plate:hover),
html.saber-on .protocol-artifacts:has(.sf-card:hover) {
    border-color: rgba(0, 180, 255, 0.55);
    box-shadow: 0 0 22px rgba(0, 180, 255, 0.12), 0 0 6px rgba(0, 180, 255, 0.22);
}

/* Surfaces page panel override — resting */
html.saber-on body.surfaces-page .panel-hero,
html.saber-on body.surfaces-page .artifact-hero,
html.saber-on body.surfaces-page .surfaces-hero,
html.saber-on body.surfaces-page .panel-body,
html.saber-on body.surfaces-page .artifact-body,
html.saber-on body.surfaces-page .surfaces-body,
html.saber-on body.surfaces-page .surfaces-doctrine {
    background: #241a1a;
    border: 1px solid rgba(200, 80, 80, 0.22);
    border-radius: 12px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Surfaces page — red hover glow (direct hover or child plate hovered) */
html.saber-on body.surfaces-page .panel-hero:hover,
html.saber-on body.surfaces-page .artifact-hero:hover,
html.saber-on body.surfaces-page .panel-body:hover,
html.saber-on body.surfaces-page .artifact-body:hover,
html.saber-on body.surfaces-page .panel-hero:has(.artifact-plate:hover),
html.saber-on body.surfaces-page .artifact-hero:has(.artifact-plate:hover),
html.saber-on body.surfaces-page .panel-body:has(.artifact-plate:hover),
html.saber-on body.surfaces-page .artifact-body:has(.artifact-plate:hover) {
    border-color: rgba(220, 60, 60, 0.65);
    box-shadow: 0 0 22px rgba(200, 40, 40, 0.14), 0 0 6px rgba(220, 60, 60, 0.28);
}

/* Surfaces page — artifact-plate uses red left-rule */
html.saber-on body.surfaces-page .artifact-plate {
    border-left-color: rgba(200, 80, 80, 0.45);
}
html.saber-on body.surfaces-page .artifact-plate:hover {
    border-left-color: rgba(220, 60, 60, 0.85);
    box-shadow: -4px 0 18px rgba(200, 40, 40, 0.30), 0 0 24px rgba(200, 40, 40, 0.10);
    transform: translateX(3px);
}

/* --------------------------------------------------
   ARTIFACT PLATE — left-rule quote/callout
   -------------------------------------------------- */
.artifact-plate {
    border: none;
    border-left: 3px solid #e2e2e2;
    border-radius: 0;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.25rem;
    background: transparent;
    transition: border-left-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    cursor: default;
}

/* Saber-on resting state */
html.saber-on .artifact-plate {
    background: transparent;
    color: #dff8ff;
    border: none;
    border-left: 3px solid rgba(0, 180, 255, 0.35);
    border-radius: 0;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.25rem;
    transition: border-left-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    cursor: default;
}

/* Hover — applies on ALL pages including saber-on */
.artifact-plate:hover,
html.saber-on .artifact-plate:hover {
    border-left-color: #00FFE5;
    box-shadow: -4px 0 18px rgba(0, 255, 229, 0.35), 0 0 24px rgba(0, 255, 229, 0.08);
    transform: translateX(3px);
}

/* --------------------------------------------------
   ARTIFACT CONTEXT / PREAMBLE / ACTION
   -------------------------------------------------- */
.artifact-context {
    margin-bottom: 0.5rem;
    opacity: 0.75;
}

.artifact-preamble { margin-bottom: 1rem; }

.artifact-action { margin-top: 1.25rem; }

/* Protocol preamble alias */
.protocol-preamble { margin-bottom: 1rem; opacity: 0.85; }

/* --------------------------------------------------
   ARTIFACT BLOCK + IMAGES
   -------------------------------------------------- */
.artifact-block {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

/* Multi-image row — equal columns, wraps on small screens */
.artifact-block--row {
    justify-content: space-between;
    align-items: stretch;
    gap: 1rem;
    flex-wrap: wrap;
}
.artifact-block--row .artifact-image {
    flex: 1 1 140px;
    max-width: 32%;
    height: 200px;
    object-fit: cover;
    margin: 0;
}
@media (max-width: 600px) {
    .artifact-block--row .artifact-image { max-width: 100%; height: 180px; }
}
.artifact-image,
.artifact-hero-image {
    display: block;
    max-width: 500px;
    width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 8px;
    border: 1px solid #393836;
}

/* --------------------------------------------------
   SF GRID / CARDS (protocol.html)
   -------------------------------------------------- */
.sf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.sf-card {
    border: 1px solid rgba(0, 180, 255, 0.18);
    border-radius: 8px;
    padding: 1.25rem;
    background: rgba(5, 6, 8, 0.6);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    cursor: default;
}
.sf-card:hover {
    border-color: rgba(0, 255, 229, 0.55);
    box-shadow: 0 0 18px rgba(0, 255, 229, 0.18), 0 0 6px rgba(0, 255, 229, 0.35);
    transform: translateY(-2px);
}

.sf-card h3 { margin-bottom: 0.5rem; font-size: 1rem; }
.sf-card p  { margin-bottom: 0.75rem; font-size: 0.9rem; opacity: 0.85; }
.sf-card a  { font-size: 0.9rem; color: #00FFE5; text-decoration: none; }
.sf-card a:hover { text-decoration: underline; }

/* Provenance Plate — full-width anchor card */
.sf-card--prov {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
}
.prov-preview {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(0, 180, 255, 0.22);
    flex-shrink: 0;
    opacity: 0.88;
    transition: opacity 0.2s, box-shadow 0.2s;
}
.sf-card--prov:hover .prov-preview {
    opacity: 1;
    box-shadow: 0 0 12px rgba(0, 255, 229, 0.3);
}
.prov-text {
    flex: 1;
    text-align: center;
}
.prov-text h3 { margin-bottom: 0.5rem; font-size: 1rem; }
.prov-text p  { margin-bottom: 0.75rem; font-size: 0.9rem; opacity: 0.85; }
.prov-text a  { font-size: 0.9rem; color: #00FFE5; text-decoration: none; }
.prov-text a:hover { text-decoration: underline; }

@media (max-width: 600px) {
    .sf-card--prov { flex-direction: column; align-items: flex-start; }
    .prov-preview { width: 80px; height: 80px; }
    .prov-text { text-align: left; }
}

/* --------------------------------------------------
   CODEX CLASS SECTIONS (codex.html)
   -------------------------------------------------- */
.codex-class {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(0, 180, 255, 0.16);
    border-radius: 10px;
    padding: 1.75rem;
    margin-bottom: 2rem;
    background: #050608;
    color: #dff8ff;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

/* --------------------------------------------------
   PROTOCOL DOCTRINE SECTIONS (protocol.html, ignition.html)
   -------------------------------------------------- */
.protocol-doctrine {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(0, 180, 255, 0.16);
    border-radius: 10px;
    padding: 1.75rem;
    margin-bottom: 2rem;
    background: #050608;
    color: #dff8ff;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

/* --------------------------------------------------
   CODEX DEFINITION BLOCKS
   -------------------------------------------------- */
.codex-definition {
    border-left: 2px solid rgba(0, 180, 255, 0.25);
    padding: 0.5rem 1rem;
    margin-bottom: 1.5rem;
}

.codex-definition h3 {
    font-family: monospace;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
    color: #00FFE5;
}

/* --------------------------------------------------
   LINKS
   -------------------------------------------------- */
html.saber-on main a {
    color: rgba(0, 220, 255, 0.85);
    text-decoration: none;
}

html.saber-on main a:hover {
    color: #00FFE5;
    text-decoration: underline;
}

.sf-open {
    display: inline-block;
    margin-top: 0.5rem;
}
