/*
Theme Name: Plátano y Anguila
Theme URI: https://platanoyanguila.com
Author: 13Node.com
Author URI: https://13node.com
Description: A unique WordPress theme featuring a peculiar panel-based navigation system with desktop floating buttons and mobile sidebar tabs.
Version: 1.0.0
Text Domain: platano
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* ==========================================================================
   1. Reset & Base
   ========================================================================== */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	height: 100%;
}

:root {
	--nav-h: 3.25rem;
	--tab-w: 6.5rem;
	--color-bg: #fff;
	--color-text: #111;
	--color-border: #ddd;
	--color-btn-bg: #000;
	--color-btn-text: #fff;
	--color-btn-hover: #222;
	--color-focus: #4A90D9;
	--color-sidebar-btn: #f0f0f0;
	--transition-speed: 0.4s;
	--shadow-btn: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   2. Accessibility — Skip Link
   ========================================================================== */

.skip-link {
	position: absolute;
	top: -100%;
	left: 1rem;
	padding: 0.5rem 1rem;
	background: var(--color-btn-bg);
	color: var(--color-btn-text);
	z-index: 10000;
	border-radius: 0 0 4px 4px;
	text-decoration: none;
	font-weight: 600;
	transition: top 0.2s ease;
}

.skip-link:focus {
	top: 0;
}

/* ==========================================================================
   3. Accessibility — Focus Styles
   ========================================================================== */

:focus-visible {
	outline: 3px solid var(--color-focus);
	outline-offset: 2px;
}

/* ==========================================================================
   4. Accessibility — Screen Reader Text
   ========================================================================== */

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: #f1f1f1;
	border-radius: 3px;
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
	clip: auto !important;
	clip-path: none;
	color: #21759b;
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

/* ==========================================================================
   5. Navigation — Top Bar
   ========================================================================== */

.site-nav {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: var(--nav-h);
	padding: 0 1rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--color-bg);
	border-bottom: 1px solid var(--color-border);
	z-index: 999;
	overflow: visible;
}

/* ---------- Site brand (logo / site name — always left) ---------- */

.site-brand {
	display: flex;
	align-items: center;
	align-self: flex-start;
	flex-shrink: 0;
	overflow: visible;
	position: relative;
	z-index: 1;
	padding-top: 0.25rem;
}

.site-brand a {
	display: inline-flex;
	align-items: center;
}

.site-brand img,
.custom-logo {
	/* Default height — overridden by Customizer inline CSS */
	max-height: 50px;
	width: auto;
	height: auto;
	display: block;
	/* Allow logo to visually overflow the navbar */
	object-fit: contain;
}

.site-title-link {
	font-size: 1.1rem;
	font-weight: 700;
	text-decoration: none;
	color: var(--color-text);
	white-space: nowrap;
}

.site-title-link:hover {
	opacity: 0.7;
}

/* ==========================================================================
   6. Navigation — Desktop Horizontal Menu (right aligned)
   ========================================================================== */

.desktop-nav {
	display: flex;
	gap: 0.75rem;
	margin: 0;
	margin-left: auto;
	padding: 0;
	list-style: none;
	align-items: center;
}

.desktop-nav li {
	list-style: none;
	position: relative;
}

.desktop-nav a {
	background: none;
	border: 0;
	font: inherit;
	cursor: pointer;
	padding: 0.25rem 0.5rem;
	text-decoration: none;
	color: var(--color-text);
	transition: opacity 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a:focus {
	text-decoration: underline;
}

/* Sub-menu (dropdown) */
.desktop-nav .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	right: 0;
	background: var(--color-bg);
	border: 1px solid var(--color-border);
	padding: 0.5rem 0;
	list-style: none;
	min-width: 10rem;
	box-shadow: var(--shadow-btn);
	border-radius: 4px;
}

.desktop-nav li:hover > .sub-menu,
.desktop-nav li:focus-within > .sub-menu {
	display: block;
}

.desktop-nav .sub-menu a {
	display: block;
	padding: 0.4rem 1rem;
	white-space: nowrap;
}

