/* =========================================================
   Apartmani Kišasondi — Main Stylesheet
   Modern rewrite: responsive, CSS custom properties, flexbox/grid
   ========================================================= */

:root {
	--color-primary:   #1a5276;
	--color-primary-dark: #154360;
	--color-accent:    #d4a05a;
	--color-accent-dark: #b8843a;
	--color-bg:        #f9f7f4;
	--color-white:     #ffffff;
	--color-text:      #1f2937;
	--color-text-light:#6b7280;
	--color-border:    #e5e7eb;
	--color-row-alt:   #f3f4f6;
	--radius:          8px;
	--shadow:          0 4px 24px rgba(26,82,118,0.10);
	--transition:      0.2s ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; }

html, body { max-width: 100%; overflow-x: hidden; }

body {
	background-color: var(--color-bg);
	margin: 0;
	font-family: 'Inter', sans-serif;
	font-size: 1rem;
	color: var(--color-text);
	line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
	color: var(--color-primary);
	margin-top: 0;
}

a:link, a:visited {
	color: var(--color-primary);
	text-decoration: none;
	transition: color var(--transition);
}
a:hover, a:active {
	color: var(--color-accent-dark);
	text-decoration: underline;
}

p { margin-top: 0; }

ul { padding-left: 1.25rem; }
ul li { margin-bottom: 0.25rem; }

/* ---- Layout Container ---- */
#container {
	max-width: 1100px;
	margin: 2rem auto;
	background: var(--color-white);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
}

/* ---- Header / Hero ---- */
#header {
	min-height: 200px;
	background-image: url('../images/bg00.jpg');
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* ---- Navigation ---- */
#menu {
	background-color: var(--color-primary);
	padding: 0 1rem;
}

#menuNav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.25rem;
	min-height: 48px;
	padding: 0.25rem 0;
}

/* Hamburger button — hidden; we always show the full nav */
#menuToggle { display: none; }

#menuCollapsible {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.25rem;
	width: 100%;
}

#menuPages {
	display: flex;
	align-items: center;
	gap: 0.15rem;
	flex-wrap: wrap;
}

#menuPages a {
	color: #e0e8f0;
	text-decoration: none;
	font-family: 'Poppins', sans-serif;
	font-size: 0.9rem;
	font-weight: 500;
	padding: 0.4rem 0.65rem;
	border-radius: 6px;
}
#menuPages a:hover {
	background: rgba(255,255,255,0.15);
	color: #ffffff;
	text-decoration: none;
}

#menuLanguages {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	flex-wrap: wrap;
}

#menuLanguages a { display: inline-block; }

#menuLanguages .flag {
	width: 36px;
	height: 22px;
	border: 2px solid transparent;
	border-radius: 3px;
	display: block;
}
#menuLanguages .flag:hover {
	border-color: var(--color-accent);
}

@media (max-width: 600px) {
	#menuPages a { font-size: 0.82rem; padding: 0.35rem 0.5rem; }
	#menuLanguages .flag { width: 30px; height: 18px; }
}

/* ---- Page content wrapper ---- */
.page-content {
	padding: 1.5rem 1.75rem 2rem;
}

/* ---- Home page ---- */
#contentHome {
	display: grid;
	grid-template-columns: 280px 1fr 180px;
	min-height: 280px;
}

#contentHomeLeft {
	background-image: url('../images/home1.jpg');
	background-repeat: no-repeat;
	background-size: cover;
	background-position: center top;
	min-height: 240px;
}

#contentHomeCenter {
	background-color: var(--color-primary);
	color: var(--color-white);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 2.5rem 2rem;
	gap: 0.75rem;
}
#contentHomeCenter h2 {
	color: var(--color-white);
	font-size: 1.6rem;
	margin-bottom: 0.25rem;
}
#contentHomeCenter p {
	margin: 0;
	font-size: 1rem;
	line-height: 1.6;
	color: #c8ddef;
}
#contentHomeCenter a.home-contact-link {
	display: inline-block;
	margin-top: 0.5rem;
	padding: 0.5rem 1.25rem;
	background: var(--color-accent);
	color: var(--color-white);
	border-radius: 6px;
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
	font-size: 0.9rem;
	text-decoration: none;
}
#contentHomeCenter a.home-contact-link:hover {
	background: var(--color-accent-dark);
	text-decoration: none;
	color: var(--color-white);
}

