/*
Theme Name: S365
Theme URI: https://soporte365cr.com
Author: S365
Author URI: https://soporte365cr.com
Description: Tema personalizado para S365 — desarrollo de plataformas educativas Moodle y sitios web institucionales. Landing de una sola página, sin constructores de terceros.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: Uso privado
Text Domain: s365
*/

/* ==========================================================================
   0. Reset básico
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, figure, blockquote, ul, ol { margin: 0; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; }

/* ==========================================================================
   1. Variables
   ========================================================================== */
:root {
	--color-bg: #F6F6F4;
	--color-text: #0D0D0D;
	--color-accent: #5B3DF6;
	--color-accent-dark: #4a2fd6;
	--color-border: #E4E3DE;
	--color-white: #FFFFFF;

	--font-heading: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
	--font-body: "Inter", "Helvetica Neue", Arial, sans-serif;

	--radius-card: 20px;
	--radius-pill: 100px;

	--container-width: 1160px;
	--section-padding: clamp(64px, 10vw, 120px);
}

/* ==========================================================================
   2. Base
   ========================================================================== */
body {
	background: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

h1, h2, h3, h4 {
	font-family: var(--font-heading);
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: -0.01em;
}

.container {
	width: 100%;
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 0 24px;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--color-text);
	color: var(--color-white);
	padding: 12px 20px;
	z-index: 1000;
}
.skip-link:focus {
	left: 16px;
	top: 16px;
	border-radius: 8px;
}

/* ==========================================================================
   3. Botones
   ========================================================================== */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-family: var(--font-heading);
	font-weight: 500;
	font-size: 15px;
	padding: 14px 28px;
	border-radius: var(--radius-pill);
	border: 2px solid transparent;
	transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
	white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn-dark {
	background: var(--color-text);
	color: var(--color-white);
}
.btn-dark:hover { background: #262626; }

.btn-accent {
	background: var(--color-accent);
	color: var(--color-white);
}
.btn-accent:hover { background: var(--color-accent-dark); }

.btn-outline {
	background: transparent;
	border-color: var(--color-border);
	color: var(--color-text);
}
.btn-outline:hover { border-color: var(--color-text); }

.btn-sm { padding: 10px 22px; font-size: 14px; }

/* ==========================================================================
   4. Header / navegación
   ========================================================================== */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(246, 246, 244, 0.85);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--color-border);
}

.site-header .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 84px;
}

.site-logo {
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 22px;
	letter-spacing: -0.02em;
}
.site-logo span { color: var(--color-accent); }

.nav-toggle {
	display: none;
	background: none;
	border: none;
	width: 40px;
	height: 40px;
	position: relative;
	z-index: 110;
}
.nav-toggle span {
	position: absolute;
	left: 8px;
	right: 8px;
	height: 2px;
	background: var(--color-text);
	transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 20px; }
.nav-toggle span:nth-child(3) { top: 26px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.site-nav {
	display: flex;
	align-items: center;
	gap: 40px;
}
.site-nav ul {
	display: flex;
	gap: 32px;
}
.site-nav a {
	font-size: 15px;
	font-weight: 500;
	opacity: 0.8;
	transition: opacity 0.15s ease;
}
.site-nav a:hover { opacity: 1; }

/* Dropdown "Servicios" */
.has-dropdown {
	position: relative;
}
.nav-dropdown-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: none;
	font-family: var(--font-body);
	font-size: 15px;
	font-weight: 500;
	color: var(--color-text);
	opacity: 0.8;
	transition: opacity 0.15s ease;
}
.nav-dropdown-toggle:hover,
.has-dropdown.is-open .nav-dropdown-toggle { opacity: 1; }
.nav-dropdown-caret {
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
	transition: transform 0.2s ease;
}
.has-dropdown.is-open .nav-dropdown-caret { transform: rotate(-135deg) translateY(1px); }

.site-nav ul.nav-dropdown {
	display: block;
	position: absolute;
	/* top queda pegado al trigger (sin gap) para que el hover no se pierda
	   al bajar el mouse; el "aire" visual se logra con padding-top en vez
	   de un top desplazado, así el área hoverable queda continua. */
	top: 100%;
	left: 50%;
	transform: translateX(-50%) translateY(-6px);
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: 16px;
	padding: 24px 10px 10px;
	min-width: 220px;
	box-shadow: 0 16px 40px rgba(0,0,0,0.1);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease, transform 0.15s ease;
	transition-delay: 0.1s;
	z-index: 120;
}
@media (min-width: 861px) {
	.has-dropdown:hover .nav-dropdown,
	.has-dropdown.is-open .nav-dropdown {
		opacity: 1;
		pointer-events: auto;
		transform: translateX(-50%) translateY(0);
		transition-delay: 0s;
	}
}
.nav-dropdown li + li { margin-top: 2px; }
.nav-dropdown a {
	display: block;
	padding: 10px 14px;
	border-radius: 10px;
	font-size: 14.5px;
	font-weight: 500;
	opacity: 0.85;
}
.nav-dropdown a:hover {
	opacity: 1;
	background: var(--color-bg);
}

