/*
Theme Name: Hoteler
Theme URI: https://www.hoteler.info/
Author: Hoteler
Author URI: https://www.hoteler.info/
Description: Laka, brza tema napravljena specijalno za Hoteler sistem (hotel CPT, listings, i18n, reviews, map). Bez Bootstrap-a, bez page-builder-a, bez nekorišćenih opcija.
Version: 1.0
Requires at least: 5.8
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hoteler
Tags: custom-logo, custom-menu, custom-header, featured-images, footer-widgets, translation-ready
*/

/* ==========================================================================
   1. Design tokens
   Boje se mogu promeniti po sajtu preko Customizer-a (Izgled -> Prilagodi -> Boje).
   ========================================================================== */

:root {
	--htl-brand: #496d46;
	--htl-brand-dark: #35512f;
	--htl-brand-contrast: #ffffff;
	--htl-page-bg: #d0dfce;

	--htl-surface: #ffffff;
	--htl-surface-alt: #f6f8f5;
	--htl-text: #262b25;
	--htl-text-muted: #6a7268;
	--htl-border: #dfe4dc;
	--htl-link: var(--htl-brand);
	--htl-link-hover: var(--htl-brand-dark);
	--htl-focus: #0073aa;

	--htl-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
		Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
	--htl-font-size: 16px;
	--htl-line: 1.65;

	--htl-container: 1200px;
	--htl-radius: 10px;
	--htl-radius-sm: 6px;
	--htl-shadow: 0 1px 3px rgba(20, 30, 18, 0.08), 0 8px 24px rgba(20, 30, 18, 0.06);
	--htl-shadow-sm: 0 1px 2px rgba(20, 30, 18, 0.08);

	--htl-space: 20px;
}

@media (max-width: 600px) {
	:root {
		/* poravnato sa .htl-content padding-om da tekst zaglavlja stoji u istoj liniji sa sadržajem */
		--htl-space: 14px;
	}
}

/* ==========================================================================
   2. Reset / osnova
   ========================================================================== */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: var(--htl-font);
	font-size: var(--htl-font-size);
	line-height: var(--htl-line);
	color: var(--htl-text);
	background-color: var(--htl-page-bg);
	background-image: linear-gradient(180deg, var(--htl-page-bg) 0%, #ffffff 520px);
	background-repeat: no-repeat;
	background-attachment: fixed;
	-webkit-font-smoothing: antialiased;
}

img,
svg,
video,
iframe {
	max-width: 100%;
	height: auto;
}

img {
	border: 0;
}

a {
	color: var(--htl-link);
	text-decoration: underline;
	text-underline-offset: 2px;
}

a:hover,
a:focus {
	color: var(--htl-link-hover);
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 0.6em;
	line-height: 1.25;
	font-weight: 700;
	color: var(--htl-text);
	text-wrap: balance;
}

h1 {
	font-size: clamp(1.6rem, 1.25rem + 1.4vw, 2.1rem);
}
h2 {
	font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.7rem);
}
h3 {
	font-size: 1.25rem;
}
h4 {
	font-size: 1.1rem;
}

/* H1 koji u sadržaj ubacuje hoteler-i18n (front / jezički root / destinacije). */
.htl-page-h1 {
	font-size: 34px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--htl-text);
	margin: 0 0 12px;
}

@media (max-width: 700px) {
	.htl-page-h1 {
		font-size: 26px;
	}
}

p,
ul,
ol,
dl,
table,
blockquote,
figure,
pre {
	margin: 0 0 1.1em;
}

ul,
ol {
	padding-left: 1.4em;
}

li + li {
	margin-top: 0.25em;
}

blockquote {
	padding: 0.2em 0 0.2em 1.1em;
	border-left: 4px solid var(--htl-brand);
	color: var(--htl-text-muted);
	font-style: italic;
}

hr {
	height: 1px;
	border: 0;
	background: var(--htl-border);
	margin: 2em 0;
}

code,
kbd,
pre,
samp {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 1em;
}

