/* kol-app.css — global baseline + shared components.
   Typography floor (Patterns V2 §14): body ≥14px, nothing below 11px. */

/* El bloque Oceano que vivía aquí duplicaba los mismos nombres que
   kol-tokens.css ya re-apuntó a la paleta miel, y al cargarse después
   deshacía la migración: --miel-claro volvía a ser azul (#E8F0FA) y con
   él --brand-soft y --cream, que es lo que teñía de azul las pestañas
   del muro. Solo sobrevive --radius, que kol-tokens no define. */
:root {
    --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Rubik', system-ui, sans-serif;
    font-size: 15px;              /* never below 14px */
    line-height: 1.5;
    color: var(--tinta);
    background: var(--panal);
}

small, .text-small, caption, .hint, label {
    font-size: 12px;              /* never below 11px */
}

h1, h2, h3 { line-height: 1.15; }

a { color: inherit; }

.wrapper { display: block; min-height: 100vh; }

/* Two-bar shell (S15): dark brand bar + white main-nav tabs, both sticky. */
.appbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 54px;
    padding: 0 18px;
    background: var(--tinta);
    color: #FFFFFF;
}
.appbar-brand {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: .01em;
    color: #FFFFFF;
    text-decoration: none;
    flex: none;
}
.appbar-spacer { flex: 1; }
.appbar-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #D7DEE8;
    transition: background .12s ease, color .12s ease;
}
.appbar-icon:hover { background: rgba(255,255,255,.12); color: #FFFFFF; }
.appbar-icon.active { color: #FFFFFF; background: rgba(255,255,255,.16); }
.appbar-icon .nav-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    margin-left: 0;
}
.appbar-user { position: relative; }
.avatar-chip {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.55);
    background: var(--miel-claro);
    color: #1E5AA8;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.user-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 44px;
    min-width: 200px;
    background: #FFFFFF;
    color: var(--tinta);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(16, 24, 40, .18);
    padding: 8px 0;
    z-index: 110;
}
.user-menu.open { display: block; }
.user-menu-name {
    padding: 8px 16px 10px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid #F0F2F5;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-menu a {
    display: block;
    padding: 8px 16px;
    font-size: 14px;
    color: #52657E;
    text-decoration: none;
}
.user-menu a:hover { background: #F3F5F7; color: #12263E; }
.user-menu a.active { color: #1E5AA8; font-weight: 600; }
.user-menu .nav-logout { border-top: 1px solid #F0F2F5; margin-top: 6px; }

.mainnav {
    position: sticky;
    top: 54px;
    z-index: 90;
    background: #FFFFFF;
    border-bottom: 1px solid #E4E7EB;
}
.mainnav-inner {
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-wrap: wrap;          /* never clip dropdown menus with overflow */
    gap: 2px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
}
.mainnav a, .nav-drop-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    padding: 13px 14px 11px;
    border: none;
    border-bottom: 3px solid transparent;
    background: none;
    color: #52657E;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: color .12s ease, border-color .12s ease;
}
.mainnav a:hover, .nav-drop-btn:hover { color: #12263E; }
.mainnav a.active,
.nav-drop.active > .nav-drop-btn {
    color: var(--miel);
    border-bottom-color: var(--miel);
    font-weight: 600;
}
.drop-caret { font-size: 10px; opacity: .7; }
.nav-drop { position: relative; display: flex; }
.nav-drop-menu {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 190px;
    background: #FFFFFF;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 28px rgba(16, 24, 40, .16);
    padding: 6px 0;
    z-index: 95;
}
.nav-drop.open .nav-drop-menu { display: block; }
.nav-drop-menu a {
    display: block;
    padding: 9px 16px;
    border-bottom: none;
}
.nav-drop-menu a:hover { background: #F3F5F7; }
.nav-drop-menu a.active { border-bottom: none; }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: #FFFFFF;
    cursor: pointer;
}
@media (max-width: 900px) {
    .nav-toggle { display: block; }
    .appbar-brand { font-size: 17px; }
    .mainnav { display: none; }
    .mainnav.open { display: block; }
    .mainnav-inner { flex-direction: column; align-items: stretch; padding: 6px 0; }
    .mainnav a, .nav-drop-btn { border-bottom: none; padding: 11px 20px; width: 100%; text-align: left; }
    .mainnav a.active, .nav-drop.active > .nav-drop-btn { background: #E8F0FA; border-bottom: none; }
    .nav-drop { flex-direction: column; }
    .nav-drop-menu {
        display: block;
        position: static;
        box-shadow: none;
        padding: 0 0 4px 14px;
        min-width: 0;
    }
    .nav-drop .drop-caret { display: none; }
}

.main-content {
    padding: 24px;
    max-width: 960px;
    margin: 0 auto;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    background: var(--miel);
    color: #FFFFFF;
    cursor: pointer;
    text-decoration: none;
    transition: background .12s ease;
}
.btn:hover { background: var(--cera); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: #FFFFFF; border: 1px solid #DDE3EA; color: #12263E; }
.btn-ghost:hover { background: #F3F5F7; }

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 4px; color: var(--tinta-70); }
.field input, .field select, .field textarea {
    width: 100%;
    font: inherit;
    padding: 9px 12px;
    border: 1px solid #DDE3EA;
    border-radius: var(--radius);
    background: var(--blanco);
    transition: border-color .12s ease, box-shadow .12s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: #1E5AA8;
    box-shadow: 0 0 0 3px rgba(30, 90, 168, .12);
}
.field .field-error { color: var(--error); font-size: 12px; margin-top: 3px; }

/* Notifications (utils.js showNotification)
   Los estilos del aviso viven ahora en kol-shell.css, con el resto de los
   componentes compartidos: este fichero solo lo carga feed.html, asi que un
   error en cualquiera de las otras 33 pantallas salia como texto suelto
   sobre la pagina, sin recuadro y pegado al borde izquierdo. */

/* Empty states — every list gets one with a next action (spec §9.5) */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--tinta-70);
}

/* Modal shell (S13/S19) — shared by feed composer, stores and vendors. */
.modal-overlay { position: fixed; inset: 0; z-index: 200;
    background: rgba(18, 38, 62, .45);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 6vh 16px 16px; overflow-y: auto; }
.modal-box { background: #fff; border-radius: 14px; width: 100%; max-width: 640px;
    box-shadow: 0 12px 40px rgba(16, 24, 40, .25); }
.modal-head { display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; border-bottom: 1px solid #F0F2F5; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { border: none; background: none; cursor: pointer; font-size: 16px;
    color: #8B99AC; padding: 4px 8px; border-radius: 8px; }
.modal-close:hover { background: #F0F2F5; color: #12263E; }

/* Auth pages — centered card, no nav */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--blanco);
    border: none;
    border-radius: 14px;
    padding: 32px 28px;
    box-shadow: 0 4px 24px rgba(16, 24, 40, .10);
}
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card .sub { color: var(--tinta-70); margin-bottom: 20px; font-size: 14px; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 6px; }
.auth-links { margin-top: 16px; font-size: 13px; text-align: center; }
.auth-links a { color: var(--cera); }
.banner {
    background: var(--miel-claro);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* Org switcher */
.org-list { list-style: none; }
.org-list li {
    background: var(--blanco);
    border: 1px solid #E4E7EB;
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.org-list li:hover { border-color: var(--miel); }
.org-list .role { font-size: 12px; color: var(--tinta-70); }

/* Language switcher inside the user menu */
.user-menu .nav-lang { display: flex; gap: 6px; padding: 8px 16px; }
.user-menu .nav-lang a {
    display: inline-block; padding: 2px 8px; font-size: 12px; border-radius: 6px;
    color: #8B99AC; text-decoration: none;
}
.user-menu .nav-lang a:hover { background: #F3F5F7; color: #12263E; }
.user-menu .nav-lang a.active { background: #E8F0FA; color: #1E5AA8; font-weight: 600; }

/* Community context in the brand bar: logo + name, select with 2+ communities. */
.nav-community { display: flex; align-items: center; gap: 8px; min-width: 0; }
.nav-community img { height: 24px; border-radius: 5px; display: block; }
.nav-community .nav-community-name {
    font-size: 14px; font-weight: 500; color: #D7DEE8;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px;
}
.nav-community select {
    padding: 6px 8px; border-radius: 8px; font-size: 13px; max-width: 220px;
    background: rgba(255,255,255,.12); color: #FFFFFF;
    border: 1px solid rgba(255,255,255,.25);
}
.nav-community select option { color: #12263E; }
@media (max-width: 560px) {
    .nav-community .nav-community-name { display: none; }
    .nav-community select { max-width: 130px; }
}

/* Member public page header */
.profile-header { margin-bottom: 16px; }
.profile-banner {
    height: 160px; background: linear-gradient(120deg, #1E5AA8, #3E7BC4);
    background-size: cover; background-position: center;
}
.profile-id { display: flex; align-items: flex-end; gap: 16px; padding: 0 20px 16px; position: relative; }
.profile-avatar {
    width: 96px; height: 96px; border-radius: 50%; margin-top: -48px; flex: none;
    background: #E8F0FA; background-size: cover; background-position: center;
    border: 4px solid var(--blanco); box-shadow: 0 2px 8px rgba(16,24,40,.18);
    display: flex; align-items: center; justify-content: center;
    font-size: 40px; font-weight: 700; color: #1E5AA8;
}
.profile-id-text { flex: 1; min-width: 0; padding-bottom: 2px; }
.profile-id-text h1 { font-size: 22px; margin: 0; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 4px; }
.mini-post { padding: 8px 0; border-bottom: 1px solid rgba(18,38,62,.08); font-size: 14px; }
.mini-post:last-child { border-bottom: none; }
.mini-post-img {
    display: block; margin-top: 8px; border-radius: 10px;
    max-height: 260px; width: 100%; object-fit: cover;
}

/* S15-W2: member page — FB/WIT layout: info rail left, member feed right. */
.main-content.member-wide { max-width: 1080px; }
.member-cols {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.member-col-side .card, .member-col-main .card { margin-bottom: 16px; }
.follow-counts { font-weight: 500; }
.follow-counts b { color: var(--tinta); }
/* S19.4: member storefront cards */
.member-store { display: flex; gap: 12px; align-items: center; padding: 9px 0;
    text-decoration: none; color: inherit;
    border-bottom: 1px solid rgba(18,38,62,.08); }
.member-store:last-child { border-bottom: none; }
.ms-img { flex: none; width: 64px; height: 48px; border-radius: 8px;
    background-size: cover; background-position: center; background-color: #E8F0FA; }
.ms-ph { display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px; }
.ms-body { display: flex; flex-direction: column; min-width: 0; }
@media (max-width: 900px) {
    .member-cols { grid-template-columns: 1fr; }
}

/* S19.5: generic social bar (reactions + comments on any object) */
.social-bar { margin-top: 8px; font-size: 13px; }
.social-bar .soc-react, .social-bar .soc-toggle {
    border: 1px solid #E4E7EB; background: #fff; border-radius: 16px;
    padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer;
    color: #52657E; margin-right: 6px;
}
.social-bar .soc-react.on { border-color: #d92c2c; color: #d92c2c; background: #FDF0F0; }
.soc-comments { margin-top: 8px; }
.soc-comment { padding: 5px 0; border-bottom: 1px solid #F3F5F7; font-size: 13.5px; }
.soc-comment:last-child { border-bottom: none; }
.soc-author { font-weight: 700; color: #12263E; text-decoration: none; }
.soc-author:hover { color: #1E5AA8; text-decoration: underline; }
.soc-form { display: flex; gap: 6px; margin-top: 8px; }
.soc-form input { flex: 1; padding: 8px 12px; border: 1px solid #E4E7EB;
    border-radius: 8px; font: inherit; font-size: 13px; }

/* S22: group picker — a second context level beside the community switcher. */
.nav-group { display: flex; align-items: center; margin-left: 6px; }
.nav-group select { font: inherit; font-size: 13px; padding: 5px 10px;
    border-radius: 8px; border: 1px solid rgba(255,255,255,.25);
    background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
    max-width: 190px; }
.nav-group select option { color: #12263E; }