@media (max-width: 860px) {
	.nav-toggle { display: block; }
	.site-nav {
		position: fixed;
		top: 84px;
		left: 0;
		right: 0;
		z-index: 99;
		background: var(--color-bg);
		border-bottom: 1px solid var(--color-border);
		flex-direction: column;
		align-items: flex-start;
		padding: 0 24px;
		gap: 32px;
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.3s ease, padding-top 0.3s ease, padding-bottom 0.3s ease;
	}
	.site-nav.is-open {
		max-height: calc(100vh - 84px);
		overflow-y: auto;
		padding-top: 32px;
		padding-bottom: 32px;
	}
	.site-nav ul {
		flex-direction: column;
		gap: 20px;
		width: 100%;
	}
	.site-nav ul a { font-size: 20px; }
	.site-nav .btn { display: inline-flex; }

	/* En móvil el dropdown se comporta como acordeón dentro del menú,
	   en vez de flotar posicionado absoluto como en desktop. */
	.nav-dropdown-toggle { font-size: 20px; padding: 0; }
	.nav-dropdown-caret { width: 9px; height: 9px; }
	.site-nav ul.nav-dropdown {
		display: block;
		position: static;
		transform: none;
		opacity: 1;
		pointer-events: auto;
		box-shadow: none;
		border: none;
		padding: 4px 0 0 0;
		min-width: 0;
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.25s ease, padding 0.25s ease;
	}
	.has-dropdown.is-open .nav-dropdown {
		max-height: 300px;
		padding: 10px 0 0 0;
	}
	.nav-dropdown a { font-size: 17px; padding: 8px 0; }
}

/* ==========================================================================
   5. Formas decorativas circulares
   ========================================================================== */
.deco-circle {
	position: absolute;
	border-radius: 50%;
	z-index: 0;
	pointer-events: none;
}
.deco-circle--violet { background: var(--color-accent); }
.deco-circle--black { background: var(--color-text); }

/* ==========================================================================
   6. Hero
   ========================================================================== */
.hero {
	position: relative;
	overflow: hidden;
	padding: 72px 0 var(--section-padding);
}
.hero .deco-circle--violet {
	width: 420px;
	height: 420px;
	top: -120px;
	right: -140px;
	opacity: 0.9;
}
.hero .deco-circle--black {
	width: 260px;
	height: 260px;
	top: 160px;
	right: 60px;
}
.hero-inner {
	position: relative;
	z-index: 1;
	max-width: 720px;
}
.hero-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 600;
	color: var(--color-accent);
	background: var(--color-white);
	border: 1px solid var(--color-border);
	padding: 8px 18px;
	border-radius: var(--radius-pill);
	margin-bottom: 28px;
}
.hero h1 {
	font-size: clamp(38px, 6vw, 68px);
	margin-bottom: 24px;
}
.hero h1 em {
	font-style: normal;
	color: var(--color-accent);
}
.hero-subtitle {
	font-size: clamp(17px, 2vw, 20px);
	color: #3a3a3a;
	max-width: 560px;
	margin-bottom: 40px;
}
.hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

/* ==========================================================================
   7. Caso de estudio
   ========================================================================== */
.case-study {
	position: relative;
	overflow: hidden;
	background: var(--color-text);
	color: var(--color-white);
	border-radius: var(--radius-card);
	margin: 0 24px;
	padding: var(--section-padding) 40px;
}
.case-study .deco-circle--violet {
	width: 380px;
	height: 380px;
	bottom: -160px;
	left: -120px;
	opacity: 0.85;
}
.case-study-inner {
	position: relative;
	z-index: 1;
	max-width: var(--container-width);
	margin: 0 auto;
}
.case-tag {
	font-size: 14px;
	font-weight: 600;
	color: var(--color-accent);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-bottom: 16px;
}
.case-study h2 {
	font-size: clamp(28px, 4vw, 42px);
	max-width: 680px;
	margin-bottom: 20px;
}
.case-study p.case-desc {
	color: #cfcfcf;
	max-width: 560px;
	margin-bottom: 48px;
	font-size: 17px;
}
.case-stats {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 24px;
	margin-bottom: 48px;
	max-width: 620px;
}
.case-stat-number {
	font-family: var(--font-heading);
	font-size: clamp(32px, 5vw, 52px);
	font-weight: 600;
	color: var(--color-white);
	line-height: 1;
	margin-bottom: 8px;
}
.case-stat-label {
	font-size: 14px;
	color: #b8b8b8;
}
.case-media {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
}
.case-media img {
	width: 100%;
	height: auto;
	border-radius: 14px;
	border: 1px solid rgba(255,255,255,0.12);
	align-self: center;
}