pre {
	padding: 1em;
	overflow: auto;
	background: var(--htl-surface-alt);
	border-radius: var(--htl-radius-sm);
}

table {
	width: 100%;
	border-collapse: collapse;
}

th,
td {
	padding: 0.5em 0.7em;
	border: 1px solid var(--htl-border);
	text-align: left;
}

th {
	background: var(--htl-surface-alt);
}

/* ==========================================================================
   3. Layout
   ========================================================================== */

.htl-container {
	width: 100%;
	max-width: var(--htl-container);
	margin-inline: auto;
	padding-inline: var(--htl-space);
}

.htl-site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.htl-main {
	flex: 1 0 auto;
	padding-block: 28px 44px;
}

.htl-content {
	background: var(--htl-surface);
	border-radius: var(--htl-radius);
	box-shadow: var(--htl-shadow);
	padding: clamp(14px, 3vw, 36px);
}

@media (max-width: 600px) {
	.htl-main {
		padding-block: 0;
	}

	.htl-main > .htl-container {
		padding-inline: 0;
	}

	.htl-content {
		border-radius: 0;
		box-shadow: none;
		/* uže od desktop clamp-a — na uskim ekranima ostavlja dovoljno mesta da NGG galerija na hotel stranicama i dalje slaže 3 sličice u red */
		padding-inline: 8px;
	}
}

.htl-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100000;
	padding: 10px 18px;
	background: var(--htl-surface);
	color: var(--htl-link);
	border-radius: 0 0 var(--htl-radius-sm) 0;
}

.htl-skip-link:focus {
	left: 0;
}

/* ==========================================================================
   4. Header
   ========================================================================== */

.htl-header {
	position: relative;
	background-color: var(--htl-brand);
	color: var(--htl-brand-contrast);
}

.htl-header__inner {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 12px;
	min-height: 88px;
	padding-block: 18px;
}

.htl-header__inner > :first-child {
	justify-self: start;
}

.htl-header__inner > :last-child {
	justify-self: end;
}

@media (max-width: 782px) {
	.htl-header__inner {
		min-height: 0;
		padding-block: 12px;
	}
}

.htl-site-branding {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	min-width: 0;
	text-align: center;
}

.htl-site-logo img {
	display: block;
	max-height: 68px;
	width: auto;
}

.htl-site-title {
	margin: 0;
	font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.15;
}

.htl-site-title a {
	color: inherit;
	text-decoration: none;
}

.htl-site-title a:hover {
	color: inherit;
	text-decoration: underline;
}

.htl-site-description {
	margin: 4px 0 0;
	font-size: 1rem;
	opacity: 0.9;
}

/* ==========================================================================
   5. Navigacija
   ========================================================================== */

/* Traka više ne postoji — <nav> služi samo kao sidrište panela odmah ispod zaglavlja. */
.htl-nav {
	position: relative;
	z-index: 20;
}

.htl-nav__inner {
	position: relative;
	height: 0;
	padding-block: 0;
}

.htl-nav__panel {
	position: absolute;
	top: 6px;
	left: var(--htl-space);
	z-index: 900;
	display: none;
	min-width: 240px;
	max-width: 320px;
	padding: 8px;
	background: var(--htl-surface);
	border: 1px solid var(--htl-border);
	border-radius: var(--htl-radius);
	box-shadow: var(--htl-shadow);
}

.htl-nav.is-open .htl-nav__panel {
	display: block;
}

/* Ikona hamburgera: tri trake koje se pretvaraju u X. */
.htl-nav__toggle-icon {
	position: relative;
	display: block;
	width: 18px;
	height: 20px;
}

