/* Estilos de las páginas generadas (directorio, cabildo, funcionarios, comercio,
   identidad). Se apoya en las variables y el lenguaje visual de ayuntamiento.css:
   NO lo sobreescribe, solo agrega lo que esas páginas necesitan. */

.page-header {
    background: linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,.75)), #62022e;
    color: #fff;
    padding: 150px 0 60px;
    text-align: center;
}
.page-header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.6rem;
    margin: 0 0 10px;
    line-height: 1.15;
}
.page-header p {
    max-width: 640px;
    margin: 0 auto;
    opacity: .9;
    font-size: 1.05rem;
}
.page-header .badge-count {
    display: inline-block;
    margin-top: 18px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    padding: 5px 16px;
    border-radius: 30px;
    font-size: .85rem;
    font-weight: 600;
}

/* ── Buscador de las páginas con listado largo ───────────────────────── */
.buscador {
    max-width: 520px;
    margin: 0 auto 36px;
    position: relative;
}
.buscador input {
    width: 100%;
    padding: 14px 18px 14px 46px;
    border: 1px solid #ddd;
    border-radius: 50px;
    font-size: 1rem;
    font-family: inherit;
    transition: .25s;
}
.buscador input:focus {
    outline: none;
    border-color: #7f2032;
    box-shadow: 0 0 0 4px rgba(127, 32, 50,.10);
}
.buscador i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}
.sin-resultados {
    text-align: center;
    padding: 40px;
    color: #888;
}

