/*
Theme Name: BuurCeedo Editorial
Theme URI: http://localhost/buurceedo-wp/
Description: Tema hijo editorial de GeneratePress para BuurCeedo. Identidad sobria, elegante y de divulgación cultural, histórica, filosófica y espiritual africana. Fase 2 — base visual mínima (sin diseño final). Fuentes del sistema, sin Google Fonts.
Author: BuurCeedo
Version: 0.7.0
Template: generatepress
Text Domain: buurceedo-editorial
*/

/* =================================================================
   1. VARIABLES DE IDENTIDAD (paleta + tipografía base del sistema)
   ================================================================= */
:root {
	/* Paleta BuurCeedo */
	--bc-marfil:     #F7F1E6; /* fondo cálido */
	--bc-antracita:  #1F1A17; /* texto principal */
	--bc-oro:        #B5893B; /* acento principal (oro viejo) */
	--bc-terracota:  #7A3322; /* acento cálido (terracota profundo) */
	--bc-arena:      #EFE2CC; /* neutro suave */

	/* Roles semánticos */
	--bc-bg:          var(--bc-marfil);
	--bc-text:        var(--bc-antracita);
	--bc-link:        var(--bc-terracota);
	--bc-link-hover:  var(--bc-oro);
	--bc-border:      #E2D6BE; /* arena algo más marcada para separadores */

	/* Tipografías de marca AUTOALOJADAS (Fase 10) — @font-face en fonts.css.
	   Fallbacks del sistema para evitar saltos si una fuente no carga. */
	--bc-font-title: "Cormorant Garamond", Georgia, "Times New Roman", serif;
	--bc-font-body:  "Literata", Georgia, "Iowan Old Style", "Palatino Linotype", serif;
	--bc-font-ui:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	/* Medidas de lectura */
	--bc-measure:    72ch;  /* ancho de lectura cómodo */
}

/* =================================================================
   2. BASE: fondo marfil, texto antracita, lectura cómoda
   ================================================================= */
body {
	background-color: var(--bc-bg);
	color: var(--bc-text);
	font-family: var(--bc-font-body);
	font-size: 1.0625rem;   /* ~17px */
	line-height: 1.7;
}

.entry-content p,
.entry-content li {
	font-size: 1.0625rem;
	line-height: 1.75;
}

/* Ancho de lectura cómodo en artículos y páginas (sin romper bloques anchos) */
.single .entry-content,
.page .entry-content {
	max-width: var(--bc-measure);
}
.entry-content > .alignwide,
.entry-content > .alignfull,
.entry-content > .wp-block-image.alignfull,
.entry-content > .wp-block-cover {
	max-width: none;
}

/* =================================================================
   3. TÍTULOS — editoriales, sobrios
   ================================================================= */
h1, h2, h3, h4, h5, h6,
.entry-title,
.site-title {
	font-family: var(--bc-font-title);
	color: var(--bc-antracita);
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: 0.01em;
}

.entry-title {
	font-weight: 600;
}

/* =================================================================
   4. ENLACES — elegantes, subrayado discreto
   ================================================================= */
a {
	color: var(--bc-link);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
	transition: color 0.15s ease;
}
a:hover,
a:focus {
	color: var(--bc-link-hover);
}

/* Enlaces dentro del cuerpo del artículo: subrayado suave */
.entry-content a {
	text-decoration: underline;
	text-decoration-color: var(--bc-arena);
}
.entry-content a:hover {
	text-decoration-color: var(--bc-oro);
}

/* =================================================================
   5. CABECERA Y NAVEGACIÓN — claro, sobrio, acentos al pasar
   ================================================================= */
.site-header {
	background-color: var(--bc-bg);
	border-bottom: 1px solid var(--bc-border);
}
.main-title a,
.site-title a {
	color: var(--bc-antracita);
}

.main-navigation {
	background-color: var(--bc-bg);
	border-bottom: 1px solid var(--bc-border);
	font-family: var(--bc-font-ui);
}
.main-navigation .main-nav ul li a {
	color: var(--bc-antracita);
	letter-spacing: 0.02em;
}
.main-navigation .main-nav ul li a:hover,
.main-navigation .main-nav ul li.current-menu-item a {
	color: var(--bc-oro);
}
/* Submenús (desplegables nativos GP) */
.main-navigation ul ul {
	background-color: var(--bc-arena);
}
.main-navigation .main-nav ul ul li a {
	color: var(--bc-antracita);
}
.main-navigation .main-nav ul ul li a:hover {
	color: var(--bc-terracota);
}

