/*
Theme Name: AVB
Theme URI: https://avb.avoco.dev
Author: Avoco d.o.o.
Author URI: https://avoco.hr
Description: Custom WordPress theme for AVB, developed by Avoco d.o.o.
Version: 1.0.0
Requires at least: 6.0
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: avb
Tags: custom-background, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready
*/

/* ==========================================================================
   Base
   ========================================================================== */

:root {
	--avb-content-width: 1200px;
	--avb-color-text: #1a1a1a;
	--avb-color-bg: #ffffff;

	/* Brand palette — derived from primary #008ed6 (Bootstrap tint/shade scale). */
	--avb-primary-100: #cce8f7;
	--avb-primary-200: #99d2ef;
	--avb-primary-300: #66bbe6;
	--avb-primary-400: #33a5de;
	--avb-primary-500: #008ed6; /* base */
	--avb-primary-600: #0072ab; /* hover */
	--avb-primary-700: #005580; /* active / emphasis */
	--avb-primary-800: #003956;
	--avb-primary-900: #001c2b;

	--avb-primary: var(--avb-primary-500);
	--avb-color-accent: var(--avb-primary-500);
}

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

body {
	margin: 0;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.6;
	color: var(--avb-color-text);
	background: var(--avb-color-bg);

	/* Sticky footer: keep the footer pinned to the bottom on short pages. */
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

a {
	color: var(--avb-color-accent);
}

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

.avb-container {
	width: 100%;
	max-width: var(--avb-content-width);
	margin-inline: auto;
	padding-inline: 1.5rem;
}

/* ==========================================================================
   Header / Footer
   ========================================================================== */

.site-header .avb-container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
}

.avb-brand-subtitle {
	font-size: 0.7rem;
	letter-spacing: 0.02em;
}

.site-branding .site-title {
	margin: 0;
	font-size: 1.5rem;
}

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

.main-navigation ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
	margin: 0;
	padding: 0;
}

.main-navigation a {
	text-decoration: none;
	color: var(--avb-color-text);
}

.site-main {
	/* Grow to fill the viewport so the footer is pushed to the bottom. */
	flex: 1 0 auto;
}

.site-footer {
	flex-shrink: 0;
	border-top: 1px solid #e5e5e5;
	color: #555;
	font-size: 0.9rem;
}

/* ==========================================================================
   Cards — make them stand out across the app.
   ========================================================================== */

.card {
	border: 1px solid rgba(15, 23, 42, 0.12);
	box-shadow: 0 0.25rem 0.85rem rgba(15, 23, 42, 0.1);
	transition: box-shadow 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.card:hover {
	border-color: var(--avb-primary-300);
	box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.16);
}

.card .card-header {
	border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

/* Flatpickr: keep the wrapper full width so the label stays above the input. */
.flatpickr-wrapper {
	display: block;
	width: 100%;
}

/* ==========================================================================
   Content
   ========================================================================== */

.entry-title {
	margin-top: 0;
}

article {
	margin-bottom: 2.5rem;
}

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

/* ==========================================================================
   Ugrađeni materijal i dijelovi — mobile stacked layout
   On phones the table row (Materijal / Količina / remove) has too little
   width, so below 576px each row becomes a stacked card with field labels.
   ========================================================================== */

@media (max-width: 575.98px) {
	table[data-avb-materijali] thead {
		display: none;
	}

	table[data-avb-materijali],
	table[data-avb-materijali] tbody,
	table[data-avb-materijali] tr,
	table[data-avb-materijali] td {
		display: block;
		width: 100%;
	}

	table[data-avb-materijali] tr {
		border: 1px solid var(--bs-border-color, #dee2e6);
		border-radius: 0.5rem;
		padding: 0.625rem 0.75rem;
		margin-bottom: 0.75rem;
	}

	table[data-avb-materijali] td {
		border: 0;
		padding: 0.25rem 0;
	}

	table[data-avb-materijali] td[data-label]::before {
		content: attr(data-label);
		display: block;
		font-size: 0.7rem;
		font-weight: 600;
		text-transform: uppercase;
		letter-spacing: 0.02em;
		color: var(--bs-secondary-color, #6c757d);
		margin-bottom: 0.15rem;
	}

	table[data-avb-materijali] td:last-child {
		text-align: right;
		padding-top: 0.4rem;
	}
}


/* Hamburger dropdown toggle: white contents when the menu is open. */
.avb-hamburger.show,
.avb-hamburger[aria-expanded="true"] {
	background-color: var(--bs-primary);
	border-color: var(--bs-primary);
	color: #fff;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

/* Bootstrap picks .btn-primary's text colour by contrast and lands on black for
   the brand blue (#008ed6). White is what the rest of the app uses on primary. */
.btn-primary {
	--bs-btn-color: #fff;
	--bs-btn-hover-color: #fff;
	--bs-btn-active-color: #fff;
	--bs-btn-disabled-color: #fff;
}


/* ==========================================================================
   Form actions
   ========================================================================== */

/* The save / cancel row under every front-end form. Stacked and full width:
   these forms are filled in on a phone on site, where one wide target is far
   easier to hit than two buttons sharing a line. */
.avb-form-actions {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.75rem;
	text-align: center;
}

/* A plain text link keeps its own width so a stray tap near the edge cannot
   throw away what was just typed; only its position is centred. */
.avb-form-actions > a:not(.btn) {
	align-self: center;
}
