/**
 * theme.css
 * Core design system and styles for fd-theme.
 * Author: FD
 */

/* ==========================================================================
   0. Custom Variables & Reset
   ========================================================================== */
:root {
	--bg-primary: #242424;
	--bg-secondary: #1B1B1B;
	--bg-accent: #90282b;
	--bg-accent-hover: #752022;
	
	--text-primary: #FFFFFF;
	--text-secondary: #F0F0F0;
	--text-muted: #abb8c3;
	
	--font-main: 'Averia Libre', Georgia, serif;
	
	--max-width: 1140px;
	--header-height: 80px;
	
	--transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
	--transition-fast: all 0.15s ease-in-out;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	scroll-behavior: smooth;
	font-size: 16px;
}

body {
	font-family: var(--font-main);
	background-color: var(--bg-primary);
	color: var(--text-primary);
	line-height: 1.6;
	overflow-x: hidden;
	padding-top: var(--header-height);
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: var(--text-primary);
	text-decoration: none;
	transition: var(--transition-fast);
}

a:hover {
	color: var(--bg-accent);
}

button, input, textarea {
	font-family: inherit;
}

/* Utilities */
.section-container {
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 80px 20px;
}

.text-center {
	text-align: center;
}

.grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 40px;
}

.align-center {
	align-items: center;
}

.img-responsive {
	width: 100%;
	height: auto;
	object-fit: cover;
}

.rounded-img {
	border-radius: 8px;
	box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.button {
	display: inline-block;
	background-color: var(--bg-accent);
	color: var(--text-primary);
	padding: 12px 30px;
	border-radius: 4px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 1px;
	border: 2px solid var(--bg-accent);
	cursor: pointer;
	transition: var(--transition-smooth);
}

.button:hover, .button:focus {
	background-color: var(--bg-accent-hover);
	border-color: var(--bg-accent-hover);
	transform: translateY(-2px);
	box-shadow: 0 5px 15px rgba(152, 36, 42, 0.4);
	outline: none;
}

/* Skip link for Accessibility */
.skip-link {
	position: absolute;
	top: -100px;
	left: 0;
	background: var(--bg-accent);
	color: #fff;
	padding: 10px 20px;
	z-index: 100000;
	transition: top 0.2s;
}

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

/* Focus states for Accessibility */
a:focus, button:focus {
	outline: 2px dashed var(--bg-accent);
	outline-offset: 3px;
}

/* ==========================================================================
   1. Header & Navigation
   ========================================================================== */
.site-header {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: var(--header-height);
	background-color: var(--bg-secondary);
	z-index: 999;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
	transition: var(--transition-smooth);
}

.site-header.scrolled {
	box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
	background-color: rgba(27, 27, 27, 0.95);
	backdrop-filter: blur(10px);
}

.header-container {
	max-width: var(--max-width);
	height: 100%;
	margin: 0 auto;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0 20px;
}

.site-branding img {
	max-height: 55px;
	width: auto;
}

.site-title-fallback {
	font-size: 1.5rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 2px;
	color: var(--text-primary);
}

/* Navigation Menu */
.main-navigation {
	display: flex;
	align-items: center;
}

.menu-toggle {
	display: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 10px;
}

.burger-icon {
	display: block;
	width: 25px;
	height: 18px;
	position: relative;
}

.burger-icon span {
	display: block;
	position: absolute;
	height: 2px;
	width: 100%;
	background: var(--text-primary);
	border-radius: 2px;
	opacity: 1;
	left: 0;
	transform: rotate(0deg);
	transition: .25s ease-in-out;
}

.burger-icon span:nth-child(1) { top: 0px; }
.burger-icon span:nth-child(2) { top: 8px; }
.burger-icon span:nth-child(3) { top: 16px; }

.menu-toggle[aria-expanded="true"] .burger-icon span:nth-child(1) {
	top: 8px;
	transform: rotate(135deg);
}
.menu-toggle[aria-expanded="true"] .burger-icon span:nth-child(2) {
	opacity: 0;
	left: -60px;
}
.menu-toggle[aria-expanded="true"] .burger-icon span:nth-child(3) {
	top: 8px;
	transform: rotate(-135deg);
}

.nav-menu {
	display: flex;
	list-style: none;
	gap: 30px;
}

.nav-menu a {
	font-size: 0.95rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
	position: relative;
	padding: 8px 0;
}

.nav-menu a::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 0;
	height: 2px;
	background-color: var(--bg-accent);
	transition: var(--transition-smooth);
}

