/* ==========================================================================
   OFM Dubrava — site styles on top of OceanWP + Elementor.
   Tokens here mirror the Elementor kit (tools/build_elementor.py); change both together.
   ========================================================================== */

:root {
	--ofm-habit: #31241b;      /* Franciscan habit: dark sections, footer */
	--ofm-brown: #443023;      /* headings on light */
	--ofm-gold: #c0a071;       /* buttons, rules, icons */
	--ofm-gold-deep: #8a6a3a;  /* links and gold text on light (4.9:1 on white) */
	--ofm-gold-light: #e3c99a; /* links on dark */
	--ofm-stucco: #f5efe6;     /* the one light warm band */
	--ofm-ink: #2a2522;
	--ofm-muted: #6d635b;
	--ofm-line: #e6ded2;
	--ofm-on-dark: #e9e0d4;

	--ofm-font-heading: 'Literata', Georgia, 'Times New Roman', serif;
	--ofm-font-body: 'Source Sans 3', 'Segoe UI', Roboto, Arial, sans-serif;

	--ofm-gutter: 40px;
	--ofm-radius: 4px;
	/* OceanWP sets html { font-size: 62.5% } (1rem = 10px): size things in px, not rem. */
}

@media (max-width: 1024px) {
	:root { --ofm-gutter: 32px; }
}

@media (max-width: 767px) {
	:root { --ofm-gutter: 20px; }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

/* iOS rubber-band scrolling reveals the html background past the footer: match the copyright bar
   instead of showing a white strip under the dark footer. Body stays white for the page itself. */
html {
	background-color: #271c15;
}

body,
body.elementor-default {
	background-color: #fff;
	font-family: var(--ofm-font-body);
	font-size: 18px;
	line-height: 1.6;
	color: var(--ofm-ink);
}

@media (max-width: 767px) {
	body { font-size: 17px; }
}

h1, h2, h3, h4, h5, h6,
.entry-title,
.page-header .page-header-title,
.sidebar-box .widget-title,
.wp-block-heading {
	font-family: var(--ofm-font-heading);
	font-weight: 600;
	color: var(--ofm-brown);
	letter-spacing: 0;
	text-transform: none;
}

a { color: var(--ofm-gold-deep); }
a:hover { color: var(--ofm-brown); }

.entry-content a:not(.elementor-button):not(.ofm-card),
.ofm-links a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

:focus-visible {
	outline: 2px solid var(--ofm-gold-deep);
	outline-offset: 3px;
}

.ofm-about :focus-visible,
.ofm-footer :focus-visible,
.page-header :focus-visible,
#site-header.transparent-header :focus-visible {
	outline-color: var(--ofm-gold-light);
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

/* One gutter everywhere: OceanWP containers and boxed Elementor sections line up at every width. */
body .container {
	width: 1200px;
	max-width: calc(100% - 2 * var(--ofm-gutter));
}

/* Full-width page sections only; nested sections and the footer template already sit inside a gutter.
   +20px because Elementor columns add 10px padding on each side. */
.elementor[data-elementor-type="wp-page"] .elementor-top-section.elementor-section-boxed > .elementor-container {
	max-width: min(1220px, calc(100% - 2 * var(--ofm-gutter) + 20px));
}

/* The footer template renders inside OceanWP's .container; pull its columns out to the same edge. */
#footer-widgets .elementor-top-section.elementor-section-boxed > .elementor-container {
	max-width: none;
	margin-left: -10px;
	margin-right: -10px;
}

.ofm-measure .elementor-widget-container,
.ofm-measure.elementor-widget-text-editor p {
	max-width: 640px;
}

/* --------------------------------------------------------------------------
   Buttons and forms
   -------------------------------------------------------------------------- */

.elementor-button,
.theme-button,
input[type="submit"],
button[type="submit"],
body div.wpforms-container-full .wpforms-form button[type=submit] {
	font-family: var(--ofm-font-body);
	font-weight: 600;
	font-size: 17px;
	letter-spacing: 0;
	text-transform: none;
	border-radius: var(--ofm-radius);
}

