/**
 * Public Pages Shared Styles - Municipalidad Distrital de Talavera
 * Sistema de Diseño Institucional Premium 2026
 * Paleta: Azul Celeste (#0284C7) / Blanco / Rojo Claro (#F87171)
 * Tipografía: Plus Jakarta Sans / Figtree
 * Animaciones: GSAP + ScrollTrigger + Lenis
 * WCAG 2.2 AA compliant
 */

/* ============================================
   1. DESIGN TOKENS - SCOPE PUBLIC
   ============================================ */
.public-page {
    --page-hero-height: clamp(350px, 45svh, 500px);
    --section-py: clamp(4rem, 7vw, 7rem);
    --section-py-sm: clamp(3rem, 5vw, 5rem);

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    font-family: var(--font-sans);
    color: var(--ink-800);
    line-height: 1.6;
    background-color: var(--notebook-paper-color);
    background-image: var(--notebook-paper-background);
    background-size: var(--notebook-paper-background-size);
    background-position: var(--notebook-paper-background-position);
    background-repeat: no-repeat, repeat, no-repeat;
    background-attachment: fixed, fixed, fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: clip;
}

.public-page *,
.public-page *::before,
.public-page *::after {
    box-sizing: border-box;
}

.public-page img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   2. CONTENEDORES Y SECCIONES
   ============================================ */
.public-page .container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.public-page .section {
    position: relative;
    padding: var(--section-py) 0;
}

.public-page .section--gray {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.72) 0%, rgba(255, 255, 255, 0.62) 100%);
}

.public-page .section--white {
    background: rgba(255, 255, 255, 0.58);
}

.public-page .section--tinted {
    background: linear-gradient(180deg, rgba(240, 249, 255, 0.72) 0%, rgba(255, 255, 255, 0.62) 100%);
}

/* ============================================
   3. ENCABEZADOS DE SECCIÓN
   ============================================ */
.section-header {
    text-align: center;
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.section-header--left {
    text-align: left;
    margin-left: 0;
}

.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: var(--space-3);
}

.section-eyebrow::before {
    content: '';
    width: 28px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-pill);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.875rem, 4vw, 2.75rem);
    font-weight: 800;
    color: var(--ink-900);
    line-height: 1.12;
    margin: 0 0 var(--space-4);
    letter-spacing: -0.025em;
}

.section-title__badge {
    display: inline-block;
    padding: 0.18em 0.5em;
    color: var(--white);
    background: linear-gradient(135deg, var(--ink-900) 0%, var(--ink-800) 100%);
    border-radius: var(--radius-sm);
    font-weight: 800;
    letter-spacing: -0.015em;
    margin-right: 0.35em;
}

.section-title__accent {
    color: var(--primary);
    font-weight: 800;
}

.section-subtitle {
    font-size: clamp(1rem, 1.5vw, 1.0625rem);
    color: var(--ink-500);
    line-height: 1.7;
    margin: 0;
    max-width: 64ch;
}

.section-header:not(.section-header--left) .section-subtitle {
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   4. SISTEMA DE BOTONES (Vidrio Cristal)
   ============================================ */
.btn,
.btn-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    min-height: 48px;
    padding: 0 1.5rem;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.01em;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    user-select: none;
    position: relative;
    overflow: hidden;
    transition:
        transform var(--duration-normal) var(--ease-smooth),
        box-shadow var(--duration-normal) var(--ease-smooth),
        background-color var(--duration-normal) var(--ease-smooth),
        border-color var(--duration-normal) var(--ease-smooth),
        color var(--duration-normal) var(--ease-smooth);
}

.btn i,
.btn-more i {
    font-size: 0.8125rem;
    transition: transform var(--duration-normal) var(--ease-spring);
}

.btn:focus-visible,
.btn-more:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 3px;
}

/* Primary Glass */
.btn--primary,
.btn-more {
    isolation: isolate;
    color: var(--white);
    background-color: rgba(2, 132, 199, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.32);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 1px 2px rgba(2, 132, 199, 0.18),
        0 8px 22px -6px rgba(2, 132, 199, 0.32);
    backdrop-filter: blur(28px) saturate(1.6);
    -webkit-backdrop-filter: blur(28px) saturate(1.6);
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.22);
    font-weight: 700;
}

.btn--primary:hover,
.btn-more:hover {
    color: var(--white);
    background-color: rgba(2, 132, 199, 0.82);
    border-color: rgba(255, 255, 255, 0.45);
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 4px 8px rgba(2, 132, 199, 0.26),
        0 14px 32px -6px rgba(2, 132, 199, 0.40);
}

.btn--primary:hover i,
.btn-more:hover i {
    transform: translateX(3px);
}

/* Ghost Glass */
.btn--ghost {
    isolation: isolate;
    color: var(--primary-dark);
    background-color: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 8px 18px -6px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(28px) saturate(1.6);
    -webkit-backdrop-filter: blur(28px) saturate(1.6);
    font-weight: 700;
}

.btn--ghost:hover {
    color: var(--primary-dark);
    background-color: rgba(255, 255, 255, 0.62);
    border-color: rgba(2, 132, 199, 0.32);
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 2px 6px rgba(15, 23, 42, 0.06),
        0 12px 26px -6px rgba(2, 132, 199, 0.18);
}

.btn--ghost:hover i {
    transform: translateX(3px);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .btn--primary, .btn-more { background-color: var(--primary); }
    .btn--ghost { background-color: var(--surface); }
}

