/*
Theme Name: AlcPopTheme
Author: Andres Felipe Hoyos
Description: Tema institucional
Version: 1.0.0
*/

/* Menú offcanvas móvil */
#offcanvasMenu .nav-link {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    color: #222;
}
#offcanvasMenu .nav-link:hover,
#offcanvasMenu .nav-link.active {
    background-color: #f0f5ff;
    color: #125ca2;
}
#offcanvasMenu .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    background-color: #f8f9fa;
    padding-left: 1rem;
}

/* =========================================================
   Design Tokens — Sistema de diseño Alcaldía de Popayán
   ========================================================= */
:root {
    /* Colores institucionales */
    --color-primary:       #125ca2;
    --color-primary-dark:  #0d4a87;
    --color-govco:         #3366cc;
    --color-link:          #032ff1;

    /* Paleta de superficie (Enterprise Gateway / Accessible & Ethical) */
    --color-background:    #F8FAFC;
    --color-foreground:    #020617;
    --color-secondary:     #334155;
    --color-muted:         #E8ECF1;
    --color-border:        #E2E8F0;
    --color-destructive:   #DC2626;

    /* Tipografía */
    --font-heading: 'EB Garamond', Georgia, serif;
    --font-body:    'Lato', system-ui, sans-serif;

    /* Espaciado base (8pt grid) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;
}

/* Tipografía global */
body {
    font-family: var(--font-body);
    background-color: var(--color-background);
    color: var(--color-foreground);
    font-size: 1rem;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-foreground);
}

/* Focus rings accesibles (WCAG AA) */
:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 3px;
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =========================================================
   front-page.php — Carrusel Hero
   ========================================================= */
.alc-hero-carousel { position: relative; }

.alc-slide-bg {
    position: relative;
    overflow: hidden;
    background-color: #0d2e5a; /* fallback si no hay imagen */
    aspect-ratio: 16 / 10; /* móvil */
}

/* Fondo desenfocado: misma imagen del slide, borrosa, rellena los huecos */
.alc-slide-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--slide-bg);
    background-size: cover;
    background-position: center;
    filter: blur(14px);
    transform: scale(1.1); /* elimina los bordes difusos del blur */
    z-index: 0;
}

/* Tablet ≥576px */
@media (min-width: 576px) {
    .alc-slide-bg {
        aspect-ratio: 16 / 9;
    }
}

/* Desktop ≥992px: panorámico con altura máxima */
@media (min-width: 992px) {
    .alc-slide-bg {
        aspect-ratio: auto;
        height: clamp(380px, 40vw, 560px);
    }
}

/* Imagen principal: completa, sin recorte, encima del fondo borroso */
.alc-slide-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center top;
    display: block;
    z-index: 1;
}

.alc-caption {
    background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.1) 100%);
    text-align: left;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 2.5rem 2rem 2rem;
    border-radius: 0;
}

.alc-caption__tag {
    display: inline-block;
    background-color: var(--color-primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.2rem 0.65rem;
    border-radius: 2px;
    margin-bottom: 0.6rem;
}

.alc-caption__title {
    font-family: var(--font-heading);
    font-size: clamp(1.3rem, 4vw, 2.2rem);
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
    margin-bottom: 0.5rem;
    max-width: 680px;
}

.alc-caption__text {
    color: rgba(255,255,255,0.88);
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    max-width: 560px;
    margin-bottom: 1rem;
}

.alc-btn-hero {
    background-color: #fff;
    color: var(--color-primary);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.55rem 1.4rem;
    border: none;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    transition: background-color 150ms ease, color 150ms ease;
}

.alc-btn-hero:hover,
.alc-btn-hero:focus-visible {
    background-color: var(--color-primary);
    color: #fff;
}

/* Badges de categoría */
.alc-badge {
    display: inline-block;
    background-color: #e8f0fb;
    color: var(--color-primary);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
}

/* =========================================================
   front-page.php — Servicios
   ========================================================= */
.alc-servicio-card {
    border: 1px solid var(--color-border);
    color: var(--color-foreground);
    transition: border-color 150ms ease, box-shadow 150ms ease, color 150ms ease;
    cursor: pointer;
    min-height: 44px;
}

.alc-servicio-card:hover,
.alc-servicio-card:focus-visible {
    border-color: var(--color-primary);
    box-shadow: 0 4px 16px rgba(18, 92, 162, 0.12);
    color: var(--color-primary);
}

.alc-servicio-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #e8f0fb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--color-primary);
    transition: background-color 150ms ease;
}