/* WPForms: one button style instead of the black-bordered default. */
body div.wpforms-container-full .wpforms-form button[type=submit] {
	background: var(--ofm-gold) !important;
	color: #2e2119 !important;
	border: 0 !important;
	padding: 14px 26px !important;
	height: auto !important;
}

body div.wpforms-container-full .wpforms-form button[type=submit]:hover {
	background: var(--ofm-brown) !important;
	color: #fff !important;
}

body div.wpforms-container-full .wpforms-form .wpforms-field-label {
	font-family: var(--ofm-font-body);
	font-weight: 600;
	font-size: 16px;
	color: var(--ofm-ink);
}

body div.wpforms-container-full .wpforms-form input[type=text],
body div.wpforms-container-full .wpforms-form input[type=email],
body div.wpforms-container-full .wpforms-form textarea,
.wp-block-search__input {
	border: 1px solid #cfc4b5;
	border-radius: var(--ofm-radius);
	font-size: 17px;
	max-width: 100% !important;
}

body div.wpforms-container-full .wpforms-form .wpforms-field {
	padding: 0 0 18px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

#site-navigation-wrap .dropdown-menu > li > a,
.oceanwp-mobile-menu-icon a,
#sidr .sidr-class-dropdown-menu li a,
.sidr-class-dropdown-menu li a {
	font-family: var(--ofm-font-body);
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
}

#site-navigation-wrap .dropdown-menu > li > a {
	font-size: 17px;
	padding: 0 14px;
}

/* No top border: the hovered item's gold underline already marks the open dropdown. */
#site-navigation-wrap .dropdown-menu .sub-menu {
	border-top: 0;
	border-radius: var(--ofm-radius);
	box-shadow: 0 14px 30px -12px rgba(49, 36, 27, 0.3);
}

#site-navigation-wrap .dropdown-menu .sub-menu li a {
	font-family: var(--ofm-font-body);
	font-size: 16px;
	color: var(--ofm-ink);
}

#sidr .sidr-class-dropdown-menu li a,
.sidr-class-dropdown-menu li a {
	font-size: 18px;
	color: var(--ofm-ink);
}

#sidr .sidr-class-dropdown-menu li a:hover,
#sidr .sidr-class-dropdown-menu li.sidr-class-current-menu-item > a {
	color: var(--ofm-gold-deep);
}

#sidr .sidr-class-toggle-sidr-close {
	background-color: var(--ofm-habit);
	text-transform: none;
	letter-spacing: 0;
	font-family: var(--ofm-font-body);
	font-size: 16px;
}

/* Centre the phone menu toggle on the logo instead of the top edge of the header.
   959px is OceanWP's default mobile-menu breakpoint; above it the toggle must stay hidden. */
@media (max-width: 959px) {
	#site-header-inner .oceanwp-mobile-menu-icon {
		display: flex;
		align-items: center;
		height: 74px; /* OceanWP's header height; the logo is centred in the same box */
	}
}

/* The phone menu toggle is a <button>, so it picked up the gold theme-button fill. */
.oceanwp-mobile-menu-icon button.mobile-menu {
	background: transparent;
	color: #fff;
	border: 0;
	min-width: 44px;
	min-height: 44px;
	padding: 0 10px;
	font-size: 22px;
	line-height: 44px;
}

.oceanwp-mobile-menu-icon button.mobile-menu:hover,
.oceanwp-mobile-menu-icon button.mobile-menu:focus {
	background: transparent;
	color: var(--ofm-gold-light);
}

.is-sticky .oceanwp-mobile-menu-icon button.mobile-menu,
#site-header:not(.transparent-header) .oceanwp-mobile-menu-icon button.mobile-menu {
	color: var(--ofm-ink);
}

/* --------------------------------------------------------------------------
   Page title band (all non-Elementor pages)
   -------------------------------------------------------------------------- */

.page-header .page-header-title {
	color: #fff;
	margin: 0; /* size comes from the OceanWP page_title_typography setting */
}

.page-header .container {
	text-align: left;
}

/* Photo title bands: warm habit-brown wash, darkest behind the left-aligned title
   (replaces OceanWP's flat 50% black, which turned warm interiors grey-green). */
.page-header .background-image-page-header-overlay {
	background: linear-gradient(90deg, rgba(30, 22, 17, 0.88) 0%, rgba(30, 22, 17, 0.62) 55%, rgba(30, 22, 17, 0.45) 100%);
	opacity: 1;
}