.nav-menu a:hover::after,
.nav-menu .current-menu-item a::after {
	width: 100%;
}

.header-socials {
	display: flex;
	gap: 15px;
}

.social-icon {
	display: inline-flex;
	justify-content: center;
	align-items: center;
	width: 38px;
	height: 38px;
	background-color: rgba(255, 255, 255, 0.05);
	border-radius: 50%;
	transition: var(--transition-smooth);
}

.social-icon:hover {
	background-color: var(--bg-accent);
	color: #fff;
	transform: translateY(-3px);
}

.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;
}

/* ==========================================================================
   2. Hero Slider
   ========================================================================== */
.hero-slider-section {
	width: 100%;
	overflow: hidden;
	background-color: #000;
}

.slider-wrapper {
	position: relative;
	width: 100%;
	height: 800px;
}

.slider-slides {
	position: relative;
	width: 100%;
	height: 100%;
}

.slide {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
	z-index: 1;
}

.slide.active {
	opacity: 1;
	visibility: visible;
	z-index: 2;
}

.slide-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.6) 100%);
}

.slide-content-container {
	position: relative;
	width: 100%;
	height: 100%;
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 0 20px;
	display: flex;
	align-items: center;
	z-index: 3;
}

.slide-content {
	max-width: 600px;
	transform: translateY(30px);
	opacity: 0;
	transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1) 0.3s, opacity 0.8s ease-out 0.3s;
}

.slide.active .slide-content {
	transform: translateY(0);
	opacity: 1;
}

.slide-title {
	font-size: 3.5rem;
	font-weight: 700;
	line-height: 1.1;
	margin-bottom: 15px;
	text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.slide-description {
	font-size: 1.5rem;
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: 2px;
	color: var(--text-secondary);
	margin-bottom: 30px;
	text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.slider-dots {
	position: absolute;
	bottom: 30px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	display: flex;
	gap: 10px;
}

.slider-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 2px solid #FFFFFF;
	background: transparent;
	cursor: pointer;
	padding: 0;
	transition: var(--transition-fast);
}

.slider-dot:hover {
	background-color: rgba(255, 255, 255, 0.5);
}

.slider-dot.active {
	background-color: var(--bg-accent);
	border-color: var(--bg-accent);
	transform: scale(1.2);
}

/* ==========================================================================
   3. Sections Styling
   ========================================================================== */
.section-title {
	font-size: 2.5rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 20px;
}

.sub-section-title {
	font-size: 2rem;
	font-weight: 600;
	text-transform: uppercase;
	margin-bottom: 20px;
}

.title-divider {
	width: 80px;
	height: 2px;
	background-color: var(--bg-accent);
	margin: 0 auto 30px auto;
}

.section-divider {
	width: 100%;
	height: 1px;
	background-color: rgba(255, 255, 255, 0.05);
	margin-top: 60px;
}

/* Intro Section */
.intro-section {
	background-color: var(--bg-primary);
}

.intro-text-content p {
	font-size: 1.15rem;
	max-width: 800px;
	margin: 0 auto 20px auto;
	line-height: 1.8;
}

/* Storia Section */
.storia-section {
	background-color: var(--bg-secondary);
}

.storia-grid {
	align-items: center;
}

.storia-text-col p {
	font-size: 1.1rem;
	margin-bottom: 20px;
	line-height: 1.7;
	text-align: justify;
}

.storia-text-col p:last-child {
	margin-bottom: 0;
}

/* Quote Section */
.quote-section {
	position: relative;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	background-attachment: fixed;
	padding: 120px 0;
}

.quote-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.7);
}