.htl-nav__toggle-icon span {
	position: absolute;
	left: 0;
	width: 18px;
	height: 2px;
	background: currentColor;
	transition: top 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.htl-nav__toggle-icon span:nth-child(1) {
	top: 3px;
}
.htl-nav__toggle-icon span:nth-child(2) {
	top: 9px;
}
.htl-nav__toggle-icon span:nth-child(3) {
	top: 15px;
}

.htl-nav__toggle[aria-expanded="true"] .htl-nav__toggle-icon span:nth-child(1) {
	top: 9px;
	transform: rotate(45deg);
}

.htl-nav__toggle[aria-expanded="true"] .htl-nav__toggle-icon span:nth-child(2) {
	opacity: 0;
}

.htl-nav__toggle[aria-expanded="true"] .htl-nav__toggle-icon span:nth-child(3) {
	top: 9px;
	transform: rotate(-45deg);
}

.htl-menu {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

.htl-menu li {
	margin: 0;
}

.htl-menu a {
	display: block;
	padding: 9px 12px;
	color: var(--htl-text);
	font-weight: 500;
	font-size: 1rem;
	text-decoration: none;
	border-radius: var(--htl-radius-sm);
}

.htl-menu a:hover,
.htl-menu a:focus {
	color: var(--htl-link);
	background: var(--htl-surface-alt);
}

.htl-menu .current-menu-item > a,
.htl-menu .current_page_item > a {
	color: var(--htl-link);
	font-weight: 600;
}

/* Podmeni — uvučen, u istom panelu (nema hover podmenija jer nema horizontalne trake). */
.htl-menu .sub-menu {
	display: block;
	margin: 0 0 2px 12px;
	padding: 0;
	list-style: none;
}

.htl-menu .sub-menu a {
	color: var(--htl-text-muted);
	font-size: 1rem;
}

.htl-menu .sub-menu a:hover,
.htl-menu .sub-menu a:focus {
	color: var(--htl-link);
	background: var(--htl-surface-alt);
}

@media (max-width: 600px) {
	.htl-nav__panel {
		right: var(--htl-space);
		min-width: 0;
		max-width: none;
	}
}

/* ==========================================================================
   6. Footer
   ========================================================================== */

.htl-footer {
	margin-top: auto;
	background: var(--htl-brand-dark);
	color: rgba(255, 255, 255, 0.85);
	font-size: 1rem;
}

.htl-footer a {
	color: #fff;
	text-decoration: underline;
}

.htl-footer a:hover,
.htl-footer a:focus {
	color: #fff;
	text-decoration: none;
}

.htl-footer__widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 28px;
	padding-block: 34px;
}

.htl-footer__widgets:empty {
	display: none;
}

.htl-footer__bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.16);
	padding-block: 18px;
	text-align: center;
}

.htl-footer__bottom .widget {
	margin: 0;
}

.htl-footer .widget-title {
	margin: 0 0 10px;
	font-size: 1rem;
	color: #fff;
}

.htl-footer ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* ==========================================================================
   7. Widgeti
   ========================================================================== */

.widget {
	margin-bottom: 26px;
}

.widget:last-child {
	margin-bottom: 0;
}

.widget-title {
	font-size: 1.05rem;
	margin-bottom: 10px;
}

/* ==========================================================================
   8. Forme i dugmad
   ========================================================================== */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="password"],
input[type="date"],
select,
textarea {
	width: 100%;
	max-width: 100%;
	padding: 9px 12px;
	font: inherit;
	font-size: 1rem;
	color: var(--htl-text);
	background: var(--htl-surface);
	border: 1px solid var(--htl-border);
	border-radius: var(--htl-radius-sm);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
	outline: 0;
	border-color: var(--htl-focus);
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.14);
}

textarea {
	min-height: 140px;
	resize: vertical;
}

.htl-btn,
button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
	display: inline-block;
	padding: 10px 20px;
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.4;
	color: var(--htl-brand-contrast);
	background: var(--htl-brand);
	border: 1px solid transparent;
	border-radius: var(--htl-radius-sm);
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease;
}

.htl-btn:hover,
button:hover,
input[type="submit"]:hover {
	color: var(--htl-brand-contrast);
	background: var(--htl-brand-dark);
	text-decoration: none;
}

/* ==========================================================================
   9. WordPress core klase
   ========================================================================== */

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.alignleft {
	float: left;
	margin: 0.3em 1.4em 1em 0;
}