/* Relative + z-index keeps the trail above the photo overlay on pages with a header image. */
.page-header .site-breadcrumbs {
	position: relative;
	z-index: 3;
	top: auto;
	right: auto;
	transform: none;
	margin-top: 12px;
	font-size: 15px;
	text-align: left;
	max-width: 100%;
}

/* OceanWP gives the trail a fixed 32px height with overflow hidden, which cut off a wrapped line. */
.page-header .site-breadcrumbs {
	height: auto;
	overflow: visible;
	white-space: normal;
}

/* On phones the last item only repeats the page title right above it. */
@media (max-width: 767px) {
	.page-header .site-breadcrumbs .trail-end {
		display: none;
	}

	.page-header .site-breadcrumbs .trail-item:nth-last-child(2) .breadcrumb-sep {
		display: none;
	}
}

.page-header .site-breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 0 0.1em;
	justify-content: flex-start;
}

.page-header .site-breadcrumbs a {
	color: var(--ofm-gold-light);
}

.page-header .site-breadcrumbs a:hover {
	color: #fff;
}

.page-header .site-breadcrumbs .trail-end,
.page-header .site-breadcrumbs .breadcrumb-sep {
	color: rgba(255, 255, 255, 0.8);
}

/* --------------------------------------------------------------------------
   Homepage: hero
   -------------------------------------------------------------------------- */

.ofm-hero .elementor-widget-wrap > .elementor-element {
	max-width: 720px;
}

.ofm-hero .elementor-widget-heading .elementor-heading-title {
	text-wrap: balance;
}

.ofm-hero .elementor-widget-text-editor p:last-child {
	margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   Homepage: Mass times panel, overlapping the hero
   -------------------------------------------------------------------------- */

.ofm-mass {
	--ofm-overlap: 96px;
	background: linear-gradient(to bottom, transparent var(--ofm-overlap), var(--ofm-stucco) var(--ofm-overlap));
}

@media (max-width: 1024px) {
	.ofm-mass { --ofm-overlap: 72px; }
}

@media (max-width: 767px) {
	.ofm-mass { --ofm-overlap: 48px; }
}

/* Sections whose columns carry their own box: the box edge, not the text, sits on the content line. */
.elementor[data-elementor-type="wp-page"] .elementor-top-section.ofm-mass > .elementor-container,
.elementor[data-elementor-type="wp-page"] .elementor-top-section.ofm-panels > .elementor-container {
	max-width: min(1200px, calc(100% - 2 * var(--ofm-gutter)));
}

.elementor[data-elementor-type="wp-page"] .elementor-top-section.ofm-mass > .elementor-container {
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 24px 48px -24px rgba(49, 36, 27, 0.35);
}

.ofm-mass .elementor-image-box-content {
	text-align: left;
}

.ofm-mass .elementor-image-box-title {
	margin-top: 0;
}

.ofm-mass .elementor-image-box-description {
	color: var(--ofm-ink);
	line-height: 1.5;
}

.ofm-mass .elementor-image-box-description strong {
	display: block;
	font-weight: 600;
	color: var(--ofm-muted);
	font-size: 15px;
}

.ofm-mass .elementor-image-box-description strong:not(:first-child) {
	margin-top: 10px;
}

@media (min-width: 1025px) {
	.ofm-mass .elementor-column + .elementor-column {
		border-left: 1px solid var(--ofm-line);
	}
}

@media (min-width: 768px) and (max-width: 1024px) {
	.ofm-mass .elementor-column:nth-child(even) {
		border-left: 1px solid var(--ofm-line);
	}

	.ofm-mass .elementor-column:nth-child(n+3) {
		border-top: 1px solid var(--ofm-line);
	}
}

@media (max-width: 767px) {
	.ofm-mass .elementor-column + .elementor-column {
		border-top: 1px solid var(--ofm-line);
	}
}

/* --------------------------------------------------------------------------
   Homepage: latest news (Ocean "magazine grid simple" widget)
   -------------------------------------------------------------------------- */

.ofm-news .oew-magazine-grid-simple-wrapper {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 28px 48px;
}

@media (max-width: 767px) {
	.ofm-news .oew-magazine-grid-simple-wrapper {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}
}

.ofm-news .oew-magazine-grid-simple-post-item {
	width: auto;
	margin: 0;
	padding: 0;
}

.ofm-news .oew-magazine-grid-simple-post-item-inner {
	display: flex;
	align-items: center;
	gap: 20px;
	margin: 0;
	padding: 0;
}

.ofm-news .oew-magazine-grid-simple-post-item .oew-magazine-grid-simple-post-image {
	flex: 0 0 112px;
	width: 112px;
	margin: 0;
	padding: 0;
}

@media (max-width: 1024px) {
	.ofm-news .oew-magazine-grid-simple-post-item .oew-magazine-grid-simple-post-image { flex-basis: 96px; width: 96px; }
}

@media (max-width: 767px) {
	.ofm-news .oew-magazine-grid-simple-post-item .oew-magazine-grid-simple-post-image { flex-basis: 84px; width: 84px; }
	.ofm-news .oew-magazine-grid-simple-post-item-inner { gap: 16px; }
}

.ofm-news .oew-magazine-grid-simple-post-image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: var(--ofm-radius);
}