/* ============================================
   5. PAGE HERO (Cabeceras de páginas internas)
   ============================================ */
.page-hero {
    position: relative;
    width: 100%;
    min-height: var(--page-hero-height);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--ink-900);
    isolation: isolate;
    padding-top: 80px; /* Header offset */
}

.page-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.page-hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.page-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        linear-gradient(180deg,
            rgba(15, 23, 42, 0.85) 0%,
            rgba(15, 23, 42, 0.65) 50%,
            rgba(15, 23, 42, 0.85) 100%),
        radial-gradient(circle at center,
            transparent 0%,
            rgba(15, 23, 42, 0.4) 100%);
}

.page-hero__content {
    position: relative;
    z-index: 10;
    width: 100%;
    text-align: center;
    padding: var(--space-8) 0;
}

.page-hero__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: var(--white);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 var(--space-4);
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.page-hero__breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.page-hero__breadcrumb a {
    color: var(--white);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-smooth);
}

.page-hero__breadcrumb a:hover {
    color: var(--primary-light);
}

.page-hero__breadcrumb i {
    font-size: 0.65rem;
    opacity: 0.5;
}

/* ============================================
   6. PUBLIC GLASS CARDS
   ============================================ */
.public-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
        linear-gradient(135deg,
            rgba(255, 255, 255, 0.6) 0%,
            rgba(255, 255, 255, 0.3) 100%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-xl);
    box-shadow:
        0 4px 24px -6px rgba(15, 23, 42, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    transition: transform var(--duration-normal) var(--ease-smooth), box-shadow var(--duration-normal) var(--ease-smooth);
}

.public-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 12px 32px -8px rgba(15, 23, 42, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 1);
    border-color: rgba(2, 132, 199, 0.2);
}

.public-card__body {
    padding: clamp(1.5rem, 3vw, 2.5rem);
}

/* ============================================
   7. DATA TABLES MODERNAS
   ============================================ */
.data-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-lg);
    background: var(--white);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.data-table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.data-table-modern th {
    background: var(--surface-soft);
    color: var(--ink-800);
    font-weight: 700;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.data-table-modern td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--ink-700);
    font-size: 0.9375rem;
    vertical-align: middle;
}

.data-table-modern tbody tr {
    transition: background-color var(--duration-fast) var(--ease-smooth);
}

.data-table-modern tbody tr:hover {
    background-color: var(--surface-hover);
}

.data-table-modern tbody tr:last-child td {
    border-bottom: none;
}

/* Badges for status */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge--success {
    background-color: var(--success-100);
    color: var(--success-700);
}

.status-badge--info {
    background-color: var(--info-100);
    color: var(--info-700);
}

.status-badge--warning {
    background-color: var(--warning-100);
    color: var(--warning-700);
}

.status-badge--danger {
    background-color: var(--danger-100);
    color: var(--danger-700);
}

/* ============================================
   8. PAGINACIÓN MODERNA
   ============================================ */
.modern-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-top: var(--space-8);
}

.modern-pagination__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink-600);
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-smooth);
}

.modern-pagination__item:hover:not(.modern-pagination__item--disabled) {
    background-color: var(--surface-hover);
    color: var(--ink-900);
}

.modern-pagination__item--active {
    background-color: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.modern-pagination__item--disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   9. PLACEHOLDERS DE IMAGEN
   ============================================ */
.img-placeholder {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--surface-soft), var(--surface));
    border: 1px dashed var(--border);
    color: var(--ink-400);
}

.img-placeholder i {
    font-size: 3rem;
    opacity: 0.5;
}

/* ============================================
   10. ALCALDE / INSTITUCIONAL CARDS
   ============================================ */
.alcalde-section__grid {
    display: grid;
    grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4.25rem);
    align-items: center;
}

.alcalde-section__image {
    position: relative;
    width: 100%;
    isolation: isolate;
    padding: 0.375rem;
    border-radius: calc(var(--radius-xl) + 0.25rem);
    background: rgba(255, 255, 255, 0.50);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 18px 40px -20px rgba(15, 23, 42, 0.15);
    backdrop-filter: blur(10px) saturate(1.2);
    -webkit-backdrop-filter: blur(10px) saturate(1.2);
}

.alcalde-section__photo {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center top;
    border-radius: var(--radius-lg);
    position: relative;
    z-index: 2;
    background-color: var(--ink-100);
    box-shadow: 0 18px 36px -18px rgba(15, 23, 42, 0.30);
}

.alcalde-section__image::before {
    content: '';
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 2px;
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.95), transparent);
    border-radius: var(--radius-pill);
    z-index: 4;
    pointer-events: none;
}

.alcalde-section__caption {
    position: absolute;
    left: 1.5rem;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 4;
    display: grid;
    gap: 0.25rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    isolation: isolate;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.42), rgba(15, 23, 42, 0.22)),
        rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.34);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        0 12px 28px -14px rgba(15, 23, 42, 0.36);
    backdrop-filter: blur(14px) saturate(1.25);
    -webkit-backdrop-filter: blur(14px) saturate(1.25);
}

.alcalde-section__caption span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    position: relative;
    z-index: 1;
}

.alcalde-section__caption strong {
    color: var(--white);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.015em;
    position: relative;
    z-index: 1;
}

.alcalde-section__text {
    font-size: clamp(0.9375rem, 1.1vw, 1rem);
    color: var(--ink-700);
    line-height: 1.78;
    margin: 0 0 1.5rem;
    max-width: 68ch;
    position: relative;
    z-index: 2;
}
