/*
Theme Name: eRiders Web Theme
Theme URI: https://eriders.clusterofthings.com
Author: eRiders
Author URI: https://eriders.clusterofthings.com
Description: Tema MVP para eRiders en WordPress (web-first).
Version: 0.1.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: eriders-theme
*/

:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --text: #1d2630;
    --muted: #64748b;
    --primary: #0f766e;
    --primary-2: #0b5f59;
    --border: #dbe1ea;
    --radius: 14px;
    --shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background: #ffffff;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-2);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
}

.wrap {
    width: min(1120px, 92vw);
    margin: 0 auto;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 64px;
}

.brand {
    font-weight: 800;
    letter-spacing: 0.4px;
    font-size: 1.05rem;
}

.main-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.main-nav a {
    display: inline-block;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    color: #0f172a;
}

.main-nav a:hover,
.main-nav .current-menu-item>a {
    background: #d8f5ef;
    color: #0f766e;
}

main.site-main {
    padding: 1.2rem 0 2.5rem;
}

.hero {
    border: 1px solid var(--border);
    border-radius: 20px;
    background: radial-gradient(circle at 20% 10%, #d9f5ef 0%, #f7fbfd 45%, #ffffff 100%);
    padding: 1.4rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.2rem;
}

.hero h1 {
    margin: 0;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.hero p {
    margin: 0.65rem 0 0;
    color: var(--muted);
}

.hero-actions {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid transparent;
    padding: 0.52rem 0.9rem;
    font-weight: 600;
    line-height: 1;
}

.button.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.button.primary:hover {
    background: var(--primary-2);
    border-color: var(--primary-2);
    color: #fff;
}

.button.ghost {
    background: #fff;
    border-color: var(--border);
    color: #0f172a;
}

.button.ghost:hover {
    border-color: #9cc9c2;
    color: var(--primary-2);
}

.button.danger-outline {
    background: #fff;
    border-color: #fecaca;
    color: #b91c1c;
}

.button.danger-outline:hover {
    border-color: #fca5a5;
    background: #fef2f2;
}

.button.icon-action-btn,
.button.primary.icon-action-btn,
.button.ghost.icon-action-btn,
.button.danger-outline.icon-action-btn {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0.22rem;
    min-width: 40px;
    min-height: 40px;
}

.button.icon-action-btn:hover,
.button.primary.icon-action-btn:hover,
.button.ghost.icon-action-btn:hover,
.button.danger-outline.icon-action-btn:hover {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.button.icon-action-btn ion-icon {
    font-size: 1.52rem;
}

.button.icon-edit,
.button.icon-close,
.button.icon-save,
.button.icon-cancel,
.button.icon-add {
    color: #111827;
}

.button.icon-delete {
    color: #b91c1c;
}

.stats {
    margin-top: 1rem;
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.stat {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.6rem 0.7rem;
    background: #fff;
}

.stat strong {
    display: block;
    font-size: 1.1rem;
}

.stat span {
    color: var(--muted);
    font-size: 0.85rem;
}

.section-title {
    margin: 1.2rem 0 0.8rem;
    font-size: 1.15rem;
}

.grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.13);
}

.card-body {
    padding: 0.9rem;
}

.card h3 {
    margin: 0 0 0.45rem;
    font-size: 1rem;
}

.card p {
    margin: 0;
}

.card .meta+p {
    margin-top: 0.45rem;
}

.meta {
    color: var(--muted);
    font-size: 0.9rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid #bfe8df;
    background: #ebfbf7;
    color: #0f766e;
    font-size: 0.76rem;
    padding: 0.18rem 0.5rem;
    margin-bottom: 0.45rem;
}

.post-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    background: #edf2f7;
}

.content-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 1rem;
}

.content-card h1 {
    margin-top: 0;
}

.event-meta-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.65rem;
    margin: 0.9rem 0;
}

.event-meta-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    background: #f8fbff;
}

.event-meta-item small {
    display: block;
    color: var(--muted);
    margin-bottom: 0.15rem;
}