.ofm-news .oew-magazine-grid-simple-post-content {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0;
}

/* Every post on the homepage is in "Obavijesti"; the label only repeated the section title. */
.ofm-news .oew-magazine-grid-simple-post-info-top {
	display: none;
}

.ofm-news .oew-magazine-grid-simple-post-title {
	font-family: var(--ofm-font-heading);
	font-size: 19px;
	line-height: 1.3;
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
	margin: 0 0 6px;
	padding: 0;
	background: none;
}

@media (max-width: 767px) {
	.ofm-news .oew-magazine-grid-simple-post-title { font-size: 18px; }
}

.ofm-news .oew-magazine-grid-simple-post-title a {
	color: var(--ofm-brown);
}

.ofm-news .oew-magazine-grid-simple-post-title a:hover {
	color: var(--ofm-gold-deep);
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.ofm-news .oew-magazine-grid-simple-post-info-date,
.ofm-news .oew-magazine-grid-simple-post-info-date a {
	font-size: 15px;
	color: var(--ofm-muted);
	margin: 0;
	padding: 0;
	pointer-events: none; /* the date links to "#" */
}

/* --------------------------------------------------------------------------
   Homepage: about & activities (dark band)
   -------------------------------------------------------------------------- */

.ofm-about .oew-info-box-wrap {
	padding: 0;
	background: none;
	text-align: left;
}

.ofm-about .oew-info-box-icon-wrap,
.ofm-about .oew-info-box-icon,
.ofm-about .oew-info-box-icon a {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	line-height: 0;
}

.ofm-about .oew-info-box-icon img {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: var(--ofm-radius);
}

.ofm-about .oew-info-box-content {
	padding: 20px 0 0;
	text-align: left;
}

.ofm-about .oew-info-box-title {
	display: inline-block;
	color: #fff;
	margin-bottom: 8px;
}

.ofm-about .oew-info-box-title:hover {
	color: var(--ofm-gold-light);
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.ofm-about .oew-info-box-divider-wrap {
	display: none;
}

.ofm-about .oew-info-box-description {
	color: var(--ofm-on-dark);
}

.ofm-about .elementor-button {
	background: transparent;
	color: #fff;
	box-shadow: inset 0 0 0 1.5px var(--ofm-gold);
}

.ofm-about .elementor-button:hover {
	background: var(--ofm-gold);
	color: #2e2119;
}

@media (min-width: 901px) {
	.ofm-cards-row > .elementor-container {
		gap: 32px;
	}

	.ofm-cards-row > .elementor-container > .elementor-column {
		width: auto;
		flex: 1 1 0;
	}
}

/* Tablet portrait: three columns are too narrow; switch to image-left rows. */
@media (min-width: 768px) and (max-width: 900px) {
	.ofm-cards-row > .elementor-container {
		flex-direction: column;
		gap: 28px;
	}

	.ofm-cards-row > .elementor-container > .elementor-column {
		width: 100%;
	}

	.ofm-about .oew-info-box {
		display: grid;
		grid-template-columns: 40% 1fr;
		gap: 24px;
		align-items: center;
	}

	.ofm-about .oew-info-box-content {
		padding-top: 0;
	}
}

@media (max-width: 767px) {
	.ofm-cards-row > .elementor-container {
		gap: 36px;
	}
}

/* --------------------------------------------------------------------------
   Homepage: notice + EU project panels
   -------------------------------------------------------------------------- */

.ofm-panels > .elementor-container {
	gap: 32px;
}

@media (min-width: 768px) {
	.ofm-panels > .elementor-container > .elementor-column {
		width: auto;
		flex: 1 1 0;
	}
}

@media (max-width: 767px) {
	.ofm-panels > .elementor-container {
		gap: 20px;
	}
}

body .elementor-section .elementor-column.ofm-panel > .elementor-widget-wrap {
	border: 1px solid var(--ofm-line);
	border-radius: 6px;
	padding: 40px;
	align-content: flex-start;
}

@media (max-width: 767px) {
	body .elementor-section .elementor-column.ofm-panel > .elementor-widget-wrap {
		padding: 28px 24px;
	}
}

.ofm-panel .elementor-widget-text-editor p:last-child {
	margin-bottom: 0;
}

/* EU panel: flag beside the text keeps it as short as the notice next to it. */
body .elementor-section .elementor-column.ofm-panel--eu > .elementor-widget-wrap {
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr);
	column-gap: 28px;
}

.ofm-panel--eu > .elementor-widget-wrap > .elementor-widget-image {
	grid-row: 1 / span 3;
}

.ofm-panel--eu > .elementor-widget-wrap > .elementor-element:not(.elementor-widget-image) {
	grid-column: 2;
}

/* Narrow phones: a side column would squeeze the text, so the flag goes back on top. */
@media (max-width: 480px) {
	body .elementor-section .elementor-column.ofm-panel--eu > .elementor-widget-wrap {
		display: flex;
	}

	.ofm-panel--eu .elementor-widget-image img {
		width: 64px;
	}
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

/* The footer logo is an SVG by URL, so Elementor prints no width/height. Reserve its box: otherwise
   the page grew ~110px when the lazy-loaded logo arrived, which felt like endless scrolling on phones. */
.ofm-footer .elementor-widget-image img {
	aspect-ratio: 567 / 442;
	height: auto;
}

.ofm-footer .elementor-icon-list-text {
	transition: color 0.15s ease;
}

.ofm-footer .elementor-icon-list-item a:hover .elementor-icon-list-text {
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

#footer-bottom {
	padding: 18px 0;
}

#footer-bottom #copyright {
	font-size: 14px;
}

/* --------------------------------------------------------------------------
   News archive (OceanWP grid) and single posts
   -------------------------------------------------------------------------- */

.blog-entry.grid-entry .blog-entry-inner {
	border: 0;
	padding: 0;
	box-shadow: none;
	background: none;
}

/* OceanWP pulls thumbnails out by the inner padding we just removed. */
.blog-entry.grid-entry .thumbnail {
	margin: 0;
}

#blog-entries.blog-grid {
	margin: 0 -16px;
}