/* =================================================================
   6. BOTONES — sobrios
   ================================================================= */
button,
.button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.wp-block-button__link {
	background-color: var(--bc-antracita);
	color: var(--bc-marfil);
	border: 1px solid var(--bc-antracita);
	border-radius: 2px;
	padding: 0.6em 1.3em;
	font-family: var(--bc-font-ui);
	font-size: 0.95rem;
	letter-spacing: 0.03em;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
button:hover,
.button:hover,
input[type="submit"]:hover,
.wp-block-button__link:hover {
	background-color: var(--bc-terracota);
	border-color: var(--bc-terracota);
	color: var(--bc-marfil);
}

/* =================================================================
   7. DETALLES EDITORIALES SOBRIOS
   ================================================================= */
blockquote {
	border-left: 3px solid var(--bc-oro);
	padding-left: 1.1em;
	color: #3A322C;
	font-style: italic;
}
hr,
.entry-content hr {
	border: 0;
	border-top: 1px solid var(--bc-border);
}
::selection {
	background: var(--bc-arena);
	color: var(--bc-antracita);
}
.site-footer,
.site-info {
	background-color: var(--bc-antracita);
	color: var(--bc-arena);
}
.site-info a {
	color: var(--bc-oro);
}

/* Footer institucional (Fase 14): fila de enlaces legales/contacto sobre el
   copyright. Sobrio, centrado y responsive (se ajusta y envuelve solo). */
.bc-footer-links {
	font-family: var(--bc-font-ui);
	font-size: 0.85rem;
	text-align: center;
	line-height: 1.7;
	margin-bottom: 0.55rem;
}
.bc-footer-links a {
	color: var(--bc-arena);
	text-decoration: none;
}
.bc-footer-links a:hover,
.bc-footer-links a:focus {
	color: var(--bc-oro);
	text-decoration: underline;
	text-underline-offset: 2px;
}
.bc-footer-sep {
	color: var(--bc-oro);
	margin: 0 0.55rem;
	opacity: 0.75;
}

/* =================================================================
   8. MASTHEAD — marca centrada + barra de navegación inferior
   (Fase 3 · correcciones de cabecera)
   La navegación se sitúa BAJO la cabecera y centrada (ajuste GP),
   de modo que los 8 ítems caben en una sola línea en escritorio y
   colapsan al menú móvil de GeneratePress en pantallas pequeñas.
   ================================================================= */

/* Marca (logo/título) centrada y sobria */
.site-header .inside-header {
	justify-content: center;
	text-align: center;
	padding-block: clamp(1.2rem, 2.6vw, 1.9rem); /* Fase 9: masthead más editorial */
}
.site-branding,
.site-logo {
	text-align: center;
}
.main-title {
	font-family: var(--bc-font-title);
	font-size: clamp(1.7rem, 3vw, 2.3rem);
	font-weight: 600;
	letter-spacing: 0.06em;
	line-height: 1.1;
	margin: 0;
}
.main-title a {
	color: var(--bc-antracita);
	text-decoration: none;
}
.site-description {
	font-family: var(--bc-font-ui);
	font-size: 0.8rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--bc-terracota);
}

/* Barra de navegación inferior: tira sobria y equilibrada, en una línea.
   Fase 9: SIN borde superior (la única separación con el masthead es el
   borde inferior de .site-header) para evitar el efecto "navegación duplicada". */
.main-navigation .inside-navigation {
	justify-content: center;
	padding-block: 0.4rem;
}
.main-navigation .main-nav ul li a {
	padding-left: 18px;
	padding-right: 18px;
	font-size: 0.92rem;
	letter-spacing: 0.04em;
}

/* Acento bajo el ítem activo / al pasar (sobrio) */
.main-navigation .main-nav ul li.current-menu-item > a,
.main-navigation .main-nav ul li a:hover {
	box-shadow: inset 0 -2px 0 var(--bc-oro);
}

/* En escritorio reducido, evitar que la barra se rompa antes del menú móvil */
@media (min-width: 769px) {
	.main-navigation .main-nav > ul {
		flex-wrap: nowrap;
	}
}

/* =================================================================
   9. MEGA MENÚ EDITORIAL (Fase 4)
   Ligero, sin plugin. Paneles para Domaines de savoir, Dossiers y
   Ressources. Revelado por hover/focus (CSS) + botón accesible (JS).
   ================================================================= */