.alc-servicio-card:hover .alc-servicio-icon,
.alc-servicio-card:focus-visible .alc-servicio-icon {
    background-color: var(--color-primary);
    color: #fff;
}

.alc-servicio-label {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
}

/* =========================================================
   single.php — Artículo individual
   ========================================================= */
.alc-single-hero {
    position: relative;
    height: clamp(240px, 40vw, 480px);
    overflow: hidden;
}

.alc-single-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.alc-single-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.35) 100%);
}

.alc-entry-content {
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--color-foreground);
    max-width: 70ch;
}

.alc-entry-content h2,
.alc-entry-content h3,
.alc-entry-content h4 {
    font-family: var(--font-heading);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.alc-entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.alc-entry-content a {
    color: var(--color-link);
    text-decoration: underline;
}

.alc-entry-content blockquote {
    border-left: 4px solid var(--color-primary);
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    background-color: #e8f0fb;
    border-radius: 0 0.25rem 0.25rem 0;
    font-style: italic;
    color: var(--color-secondary);
}

/* =========================================================
   page.php — Páginas estáticas
   ========================================================= */

/* Hero con imagen destacada */
.alc-page-hero {
    position: relative;
    height: clamp(200px, 35vw, 400px);
    overflow: hidden;
}

.alc-page-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.alc-page-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.65) 100%);
    display: flex;
    align-items: flex-end;
    padding-bottom: 2rem;
}

.alc-page-hero__title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0,0,0,0.4);
    max-width: 780px;
}

/* Barra sin imagen destacada */
.alc-page-header-bar {
    background-color: var(--color-primary);
}

.alc-page-header-bar__title {
    font-family: var(--font-heading);
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    font-weight: 700;
    color: #fff;
}

/* =========================================================
   Design Tokens — Identidad TIC
   ========================================================= */
:root {
    --color-tic-accent:    #0ea5e9;
    --color-tic-accent-dk: #0284c7;
    --color-tic-surface:   #f0f7ff;
    --color-tic-glow:      rgba(14, 165, 233, 0.12);
}

/* =========================================================
   front-page.php — Servicios Digitales TIC
   ========================================================= */
.alc-tic-services {
    background-color: var(--color-tic-surface);
}

/* =========================================================
   front-page.php — Noticias featured layout
   ========================================================= */
.alc-news-featured {
    border-radius: 0.75rem;
    overflow: hidden;
    border: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    height: 100%;
}

.alc-news-featured__img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center;
    display: block;
}

.alc-news-featured__body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.alc-news-featured__title {
    font-family: var(--font-heading);
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 800;
    line-height: 1.25;
    color: var(--color-foreground);
    margin-bottom: 0.5rem;
}

.alc-news-secondary {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.alc-news-secondary:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.alc-news-secondary__thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.5rem;
    flex-shrink: 0;
}

.alc-news-secondary__title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-foreground);
    margin-bottom: 0.25rem;
}

/* Botón de pausa carrusel */
.alc-carousel-pause {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 50%;
    width: 52px;
    height: 52px;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 200ms ease, background 150ms ease;
}

.alc-hero-carousel:hover .alc-carousel-pause {
    opacity: 1;
}

.alc-carousel-pause:hover,
.alc-carousel-pause:focus-visible {
    background: rgba(0, 0, 0, 0.75);
    opacity: 1;
}