#blog-entries.blog-grid > .blog-entry {
	padding: 0 16px;
	margin-bottom: 48px;
}

.blog-entry.grid-entry .thumbnail img,
.related-thumb img {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: var(--ofm-radius);
}

.blog-entry.grid-entry .blog-entry-header {
	margin: 0 0 8px;
}

.blog-entry.grid-entry .blog-entry-title {
	font-size: 21px;
	line-height: 1.3;
}

.blog-entry.grid-entry .blog-entry-title a {
	color: var(--ofm-brown);
}

.blog-entry.grid-entry .blog-entry-title a:hover {
	color: var(--ofm-gold-deep);
}

.blog-entry.grid-entry ul.meta {
	margin: 18px 0 6px;
	padding: 0;
	border: 0;
	font-size: 15px;
	text-transform: none;
	letter-spacing: 0;
}

.blog-entry.grid-entry ul.meta li,
.blog-entry.grid-entry ul.meta li a {
	color: var(--ofm-muted);
	font-size: 15px;
}

.blog-entry.grid-entry ul.meta li i {
	display: none;
}

.blog-entry.grid-entry .blog-entry-summary {
	margin: 0;
	font-size: 16px;
	color: var(--ofm-muted);
}

.blog-entry.grid-entry .blog-entry-summary p {
	margin: 0;
}