/* La barra de navegación es el contexto de posicionamiento del panel */
.main-navigation {
	position: relative;
	z-index: 30;
}
.main-navigation .inside-navigation,
.main-navigation .main-nav,
.main-navigation .main-nav > ul {
	overflow: visible;
}
/* GeneratePress pone position:relative en cada <li>; lo anulamos en los ítems
   con mega para que el panel se posicione respecto a la barra (full-width). */
.main-navigation .main-nav ul li.bc-has-mega {
	position: static;
}

/* Botón de apertura (flecha) junto al enlace */
.bc-mega-toggle {
	background: transparent;
	border: 0;
	padding: 0 0.45rem;
	margin: 0;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	color: inherit;
	line-height: 1;
}
.bc-mega-toggle__icon {
	width: 0.5rem;
	height: 0.5rem;
	border-right: 1.5px solid var(--bc-terracota);
	border-bottom: 1.5px solid var(--bc-terracota);
	transform: rotate(45deg);
	transition: transform 0.18s ease;
	display: inline-block;
	margin-top: -2px;
}
.bc-has-mega:hover .bc-mega-toggle__icon,
.bc-has-mega.bc-mega-open .bc-mega-toggle__icon {
	transform: rotate(-135deg);
	margin-top: 2px;
}

/* Panel: a sangre bajo la barra, contenido centrado */
.bc-mega {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	background: var(--bc-marfil);
	border-top: 1px solid var(--bc-border);
	border-bottom: 3px solid var(--bc-oro);
	box-shadow: 0 16px 30px rgba(31, 26, 23, 0.10);
	z-index: 200;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}