.alignright {
	float: right;
	margin: 0.3em 0 1em 1.4em;
}

.aligncenter {
	display: block;
	margin-inline: auto;
}

.alignwide,
.alignfull {
	margin-inline: 0;
}

.wp-caption {
	max-width: 100%;
}

.wp-caption-text,
.wp-block-image figcaption {
	font-size: 1rem;
	color: var(--htl-text-muted);
	text-align: center;
}

.sticky,
.gallery-caption,
.bypostauthor {
	/* obavezne klase za WP theme check */
}

.htl-entry-content::after {
	content: "";
	display: table;
	clear: both;
}

/* ==========================================================================
   10. Stranice / unosi
   ========================================================================== */

.htl-entry-header {
	margin-bottom: 18px;
}

.htl-entry-title {
	margin-bottom: 6px;
}

.htl-entry-meta {
	font-size: 1rem;
	color: var(--htl-text-muted);
}

.htl-entry-content > *:first-child {
	margin-top: 0;
}

.htl-entry-content > *:last-child {
	margin-bottom: 0;
}

.htl-entry + .htl-entry {
	margin-top: 36px;
	padding-top: 30px;
	border-top: 1px solid var(--htl-border);
}

.htl-page-links {
	margin-top: 1.2em;
	font-size: 1rem;
}

/* Paginacija */
.htl-pagination {
	margin-top: 30px;
}

.htl-pagination .page-numbers {
	display: inline-block;
	min-width: 38px;
	padding: 7px 10px;
	margin: 0 3px 6px 0;
	text-align: center;
	text-decoration: none;
	color: var(--htl-link);
	background: var(--htl-surface);
	border: 1px solid var(--htl-border);
	border-radius: var(--htl-radius-sm);
}

.htl-pagination .page-numbers.current,
.htl-pagination .page-numbers:hover {
	color: var(--htl-brand-contrast);
	background: var(--htl-brand);
	border-color: var(--htl-brand);
}

/* 404 / pretraga */
.htl-404 .htl-search-form,
.htl-no-results .htl-search-form {
	max-width: 460px;
}

.htl-search-form {
	display: flex;
	gap: 8px;
}

.htl-search-form .htl-search-field {
	flex: 1 1 auto;
}

.htl-404__links {
	margin-top: 26px;
}

/* ==========================================================================
   11. Hotel single (hotel CPT)
   ========================================================================== */

.hotel-single > *:last-child {
	margin-bottom: 0;
}

.hotel-single h1 {
	margin-bottom: 10px;
}

.hotel-stars {
	margin: 0 0 12px;
	font-size: 1.35rem;
	line-height: 1;
	letter-spacing: 2px;
	color: #a05a00;
}

.hotel-destination {
	margin: 0 0 20px;
	font-size: 1rem;
	color: var(--htl-text-muted);
}

.hotel-destination .hotel-dest-label {
	margin-right: 5px;
	font-weight: 700;
	color: var(--htl-text);
}

.hotel-body {
	display: flex;
	align-items: flex-start;
	gap: 28px;
}

.hotel-content-col {
	flex: 1 1 0;
	min-width: 0;
}

.hotel-content {
	line-height: 1.75;
}

.hotel-content > *:first-child {
	margin-top: 0;
}

.hotel-attributes {
	flex: 0 0 250px;
	width: 250px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 18px 20px;
	background: var(--htl-surface-alt);
	border: 1px solid var(--htl-border);
	border-radius: var(--htl-radius);
}

.hotel-attr-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.hotel-attr-label {
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: none;
	color: var(--htl-text-muted);
}

.hotel-attr-values {
	display: flex;
	flex-direction: column;
	gap: 3px;
	font-size: 1rem;
	line-height: 1.5;
}

.hotel-attr-item::before {
	content: "✔";
	margin-right: 6px;
	color: var(--htl-brand);
}

@media (max-width: 782px) {
	.hotel-body {
		flex-direction: column;
	}

	.hotel-attributes {
		flex: none;
		width: 100%;
		order: -1;
	}
}