.single-post .entry-content img {
	border: 0;
	border-radius: var(--ofm-radius);
}

/* Posters are embedded with PDF Embedder; drop its black frame. */
.pdfemb-viewer,
.pdfemb-viewer .pdfemb-pagescontainer {
	border: 0 !important;
	border-radius: var(--ofm-radius);
}

.single-post #content .entry-content {
	font-size: 18px;
}

.entry-share {
	border-top: 1px solid var(--ofm-line);
	border-bottom: 0;
	padding-top: 24px;
}

.entry-share .theme-heading,
.entry-share .social-share-title {
	font-family: var(--ofm-font-body);
	font-size: 16px;
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
	color: var(--ofm-ink);
}

.post-navigation .nav-links .title {
	font-family: var(--ofm-font-body);
	font-size: 14px;
	text-transform: none;
	letter-spacing: 0;
	color: var(--ofm-muted);
}

.post-navigation .nav-links .post-title {
	font-family: var(--ofm-font-heading);
	font-weight: 600;
	color: var(--ofm-brown);
}

/* Sidebar */
.sidebar-box {
	margin-bottom: 44px;
}

.widget-area .sidebar-box h4.wp-block-heading,
.widget-area .sidebar-box .widget-title {
	font-family: var(--ofm-font-heading);
	font-size: 19px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	color: var(--ofm-brown);
	margin-bottom: 14px;
	padding: 0;
	border: 0;
}

.sidebar-box .wp-block-latest-posts__list li {
	margin-bottom: 12px;
	line-height: 1.35;
}

.sidebar-box .wp-block-latest-posts__list a {
	color: var(--ofm-ink);
	text-decoration: none;
	font-size: 16px;
}

.sidebar-box .wp-block-latest-posts__list a:hover {
	color: var(--ofm-gold-deep);
	text-decoration: underline;
}

.sidebar-box .wp-block-latest-posts__post-date {
	font-size: 14px;
	color: var(--ofm-muted);
}

.sidebar-box p {
	font-size: 16px;
	margin-bottom: 10px;
}

.wp-block-search__button {
	background: var(--ofm-gold);
	color: #2e2119;
	border: 0;
	border-radius: var(--ofm-radius);
	font-weight: 600;
}

/* --------------------------------------------------------------------------
   Content pages: centred reading column, wide elements allowed
   -------------------------------------------------------------------------- */

/* Left-aligned under the page title, capped at about 75 characters per line. */
.page:not(.elementor-page) .entry > * {
	max-width: 620px;
}

.page:not(.elementor-page) .entry > .gallery,
.page:not(.elementor-page) .entry > .ofm-cards,
.page:not(.elementor-page) .entry > .ofm-related,
.page:not(.elementor-page) .entry > .ofm-contact,
.page:not(.elementor-page) .entry > .ofm-map,
.page:not(.elementor-page) .entry > .ofm-band,
.page:not(.elementor-page) .entry > .ofm-sep {
	max-width: none;
}

/* [gallery]: an even grid of square photos filling the content width (core floats 150px thumbnails
   inside wide columns, leaving big gaps). Two columns on phones. */
.entry-content .gallery,
.entry .gallery {
	display: grid;
	grid-template-columns: repeat(var(--ofm-gallery-cols, 3), minmax(0, 1fr));
	gap: 8px;
	margin: 28px 0;
}

.gallery-columns-1 { --ofm-gallery-cols: 1; }
.gallery-columns-2 { --ofm-gallery-cols: 2; }
.gallery-columns-4 { --ofm-gallery-cols: 4; }
.gallery-columns-5 { --ofm-gallery-cols: 5; }
.gallery-columns-6,
.gallery-columns-7,
.gallery-columns-8,
.gallery-columns-9 { --ofm-gallery-cols: 6; }

@media (max-width: 767px) {
	.entry-content .gallery:not(.gallery-columns-1),
	.entry .gallery:not(.gallery-columns-1) {
		--ofm-gallery-cols: 2;
	}
}

