/*
Theme Name: Cristóbal Trujillo Profesional
Theme URI: https://cristobaltrujillo.formarenred.es/
Author: Formar En Red
Author URI: https://www.formarenred.es/
Description: Tema profesional de Cristóbal Trujillo Martín. Currículum, docencia, premios, cursos y publicaciones.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: cristobal-trujillo
*/

:root {
    --ct-navy: #071a2f;
    --ct-navy-soft: #102d4c;
    --ct-blue: #0878d1;
    --ct-cyan: #20b8d8;
    --ct-gold: #e9ad36;
    --ct-ink: #122033;
    --ct-muted: #5e6d7d;
    --ct-bg: #f3f7fb;
    --ct-white: #fff;
    --ct-line: #d8e3ed;
    --ct-radius: 18px;
    --ct-shadow: 0 18px 50px rgba(7, 26, 47, .12);
    --ct-container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ct-ink);
    background: var(--ct-white);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.65;
}
body.admin-bar .ct-header { top: 32px; }
img { max-width: 100%; height: auto; }
a { color: var(--ct-blue); text-decoration: none; }
a:hover { color: #005da9; }
.ct-container { width: min(calc(100% - 40px), var(--ct-container)); margin-inline: auto; }
.screen-reader-text {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.ct-header {
    position: sticky;
    z-index: 1000;
    top: 0;
    color: #fff;
    background: rgba(7, 26, 47, .95);
    border-bottom: 1px solid rgba(255,255,255,.1);
    backdrop-filter: blur(14px);
}
.ct-header-row {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.ct-brand { display: flex; flex-direction: column; color: #fff; line-height: 1.1; }
.ct-brand strong { font-size: 1.03rem; letter-spacing: .01em; }
.ct-brand span { margin-top: 6px; color: #a9c9e7; font-size: .72rem; letter-spacing: .13em; text-transform: uppercase; }
.ct-nav ul { display: flex; align-items: center; gap: 24px; margin: 0; padding: 0; list-style: none; }
.ct-nav a { color: #e8f2fa; font-size: .91rem; font-weight: 700; }
.ct-nav a:hover { color: #67d8ee; }
.ct-menu-toggle {
    display: none; padding: 8px 12px; color: #fff; background: transparent;
    border: 1px solid rgba(255,255,255,.3); border-radius: 10px; font: inherit;
}

.ct-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
      radial-gradient(circle at 12% 18%, rgba(32,184,216,.28), transparent 30%),
      linear-gradient(125deg, #061528 0%, #0b3153 58%, #075a87 100%);
}
.ct-hero::after {
    content: ""; position: absolute; inset: 0; opacity: .32; pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: linear-gradient(to right, #000, transparent 72%);
}
.ct-hero-grid {
    position: relative; z-index: 1;
    min-height: 680px; display: grid; grid-template-columns: 1.08fr .92fr;
    align-items: center; gap: 64px; padding-block: 74px;
}
.ct-eyebrow {
    display: inline-flex; align-items: center; gap: 9px; margin: 0 0 18px;
    color: #7ee9f4; font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
}
.ct-eyebrow::before { content: ""; width: 32px; height: 2px; background: var(--ct-cyan); }
.ct-hero h1 { margin: 0; max-width: 760px; font-size: clamp(2.7rem, 6vw, 5.6rem); line-height: .98; letter-spacing: -.055em; }
.ct-hero-lead { max-width: 700px; margin: 27px 0 0; color: #d6e5f1; font-size: clamp(1.05rem, 1.8vw, 1.32rem); }
.ct-actions { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 34px; }
.ct-button {
    display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px;
    color: #fff; background: var(--ct-blue); border: 1px solid var(--ct-blue); border-radius: 999px;
    font-size: .9rem; font-weight: 800; transition: .2s ease;
}
.ct-button:hover { color: #fff; background: #0567b4; transform: translateY(-2px); }
.ct-button--ghost { background: transparent; border-color: rgba(255,255,255,.5); }
.ct-button--ghost:hover { background: rgba(255,255,255,.1); }
.ct-hero-photo {
    position: relative; align-self: stretch; min-height: 520px; border-radius: 34px; overflow: hidden;
    box-shadow: 0 26px 80px rgba(0,0,0,.35);
}
.ct-hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 67% center; }
.ct-photo-caption {
    position: absolute; right: 22px; bottom: 22px; left: 22px; padding: 18px 20px;
    background: rgba(5,21,40,.82); border: 1px solid rgba(255,255,255,.18); border-radius: 16px;
    backdrop-filter: blur(12px);
}
.ct-photo-caption strong { display: block; font-size: 1rem; }
.ct-photo-caption span { color: #b7d3e7; font-size: .82rem; }

.ct-statbar { position: relative; z-index: 3; margin-top: -36px; }
.ct-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); overflow: hidden;
    background: #fff; border: 1px solid var(--ct-line); border-radius: 20px; box-shadow: var(--ct-shadow);
}
.ct-stat { padding: 25px 28px; border-right: 1px solid var(--ct-line); }
.ct-stat:last-child { border-right: 0; }
.ct-stat strong { display: block; color: var(--ct-blue); font-size: 1.85rem; line-height: 1; }
.ct-stat span { display: block; margin-top: 8px; color: var(--ct-muted); font-size: .82rem; }

.ct-section { padding-block: 94px; }
.ct-section--soft { background: var(--ct-bg); }
.ct-section--dark { color: #fff; background: var(--ct-navy); }
.ct-section-head { max-width: 790px; margin-bottom: 42px; }
.ct-section-head h2 { margin: 5px 0 14px; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.06; letter-spacing: -.04em; }
.ct-section-head p { margin: 0; color: var(--ct-muted); font-size: 1.08rem; }
.ct-section--dark .ct-section-head p { color: #b6c9da; }

.ct-profile-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: start; }
.ct-prose { font-size: 1.05rem; }
.ct-prose p:first-child { margin-top: 0; font-size: 1.25rem; line-height: 1.65; }
.ct-highlight {
    padding: 30px; color: #fff; background: linear-gradient(140deg, #0b65a9, #082944);
    border-radius: var(--ct-radius); box-shadow: var(--ct-shadow);
}
.ct-highlight h3 { margin: 0 0 16px; font-size: 1.35rem; }
.ct-highlight ul { margin: 0; padding-left: 20px; }
.ct-highlight li + li { margin-top: 10px; }

.ct-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ct-card {
    padding: 28px; background: #fff; border: 1px solid var(--ct-line); border-radius: var(--ct-radius);
    box-shadow: 0 10px 30px rgba(7,26,47,.055);
}
.ct-card-icon {
    display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 20px;
    color: #fff; background: linear-gradient(135deg, var(--ct-blue), var(--ct-cyan)); border-radius: 14px;
    font-size: 1.35rem;
}
.ct-card h3 { margin: 0 0 10px; font-size: 1.13rem; line-height: 1.35; }
.ct-card p { margin: 0; color: var(--ct-muted); font-size: .93rem; }

.ct-awards { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.ct-award {
    position: relative; padding: 38px; overflow: hidden;
    background: linear-gradient(145deg, #fff, #f5f9fc); border: 1px solid var(--ct-line); border-radius: 24px;
}
.ct-award::before {
    content: attr(data-year); position: absolute; right: 15px; top: -22px;
    color: rgba(8,120,209,.07); font-size: 8rem; font-weight: 900; line-height: 1;
}
.ct-award-badge { display: inline-block; padding: 6px 11px; color: #765000; background: #fff0c7; border-radius: 999px; font-size: .75rem; font-weight: 900; }
.ct-award h3 { position: relative; margin: 18px 0 12px; font-size: 1.5rem; line-height: 1.25; }
.ct-award p { position: relative; margin: 0; color: var(--ct-muted); }

.ct-credentials { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ct-credential {
    display: flex; gap: 18px; padding: 22px; background: rgba(255,255,255,.055);
    border: 1px solid rgba(255,255,255,.12); border-radius: 16px;
}
.ct-credential span { flex: 0 0 auto; color: #71ddeb; font-weight: 900; }
.ct-credential strong { display: block; color: #fff; }
.ct-credential small { display: block; margin-top: 4px; color: #a9bfd0; }

.ct-filters { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 28px; }
.ct-filter {
    padding: 9px 15px; color: var(--ct-navy-soft); background: #fff; border: 1px solid var(--ct-line);
    border-radius: 999px; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 800;
}
.ct-filter.is-active, .ct-filter:hover { color: #fff; background: var(--ct-blue); border-color: var(--ct-blue); }
.ct-courses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.ct-course {
    display: flex; flex-direction: column; overflow: hidden; background: #fff;
    border: 1px solid var(--ct-line); border-radius: 18px; box-shadow: 0 12px 35px rgba(7,26,47,.07);
}
.ct-course[hidden] { display: none; }
.ct-course-media { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #dce8f3; }
.ct-course-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.ct-course:hover .ct-course-media img { transform: scale(1.035); }
.ct-course-label {
    position: absolute; top: 13px; left: 13px; padding: 6px 10px; color: #fff;
    background: rgba(6,23,42,.85); border-radius: 999px; font-size: .69rem; font-weight: 900;
}
.ct-course-body { display: flex; flex: 1; flex-direction: column; padding: 21px; }
.ct-course h3 { margin: 0; font-size: 1.05rem; line-height: 1.38; }
.ct-author { margin: 12px 0; color: var(--ct-blue); font-size: .78rem; font-weight: 850; }
.ct-course-link { margin-top: auto; padding-top: 12px; font-size: .82rem; font-weight: 850; }

.ct-timeline { position: relative; display: grid; gap: 18px; }
.ct-timeline::before { content: ""; position: absolute; top: 0; bottom: 0; left: 18px; width: 2px; background: var(--ct-line); }
.ct-timeline-item { position: relative; padding: 3px 0 3px 58px; }
.ct-timeline-item::before {
    content: ""; position: absolute; left: 10px; top: 9px; width: 18px; height: 18px;
    background: #fff; border: 5px solid var(--ct-blue); border-radius: 50%;
}
.ct-timeline-item h3 { margin: 0; font-size: 1.1rem; }
.ct-timeline-item p { margin: 5px 0 0; color: var(--ct-muted); }

.ct-contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 52px; }
.ct-contact-panel { padding: 34px; color: #fff; background: linear-gradient(145deg, #0a385e, #071a2f); border-radius: 24px; }
.ct-contact-panel a { color: #7ee9f4; }
.ct-contact-panel h3 { margin-top: 0; font-size: 1.5rem; }
.ct-contact-panel p { color: #bfd2df; }
.ct-contact-links { display: grid; gap: 12px; margin-top: 26px; }
.ct-contact-link { padding: 13px 15px; color: #fff !important; background: rgba(255,255,255,.07); border-radius: 12px; }
.ct-form { display: grid; gap: 15px; }
.ct-form label { display: grid; gap: 7px; font-size: .84rem; font-weight: 800; }
.ct-form input, .ct-form textarea {
    width: 100%; padding: 13px 15px; color: var(--ct-ink); background: #fff;
    border: 1px solid #becdda; border-radius: 11px; font: inherit;
}
.ct-form textarea { min-height: 145px; resize: vertical; }
.ct-form-note { margin: 0; color: var(--ct-muted); font-size: .78rem; }

.ct-footer { padding: 56px 0 24px; color: #d7e6f1; background: #061321; }
.ct-footer-grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 40px; }
.ct-footer h2, .ct-footer h3 { color: #fff; }
.ct-footer h2 { margin: 0; font-size: 1.35rem; }
.ct-footer h3 { margin: 0 0 12px; font-size: .85rem; letter-spacing: .11em; text-transform: uppercase; }
.ct-footer p { color: #9eb7c9; }
.ct-footer ul { margin: 0; padding: 0; list-style: none; }
.ct-footer li + li { margin-top: 8px; }
.ct-footer a { color: #cfe5f3; }
.ct-footer-bottom {
    display: flex; justify-content: space-between; gap: 20px; margin-top: 42px; padding-top: 20px;
    color: #829bae; border-top: 1px solid rgba(255,255,255,.12); font-size: .78rem;
}

.ct-page { padding-block: 80px; }
.ct-page h1 { font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.05; }
.ct-entry { max-width: 850px; }

@media (max-width: 980px) {
    .ct-menu-toggle { display: inline-flex; }
    .ct-nav {
        position: absolute; right: 20px; top: calc(100% + 8px); left: 20px; display: none;
        padding: 18px; background: var(--ct-navy); border: 1px solid rgba(255,255,255,.14); border-radius: 16px;
    }
    .ct-nav.is-open { display: block; }
    .ct-nav ul { align-items: stretch; flex-direction: column; gap: 12px; }
    .ct-hero-grid { grid-template-columns: 1fr; min-height: auto; }
    .ct-hero-photo { min-height: 480px; }
    .ct-stats { grid-template-columns: 1fr 1fr; }
    .ct-stat:nth-child(2) { border-right: 0; }
    .ct-stat:nth-child(-n+2) { border-bottom: 1px solid var(--ct-line); }
    .ct-profile-grid, .ct-contact-grid { grid-template-columns: 1fr; }
    .ct-card-grid, .ct-courses { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
    body.admin-bar .ct-header { top: 46px; }
    .ct-container { width: min(calc(100% - 28px), var(--ct-container)); }
    .ct-header-row { min-height: 68px; }
    .ct-brand span { display: none; }
    .ct-hero-grid { gap: 34px; padding-block: 54px 72px; }
    .ct-hero h1 { font-size: clamp(2.65rem, 13vw, 4.1rem); }
    .ct-hero-photo { min-height: 420px; border-radius: 24px; }
    .ct-actions { align-items: stretch; flex-direction: column; }
    .ct-button { width: 100%; }
    .ct-statbar { margin-top: -26px; }
    .ct-stats, .ct-card-grid, .ct-awards, .ct-credentials, .ct-courses, .ct-footer-grid { grid-template-columns: 1fr; }
    .ct-stat { border-right: 0; border-bottom: 1px solid var(--ct-line); }
    .ct-stat:last-child { border-bottom: 0; }
    .ct-section { padding-block: 68px; }
    .ct-award { padding: 28px; }
    .ct-footer-bottom { flex-direction: column; }
}

/* Menú principal simplificado */
.ct-menu { display: flex; align-items: center; gap: 26px; margin: 0; padding: 0; list-style: none; }
.ct-menu a { white-space: nowrap; }

/* Accesos directos del encabezado */
.ct-quicklinks { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.ct-quicklinks a {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 11px 22px; font-size: .9rem; font-weight: 700; line-height: 1;
    color: #eaf6ff; text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.ct-quicklinks a:hover, .ct-quicklinks a:focus {
    color: #071a2f; background: #fff; border-color: #fff;
}

/* Redes sociales en el pie */
.ct-social { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, 0.15); }
.ct-social h3 { margin: 0 0 .9rem; font-size: 1rem; }
.ct-social-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ct-social-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; color: #eaf6ff; text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
}
.ct-social-btn:hover, .ct-social-btn:focus { color: #071a2f; background: #fff; }
.ct-social-icon { display: block; width: 18px; height: 18px; max-width: 18px; max-height: 18px; flex: 0 0 auto; fill: currentColor; }

@media (max-width: 900px) {
    .ct-menu { flex-direction: column; align-items: stretch; gap: 14px; }
}

/* Navegación por anclas con cabecera fija */
html { scroll-behavior: smooth; }
#perfil, #especializacion, #premios, #formacion, #experiencia, #cursos, #contacto, #contenido {
    scroll-margin-top: 96px;
}
body.admin-bar #perfil, body.admin-bar #especializacion, body.admin-bar #premios,
body.admin-bar #formacion, body.admin-bar #experiencia, body.admin-bar #cursos,
body.admin-bar #contacto { scroll-margin-top: 130px; }

/* Blog */
.ct-articles { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.ct-article {
    display: flex; flex-direction: column; gap: 10px; padding: 26px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 18px;
}
.ct-article-date { margin: 0; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
.ct-article h3 { margin: 0; font-size: 1.1rem; line-height: 1.35; }
.ct-article h3 a { text-decoration: none; }
.ct-article h3 a:hover, .ct-article h3 a:focus { text-decoration: underline; }
.ct-article p { margin: 0; }
.ct-article .ct-course-link { margin-top: auto; }
#blog { scroll-margin-top: 96px; }
body.admin-bar #blog { scroll-margin-top: 130px; }
