/*
Theme Name: Centrum Medyczne Demo
Theme URI: https://fibogacci.pl
Author: Fibogacci
Author URI: https://fibogacci.pl
Description: Block theme dla centrum medycznego. Plus Jakarta Sans, sky blue #0EA5E9, bento grid, floating actions.
Version: 0.2.0
Requires at least: 6.5
Tested up to: 6.9
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: medical-demo
Tags: block-patterns, full-site-editing, medical
*/

/* === DESIGN TOKENS === */
:root {
	--primary: #0EA5E9;
	--primary-dark: #0F172A;
	--secondary: #38BDF8;
	--accent: #F43F5E;
	--surface: #FFFFFF;
	--surface-alt: #F8FAFC;
	--text-main: #334155;
	--text-light: #64748B;
	--border: #E2E8F0;
	--font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
	--radius-lg: 24px;
	--radius-md: 16px;
	--radius-sm: 8px;
	--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
	--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
	--shadow-float: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* === BASE === */
html { scroll-behavior: smooth; }

body {
	font-family: var(--font);
	color: var(--text-main);
	background-color: var(--surface-alt);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

* { box-sizing: border-box; }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font);
	font-weight: 800;
	line-height: 1.2;
	color: var(--primary-dark);
	letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }

p { color: var(--text-light); line-height: 1.6; }
a { text-decoration: none; color: inherit; transition: all 0.2s ease; }
ul { list-style: none; }
img { max-width: 100%; height: auto; }

/* === WORDPRESS BLOCK OVERRIDES === */
.wp-site-blocks { background-color: var(--surface-alt); }

.wp-block-site-title a {
	font-family: var(--font);
	font-weight: 800;
	color: var(--primary-dark);
}

.wp-block-navigation a {
	font-family: var(--font);
	font-weight: 500;
	font-size: 0.95rem;
	color: var(--text-main);
}

.wp-block-navigation a:hover { color: var(--primary); }

.wp-element-button,
.wp-block-button__link {
	font-family: var(--font) !important;
	font-weight: 600;
	border-radius: 50px !important;
}

/* Header sticky glassmorphism */
.wp-block-template-part[data-area="header"] {
	position: sticky;
	top: 0;
	z-index: 1000;
	background: rgba(255, 255, 255, 0.92) !important;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* === HERO === */
.medical-hero {
	position: relative;
	padding: 80px 0 140px;
	background: radial-gradient(circle at 80% 20%, #E0F2FE 0%, transparent 40%),
	            radial-gradient(circle at 20% 80%, #F0F9FF 0%, transparent 40%);
	overflow: hidden;
}

.medical-hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; color: var(--primary-dark); margin-bottom: 24px; }
.medical-hero h1 span { color: var(--primary); position: relative; }
.medical-hero h1 span::after {
	content: '';
	position: absolute;
	bottom: 4px; left: 0; width: 100%; height: 10px;
	background: rgba(14,165,233,0.2); z-index: -1; transform: rotate(-2deg);
}
.medical-hero p { font-size: 1.15rem; color: var(--text-light); margin-bottom: 36px; }

/* Hero blob animation */
.hero-blob {
	position: absolute;
	top: -20px; right: -20px; width: 100%; height: 100%;
	background: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 100%);
	border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
	z-index: -1;
	animation: morph 8s ease-in-out infinite;
}

@keyframes morph {
	0%, 100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
	50%       { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

/* Stats row */
.stats-row {
	display: flex;
	gap: 40px;
	margin-top: 40px;
	border-top: 1px solid var(--border);
	padding-top: 28px;
}
.stat-item h4 { font-size: 2rem; font-weight: 800; color: var(--primary-dark); line-height: 1; margin: 0; }
.stat-item span { font-size: 0.85rem; color: var(--text-light); font-weight: 500; }

/* === EMERGENCY / SOR BUTTON === */
.emergency-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: rgba(244, 63, 94, 0.1);
	color: var(--accent);
	padding: 8px 18px;
	border-radius: 50px;
	font-weight: 700;
	font-size: 0.85rem;
	border: none;
	cursor: pointer;
	transition: background 0.2s;
}
.emergency-btn:hover { background: rgba(244, 63, 94, 0.2); }

.emergency-blink {
	width: 8px; height: 8px;
	background: var(--accent);
	border-radius: 50%;
	animation: pulse 2s infinite;
}

@keyframes pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.5; transform: scale(1.2); }
}