.gallery .gallery-item {
	float: none;
	width: auto !important; /* core prints an inline per-column width */
	max-width: none;
	margin: 0;
	padding: 0;
}

.gallery .gallery-item img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
	border: 0 !important;
	border-radius: 2px;
}

/* Square crops stay square; galleries in other sizes (e.g. O nama) keep the photos' own shape. */
.gallery-size-thumbnail .gallery-item img,
.gallery-size-ocean-thumb-m .gallery-item img {
	aspect-ratio: 1;
}

.gallery br {
	display: none;
}

.gallery .gallery-caption {
	font-size: 14px;
	color: var(--ofm-muted);
	padding-top: 4px;
}

/* Videos embedded in old posts as fixed 560x315 iframes: full content width, 16:9. */
.entry-content iframe[src*="youtube.com"],
.entry-content iframe[src*="youtube-nocookie.com"],
.entry-content iframe[src*="vimeo.com"] {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	border: 0;
}

/* Featured-image captions imported with old posts are filenames ("smart"); not shown on the archive grid. */
.blog-entry.grid-entry .thumbnail-caption {
	display: none;
}

.page:not(.elementor-page) .entry h2,
.page:not(.elementor-page) .entry h3 {
	margin-top: 1.6em;
	margin-bottom: 0.5em;
}

/* --------------------------------------------------------------------------
   Content helpers used by page content (Aktivnosti, Kontakt, …)
   -------------------------------------------------------------------------- */

.ofm-sep {
	margin: 48px 0;
	border: 0;
	border-top: 1px solid var(--ofm-line);
}

.ofm-sub {
	font-size: 20px;
	color: var(--ofm-muted);
}

.ofm-h {
	font-size: 30px;
}

.ofm-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 40px 32px;
	margin-top: 32px;
}

.entry .ofm-card {
	display: block;
	color: var(--ofm-brown);
	text-decoration: none !important; /* beats OceanWP's page-link underline */
}

.ofm-card-img {
	display: block;
	aspect-ratio: 3 / 2;
	background-size: cover;
	background-position: center;
	border-radius: var(--ofm-radius);
}

.ofm-card-t {
	display: block;
	padding-top: 14px;
	font-family: var(--ofm-font-heading);
	font-size: 21px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--ofm-brown);
}

.entry .ofm-card:hover .ofm-card-t {
	color: var(--ofm-gold-deep);
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.ofm-map iframe {
	display: block;
	width: 100%;
	height: 420px;
	border: 0;
	border-radius: 6px;
}

@media (max-width: 767px) {
	.ofm-map iframe { height: 320px; }
}

.ofm-eu {
	display: flex;
	gap: 14px;
	align-items: center;
	padding: 14px;
	border: 1px solid var(--ofm-line);
	border-radius: 6px;
	color: var(--ofm-ink);
	font-size: 14px;
	line-height: 1.4;
	text-decoration: none;
}

.ofm-eu img {
	width: 64px;
	height: auto;
}

.ofm-eu:hover {
	border-color: var(--ofm-gold);
	color: var(--ofm-ink);
}

.widget-area .ofm-eu,
.widget-area .ofm-eu * {
	color: var(--ofm-ink);
	text-decoration: none !important; /* beats OceanWP's link underline */
}

/* Photo band (fra3.net on O nama): text over a darkened photo, darkest behind the text. */
.ofm-band {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: flex;
	align-items: center;
	min-height: 340px;
	margin: 56px 0;
	border-radius: 6px;
	background: var(--ofm-habit);
}

.entry .ofm-band .ofm-band-media {
	position: absolute;
	inset: 0;
	z-index: -2;
	margin: 0;
}

.entry .ofm-band .ofm-band-media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center 40%;
	border-radius: 0;
}

.ofm-band::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(90deg, rgba(30, 22, 17, 0.9) 0%, rgba(30, 22, 17, 0.72) 45%, rgba(30, 22, 17, 0.2) 100%);
}

.ofm-band-body {
	max-width: 600px;
	padding: 56px;
}

.entry .ofm-band .ofm-band-title {
	color: #fff;
	font-size: 32px;
	line-height: 1.2;
	margin: 0 0 12px;
}

