/*
 | Menú lateral vintage — app/Views/partials/side_menu.php
 | El mismo en todas las vistas: la portada (landing.php) y las páginas del tema retro.
 | Autónomo (la portada no carga style.sys.retro.css): fuentes, colores y estampillas propios,
 | con prefijo "sm-" para no chocar con la plantilla de la portada ni con el tema.
 */
@font-face { font-family: "Lobster"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/retro/lobster-400-latin.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/retro/barlow-condensed-600-latin.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/retro/barlow-condensed-700-latin.woff2") format("woff2"); }

/* ===== Fondo oscuro ===== */
.sm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #2a2522a6;
    opacity: 0;
    visibility: hidden;
    transition: opacity .4s ease, visibility 0s .4s;
}
html.sm-is-open .sm-overlay { opacity: 1; visibility: visible; transition: opacity .4s ease, visibility 0s; }
html.sm-is-open,
html.sm-is-open body { overflow: hidden; }

/* ===== Panel ===== */
.side-menu {
    --sm-paper: #f8ecd5;
    --sm-ink: #2a2522;
    --sm-red: #b82e20;
    --sm-deep: #7e1f1a;
    --sm-teal: #155d61;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 10001;
    width: min(360px, 88vw);
    height: 100vh;
    height: 100dvh;
    visibility: hidden;
    transform: translateX(104%);
    filter: drop-shadow(-6px 0 14px #0000004d);   /* la sombra va aquí: la máscara del papel la recortaría */
    transition: transform .55s cubic-bezier(.2, .8, .2, 1), visibility 0s .55s;
}
html.sm-is-open .side-menu { visibility: visible; transform: translateX(0); transition: transform .55s cubic-bezier(.2, .8, .2, 1), visibility 0s; }

/* Papel con trama de puntos, borde izquierdo troquelado y filete interior */
.sm-paper {
    --r: 5px;
    box-sizing: border-box;
    height: 100%;
    overflow-y: auto;
    padding: 28px 28px 30px 36px;
    background-color: var(--sm-paper);
    background-image:
        radial-gradient(#7c4b2722 .65px, transparent .9px),
        radial-gradient(#a67d4d19 .8px, transparent 1px);
    background-size: 9px 9px, 16px 16px;
    background-position: 0 0, 3px 5px;
    box-shadow: inset 0 0 0 10px var(--sm-paper), inset 0 0 0 11px #7e1f1a33;
    color: var(--sm-ink);
    font-family: "Trebuchet MS", Arial, sans-serif;
    -webkit-mask: radial-gradient(circle var(--r) at 0 50%, #0000 98%, #000) 0 0 / 100% calc(3 * var(--r)) repeat-y;
    mask: radial-gradient(circle var(--r) at 0 50%, #0000 98%, #000) 0 0 / 100% calc(3 * var(--r)) repeat-y;
}

/* ===== Estampilla pequeña (cerrar, banderas) ===== */
.sm-stamp {
    position: relative;
    display: block;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    filter: drop-shadow(1px 2px 2px #0000004d);
    transform: rotate(var(--sm-tilt, 5deg));
    transition: transform .2s, filter .2s;
}
.sm-stamp:hover,
.sm-stamp:focus-visible { transform: rotate(0) translateY(-2px) scale(1.08); }
.sm-stamp:focus-visible { outline: 2px solid var(--sm-teal); outline-offset: 3px; }
.sm-stamp-paper {
    --r: 2.5px;
    display: block;
    padding: calc(2 * var(--r));
    background: #fff4dc;
    -webkit-mask:
        radial-gradient(var(--r), #0000 98%, #000) round calc(-1.5 * var(--r)) calc(-1.5 * var(--r)) / calc(3 * var(--r)) calc(3 * var(--r)),
        linear-gradient(#000 0 0) no-repeat 50% / calc(100% - 3 * var(--r)) calc(100% - 3 * var(--r));
    mask:
        radial-gradient(var(--r), #0000 98%, #000) round calc(-1.5 * var(--r)) calc(-1.5 * var(--r)) / calc(3 * var(--r)) calc(3 * var(--r)),
        linear-gradient(#000 0 0) no-repeat 50% / calc(100% - 3 * var(--r)) calc(100% - 3 * var(--r));
}
.sm-stamp-face { position: relative; display: grid; place-items: center; overflow: hidden; }

/* ===== Cabecera del panel ===== */
.sm-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 24px; }
.sm-brand { position: relative; display: inline-block; padding: 14px 32px 0 0; color: var(--sm-ink); text-decoration: none; }
.sm-brand:hover { color: var(--sm-ink); text-decoration: none; }
.sm-brand-text { display: block; font-family: "Lobster", "Brush Script MT", cursive; font-size: 30px; line-height: .86; text-align: center; transform: rotate(-4deg); }
.sm-brand svg { position: absolute; width: 44px; right: -2px; top: -2px; transform: rotate(14deg); }

.sm-close .sm-stamp-face {
    width: 34px;
    height: 34px;
    background: var(--sm-red);
    color: #fff4dc;
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    outline: 1px dashed #fff4dcaa;
    outline-offset: -4px;
}

.sm-title {
    margin: 0 0 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 900;
    font-size: 26px;
    letter-spacing: -.03em;
    color: var(--sm-deep);
    transform: rotate(-1.5deg);
}
.sm-title:before { content: "✺"; margin-right: 10px; font-size: 20px; color: var(--sm-red); }

/* ===== Lista: cada elemento ocupa todo el ancho; texto a la izquierda, "+" a la derecha ===== */
.side-menu .sm-nav { display: block; width: 100%; }
.sm-nav ul { display: block; width: 100%; list-style: none; margin: 0; padding: 0; }
.sm-nav li { display: block; width: 100%; }
.sm-nav details { display: block; width: 100%; }
.sm-nav > ul > li { border-bottom: 1px dashed #c9b28d; }
.sm-nav summary,
.sm-nav .sm-link {
    box-sizing: border-box;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
    border-radius: 0;
    background: none;
    white-space: normal;
    padding: 12px 4px;
    font-family: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
    font-weight: 700;
    font-size: 21px;
    letter-spacing: .01em;
    color: var(--sm-ink);
    text-decoration: none;
    cursor: pointer;
    list-style: none;
    transition: color .2s;
}
.sm-nav summary::-webkit-details-marker { display: none; }
.sm-nav summary:after {
    content: "+";
    flex: 0 0 auto;
    margin-left: auto;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--sm-teal);
    color: #fff4dc;
    font-size: 18px;
    line-height: 1;
    transition: background .25s, transform .25s;
}
.sm-nav details[open] > summary:after { content: "–"; background: var(--sm-red); transform: rotate(180deg); }
.sm-nav summary:hover,
.sm-nav .sm-link:hover { color: var(--sm-red); text-decoration: none; }
.sm-nav details ul { padding: 0 0 12px 12px; }
.sm-nav details li a {
    position: relative;
    display: block;
    padding: 6px 0 6px 20px;
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-size: 17px;
    color: #4a3e31;
    text-decoration: none;
}
.sm-nav details li a:before { content: "✳"; position: absolute; left: 0; top: 8px; font-size: 11px; font-style: normal; color: var(--sm-red); }
.sm-nav details li a:hover { color: var(--sm-red); text-decoration: none; }

/* ===== Idioma ===== */
.sm-lang { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.sm-lang .sm-stamp + .sm-stamp { --sm-tilt: -4deg; }
.sm-lang .sm-stamp-face { width: 34px; height: 24px; outline: 1px solid #0000001a; outline-offset: -1px; }
.sm-lang .sm-stamp-face svg { display: block; width: 100%; height: 100%; }
.sm-lang .sm-stamp[aria-pressed="true"] { cursor: default; }
.sm-lang .sm-stamp[aria-pressed="true"]:after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -9px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--sm-red);
    transform: translateX(-50%);
}

/* ===== Pie del panel ===== */
.sm-foot { margin-top: 30px; padding-top: 18px; border-top: 2px solid #7e1f1a33; font-size: 14px; line-height: 1.45; }
.sm-copy { margin: 0 0 14px; font-family: "Barlow Condensed", "Arial Narrow", Arial, sans-serif; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sm-deep); }
.sm-dev { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sm-dev img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid #fff4dc; box-shadow: 0 1px 3px #0004; }
.sm-dev b { display: block; }
.sm-dev small { display: block; color: #685843; }
.sm-dev a { color: inherit; }
.sm-iou { color: var(--sm-teal); font-weight: 700; text-decoration: underline; }
.sm-iou:hover { color: var(--sm-red); }