.bc-has-mega:hover > .bc-mega,
.bc-has-mega:focus-within > .bc-mega,
.bc-has-mega.bc-mega-open > .bc-mega {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.bc-mega__inner {
	max-width: 1160px; /* Fase 9: alineado al ancho editorial del sitio */
	margin: 0 auto;
	padding: clamp(1.6rem, 2.2vw, 2rem) clamp(1.25rem, 4vw, 3rem) clamp(1.7rem, 2.4vw, 2.1rem);
	text-align: left;
}
.bc-mega__eyebrow {
	font-family: var(--bc-font-ui);
	text-transform: uppercase;
	letter-spacing: 0.16em;
	font-size: 0.68rem;
	color: var(--bc-terracota);
	margin: 0 0 1rem;
}

/* Rejillas del panel — Fase 9: más aire entre filas, columnas con ritmo */
.bc-mega__grid {
	display: grid;
	gap: 0.7rem 1.75rem;
}
.bc-mega__grid--4 { grid-template-columns: repeat(4, 1fr); }
.bc-mega__grid--2 { grid-template-columns: repeat(2, 1fr); }

/* Entradas del panel: título + descripción.
   Fase 9: hover ligero (sin borde pesado), acento oro a la izquierda. */
.bc-mega__item {
	display: block;
	padding: 0.6rem 0.8rem;
	border-radius: 3px;
	text-decoration: none;
	box-shadow: inset 0 0 0 0 transparent;
	transition: background-color 0.14s ease, box-shadow 0.14s ease;
}
.bc-mega__item:hover,
.bc-mega__item:focus-visible {
	background: rgba(181, 137, 59, 0.08);
	box-shadow: inset 2px 0 0 var(--bc-oro);
}
.bc-mega__num {
	font-family: var(--bc-font-title);
	font-size: 0.85rem;
	color: var(--bc-oro);
	margin-right: 0.4rem;
}
.bc-mega__title {
	font-family: var(--bc-font-title);
	font-size: 1.02rem;
	color: var(--bc-antracita);
	display: inline;
}
.bc-mega__desc {
	display: block;
	margin-top: 0.2rem;
	font-family: var(--bc-font-ui);
	font-size: 0.82rem;
	line-height: 1.5;
	color: #4A4039;
}
.bc-mega__item:hover .bc-mega__title {
	color: var(--bc-terracota);
}
.bc-mega__foot {
	margin: 1.2rem 0 0;
	padding-top: 1rem;
	border-top: 1px solid var(--bc-border);
}
.bc-mega__cta {
	font-family: var(--bc-font-ui);
	font-size: 0.85rem;
	letter-spacing: 0.03em;
	color: var(--bc-terracota);
	text-decoration: none;
}
.bc-mega__cta:hover { color: var(--bc-oro); }

/* Accesibilidad: foco visible */
.main-navigation .bc-mega-toggle:focus-visible,
.bc-mega__item:focus-visible,
.bc-mega__cta:focus-visible,
.main-navigation .main-nav ul li a:focus-visible {
	outline: 2px solid var(--bc-oro);
	outline-offset: 2px;
}

/* -----------------------------------------------------------------
   Móvil: sin hover. Acordeón en flujo, sin desbordar la pantalla.
   El menú móvil de GeneratePress actúa por debajo de 769px.
   ----------------------------------------------------------------- */
@media (max-width: 768px) {
	.bc-mega {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border-top: 1px solid var(--bc-border);
		border-bottom: 1px solid var(--bc-border);
		display: none;
		width: 100%;
	}
	.bc-has-mega.bc-mega-open > .bc-mega {
		display: block;
	}
	/* En móvil NO abrir por hover/focus: solo el botón (clase .bc-mega-open) */
	.bc-has-mega:hover > .bc-mega,
	.bc-has-mega:focus-within > .bc-mega {
		display: none;
	}
	.bc-has-mega.bc-mega-open:hover > .bc-mega,
	.bc-has-mega.bc-mega-open:focus-within > .bc-mega {
		display: block;
	}
	.bc-mega__inner {
		padding: 1rem 1.1rem;
	}
	.bc-mega__grid--4,
	.bc-mega__grid--2 {
		grid-template-columns: 1fr;
	}
	.bc-mega-toggle {
		padding: 0.4rem 0.8rem;
	}
}

/* =================================================================
   10. SISTEMA DE IMÁGENES (Fase 5)
   Clases genéricas para imágenes responsive + fallback editorial.
   Reutilizables en home, single y archivos. object-fit: cover y
   relación de aspecto fija para evitar layout shift (CLS).
   ================================================================= */

/* Contenedor con relación de aspecto fija */
.bc-media {
	position: relative;
	display: block;
	overflow: hidden;
	background: var(--bc-arena);
	margin: 0;
}
.bc-ratio {
	width: 100%;
}
.bc-ratio--16x9 { aspect-ratio: 16 / 9; }
.bc-ratio--1x1  { aspect-ratio: 1 / 1; }

/* Imagen real: cubre el contenedor sin deformarse */
.bc-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

/* Fallback editorial (sin archivo): marfil/arena + dominio + marca */
.bc-imgph {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 1rem 1.2rem;
	background:
		radial-gradient( 120% 120% at 100% 0%, rgba(181,137,59,0.10) 0%, rgba(247,241,230,0) 55% ),
		linear-gradient( 135deg, var(--bc-arena) 0%, var(--bc-marfil) 100% );
	border: 1px solid var(--bc-border);
}
.bc-imgph::before {
	/* filete superior sutil en oro */
	content: "";
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 3px;
	background: var(--bc-oro);
	opacity: 0.85;
}
.bc-imgph__label {
	font-family: var(--bc-font-title);
	font-size: clamp(1rem, 2.2vw, 1.3rem);
	line-height: 1.2;
	color: var(--bc-antracita);
	max-width: 90%;
}
.bc-imgph__mark {
	margin-top: 0.5rem;
	font-family: var(--bc-font-ui);
	text-transform: uppercase;
	letter-spacing: 0.22em;
	font-size: 0.62rem;
	color: var(--bc-oro);
}

/* Fase 9: en TARJETAS el fallback es más discreto (no debe dominar la card). */
.bc-card__media .bc-imgph::before { opacity: 0.45; }
.bc-card__media .bc-imgph__label {
	font-size: 0.98rem;
	font-weight: 400;
	color: #6F6256;
}
.bc-card__media .bc-imgph__mark {
	font-size: 0.55rem;
	opacity: 0.65;
}

/* Imagen destacada de artículo (la usará Fase 6) */
.bc-single-media {
	margin: 0 0 1.8rem;
	border-radius: 3px;
}

/* Hero con imagen (preparado para futuro; oculto si no se usa) */
.bc-hero__media {
	position: absolute;
	inset: 0;
	z-index: 0;
}
.bc-hero__media .bc-img { filter: brightness(0.55); }
.bc-hero--has-image .bc-hero__inner { position: relative; z-index: 1; }

/* Responsive: en móvil las tarjetas pasan a 1 columna (grids ya lo hacen);
   la relación de aspecto mantiene la altura proporcional. */
@media (max-width: 600px) {
	.bc-imgph__label { font-size: 1.05rem; }
}