#contentHomeRight {
	background-image: url('../images/home2.jpg');
	background-repeat: no-repeat;
	background-size: cover;
	background-position: center top;
	min-height: 240px;
}

@media (max-width: 768px) {
	#contentHome {
		grid-template-columns: 1fr;
	}
	#contentHomeLeft, #contentHomeRight {
		min-height: 180px;
	}
}

/* ---- Apartment pages ---- */
#contentApartment {
	padding: 1.5rem 1.75rem 2rem;
	display: flex;
	flex-wrap: wrap;
	gap: 2rem;
	align-items: flex-start;
}

#contentApartmentTop { display: none; }

#contentApartmentLeft {
	flex: 1 1 580px;
	min-width: 0;
}

#contentApartmentRight {
	flex: 0 0 240px;
	position: sticky;
	top: 60px;
}

@media (max-width: 860px) {
	#contentApartment { flex-direction: column; }
	#contentApartmentRight { position: static; flex: none; width: 100%; }
}

/* Spec tables */
.spec-tables {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	margin-bottom: 1.5rem;
}

.spec-table {
	border-collapse: collapse;
	font-size: 0.9rem;
	flex: 1 1 260px;
	min-width: 0;
	max-width: 100%;
}

@media (max-width: 600px) {
	.spec-tables { flex-direction: column; }
	.spec-table { flex: none; width: 100%; }
}
.spec-table caption {
	text-align: left;
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
	color: var(--color-primary);
	margin-bottom: 0.4rem;
	font-size: 1rem;
}
.spec-table td {
	padding: 0.45rem 0.75rem;
	border: 1px solid var(--color-border);
}
.spec-table tr:nth-child(even) td { background: var(--color-row-alt); }
.spec-table td:first-child { color: var(--color-text-light); word-break: break-word; }
.spec-table td:last-child { font-weight: 500; }

/* Legacy table styling (fallback for border="1" tables) */
table[border="1"] {
	border-collapse: collapse;
	font-size: 0.9rem;
	margin-bottom: 1rem;
}
table[border="1"] td {
	padding: 0.45rem 0.75rem;
	border: 1px solid var(--color-border);
}
table[border="1"] tr:nth-child(even) td { background: var(--color-row-alt); }

/* ---- Prices / notes sections ---- */
.prices-notes {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	margin-bottom: 1.5rem;
}
.prices-notes > div { flex: 1 1 260px; }

/* ---- Availability link ---- */
.availability-link {
	display: inline-block;
	margin: 0.75rem 0;
	padding: 0.45rem 1rem;
	background: var(--color-primary);
	color: var(--color-white) !important;
	border-radius: 6px;
	font-family: 'Poppins', sans-serif;
	font-size: 0.9rem;
	font-weight: 500;
	text-decoration: none !important;
	transition: background var(--transition);
}
.availability-link:hover {
	background: var(--color-primary-dark);
}

/* ---- Map / HowTo / Lošinj pages ---- */
#contentHowTo {
	padding: 1.5rem 1.75rem 2rem;
	display: grid;
	grid-template-columns: 1fr 240px;
	grid-template-rows: auto auto;
	gap: 1.5rem 2rem;
	align-items: start;
}

/* Top sections (map iframe / image) span full width */
#contentHowToTop,
#contentLosinjTop {
	grid-column: 1 / -1;
}

/* Responsive video embed (16:9) */
.video-embed {
	position: relative;
	padding-bottom: 56.25%;
	height: 0;
	overflow: hidden;
	border-radius: var(--radius);
	margin-bottom: 0.5rem;
}
.video-embed iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}
.video-caption {
	font-size: 0.85rem;
	color: var(--color-text-light);
	margin-bottom: 1rem;
}

/* Responsive iframe wrapper */
#contentHowToTop iframe {
	width: 100%;
	height: 350px;
	border: none;
	border-radius: var(--radius);
}

/* Right sidebars (gallery) */
#contentHowToRight,
#contentLosinjRight {
	position: sticky;
	top: 60px;
}

/* Lošinj left takes remaining column */
#contentLosinjLeft {
	/* inherits column 1 automatically */
}

@media (max-width: 780px) {
	#contentHowTo {
		grid-template-columns: 1fr;
	}
	#contentHowToRight,
	#contentLosinjRight {
		position: static;
	}
	#contentHowToTop iframe { height: 220px; }
}