.quote-content {
	position: relative;
	z-index: 2;
}

.blockquote-title {
	font-size: 2rem;
	font-weight: 600;
	font-style: italic;
	line-height: 1.4;
	margin-bottom: 20px;
	max-width: 900px;
	margin-left: auto;
	margin-right: auto;
	color: #FFFFFF;
	text-transform: uppercase;
}

.blockquote-subtext {
	font-size: 1.15rem;
	color: var(--text-muted);
}

/* Timeline Section (Tabs/Accordion) */
.timeline-section {
	background-color: var(--bg-secondary);
}

.tabs-container {
	width: 100%;
	margin-bottom: 40px;
}

.tabs-nav {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	list-style: none;
	border-bottom: 4px solid var(--bg-primary);
	margin-bottom: 30px;
}

.tab-button {
	background: none;
	border: none;
	color: var(--text-primary);
	padding: 15px 25px;
	font-size: 1.15rem;
	font-weight: 700;
	cursor: pointer;
	transition: var(--transition-fast);
	border-bottom: 4px solid transparent;
	margin-bottom: -4px;
}

.tab-button:hover {
	color: var(--bg-accent);
}

.tab-button.active {
	color: var(--text-primary);
	background-color: var(--bg-accent);
	border-bottom: 4px solid var(--bg-accent);
}