.member-avatar {
    background: linear-gradient(180deg, #e6f4f1, #ecf4fb);
}

.member-phone {
    margin-top: 0.45rem;
    display: inline-flex;
    font-weight: 600;
}

.members-actions {
    margin: 0.4rem 0 0.75rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.members-search-wrap {
    margin: 0.5rem 0 0.8rem;
}

.members-search-input {
    width: 100%;
    border: 1px solid #cfdae6;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font-size: 0.98rem;
    padding: 0.68rem 0.85rem;
    outline: none;
}

.members-search-input::placeholder {
    color: #90a0b3;
}

.members-search-input:focus {
    border-color: #7dd3c5;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}

.empty-state {
    border: 1px dashed #bcd3df;
    border-radius: 12px;
    background: #f8fcff;
    padding: 1rem;
    color: #476175;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0 1rem;
}

.filter-link {
    appearance: none;
    cursor: pointer;
    font: inherit;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    color: #334155;
    background: #fff;
}

.filter-link.active {
    border-color: #99e3d8;
    background: #e7faf6;
    color: #0f766e;
}

.members-loading {
    color: var(--muted);
    margin: 0.2rem 0 0.95rem;
}

.members-dialog {
    width: min(620px, calc(100% - 1.1rem));
    border: 0;
    padding: 0;
    background: transparent;
}

.members-dialog[open] .content-card {
    animation: dialog-pop-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.members-dialog::backdrop {
    background: rgba(2, 6, 23, 0.55);
}

@keyframes dialog-pop-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.members-form-card,
.members-detail-card {
    margin: 0;
}

.members-form-card h3,
.members-detail-card h3 {
    margin-top: 0;
}

.members-form-grid {
    display: grid;
    gap: 0.65rem;
}

.members-form-grid label {
    display: grid;
    gap: 0.34rem;
    font-size: 0.92rem;
    color: #1e293b;
}

.members-form-grid input,
.members-form-grid select,
.members-form-grid textarea {
    border: 1px solid #cfdae6;
    border-radius: 10px;
    padding: 0.62rem 0.74rem;
    font-size: 0.96rem;
    background: #fff;
    color: #0f172a;
}

.members-form-grid input:focus,
.members-form-grid select:focus,
.members-form-grid textarea:focus {
    outline: none;
    border-color: #7dd3c5;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}

.members-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    margin-top: 0.25rem;
}

.members-form-actions .button {
    cursor: pointer;
}

.event-detail-web {
    display: grid;
    gap: 0.8rem;
}

.event-detail-hero-web {
    width: 100%;
    height: 220px;
    border-radius: 12px;
    object-fit: cover;
    background: #e2e8f0;
}

.event-detail-head-web .event-detail-title-web {
    margin: 0;
}

.event-detail-head-web .meta {
    margin-top: 0.2rem;
}

.event-detail-section-web {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fbfdff;
    padding: 0.75rem;
}

.event-detail-section-web h4 {
    margin: 0 0 0.55rem;
    font-size: 0.95rem;
    color: #0f172a;
}

.event-detail-section-web p {
    margin: 0;
}

.member-detail-web {
    display: grid;
    gap: 0.7rem;
}

.member-detail-head-web h3 {
    margin: 0;
}

.member-detail-head-web .meta {
    margin-top: 0.2rem;
}

.member-detail-avatar {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin-bottom: 0.5rem;
    background: #e2e8f0;
}

.member-detail-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #0f172a;
    background: linear-gradient(180deg, #d9e8f7, #e8f1fb);
}

.member-detail-grid-web {
    display: grid;
    gap: 0.4rem;
}

.member-detail-grid-web p {
    margin: 0;
}

.album-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-weight: 600;
    background: linear-gradient(180deg, #e8eef6, #dde7f3);
}

.album-grid-web {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.album-thumb-btn {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.album-thumb-web {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    display: block;
    background: #e2e8f0;
}

.album-viewer-card {
    width: min(840px, calc(100% - 1.1rem));
}

.album-viewer-wrap {
    display: grid;
    gap: 0.4rem;
}

.album-viewer-title {
    margin: 0;
}

.album-viewer-image {
    width: 100%;
    max-height: min(68vh, 760px);
    object-fit: contain;
    border-radius: 12px;
    background: #0f172a;
}

.album-viewer-actions {
    align-items: center;
}

.skeleton-block,
.skeleton-line {
    position: relative;
    overflow: hidden;
    background: #e5edf6;
}

.skeleton-block::after,
.skeleton-line::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
    animation: skeleton-shimmer 1.25s ease-in-out infinite;
}

.skeleton-line {
    height: 12px;
    border-radius: 8px;
}

.skeleton-title {
    height: 22px;
    width: 72%;
}

.skeleton-small {
    width: 46%;
}

.skeleton-wide {
    width: 86%;
}

@keyframes skeleton-shimmer {
    100% {
        transform: translateX(100%);
    }
}

.site-footer {
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.92rem;
    padding: 1rem 0 2rem;
}

.pagination {
    margin-top: 1rem;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-right: 0.35rem;
    color: #334155;
    background: #fff;
}

.pagination .page-numbers.current {
    border-color: #99e3d8;
    background: #e7faf6;
    color: #0f766e;
}

body.has-bottom-tabs {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

.tabbar-bottom {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: min(760px, 100%);
    z-index: 40;
    border-top: 1px solid #d6dde7;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 0.3rem 0.2rem calc(0.35rem + env(safe-area-inset-bottom));
}

.tab-item {
    min-height: 50px;
    padding: 0.3rem 0.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    color: #475569;
    font-size: 0.74rem;
    font-weight: 600;
    border-radius: 10px;
}

.tab-item .tab-icon {
    font-size: 1.18rem;
    color: #94a3b8;
}

.tab-item.active {
    color: #0f766e;
    background: #ebfbf7;
}

.tab-item.active .tab-icon {
    color: #0f766e;
}

.tab-item.tab-logout {
    color: #9f1239;
}

.tab-item.tab-logout .tab-icon {
    color: #e11d48;
}

body.is-login-gate .site-header,
body.is-login-gate .site-footer {
    display: none;
}

body.is-login-gate .tabbar-bottom {
    display: none;
}

body.is-login-gate main.site-main {
    min-height: 100dvh;
    padding: 0;
    background: #ffffff;
}

body.is-login-gate .wrap {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1.2rem;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-screen {
    width: min(400px, 100%);
}

.login-card-web {
    border: 1px solid #d7dee8;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
    background: #fff;
    margin: 0 auto;
}

.login-card-logo {
    width: 100%;
    display: block;
    object-fit: contain;
    object-position: center center;
    height: 190px;
    background: #000;
}

.login-card-body {
    padding: 0.95rem 1rem 1rem;
}

.login-card-body h1 {
    margin: 0;
    font-size: 1.2rem;
}

.login-card-body p {
    margin: 0.4rem 0 0.8rem;
    color: var(--muted);
    font-size: 0.94rem;
}

.login-form-web {
    display: grid;
    gap: 0.65rem;
}

.login-item {
    border: 1px solid #dde4ee;
    border-radius: 12px;
    background: #fff;
    padding: 0.55rem 0.7rem 0.62rem;
}

.login-form-web label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}

.login-form-web input[type="text"],
.login-form-web input[type="password"] {
    width: 100%;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: #0f172a;
    padding: 0.12rem 0;
    outline: none;
    font-size: 0.98rem;
}

.login-form-web input[type="text"]:focus,
.login-form-web input[type="password"]:focus {
    box-shadow: none;
}

.login-item:focus-within {
    border-color: #7dd3c5;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.login-form-web input::placeholder {
    color: #94a3b8;
}

.remember-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: #475569;
}

.login-form-web .button {
    margin-top: 0.15rem;
    width: 100%;
    border: 0;
    cursor: pointer;
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    font-size: 0.98rem;
}

@media (max-width: 480px) {
    body.is-login-gate .wrap {
        padding: 0.9rem;
    }

    .login-card-logo {
        height: 170px;
    }
}

.login-error {
    border: 1px solid #f7c0c0;
    background: #fff1f1;
    color: #b91c1c;
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    margin: 0 0 0.8rem;
}

@media (max-width: 780px) {
    .header-inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 0.7rem 0;
    }

    .post-thumb {
        height: 160px;
    }

    .members-actions .button {
        flex: 0 0 auto;
    }

    .members-form-actions {
        flex-direction: row;
        justify-content: flex-end;
        flex-wrap: nowrap;
    }

    .members-form-actions .button {
        width: auto;
    }

    .album-grid-web {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}