/*
Theme Name: Fotónica EIE PUCV
Theme URI: https://fotonica.pucv.cl
Author: Laboratorio de Fotónica EIE PUCV
Description: Tema para el sitio web del Laboratorio de Fotónica de la Pontificia Universidad Católica de Valparaíso. Incluye portada con secciones (sobre nosotros, líneas de investigación, proyectos, noticias), tipos de contenido para Equipo, Proyectos y Publicaciones, y página de contacto.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fotonica-pucv
Tags: education, blog, custom-menu, featured-images, translation-ready
*/

:root {
  --navy: #0a1a33;
  --navy-2: #12284d;
  --blue: #1d4ed8;
  --cyan: #06b6d4;
  --violet: #7c3aed;
  --gold: #f5b700;
  --ink: #1b2433;
  --muted: #5b6678;
  --line: #e3e8ef;
  --bg: #ffffff;
  --bg-soft: #f4f7fb;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(10, 26, 51, .08);
  --spectrum: linear-gradient(90deg, #7c3aed 0%, #2563eb 30%, #06b6d4 55%, #22c55e 72%, #f5b700 86%, #ef4444 100%);
  --font-head: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; color: var(--navy); margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); letter-spacing: -.01em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.screen-reader-text { position: absolute; left: -9999px; }
.skip-link:focus { left: 10px; top: 10px; z-index: 999; background: #fff; padding: 8px 12px; }

/* ---------- Header ---------- */
.topbar { background: var(--navy); color: #c9d4e6; font-size: .82rem; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; min-height: 36px; gap: 12px; }
.topbar a { color: #c9d4e6; }
.topbar .lang a { margin-left: 10px; }
.topbar .lang a.active { color: #fff; font-weight: 600; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header::after { content: ""; display: block; height: 3px; background: var(--spectrum); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--navy); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 44px; height: 44px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-head); font-size: 1.15rem; }
.brand-text span { font-size: .78rem; color: var(--muted); }
.custom-logo { max-height: 52px; width: auto; }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav li { position: relative; }
.main-nav a { display: block; padding: 10px 14px; border-radius: 8px; color: var(--ink); font-weight: 500; font-size: .95rem; }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current-menu-ancestor > a { background: var(--bg-soft); color: var(--blue); text-decoration: none; }
.main-nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 210px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; flex-direction: column; }
.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { display: flex; }
.menu-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 1rem; cursor: pointer; color: var(--navy); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(1000px 500px at 85% 20%, rgba(6,182,212,.35), transparent 60%),
    radial-gradient(800px 500px at 10% 90%, rgba(124,58,237,.35), transparent 60%),
    linear-gradient(135deg, #071327 0%, #0a1a33 50%, #12284d 100%);
}
.hero-photo { background-size: cover; background-position: 65% center; background-color: #040914; }
.hero-photo .wrap { padding-top: 140px; padding-bottom: 150px; }
.hero canvas, .hero .beams { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .55; }
.hero .wrap { position: relative; padding: 110px 20px 120px; }
.hero h1 { color: #fff; max-width: 820px; }
.hero h1 .accent { background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.2rem; color: #c9d4e6; max-width: 640px; }
.eyebrow { display: inline-block; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--cyan); margin-bottom: 14px; }
.hero .eyebrow { color: #7dd3fc; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { display: inline-block; padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: .95rem; border: 2px solid transparent; transition: transform .15s, background .15s; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: #fff; color: var(--navy); }
.btn-primary:hover { background: #e0f2fe; }
.btn-ghost { border-color: rgba(255,255,255,.5); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--blue); }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-top: 64px; max-width: 760px; }
.hero-stats div { border-left: 2px solid rgba(255,255,255,.25); padding-left: 14px; }
.hero-stats strong { display: block; font-family: var(--font-head); font-size: 1.9rem; color: #fff; }
.hero-stats span { font-size: .85rem; color: #a9b8d0; }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section-soft { background: var(--bg-soft); }
.section-dark { background: var(--navy); color: #c9d4e6; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 40px; flex-wrap: wrap; }
.section-head p { color: var(--muted); max-width: 620px; margin: 0; }
.more { font-weight: 600; white-space: nowrap; }

.about { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.about-figure { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--navy); aspect-ratio: 4/3; }
.about-figure img, .about-figure svg { width: 100%; height: 100%; object-fit: cover; }
.checklist { list-style: none; padding: 0; margin: 20px 0 0; }
.checklist li { padding-left: 30px; position: relative; margin-bottom: 10px; }
.checklist li::before { content: ""; position: absolute; left: 0; top: .55em; width: 16px; height: 3px; border-radius: 2px; background: var(--spectrum); }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; transition: box-shadow .2s, transform .2s; display: flex; flex-direction: column; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card h3 { margin-bottom: .4em; }
.card h3 a { color: var(--navy); }
.card p { color: var(--muted); font-size: .97rem; }
.card .meta { font-size: .82rem; color: var(--muted); margin-bottom: 8px; }
.card-icon { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 18px; color: #fff; }
.card-icon svg { width: 26px; height: 26px; }
.i1 { background: linear-gradient(135deg, #7c3aed, #2563eb); }
.i2 { background: linear-gradient(135deg, #2563eb, #06b6d4); }
.i3 { background: linear-gradient(135deg, #06b6d4, #22c55e); }
.i4 { background: linear-gradient(135deg, #f59e0b, #ef4444); }

.post-card { padding: 0; overflow: hidden; }
.post-card .thumb { aspect-ratio: 16/9; background: var(--navy-2); overflow: hidden; }
.post-card .thumb img, .post-card .thumb svg { width: 100%; height: 100%; object-fit: cover; }
.post-card .body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.tag { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); background: #e8efff; padding: 3px 9px; border-radius: 999px; margin-bottom: 10px; align-self: flex-start; }
.tag.green { color: #047857; background: #d1fae5; }
.tag.gray { color: #475569; background: #e2e8f0; }

.project { border-left: 4px solid; border-image: var(--spectrum) 1; }
.project .facts { font-size: .85rem; color: var(--muted); margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line); }

/* Team */
.member { text-align: center; padding: 30px 22px; }
.avatar { width: 112px; height: 112px; border-radius: 50%; margin: 0 auto 16px; overflow: hidden; background: linear-gradient(135deg, #12284d, #1d4ed8); color: #fff; display: grid; place-items: center; font-family: var(--font-head); font-size: 2rem; font-weight: 600; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.member .role { color: var(--blue); font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.member p { font-size: .9rem; }
.member .links { display: flex; justify-content: center; gap: 12px; font-size: .85rem; margin-top: auto; }
.team-group { margin-bottom: 56px; }
.team-group > h2 { font-size: 1.5rem; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }

/* Publications */
.pub-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.pub-filter a, .pub-filter button { border: 1px solid var(--line); background: #fff; padding: 6px 14px; border-radius: 999px; font-size: .88rem; color: var(--ink); cursor: pointer; font-family: inherit; }
.pub-filter .active { background: var(--navy); color: #fff; border-color: var(--navy); }
.pub-year { font-family: var(--font-head); font-size: 1.4rem; color: var(--navy); margin: 40px 0 14px; }
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub { padding: 18px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; }
.pub-title { font-weight: 600; color: var(--navy); }
.pub-authors { color: var(--muted); font-size: .92rem; }
.pub-venue { font-style: italic; font-size: .92rem; }
.pub-links a { font-size: .8rem; font-weight: 600; border: 1px solid var(--line); padding: 4px 10px; border-radius: 6px; margin-left: 6px; white-space: nowrap; }

/* Page header */
.page-hero { background: linear-gradient(135deg, #071327, #12284d); color: #c9d4e6; padding: 64px 0 56px; position: relative; overflow: hidden; }
.page-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--spectrum); }
.page-hero h1 { color: #fff; margin-bottom: .2em; }
.page-hero p { margin: 0; max-width: 680px; }
.breadcrumbs { font-size: .85rem; margin-bottom: 10px; color: #8fa3c2; }
.breadcrumbs a { color: #c9d4e6; }

.content-area { padding: 64px 0 88px; }
.layout-sidebar { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 48px; }
.entry-content { max-width: 760px; }
.entry-content h2 { margin-top: 1.6em; }
.entry-content img { border-radius: 10px; }
.entry-meta { color: var(--muted); font-size: .9rem; margin-bottom: 24px; }
.widget { background: var(--bg-soft); border-radius: var(--radius); padding: 22px; margin-bottom: 24px; }
.widget h3, .widget-title { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; }
.widget ul { margin: 0; padding-left: 18px; }

.search-form { display: flex; gap: 8px; }
.search-form input[type=search] { flex: 1; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; font: inherit; }
.search-form button { padding: 10px 18px; border: 0; border-radius: 999px; background: var(--navy); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; }
.contact-item { display: flex; gap: 14px; margin-bottom: 22px; }
.contact-item .card-icon { width: 44px; height: 44px; margin: 0; flex: none; }
.contact-item .card-icon svg { width: 22px; height: 22px; }
.form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.form input, .form textarea, .form select { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font: inherit; margin-bottom: 16px; background: #fff; }
.form textarea { min-height: 140px; }
.map { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); min-height: 280px; }
.map iframe { width: 100%; height: 100%; min-height: 280px; border: 0; }

/* CTA + partners */
.cta { background: var(--spectrum); border-radius: 20px; padding: 3px; }
.cta-inner { background: var(--navy); border-radius: 18px; padding: 48px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; color: #c9d4e6; }
.cta-inner h2 { color: #fff; margin-bottom: .3em; }
.partners { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 40px; align-items: center; }
.partners span { font-family: var(--font-head); font-weight: 600; color: #94a3b8; font-size: 1.05rem; letter-spacing: .02em; }

/* Pagination */
.pagination, .nav-links { display: flex; gap: 8px; margin-top: 40px; flex-wrap: wrap; }
.page-numbers { padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
.page-numbers.current { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Intranet */
.btn-line { border-color: var(--line); color: var(--navy); background: #fff; }
.btn-line:hover { background: var(--bg-soft); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.intranet-login { max-width: 460px; margin: 0 auto; padding: 36px; }
.intranet-login h2 { font-size: 1.5rem; }
.intranet-login form p { margin-bottom: 14px; }
.intranet-login label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.intranet-login input[type=text], .intranet-login input[type=password] { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.intranet-login .login-remember label { display: inline; font-weight: 400; }
.intranet-login input[type=submit] { padding: 12px 22px; border: 0; border-radius: 999px; background: var(--navy); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.intranet-login input[type=submit]:hover { background: var(--blue); }
.intranet-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--bg-soft); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 24px; }
.intranet-bar .muted { display: block; font-size: .9rem; }
.intranet-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.intranet-actions .btn, .code-links .btn { padding: 8px 16px; font-size: .88rem; }
.intranet-search input { width: 100%; padding: 12px 16px; border: 1px solid var(--line); border-radius: 999px; font: inherit; margin-bottom: 20px; }
.code-list { display: flex; flex-direction: column; gap: 16px; }
.code-item { padding: 22px 24px; }
.code-item:hover { transform: none; }
.code-item[hidden] { display: none; }
.code-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.code-head h3 { margin: 8px 0 4px; }
.code-links { display: flex; gap: 8px; flex-wrap: wrap; }
.code-item p { margin: 10px 0 0; }
.code-item details { margin-top: 12px; }
.code-item summary { cursor: pointer; font-weight: 600; color: var(--blue); font-size: .92rem; }
.entry-content pre { background: #0a1a33; color: #e2e8f0; padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-size: .88rem; }

/* ---------- Footer ---------- */
.site-footer { background: #061021; color: #94a3b8; font-size: .92rem; }
.site-footer::before { content: ""; display: block; height: 3px; background: var(--spectrum); }
.footer-cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; padding: 64px 20px 40px; }
.site-footer h4 { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.site-footer a { color: #cbd5e1; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer .brand { color: #fff; margin-bottom: 14px; }
.site-footer .brand-text span { color: #94a3b8; }
.social { display: flex; gap: 10px; margin-top: 16px; }
.social a { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #22314a; display: grid; place-items: center; }
.social a:hover { background: #12284d; }
.social svg { width: 16px; height: 16px; fill: currentColor; }
.footer-bottom { border-top: 1px solid #1a2840; }
.footer-bottom .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 18px; padding-bottom: 18px; font-size: .85rem; }

/* WP core */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption-text, figcaption { font-size: .85rem; color: var(--muted); }
.sticky .card { border-color: var(--blue); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .layout-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; padding: 10px 16px; }
  .main-nav .sub-menu { display: flex; position: static; box-shadow: none; border: 0; padding: 0 0 0 14px; }
  .about, .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero .wrap, .hero-photo .wrap { padding: 72px 20px 80px; }
  .hero-photo { background-position: 72% center; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0,1fr)); margin-top: 44px; }
  .topbar .hide-sm { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr; padding: 48px 16px 28px; }
  .section { padding: 64px 0; }
  .cta-inner { padding: 32px 24px; }
  .pub { grid-template-columns: 1fr; }
  .pub-links a { margin: 0 6px 0 0; }
  .brand-text span { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