/* ==========================================================================
   8. Qué ofrecemos — grid de tarjetas
   ========================================================================== */
.section {
	padding: var(--section-padding) 0;
}
.section-head {
	max-width: 640px;
	margin-bottom: 56px;
}
.section-eyebrow {
	font-size: 14px;
	font-weight: 600;
	color: var(--color-accent);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-bottom: 12px;
}
.section-head h2 {
	font-size: clamp(28px, 4vw, 40px);
}
.section-head p {
	margin-top: 16px;
	font-size: 17px;
	color: #3a3a3a;
}

.offer-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
}
.offer-card {
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-card);
	padding: 32px 28px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-height: 260px;
}
.offer-card-icon {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--color-bg);
	display: flex;
	align-items: center;
	justify-content: center;
}
.offer-card h3 {
	font-size: 19px;
	margin-top: auto;
}
.offer-card p {
	font-size: 14.5px;
	color: #4a4a4a;
}
.offer-price {
	font-size: 13.5px !important;
	font-weight: 600;
	color: var(--color-accent) !important;
	margin-top: -4px;
}
.offer-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-family: var(--font-heading);
	font-size: 13.5px;
	font-weight: 600;
	color: var(--color-text);
	margin-top: 4px;
}
.offer-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.offer-card--featured .offer-link { color: var(--color-white); }
.offer-card--featured {
	background: var(--color-accent);
	border-color: var(--color-accent);
	color: var(--color-white);
}
.offer-card--featured .offer-card-icon {
	background: rgba(255,255,255,0.15);
}
.offer-card--featured p { color: rgba(255,255,255,0.85); }
.offer-card--featured .offer-price { color: var(--color-white) !important; }
.offer-card--featured .offer-badge {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	background: rgba(255,255,255,0.15);
	padding: 4px 12px;
	border-radius: var(--radius-pill);
	width: fit-content;
}

/* ==========================================================================
   9. Por qué S365
   ========================================================================== */
.why-section {
	background: var(--color-white);
	border-top: 1px solid var(--color-border);
	border-bottom: 1px solid var(--color-border);
}
.why-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 56px;
	align-items: start;
}
.why-list {
	display: flex;
	flex-direction: column;
	gap: 28px;
}
.why-item {
	display: flex;
	gap: 18px;
}
.why-item-num {
	font-family: var(--font-heading);
	font-weight: 600;
	color: var(--color-accent);
	font-size: 18px;
	flex-shrink: 0;
}
.why-item h3 {
	font-size: 17px;
	margin-bottom: 6px;
}
.why-item p {
	font-size: 14.5px;
	color: #4a4a4a;
}

/* ==========================================================================
   10. Preguntas frecuentes (acordeón)
   ========================================================================== */
.faq-list {
	display: flex;
	flex-direction: column;
	gap: 16px;
	max-width: 780px;
}
.faq-item {
	border: 1px solid var(--color-border);
	border-radius: 16px;
	background: var(--color-white);
	overflow: hidden;
}
.faq-question {
	margin: 0;
	font-size: 17px;
}
.faq-question button {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 24px;
	background: none;
	border: none;
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 16px;
	text-align: left;
	color: var(--color-text);
}
.faq-icon {
	position: relative;
	flex-shrink: 0;
	width: 20px;
	height: 20px;
}
.faq-icon::before,
.faq-icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	background: var(--color-accent);
	transform: translate(-50%, -50%);
	transition: transform 0.2s ease, opacity 0.2s ease;
}
.faq-icon::before { width: 14px; height: 2px; }
.faq-icon::after { width: 2px; height: 14px; }
.faq-item.is-open .faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); opacity: 0; }

.faq-answer {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.25s ease;
}
.faq-answer p {
	padding: 0 24px 20px;
	font-size: 14.5px;
	color: #4a4a4a;
}
.faq-item.is-open .faq-answer {
	max-height: 240px;
}

/* ==========================================================================
   11. Contacto
   ========================================================================== */
.contact-section {
	position: relative;
	overflow: hidden;
}
.contact-inner {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: 0.9fr 1.1fr;
	gap: 56px;
}
.contact-text h2 {
	font-size: clamp(28px, 4vw, 40px);
	margin-bottom: 16px;
}
.contact-text p {
	font-size: 17px;
	color: #3a3a3a;
	margin-bottom: 32px;
	max-width: 460px;
}
.contact-links {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.contact-link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-weight: 500;
	font-size: 15px;
}
.contact-link .dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--color-accent);
}