.tabs-content {
	background-color: var(--bg-accent);
	padding: 40px;
	border-radius: 0 0 8px 8px;
	box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.tab-panel-inner h3 {
	font-size: 1.75rem;
	margin-bottom: 20px;
	text-transform: uppercase;
	border-bottom: 1px solid rgba(255,255,255,0.2);
	padding-bottom: 10px;
}

.history-desc p {
	font-size: 1.1rem;
	line-height: 1.7;
	margin-bottom: 15px;
}

.history-desc p:last-child {
	margin-bottom: 0;
}

.tab-panel.hidden {
	display: none;
}

/* Mobile Accordion Headers (hidden on desktop) */
.tab-accordion-header {
	display: none;
	width: 100%;
	background: var(--bg-primary);
	color: var(--text-primary);
	border: 1px solid rgba(255, 255, 255, 0.05);
	padding: 15px;
	font-size: 1.15rem;
	font-weight: 700;
	text-align: left;
	cursor: pointer;
	position: relative;
	transition: var(--transition-fast);
}

.tab-accordion-header::after {
	content: '\f078';
	font-family: 'Font Awesome 5 Free';
	font-weight: 900;
	position: absolute;
	right: 15px;
	font-size: 0.9rem;
	transition: transform 0.25s ease;
}

.tab-accordion-header.active {
	background: var(--bg-accent);
	color: #fff;
	border-color: var(--bg-accent);
}

.tab-accordion-header.active::after {
	transform: rotate(180deg);
}

/* Logo Explanation */
.logo-explanation-section {
	background-color: var(--bg-secondary);
	padding-bottom: 80px;
}

.logo-explanation-image img {
	max-height: 400px;
	object-fit: contain;
	margin: 0 auto;
}

.logo-explanation-body p {
	font-size: 1.1rem;
	margin-bottom: 20px;
	line-height: 1.7;
}

.logo-explanation-body p:last-child {
	margin-bottom: 0;
}

/* Vino Section */
.vino-section {
	background-color: var(--bg-primary);
}

.vino-intro {
	margin-bottom: 60px;
}

.vino-intro-text p {
	font-size: 1.15rem;
	max-width: 800px;
	margin: 0 auto;
	line-height: 1.8;
}

.vino-row {
	margin-bottom: 80px;
}

.vino-row:last-child {
	margin-bottom: 0;
}

.row-title {
	font-size: 1.75rem;
	font-weight: 600;
	text-transform: uppercase;
	margin-bottom: 20px;
	position: relative;
}

.row-text p {
	font-size: 1.1rem;
	margin-bottom: 15px;
	line-height: 1.7;
}

.row-text p:last-child {
	margin-bottom: 0;
}

/* Collaborazioni Section */
.collaborazioni-section {
	background-color: var(--bg-accent);
}

.collab-row {
	margin-bottom: 80px;
}

.solutions-row {
	border-top: 1px solid rgba(255, 255, 255, 0.05);
	padding-top: 80px;
}

.collab-logo {
	max-height: 350px;
	object-fit: contain;
	margin: 0 auto;
}

.solutions-link-wrapper {
	margin-top: 25px;
}

.solutions-link {
	font-size: 1.1rem;
	font-weight: 700;
	text-decoration: underline;
	color: #FFFFFF;
}

.solutions-link:hover {
	color: var(--bg-accent);
}

/* Partners Carousel */
.partners-section {
	background-color: var(--bg-secondary);
	padding: 80px 0;
}

.partners-carousel-container {
	margin-top: 0;
	padding-top: 0;
	border-top: none;
}

.partners-title {
	font-size: 1.5rem;
	text-transform: uppercase;
	letter-spacing: 1px;
	text-align: center;
	margin-bottom: 15px;
}

.partners-divider {
	width: 50px;
	height: 1px;
	background-color: var(--bg-accent);
	margin: 0 auto 40px auto;
}

.partners-slider {
	width: 100%;
	overflow: hidden;
	position: relative;
	background-color: var(--bg-secondary);
	padding: 20px 0;
}

.partners-track {
	display: flex;
	width: max-content;
	animation: marquee 40s linear infinite;
	align-items: center;
}

.partners-slider:hover .partners-track {
	animation-play-state: paused;
}

.partner-slide {
	padding: 0 40px;
	display: flex;
	justify-content: center;
	align-items: center;
}

.partner-logo {
	max-height: 60px;
	width: auto;
	filter: grayscale(100%) brightness(0.85) contrast(1.2);
	opacity: 0.7;
	transition: var(--transition-smooth);
}

.partner-logo:hover {
	filter: none;
	opacity: 1;
	transform: scale(1.05);
}

@keyframes marquee {
	0% {
		transform: translateX(0);
	}
	100% {
		transform: translateX(-50%);
	}
}

/* ==========================================================================
   4. Footer Styling
   ========================================================================== */
.site-footer {
	background-color: var(--bg-secondary);
	border-top: 1px solid rgba(255, 255, 255, 0.05);
	position: relative;
}

.footer-container {
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 80px 20px 40px 20px;
	text-align: center;
}

.footer-heading {
	font-size: 2rem;
	font-weight: 600;
	text-transform: uppercase;
	margin-bottom: 25px;
}

.footer-text p {
	font-size: 1.1rem;
	max-width: 700px;
	margin: 0 auto 15px auto;
	color: var(--text-secondary);
}

.footer-email-row {
	margin: 35px 0;
}

.footer-email-link {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	font-size: 1.25rem;
	font-weight: 600;
	background-color: rgba(255,255,255,0.02);
	border: 1px solid rgba(255, 255, 255, 0.05);
	padding: 15px 30px;
	border-radius: 50px;
	transition: var(--transition-smooth);
}

.footer-email-link:hover {
	background-color: var(--bg-accent);
	border-color: var(--bg-accent);
	color: #fff;
	transform: translateY(-3px);
	box-shadow: 0 10px 20px rgba(152, 36, 42, 0.2);
}

.email-icon {
	font-size: 1.4rem;
}

.footer-socials {
	display: flex;
	justify-content: center;
	gap: 20px;
	margin-bottom: 50px;
}

.footer-socials .social-icon {
	width: 48px;
	height: 48px;
	font-size: 1.2rem;
}

.footer-copyright {
	font-size: 0.95rem;
	color: var(--text-muted);
	border-top: 1px solid rgba(255, 255, 255, 0.05);
	padding-top: 30px;
}

.footer-copyright a {
	color: #FFFFFF;
	font-weight: 600;
}

.footer-copyright a:hover {
	color: var(--bg-accent);
}

/* Scroll To Top Button */
.scroll-to-top {
	position: fixed;
	bottom: 30px;
	right: 30px;
	width: 45px;
	height: 45px;
	background-color: var(--bg-accent);
	color: #FFFFFF;
	border-radius: 50%;
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 1.2rem;
	cursor: pointer;
	z-index: 998;
	opacity: 0;
	visibility: hidden;
	transform: translateY(20px);
	transition: var(--transition-smooth);
	box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.scroll-to-top.visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.scroll-to-top:hover {
	background-color: var(--bg-accent-hover);
	transform: translateY(-3px) scale(1.05);
	box-shadow: 0 6px 15px rgba(0,0,0,0.4);
}

/* ==========================================================================
   5. Responsive Styles
   ========================================================================== */
@media (max-width: 1024px) {
	:root {
		--header-height: 70px;
	}
	
	.slider-wrapper {
		height: 600px;
	}
	
	.slide-title {
		font-size: 2.8rem;
	}
	
	.slide-description {
		font-size: 1.25rem;
	}
	
	.section-title {
		font-size: 2.2rem;
	}
}

@media (max-width: 768px) {
	.grid-2 {
		grid-template-columns: 1fr;
		gap: 30px;
	}
	
	.reversed-desktop {
		/* Reverse ordering of columns on mobile for semantic text-image layout */
		display: flex;
		flex-direction: column-reverse;
	}
	
	.section-container {
		padding: 50px 20px;
	}
	
	.site-header {
		background-color: var(--bg-secondary);
	}
	
	/* Burger Menu Navigation */
	.menu-toggle {
		display: block;
	}
	
	.menu-primary-container {
		position: fixed;
		top: var(--header-height);
		left: 0;
		width: 100%;
		height: calc(100vh - var(--header-height));
		background-color: var(--bg-secondary);
		padding: 40px 20px;
		display: none; /* controlled by JS */
		opacity: 0;
		transform: translateY(-20px);
		transition: opacity 0.3s ease, transform 0.3s ease;
		border-top: 1px solid rgba(255,255,255,0.05);
		overflow-y: auto;
	}
	
	.menu-primary-container.open {
		display: block;
		opacity: 1;
		transform: translateY(0);
	}
	
	.nav-menu {
		flex-direction: column;
		align-items: center;
		gap: 25px;
	}
	
	.nav-menu a {
		font-size: 1.25rem;
	}
	
	.header-socials {
		display: none; /* Hide top-header socials on mobile */
	}
	
	/* Hero slider on mobile */
	.slider-wrapper {
		height: 480px;
	}
	
	.slide-title {
		font-size: 2.2rem;
	}
	
	.slide-description {
		font-size: 1.1rem;
		letter-spacing: 1px;
	}
	
	/* Timeline Responsive Accordion */
	.tabs-nav {
		display: none; /* Hide tab-buttons on mobile */
	}
	
	.tab-accordion-header {
		display: block; /* Show accordion headers instead */
		margin-bottom: 2px;
	}
	
	.tabs-content {
		padding: 0;
		background: none;
		border-radius: 0;
		box-shadow: none;
	}
	
	.tab-panel {
		background-color: var(--bg-accent);
		padding: 30px 20px;
		border-radius: 0 0 4px 4px;
		margin-bottom: 10px;
	}
	
	.tab-panel.hidden {
		display: none;
	}
	
	/* Quote Section */
	.quote-section {
		padding: 80px 20px;
		background-attachment: scroll; /* Fixes performance issues on mobile scrolling */
	}
	
	.blockquote-title {
		font-size: 1.4rem;
	}
	
	/* Footer */
	.footer-email-link {
		font-size: 1rem;
		padding: 12px 20px;
	}
	
	.footer-heading {
		font-size: 1.6rem;
	}
}

@media (max-width: 480px) {
	.slider-wrapper {
		height: 400px;
	}
	
	.slide-title {
		font-size: 1.75rem;
	}
	
	.section-title {
		font-size: 1.8rem;
	}
	
	.sub-section-title {
		font-size: 1.5rem;
	}
}