/* ---- Gallery thumbnails ---- */
.gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
	gap: 6px;
}
.gallery-grid img,
img.thumbnail {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 4px;
	border: 2px solid transparent;
	transition: border-color var(--transition), transform var(--transition);
}
.gallery-grid a:hover img,
a:hover img.thumbnail {
	border-color: var(--color-accent);
	transform: scale(1.04);
}

/* ---- Form table layout ---- */
.form-table {
	border-collapse: collapse;
	width: 100%;
	max-width: 520px;
	font-size: 0.95rem;
}
.form-table td {
	padding: 0.5rem 0.75rem;
	border: none;
	vertical-align: top;
}
.form-table tr:nth-child(even) td { background: transparent; }
.form-table td:first-child {
	width: 180px;
	color: var(--color-text-light);
	font-weight: 500;
	padding-top: 0.7rem;
	word-break: break-word;
}
.form-table td[colspan] {
	color: var(--color-primary);
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
	padding-top: 1rem;
	font-size: 0.9rem;
}
.form-table input[type="text"],
.form-table input[type="email"],
.form-table select,
.form-table textarea {
	max-width: 100%;
}

@media (max-width: 540px) {
	.form-table, .form-table tbody, .form-table tr { display: block; }
	.form-table td { display: block; width: 100%; padding: 0.25rem 0; }
	.form-table td:first-child { width: auto; padding-top: 0.5rem; }
}

/* ---- Contact / inquiry form ---- */
.inquiry-form { margin-top: 1.5rem; }
.inquiry-form h4 {
	font-size: 1.1rem;
	margin-bottom: 1rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
textarea,
select {
	width: 100%;
	max-width: 100%;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--color-border);
	border-radius: 6px;
	font-family: 'Inter', sans-serif;
	font-size: 0.95rem;
	color: var(--color-text);
	background: var(--color-white);
	transition: border-color var(--transition), box-shadow var(--transition);
	margin-bottom: 0.5rem;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
	outline: none;
	border-color: var(--color-primary);
	box-shadow: 0 0 0 3px rgba(26,82,118,0.12);
}
textarea { max-width: 100%; min-height: 120px; resize: vertical; }

.button1,
input[type="submit"],
button[type="submit"] {
	padding: 0.55rem 1.5rem;
	background: var(--color-primary);
	color: var(--color-white);
	border: none;
	border-radius: 6px;
	font-family: 'Poppins', sans-serif;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	transition: background var(--transition);
	width: auto;
}
.button1:hover,
input[type="submit"]:hover,
button[type="submit"]:hover {
	background: var(--color-primary-dark);
}

/* ---- Form success / error messages ---- */
.form-success {
	background: #d1fae5;
	color: #065f46;
	border: 1px solid #6ee7b7;
	border-radius: 6px;
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
}
.form-error {
	background: #fee2e2;
	color: #991b1b;
	border: 1px solid #fca5a5;
	border-radius: 6px;
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
}

/* ---- Footer ---- */
#footer {
	background-color: var(--color-primary);
	color: #d0dce8;
	padding: 2rem 1.75rem 1.25rem;
	clear: both;
}

#footerInner {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2rem;
	margin-bottom: 1.25rem;
}

#footer h4 {
	color: var(--color-white);
	font-family: 'Poppins', sans-serif;
	font-size: 1rem;
	margin-bottom: 0.5rem;
}
#footer a { color: var(--color-accent); }
#footer a:hover { color: #f0c070; text-decoration: underline; }
#footer p { margin: 0.2rem 0; font-size: 0.9rem; }

#footerCopy {
	border-top: 1px solid rgba(255,255,255,0.15);
	padding-top: 0.75rem;
	font-size: 0.82rem;
	color: #8fafc7;
	text-align: center;
}

@media (max-width: 640px) {
	#footerInner { grid-template-columns: 1fr; gap: 1rem; }
	#container { margin: 0; border-radius: 0; }
}

/* ---- Utility ---- */
.clear { clear: both; }
.left  { float: left; }
.right { float: right; }
.leftMargin { margin-left: 1.25rem; }

@media (max-width: 640px) {
	.left, .right { float: none; width: 100% !important; }
	.leftMargin { margin-left: 0; }
	table[border="1"] { width: 100%; }
}