.contact-form {
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-card);
	padding: 36px;
}
.form-row {
	margin-bottom: 20px;
}
.form-row label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 8px;
	color: #333;
}
.form-row input,
.form-row textarea {
	width: 100%;
	padding: 14px 16px;
	border: 1px solid var(--color-border);
	border-radius: 12px;
	background: var(--color-bg);
	font-size: 15px;
	color: var(--color-text);
}
.form-row input:focus,
.form-row textarea:focus {
	outline: 2px solid var(--color-accent);
	outline-offset: 1px;
}
.form-row textarea { resize: vertical; min-height: 120px; }

.form-notice {
	padding: 14px 18px;
	border-radius: 12px;
	font-size: 14px;
	margin-bottom: 20px;
}
.form-notice--success {
	background: #eaf7ee;
	color: #1e6b34;
	border: 1px solid #bfe6ca;
}
.form-notice--error {
	background: #fdeceb;
	color: #a3271b;
	border: 1px solid #f3c6c1;
}

/* ==========================================================================
   12. Páginas de servicio (plataformas-moodle, sitios-institucionales,
       mantenimiento-web, migracion-moodle)
   ========================================================================== */
.service-back {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 500;
	color: #4a4a4a;
	margin-bottom: 24px;
}
.service-back:hover { color: var(--color-text); }

.service-price-badge {
	display: inline-flex;
	align-items: baseline;
	gap: 8px;
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-pill);
	padding: 12px 22px;
	margin-bottom: 32px;
	font-family: var(--font-heading);
}
.service-price-badge strong {
	font-size: 20px;
	color: var(--color-accent);
}
.service-price-badge span {
	font-family: var(--font-body);
	font-size: 13.5px;
	color: #6b6b6b;
}

.service-copy {
	max-width: 720px;
}
.service-copy p {
	font-size: 17px;
	color: #3a3a3a;
	margin-bottom: 24px;
}
.service-copy p:last-child { margin-bottom: 0; }

.service-cta {
	position: relative;
	overflow: hidden;
	background: var(--color-text);
	color: var(--color-white);
	border-radius: var(--radius-card);
	margin: 0 24px;
	padding: 64px 40px;
	text-align: center;
}
.service-cta .deco-circle--violet {
	width: 320px;
	height: 320px;
	bottom: -140px;
	right: -100px;
	opacity: 0.85;
}
.service-cta-inner {
	position: relative;
	z-index: 1;
	max-width: 520px;
	margin: 0 auto;
}
.service-cta h2 {
	font-size: clamp(26px, 4vw, 36px);
	margin-bottom: 14px;
}
.service-cta p {
	color: #cfcfcf;
	margin-bottom: 32px;
	font-size: 16px;
}

@media (max-width: 640px) {
	.service-cta { margin: 0 16px; padding: 48px 24px; }
}

/* ==========================================================================
   13. Footer
   ========================================================================== */
.site-footer {
	border-top: 1px solid var(--color-border);
	padding: 40px 0;
}
.site-footer .container {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
}
.footer-brand {
	font-family: var(--font-heading);
	font-weight: 600;
}
.footer-meta {
	font-size: 13.5px;
	color: #6b6b6b;
}
.footer-meta a { text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   14. Responsive — tablet / mobile
   ========================================================================== */
@media (max-width: 980px) {
	.offer-grid { grid-template-columns: repeat(2, 1fr); }
	.why-grid { grid-template-columns: 1fr; gap: 32px; }
	.contact-inner { grid-template-columns: 1fr; gap: 40px; }
	.case-media { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
	:root { --section-padding: 64px; }
	.container { padding: 0 20px; }
	.case-study { margin: 0 16px; padding: 56px 24px; }
	.offer-grid { grid-template-columns: 1fr; }
	.case-stats { grid-template-columns: 1fr; gap: 28px; }
	.case-media { grid-template-columns: 1fr; }
	.hero-actions .btn { width: 100%; }
	.contact-form { padding: 24px; }
	.faq-question button { padding: 16px 18px; font-size: 15px; }
	.faq-answer p { padding: 0 18px 18px; }
	.faq-item.is-open .faq-answer { max-height: 320px; }

	/* El círculo negro decorativo, a tamaño completo, cae justo sobre el
	   título/subtítulo del hero en pantallas chicas (texto negro sobre
	   círculo negro = ilegible). Se achica y se manda a una esquina fuera
	   del bloque de texto. */
	.hero .deco-circle--violet {
		width: 220px;
		height: 220px;
		top: -90px;
		right: -90px;
	}
	.hero .deco-circle--black {
		width: 110px;
		height: 110px;
		top: auto;
		bottom: -60px;
		right: -20px;
	}
}