/* ==========================================================================
   7. Navigation — Hamburger Button (CSS-drawn lines)
   ========================================================================== */

.hamburger {
	display: none;
	margin-left: auto;
	background: none;
	border: 0;
	cursor: pointer;
	padding: 0.4rem;
	width: 2rem;
	height: 2rem;
	position: relative;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 5px;
}

.hamburger-line {
	display: block;
	width: 100%;
	height: 2px;
	background: var(--color-text);
	border-radius: 2px;
	transition: transform 0.3s ease, opacity 0.3s ease;
	pointer-events: none;
}

/* Animate into ✕ when offcanvas is open */
.hamburger.is-active .hamburger-line:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.hamburger.is-active .hamburger-line:nth-child(2) {
	opacity: 0;
}

.hamburger.is-active .hamburger-line:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   8. Navigation — Offcanvas Mobile Menu
   ========================================================================== */

.offcanvas-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 1000;
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--transition-speed) ease,
	            visibility var(--transition-speed);
}

.offcanvas-overlay.show {
	opacity: 1;
	visibility: visible;
}

.offcanvas {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: min(80vw, 20rem);
	background: var(--color-bg);
	z-index: 1001;
	overflow-y: auto;
	transform: translateX(-100%);
	visibility: hidden;
	transition: transform var(--transition-speed) ease,
	            visibility var(--transition-speed);
	box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

.offcanvas.show {
	transform: translateX(0);
	visibility: visible;
}

/* Offcanvas header */
.offcanvas-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem;
	border-bottom: 1px solid var(--color-border);
}

.offcanvas-brand {
	display: flex;
	align-items: center;
}

.offcanvas-brand img,
.offcanvas-brand .custom-logo {
	max-height: 2.5rem;
	width: auto;
	height: auto;
}

.offcanvas-brand .site-title-link {
	font-size: 1rem;
}

.offcanvas-close {
	background: none;
	border: 1px solid var(--color-border);
	border-radius: 50%;
	width: 2rem;
	height: 2rem;
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--color-text);
	transition: background 0.2s ease;
	flex-shrink: 0;
}

.offcanvas-close:hover {
	background: var(--color-sidebar-btn);
}

/* Offcanvas navigation list */
.offcanvas-nav {
	padding: 1rem;
}

.offcanvas-nav-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.offcanvas-nav-list li {
	border-bottom: 1px solid var(--color-border);
}

.offcanvas-nav-list li:last-child {
	border-bottom: 0;
}

.offcanvas-nav-list a {
	display: block;
	padding: 0.75rem 0.5rem;
	text-decoration: none;
	color: var(--color-text);
	font-size: 1rem;
	transition: background 0.2s ease;
}

.offcanvas-nav-list a:hover,
.offcanvas-nav-list a:focus {
	background: var(--color-sidebar-btn);
}

/* Sub-menu within offcanvas */
.offcanvas-nav-list .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0 0 0 1rem;
}

.offcanvas-nav-list .sub-menu a {
	font-size: 0.9rem;
	padding-left: 1rem;
}

/* ==========================================================================
   9. Navigation — Mobile Right Sidebar (Section Tabs)
   ========================================================================== */

.mobile-tabs {
	position: fixed;
	top: var(--nav-h);
	right: 0;
	bottom: 0;
	width: 30%;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1rem;
	z-index: 998;
	overflow-y: auto;
	list-style: none;
	margin: 0;
}

.mobile-tabs button {
	width: 100%;
	border: 0;
	padding: 0.8rem;
	font-size: 0.9rem;
	cursor: pointer;
	border-radius: 4px;
	text-align: center;
	background: var(--color-sidebar-btn);
	color: var(--color-text);
	transition: background 0.2s ease, color 0.2s ease;
}

.mobile-tabs button:hover,
.mobile-tabs button[aria-expanded="true"] {
	background: var(--color-btn-bg);
	color: var(--color-btn-text);
}

/* ==========================================================================
   10. Desktop Floating Buttons
   ========================================================================== */