/* === FLOATING ACTION CARDS === */
.floating-actions {
	margin-top: -80px;
	position: relative;
	z-index: 10;
	padding: 0 24px;
}

.actions-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
	max-width: 1280px;
	margin: 0 auto;
}

.action-card {
	background: white;
	padding: 28px 22px;
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-lg);
	text-align: center;
	transition: all 0.3s ease;
	cursor: pointer;
	border: 1px solid rgba(255,255,255,0.5);
}

.action-card:hover {
	transform: translateY(-8px);
	box-shadow: var(--shadow-float);
}

.action-card.primary {
	background: var(--primary);
	color: white;
}

.action-card.primary p { color: rgba(255,255,255,0.9); }
.action-card.primary .icon-box { background: rgba(255,255,255,0.2); color: white; }
.action-card.primary:hover .icon-box { background: white; color: var(--primary); }

.icon-box {
	width: 52px; height: 52px;
	background: var(--surface-alt);
	color: var(--primary);
	border-radius: 14px;
	display: inline-flex;
	align-items: center; justify-content: center;
	margin-bottom: 16px;
	transition: 0.3s;
}
.action-card:not(.primary):hover .icon-box { background: var(--primary); color: white; }

.action-title { font-weight: 700; font-size: 1rem; margin-bottom: 6px; display: block; color: inherit; }
.action-desc { font-size: 0.85rem; color: var(--text-light); line-height: 1.4; }
.action-card.primary .action-desc { color: rgba(255,255,255,0.85); }

/* === BENTO GRID (Departments) === */
.bento-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	grid-auto-rows: 140px;
	gap: 20px;
}

.bento-item {
	background: white;
	border-radius: var(--radius-md);
	padding: 22px;
	border: 1px solid var(--border);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	transition: 0.3s;
	text-decoration: none;
	color: var(--text-main);
	position: relative;
	overflow: hidden;
}

.bento-item:hover {
	border-color: var(--primary);
	box-shadow: var(--shadow-lg);
}

.bento-item h3 { font-size: 1.05rem; font-weight: 700; z-index: 2; margin: 0; }

.bento-item .arrow {
	align-self: flex-end;
	opacity: 0;
	transform: translateX(-8px);
	transition: 0.3s;
	color: var(--primary);
}
.bento-item:hover .arrow { opacity: 1; transform: translateX(0); }

.bento-large {
	grid-column: span 2;
	grid-row: span 2;
	background: var(--primary-dark);
	color: white;
	border: none;
}
.bento-large h3 { font-size: 1.6rem; color: white; margin-bottom: 8px; }
.bento-large p { color: #94A3B8; font-size: 0.9rem; margin-bottom: 16px; }
.bento-large:hover { border-color: transparent; }

/* === DOCTOR CARDS === */
.doc-scroll {
	display: flex;
	gap: 28px;
	overflow-x: auto;
	padding-bottom: 32px;
	-webkit-overflow-scrolling: touch;
}
.doc-scroll::-webkit-scrollbar { height: 6px; }
.doc-scroll::-webkit-scrollbar-track { background: transparent; }
.doc-scroll::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }

.doc-profile {
	min-width: 270px;
	background: white;
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	transition: 0.3s;
	border: 1px solid transparent;
	flex-shrink: 0;
}
.doc-profile:hover {
	transform: translateY(-5px);
	box-shadow: var(--shadow-lg);
	border-color: var(--border);
}

.doc-img {
	height: 200px;
	background: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 100%);
	position: relative;
}

.doc-badge {
	position: absolute;
	top: 14px; right: 14px;
	background: white;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--primary);
	box-shadow: var(--shadow-sm);
}