.entry .ofm-band p {
	color: var(--ofm-on-dark);
	margin: 0 0 28px;
}

.entry .ofm-band p:last-child {
	margin-bottom: 0; /* wpautop wraps the button in a <p> */
}

.entry .ofm-band .ofm-band-button {
	display: inline-block;
	padding: 14px 26px;
	border-radius: var(--ofm-radius);
	background: var(--ofm-gold);
	color: #2e2119;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none !important; /* beats OceanWP's page-link underline */
}

.entry .ofm-band .ofm-band-button:hover {
	background: #fff;
	color: var(--ofm-brown);
}

@media (max-width: 767px) {
	.ofm-band {
		min-height: 0;
		margin: 40px 0;
	}

	/* Text spans the full width on phones, so darken evenly from the bottom up. */
	.ofm-band::before {
		background: linear-gradient(0deg, rgba(30, 22, 17, 0.92) 0%, rgba(30, 22, 17, 0.75) 60%, rgba(30, 22, 17, 0.45) 100%);
	}

	.ofm-band-body {
		padding: 120px 24px 28px;
	}

	.entry .ofm-band .ofm-band-title {
		font-size: 26px;
	}
}

/* Sidebar card version of the fra3 band: photo fades into the habit-brown text area. */
.ofm-promo {
	display: block;
	max-width: 420px;
	overflow: hidden;
	border-radius: 6px;
	background: var(--ofm-habit);
	text-decoration: none !important; /* beats OceanWP's link underline */
}

.ofm-promo-media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
}

.ofm-promo-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}

.ofm-promo-media::after {
	content: "";
	position: absolute;
	inset: auto 0 0;
	height: 50%;
	background: linear-gradient(to bottom, rgba(49, 36, 27, 0), var(--ofm-habit));
}

.ofm-promo-body {
	display: block;
	padding: 4px 22px 24px;
}

.ofm-promo-title {
	display: block;
	margin-bottom: 8px;
	font-family: var(--ofm-font-heading);
	font-size: 21px;
	font-weight: 600;
	line-height: 1.25;
	color: #fff;
}

.ofm-promo-text {
	display: block;
	margin-bottom: 18px;
	font-size: 16px;
	line-height: 1.5;
	color: var(--ofm-on-dark);
}

.ofm-promo-button {
	display: inline-block;
	padding: 11px 20px;
	border-radius: var(--ofm-radius);
	background: var(--ofm-gold);
	color: #2e2119;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
}

.ofm-promo:hover .ofm-promo-button {
	background: #fff;
	color: var(--ofm-brown);
}

/* 404 page (also shown for ?s= requests, since the site has no search) */
.error404-content .error-text {
	margin-bottom: 28px;
}

.error404-content .error-btn,
.error404-content .error-btn:visited {
	margin: 0;
	padding: 14px 26px;
	border: 0;
	border-radius: var(--ofm-radius);
	background: var(--ofm-gold);
	color: #2e2119;
	font-size: 17px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
}

.error404-content .error-btn:hover {
	background: var(--ofm-brown);
	color: #fff;
}

/* Label/value lists (EU project facts, contact details) */
.ofm-facts {
	margin: 32px 0;
	border-top: 1px solid var(--ofm-line);
}

.ofm-facts dt {
	font-weight: 600;
	font-size: 15px;
	color: var(--ofm-muted);
	padding-top: 16px;
}

.ofm-facts dd {
	margin: 2px 0 0;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--ofm-line);
}

.ofm-plain {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ofm-plain li {
	margin-bottom: 8px;
}

.ofm-eu-banner {
	margin: 0 0 32px;
}

.ofm-eu-banner img {
	display: block;
	width: 100%;
	height: auto;
}

/* Kontakt page */
.ofm-contact {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: 56px;
	align-items: start;
}

@media (max-width: 900px) {
	.ofm-contact { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}

.ofm-contact h2 {
	font-size: 24px;
	margin: 0 0 16px;
}

.ofm-contact dl {
	margin: 0 0 28px;
}

.ofm-contact dt {
	font-weight: 600;
	color: var(--ofm-muted);
	font-size: 15px;
	margin-top: 12px;
}

.ofm-contact dd {
	margin: 0;
}