/* ── Rejilla de tarjetas (dependencias, funcionarios, comercios) ─────── */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}
.info-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 6px 24px rgba(0,0,0,.07);
    transition: transform .25s, box-shadow .25s;
}
.info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,.11);
}
.info-card .tipo {
    display: inline-block;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    color: #b6a07a;
    margin-bottom: 8px;
}
.info-card h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.08rem;
    margin: 0 0 6px;
    color: #222;
    line-height: 1.35;
}
.info-card .titular {
    font-weight: 600;
    color: #7f2032;
    font-size: .95rem;
    margin: 0 0 4px;
}
.info-card .cargo {
    font-size: .85rem;
    color: #777;
    margin: 0 0 14px;
}
.info-card .datos {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid #f0f0f0;
    padding-top: 14px;
}
.info-card .datos li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: .88rem;
    color: #555;
    margin-bottom: 8px;
}
.info-card .datos li:last-child { margin-bottom: 0; }
.info-card .datos i {
    color: #b6a07a;
    width: 15px;
    margin-top: 3px;
    flex: none;
}
.info-card .datos a { color: #555; text-decoration: none; }
.info-card .datos a:hover { color: #7f2032; text-decoration: underline; }

/* ── Cabildo ─────────────────────────────────────────────────────────── */
.alcalde-card {
    max-width: 720px;
    margin: 0 auto 50px;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 14px 40px rgba(0,0,0,.12);
    display: grid;
    grid-template-columns: 240px 1fr;
}
.alcalde-card .foto {
    background: #eee center/cover no-repeat;
    min-height: 260px;
}
.alcalde-card .cuerpo { padding: 34px; }
.alcalde-card .rol {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #b6a07a;
    font-weight: 700;
}
.alcalde-card h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    margin: 8px 0 6px;
    color: #222;
}
.alcalde-card .puesto { color: #7f2032; font-weight: 600; }

.edil-card { display: flex; gap: 18px; }
.edil-card .foto {
    width: 74px; height: 74px;
    border-radius: 50%;
    background: #eee center/cover no-repeat;
    flex: none;
    border: 3px solid #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,.14);
}
.edil-card .comisiones {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}
.edil-card .comisiones span {
    display: block;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #aaa;
    font-weight: 700;
    margin-bottom: 6px;
}
.edil-card .comisiones p {
    font-size: .85rem;
    color: #666;
    margin: 0;
    white-space: pre-line;
    line-height: 1.55;
}

/* ── Identidad ───────────────────────────────────────────────────────── */
.prosa { max-width: 760px; margin: 0 auto; }
.prosa h2 {
    font-family: 'Poppins', sans-serif;
    color: #7f2032;
    border-bottom: 2px solid #b6a07a;
    padding-bottom: 8px;
    margin-top: 44px;
}
.prosa p { line-height: 1.85; color: #444; }
.datos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 30px 0;
}
.dato-box {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,.06);
}
.dato-box strong {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    color: #7f2032;
    margin-bottom: 4px;
}
.dato-box span { font-size: .82rem; color: #888; text-transform: uppercase; letter-spacing: .05em; }

/* ── Trámites ────────────────────────────────────────────────────────── */
.tramite-row {
    background: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 10px;
    display: flex;
    gap: 16px;
    align-items: center;
    box-shadow: 0 3px 12px rgba(0,0,0,.05);
}
.tramite-row .clave {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #7f2032;
    font-size: .85rem;
    min-width: 68px;
}
.tramite-row .nombre { flex: 1; font-weight: 600; color: #333; }
.tramite-row .area { font-size: .82rem; color: #888; }

@media (max-width: 700px) {
    .page-header { padding: 120px 0 44px; }
    .page-header h1 { font-size: 1.9rem; }
    .alcalde-card { grid-template-columns: 1fr; }
    .alcalde-card .foto { min-height: 220px; }
    .tramite-row { flex-wrap: wrap; }
}

/* =========================================================================
   Refresco visual (alinea estas páginas con la portada nueva).
   Va al final a propósito: sobreescribe lo anterior sin tocar el HTML generado.
   Usa las variables de ayuntamiento.css (--primary, --gold, --ease…).
   ========================================================================= */
.page-header {
    position: relative; overflow: hidden; isolation: isolate;
    background: linear-gradient(120deg, #3d0119 0%, #7f2032 100%);
    padding: 150px 0 72px;
}
.page-header::before {
    content: ''; position: absolute; z-index: -1; right: -80px; top: -120px; width: 420px; height: 420px; border-radius: 50%;
    background: radial-gradient(circle, rgba(182, 160, 122,.5), transparent 70%); filter: blur(30px);
    animation: float 14s ease-in-out infinite alternate;
}
.page-header h1 { font-weight: 800; letter-spacing: -.5px; animation: rise .9s var(--ease) both; }
.page-header p { animation: rise .9s var(--ease) .12s both; }
.page-header .badge-count { animation: rise .9s var(--ease) .24s both; backdrop-filter: blur(8px); }

.buscador input { border: 1px solid var(--line); box-shadow: var(--shadow-sm); padding: 15px 20px 15px 48px; }
.buscador input:focus { box-shadow: 0 0 0 4px rgba(127, 32, 50,.10), var(--shadow); }

.info-card {
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
    transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .3s;
}
.info-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.info-card .datos { border-top-color: var(--line); }

.alcalde-card { border-radius: 22px; box-shadow: var(--shadow-lg); }
.edil-card .foto { transition: transform .5s var(--ease); }
.edil-card:hover .foto { transform: scale(1.08); }

.dato-box { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.dato-box:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.tramite-row { border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.tramite-row:hover { transform: translateX(6px); box-shadow: var(--shadow); }
.prosa h2 { border-bottom: 0; position: relative; padding-bottom: 14px; }
.prosa h2::after { content: ''; position: absolute; left: 0; bottom: 0; width: 56px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--primary), var(--gold)); }

/* Aparición escalonada de las tarjetas al cargar la página */
.grid-cards > * { animation: rise .7s var(--ease) both; }
.grid-cards > *:nth-child(2) { animation-delay: .05s; } .grid-cards > *:nth-child(3) { animation-delay: .1s; }
.grid-cards > *:nth-child(4) { animation-delay: .15s; } .grid-cards > *:nth-child(5) { animation-delay: .2s; }
.grid-cards > *:nth-child(n+6) { animation-delay: .25s; }
@media (prefers-reduced-motion: reduce) { .grid-cards > *, .page-header h1, .page-header p, .page-header .badge-count { animation: none; } }