/* ==========================================================================
   12. Jezički switcher (deli ga tema i hoteler-i18n plugin)
   ========================================================================== */

.htl-lang-dropdown {
	position: relative;
	display: inline-block;
	margin: 0 0 22px;
	user-select: none;
}

/* Dugmad zaglavlja — meni i jezik dele isti izgled. */
.htl-nav__toggle,
.htl-lang-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 8px 13px;
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.4;
	color: var(--htl-text);
	background: var(--htl-surface-alt);
	border: 1px solid var(--htl-border);
	border-radius: var(--htl-radius-sm);
	cursor: pointer;
}

/* Pozadina ostaje ista i kad je otvoreno — menja se samo ivica. */
.htl-nav__toggle:hover,
.htl-nav__toggle:focus,
.htl-lang-btn:hover,
.htl-lang-btn:focus,
.htl-nav__toggle[aria-expanded="true"],
.htl-lang-dropdown.is-open .htl-lang-btn {
	color: var(--htl-text);
	background: var(--htl-surface-alt);
	border-color: var(--htl-text-muted);
	box-shadow: none;
}

.htl-lang-label {
	font-size: 1rem;
	font-weight: 400;
	color: var(--htl-text-muted);
}

.htl-lang-arrow {
	margin-left: 2px;
	font-size: 0.7rem;
	color: var(--htl-text-muted);
	transition: transform 0.2s ease;
}

.htl-lang-dropdown.is-open .htl-lang-arrow {
	transform: rotate(180deg);
}

.htl-lang-menu {
	position: absolute;
	top: calc(100% + 5px);
	left: 0;
	z-index: 9999;
	display: none;
	min-width: 540px;
	padding: 10px;
	background: var(--htl-surface);
	border: 1px solid var(--htl-border);
	border-radius: var(--htl-radius);
	box-shadow: var(--htl-shadow);
}

.htl-lang-dropdown.is-open .htl-lang-menu {
	display: block;
}

.htl-lang-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 2px;
}

.htl-lang-grid a,
.htl-lang-grid .htl-current {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 7px 10px;
	font-size: 1rem;
	color: var(--htl-text);
	text-decoration: none;
	white-space: nowrap;
	border-radius: 5px;
}

.htl-lang-grid a:hover {
	color: var(--htl-focus);
	background: #f0f6fb;
}

.htl-lang-grid .htl-current {
	font-weight: 600;
	color: var(--htl-focus);
	background: #eef5fb;
	cursor: default;
}

.htl-lang-grid .htl-current::after {
	content: "✓";
	margin-left: auto;
	font-size: 0.7rem;
	opacity: 0.7;
}

@media (max-width: 600px) {
	.htl-lang-menu {
		min-width: calc(100vw - 2 * var(--htl-space));
	}

	.htl-lang-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* Switcher u zaglavlju — dropdown uz desnu ivicu. */
.htl-header__lang .htl-lang-dropdown {
	margin: 0;
}

.htl-header__lang .htl-lang-menu {
	left: auto;
	right: 0;
}

@media (max-width: 600px) {
	/* sidrimo za zaglavlje, a ne za dugme — 100vw bi uracunao i scrollbar pa meni izlazi levo van ekrana */
	.htl-header__lang .htl-lang-dropdown {
		position: static;
	}

	.htl-header__lang .htl-lang-menu {
		top: 100%;
		left: var(--htl-space);
		right: var(--htl-space);
		min-width: 0;
	}

	/* Uz naziv sajta nema mesta za tekst — skrivamo ga vizuelno, ostaje čitačima ekrana. */
	.htl-header__lang .htl-lang-label,
	.htl-nav__toggle-text {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
}

/* ==========================================================================
   13. Back to top
   ========================================================================== */

.htl-to-top {
	position: fixed;
	right: 18px;
	bottom: 18px;
	z-index: 900;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	font-size: 1.1rem;
	color: var(--htl-brand-contrast);
	background: var(--htl-brand);
	border: 0;
	border-radius: 50%;
	box-shadow: var(--htl-shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.htl-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