.desktop-floating {
	position: fixed;
	z-index: 998;
	display: none;
}

.desktop-floating button {
	background: var(--color-btn-bg);
	color: var(--color-btn-text);
	border: 0;
	padding: 0.8rem 1.2rem;
	border-radius: 8px;
	font-size: 1rem;
	cursor: pointer;
	box-shadow: var(--shadow-btn);
	transition: transform 0.2s ease, background 0.2s ease;
}

.desktop-floating button:hover {
	transform: scale(1.05);
}

.desktop-floating button[aria-expanded="true"] {
	background: var(--color-btn-hover);
}

@media (min-width: 768px) {
	.desktop-floating {
		max-height: 20vh;
	}
}

/* ==========================================================================
   11. Slide-up Panels
   ========================================================================== */

.panel {
	position: fixed;
	left: 0;
	top: var(--nav-h);
	bottom: 0;
	background: var(--color-bg);
	overflow: auto;
	padding: 2.5rem 1rem 4rem;
	transform: translateY(100%);
	visibility: hidden;
	transition: transform var(--transition-speed) ease,
		visibility var(--transition-speed);
	z-index: 997;
}

.panel.active {
	transform: translateY(0);
	visibility: visible;
}

.panel:focus {
	outline: none;
}

/* Panel close button */
.panel-close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	background: none;
	border: 1px solid var(--color-border);
	border-radius: 50%;
	width: 2rem;
	height: 2rem;
	font-size: 1.2rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--color-text);
	transition: background 0.2s ease;
}

.panel-close:hover {
	background: var(--color-sidebar-btn);
}

/* ==========================================================================
   12. Responsive Video Embed
   ========================================================================== */

.video-container {
	position: relative;
	width: 100%;
	height: 0;
	padding-bottom: 56.25%;
	/* 16:9 */
}

.video-container iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* ==========================================================================
   13. Responsive — Mobile (< 768px)
   ========================================================================== */

@media (max-width: 767px) {
	.desktop-nav {
		display: none;
	}

	.hamburger {
		display: flex;
	}

	.desktop-floating {
		display: none !important;
	}

	.panel {
		right: 30%;
		/* Leave space for the right sidebar */
	}
}

/* ==========================================================================
   14. Responsive — Desktop (>= 768px)
   ========================================================================== */

@media (min-width: 768px) {

	.mobile-tabs,
	.hamburger,
	.offcanvas,
	.offcanvas-overlay {
		display: none !important;
	}

	.desktop-floating {
		display: block;
	}

	.panel {
		right: 0;
		top: calc(var(--nav-h) + 20vh);
		height: 80vh;
	}
}

/* ==========================================================================
   15. Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ==========================================================================
   16. WordPress Core Styles
   ========================================================================== */

.alignnone {
	margin: 5px 20px 20px 0;
}

.aligncenter,
div.aligncenter {
	display: block;
	margin: 5px auto;
}

.alignright {
	float: right;
	margin: 5px 0 20px 20px;
}

.alignleft {
	float: left;
	margin: 5px 20px 20px 0;
}

a img.alignright {
	float: right;
	margin: 5px 0 20px 20px;
}

a img.alignnone {
	margin: 5px 20px 20px 0;
}

a img.alignleft {
	float: left;
	margin: 5px 20px 20px 0;
}

a img.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.wp-caption {
	background: #fff;
	border: 1px solid #f0f0f0;
	max-width: 96%;
	padding: 5px 3px 10px;
	text-align: center;
}

.wp-caption.alignnone {
	margin: 5px 20px 20px 0;
}

.wp-caption.alignleft {
	margin: 5px 20px 20px 0;
}

.wp-caption.alignright {
	margin: 5px 0 20px 20px;
}

.wp-caption img {
	border: 0 none;
	height: auto;
	margin: 0;
	max-width: 98.5%;
	padding: 0;
	width: auto;
}

.wp-caption p.wp-caption-text {
	font-size: 0.8rem;
	line-height: 17px;
	margin: 0;
	padding: 0 4px 5px;
}