.doc-info { padding: 20px; }
.doc-name { font-size: 1rem; font-weight: 700; color: var(--primary-dark); }
.doc-role {
	color: var(--primary);
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 10px;
	display: block;
}
.doc-info p { font-size: 0.85rem; margin-top: 6px; }
.doc-info a {
	display: block;
	margin-top: 12px;
	font-weight: 600;
	color: var(--primary);
	font-size: 0.85rem;
}
.doc-info a:hover { color: var(--primary-dark); }

/* === CLINIC CARD === */
.clinic-card {
	background: #fff;
	border-radius: var(--radius-sm);
	padding: 1.5rem;
	border-left: 4px solid var(--primary);
	box-shadow: var(--shadow-sm);
	transition: box-shadow 0.2s ease;
}
.clinic-card:hover { box-shadow: var(--shadow-lg); }
.clinic-card__name { font-size: 1.1rem; font-weight: 700; color: var(--primary-dark); margin: 0 0 0.5rem; }
.clinic-card__meta { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--text-light); font-size: 0.875rem; }
.clinic-card__phone { font-weight: 600; color: var(--primary); }

/* === DOCTOR CARD (archive) === */
.doctor-card {
	background: #fff;
	border-radius: var(--radius-md);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	text-align: center;
	transition: transform 0.2s ease;
}
.doctor-card:hover { transform: translateY(-4px); }
.doctor-card__photo { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; margin: 1.5rem auto 1rem; border: 3px solid #E0F2FE; }
.doctor-card__name { font-size: 1rem; font-weight: 700; color: var(--primary-dark); margin: 0 0 0.25rem; }
.doctor-card__specialty { color: var(--primary); font-size: 0.875rem; font-weight: 600; margin-bottom: 0.5rem; }
.doctor-card__clinics { color: var(--text-light); font-size: 0.8rem; padding: 0 1rem 1.5rem; }

/* === QUICK LINKS === */
.quick-links { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.quick-link {
	display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
	padding: 1.25rem 1.75rem; background: #fff; border-radius: var(--radius-md);
	color: var(--primary-dark); box-shadow: var(--shadow-sm);
	transition: all 0.2s ease; min-width: 140px; text-align: center; border: 1px solid var(--border);
}
.quick-link:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: var(--primary); border-color: var(--primary); }
.quick-link__icon { font-size: 1.75rem; }
.quick-link__label { font-weight: 600; font-size: 0.9rem; }

/* === OPENING HOURS === */
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table th, .hours-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); font-family: var(--font); }
.hours-table th { font-weight: 700; color: var(--primary-dark); }
.hours-table td { color: var(--text-light); }

/* === ALERT BAR === */
.alert-bar {
	background: var(--accent);
	color: #fff;
	padding: 0.5rem 1rem;
	text-align: center;
	font-size: 0.875rem;
	font-weight: 600;
}
.alert-bar a { color: #fff; text-decoration: underline; }

/* === SECTION HEADER === */
.section-header { text-align: center; max-width: 600px; margin: 0 auto 52px; }
.section-header h2 { font-size: 2rem; color: var(--primary-dark); font-weight: 800; margin-bottom: 12px; }
.section-header p { color: var(--text-light); font-size: 1rem; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
	.actions-grid { grid-template-columns: repeat(2, 1fr); }
	.bento-grid { grid-template-columns: repeat(2, 1fr); }
	.bento-large { grid-column: span 2; }
}

@media (max-width: 768px) {
	.medical-hero { padding: 60px 0 120px; }
	.floating-actions { margin-top: -60px; }
	.stats-row { flex-wrap: wrap; gap: 20px; }
	.quick-links { flex-direction: column; align-items: stretch; }
	.quick-link { flex-direction: row; min-width: auto; }
}

@media (max-width: 600px) {
	.actions-grid { grid-template-columns: 1fr; }
	.bento-grid { grid-template-columns: 1fr; }
	.bento-large { grid-column: span 1; grid-row: auto; }
}
