/*
Theme Name: Dragonfly Dealer
Theme URI: https://dealer.dragonfly.dk
Author: Dragonfly Trimarans
Description: Private dealer portal for Dragonfly Trimarans. Navy and gold design with the Dragonfly logo, news, media bank and manuals & documents.
Version: 2.6.3
Requires at least: 6.5
Tested up to: 7.1
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: dragonfly-dealer
*/

/* ---------- Header ---------- */
.dd-header { position: relative; z-index: 10; }
.dd-header .wp-block-navigation a { text-decoration: none; }
.dd-header .wp-block-navigation .wp-block-navigation-item__content {
	padding: 14px 4px 11px;
	border-bottom: 3px solid transparent;
	color: #C9D6DD;
}
.dd-header .wp-block-navigation .wp-block-navigation-item__content:hover,
.dd-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
	color: #FFFFFF;
	border-bottom-color: var(--wp--preset--color--gold);
}
.dd-header .wp-block-navigation__responsive-container-open,
.dd-header .wp-block-navigation__responsive-container-close { color: #FFFFFF; }
.dd-header .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--navy) !important;
	color: #FFFFFF !important;
	padding: 24px;
}
.dd-portal-label {
	border-left: 1px solid rgba(255,255,255,0.35);
	padding-left: 12px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
}
.dd-logout a { color: #FFFFFF; }

/* Logged-out visitors only see the logo, never the menu */
body:not(.logged-in) .dd-nav,
body:not(.logged-in) .dd-logout { display: none !important; }

/* ---------- Cards ---------- */
.dd-card {
	background: #FFFFFF;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 12px;
	overflow: hidden;
	height: 100%;
	transition: box-shadow .15s ease, border-color .15s ease;
}
.dd-card:hover { border-color: #B9CDE6; box-shadow: 0 6px 24px rgba(3,41,90,0.08); }
.dd-card .wp-block-post-featured-image { margin: 0; }
.dd-card .wp-block-post-featured-image img { aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.dd-card a { text-decoration: none; }
.dd-card .wp-block-post-title a:hover { text-decoration: underline; }

.dd-quicklink {
	background: #FFFFFF;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 12px;
	height: 100%;
	transition: box-shadow .15s ease, border-color .15s ease;
}
.dd-quicklink:hover { border-color: #B9CDE6; box-shadow: 0 6px 24px rgba(3,41,90,0.08); }
.dd-quicklink h3 a { text-decoration: none; color: inherit; }
.dd-quicklink h3 a::after { content: ""; position: absolute; inset: 0; }
.dd-quicklink { position: relative; }

.dd-gold-bar { width: 56px; height: 3px; background: var(--wp--preset--color--gold); }

/* Category pills */
.dd-pills { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.dd-pills li { margin: 0; }
.dd-pills a {
	display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
	border: 1px solid #B8C4CB; border-radius: 999px; background: #FFFFFF;
	color: var(--wp--preset--color--navy); text-decoration: none; font-size: 15px;
}
.dd-pills a:hover, .dd-pills .current-cat a { background: var(--wp--preset--color--navy); border-color: var(--wp--preset--color--navy); color: #FFFFFF; }

.dd-meta, .dd-meta a { color: var(--wp--preset--color--muted); text-decoration: none; }
.dd-meta .wp-block-post-terms a { color: var(--wp--preset--color--blue); font-weight: 600; }

/* Pagination */
.wp-block-query-pagination a, .wp-block-query-pagination .page-numbers { text-decoration: none; padding: 6px 10px; }
.wp-block-query-pagination .current { background: var(--wp--preset--color--navy); color: #FFFFFF; border-radius: 6px; }

/* ---------- Login page (Ultimate Member) ---------- */
.dd-login-split { min-height: calc(100vh - 140px); }
.dd-login-hero { flex: 1 1 auto; display: flex; width: 100%; }
.dd-login-hero img { width: 100%; height: 100%; min-height: 260px; object-fit: cover; border-radius: 12px; }
.um .um-field-label label { color: var(--wp--preset--color--navy) !important; font-weight: 600 !important; }
.um input[type=text], .um input[type=password], .um input[type=email] {
	border: 1px solid #B8C4CB !important; border-radius: 8px !important; height: 48px !important; font-size: 16px !important;
}
.um input[type=submit].um-button, .um a.um-button, .um .um-button {
	background: var(--wp--preset--color--navy) !important; border-radius: 8px !important; min-height: 48px; font-weight: 600 !important;
}
.um input[type=submit].um-button:hover, .um .um-button:hover { background: var(--wp--preset--color--blue) !important; }
.um a.um-link-alt { color: var(--wp--preset--color--blue) !important; }
.um-page-login .um, .um-page-password-reset .um { max-width: 420px !important; }

/* Hide page titles on Ultimate Member system pages */
.um-page-login .wp-block-post-title,
.um-page-password-reset .wp-block-post-title { display: none; }

/* Download / file links inside content */
.wp-block-file { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--wp--preset--color--line); margin: 0; }
.wp-block-file a:not(.wp-block-file__button) { font-weight: 600; color: var(--wp--preset--color--navy); }
.wp-block-file .wp-block-file__button {
	background: #FFFFFF; color: var(--wp--preset--color--navy); border: 1px solid #B8C4CB;
	border-radius: 8px; padding: 10px 16px; font-size: 14px; font-weight: 600; margin-left: auto;
}
.wp-block-file .wp-block-file__button:hover { background: var(--wp--preset--color--navy); color: #FFFFFF; }

/* Galleries in the media bank */
.wp-block-gallery.has-nested-images figure.wp-block-image img { border-radius: 10px; }

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--wp--preset--color--blue); outline-offset: 2px; }

/* ---------- News: All pill ---------- */
.dd-pillrow { align-items: center; }
.dd-pillrow .dd-pills { display: contents; }
.dd-all { margin: 0; }
.dd-all a {
	display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
	border: 1px solid #B8C4CB; border-radius: 999px; background: #FFFFFF;
	color: var(--wp--preset--color--navy); text-decoration: none; font-size: 15px;
}
.dd-all a:hover, body.blog .dd-all a { background: var(--wp--preset--color--navy); border-color: var(--wp--preset--color--navy); color: #FFFFFF; }

/* ---------- Folders (Details block) ---------- */
.wp-block-details.dd-folder {
	background: #FFFFFF;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 12px;
	padding: 0 24px;
	margin-block: 12px;
}
.wp-block-details.dd-folder > summary {
	cursor: pointer;
	list-style: none;
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: 64px;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	font-size: 20px;
	color: var(--wp--preset--color--navy);
}
.wp-block-details.dd-folder > summary::-webkit-details-marker { display: none; }
.wp-block-details.dd-folder > summary::before {
	content: "";
	flex: none;
	width: 9px; height: 9px;
	border-right: 2px solid var(--wp--preset--color--gold);
	border-bottom: 2px solid var(--wp--preset--color--gold);
	transform: rotate(-45deg);
	transition: transform .15s ease;
}
.wp-block-details.dd-folder[open] > summary::before { transform: rotate(45deg); }
.wp-block-details.dd-folder[open] > summary { border-bottom: 1px solid var(--wp--preset--color--line); margin-bottom: 20px; }
.wp-block-details.dd-folder[open] { padding-bottom: 20px; }
.wp-block-details.dd-folder > summary:hover { color: var(--wp--preset--color--blue); }

.wp-block-details.dd-subfolder {
	background: var(--wp--preset--color--background);
	border-color: var(--wp--preset--color--line);
	padding: 0 20px;
}
.wp-block-details.dd-subfolder > summary { font-size: 17px; min-height: 52px; }
.wp-block-details.dd-subfolder[open] > summary { margin-bottom: 16px; }

.dd-hint { color: var(--wp--preset--color--muted); font-size: 15px; }

/* ---------- Galleries: equal-size thumbnails on every row ---------- */
.wp-block-details.dd-folder .wp-block-gallery.has-nested-images {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 16px;
}
.wp-block-details.dd-folder .wp-block-gallery.has-nested-images figure.wp-block-image {
	width: auto !important;
	margin: 0 !important;
}
.wp-block-details.dd-folder .wp-block-gallery.has-nested-images figure.wp-block-image img {
	aspect-ratio: 4 / 3;
	width: 100%;
	height: auto;
	object-fit: cover;
}

/* ---------- Download Monitor buttons ---------- */
.download-count, .dlm-download-count { display: none !important; }
a.download-link, .dlm-buttons-button, a.dlm-download-button {
	display: inline-flex; align-items: center; gap: 10px;
	min-height: 44px; padding: 10px 18px;
	background: var(--wp--preset--color--navy) !important; color: #FFFFFF !important;
	border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 15px;
}
a.download-link:hover, .dlm-buttons-button:hover, a.dlm-download-button:hover { background: var(--wp--preset--color--blue) !important; }
.wp-block-details.dd-folder .download-link, .wp-block-details.dd-folder .dlm-buttons-button { margin: 0 8px 8px 0; }

/* View (open in browser) next to download buttons */
a.dd-view-link {
	display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px;
	background: #FFFFFF; color: var(--wp--preset--color--navy);
	border: 1px solid #B8C4CB; border-radius: 8px;
	text-decoration: none; font-weight: 600; font-size: 15px; margin: 0 8px 8px 0;
}
a.dd-view-link:hover { border-color: var(--wp--preset--color--navy); background: var(--wp--preset--color--background); }

/* ---------- Overview: dealer group photo ---------- */
.dd-overview-photo { margin: 0; }
.dd-overview-photo img { display: block; width: 100%; height: auto; border-radius: 12px; }
.dd-overview-photo figcaption { margin-top: 10px; font-size: 14px; color: var(--wp--preset--color--muted); }

/* ---------- Upcoming events ---------- */
.dd-events { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.dd-event {
	display: flex; gap: 16px; align-items: flex-start;
	background: #FFFFFF; border: 1px solid var(--wp--preset--color--line); border-radius: 12px; padding: 20px;
}
.dd-event-date {
	flex: none; width: 64px; padding: 8px 0; text-align: center;
	background: var(--wp--preset--color--navy); color: #FFFFFF; border-radius: 10px;
	border-bottom: 3px solid var(--wp--preset--color--gold);
}
.dd-event-day { display: block; font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 26px; line-height: 1.1; }
.dd-event-month { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: #C9D6DD; }
.dd-event-body { min-width: 0; }
.dd-event-title { margin: 0 0 4px; font-size: 18px; line-height: 1.3; }
.dd-event-title a { color: inherit; text-decoration: none; }
.dd-event-title a:hover { text-decoration: underline; }
.dd-event-meta { margin: 0; font-size: 14px; color: var(--wp--preset--color--gold-dark); font-weight: 600; }
.dd-event-excerpt { margin: 8px 0 0; font-size: 15px; color: var(--wp--preset--color--muted); }
.dd-event-meta-single { font-size: 16px; }

/* ---------- Overview hero row: photo + production status ---------- */
.dd-hero-row { align-items: stretch; }
.dd-hero-row > .wp-block-column { display: flex; flex-direction: column; justify-content: center; }
.dd-production-status {
	height: 100%;
	box-sizing: border-box;
	background: var(--wp--preset--color--navy);
	color: #FFFFFF;
	border-radius: 12px;
	padding: 24px 28px;
	display: flex; flex-direction: column; gap: 14px;
}
.dd-ps-head h2 { margin: 0; color: #FFFFFF; font-size: 22px; }
.dd-ps-head h2::after { content: ""; display: block; width: 48px; height: 3px; margin-top: 10px; background: var(--wp--preset--color--gold); }
.dd-ps-sub { margin: 10px 0 0; font-size: 14px; color: #C9D6DD; text-transform: uppercase; letter-spacing: 1px; }
.dd-ps-table { width: 100%; border-collapse: collapse; }
.dd-ps-table th, .dd-ps-table td { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.15); text-align: left; vertical-align: top; }
.dd-ps-table tr:last-child th, .dd-ps-table tr:last-child td { border-bottom: 0; }
.dd-ps-table th { font-weight: 600; font-size: 15px; white-space: nowrap; padding-right: 16px; }
.dd-ps-table td { text-align: right; }
.dd-ps-delivery { display: block; font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 17px; color: #FFFFFF; }
.dd-ps-note { display: block; font-size: 13px; color: #D8CCB4; margin-top: 2px; }
.dd-ps-intro { margin: 0; font-size: 14px; color: #C9D6DD; }
.dd-ps-updated { margin: auto 0 0; font-size: 13px; color: #A9BDC8; }

/* ---------- Overview banner + two boxes ---------- */
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dd-overview-banner img {
	aspect-ratio: 12 / 5;
	height: auto;
	object-fit: cover;
	object-position: 50% var(--dd-focus, 50%);
}
@media (max-width: 600px) { .dd-overview-banner img { aspect-ratio: 16 / 9; } }

.dd-events-box {
	height: 100%; box-sizing: border-box;
	background: #FFFFFF; border: 1px solid var(--wp--preset--color--line); border-radius: 12px;
}
.dd-box-title { margin: 0; font-size: 22px; }
.dd-box-title::after { content: ""; display: block; width: 48px; height: 3px; margin-top: 10px; background: var(--wp--preset--color--gold); }
.dd-events--list { grid-template-columns: 1fr; gap: 0; }
.dd-events--list .dd-event { border: 0; border-bottom: 1px solid var(--wp--preset--color--line); border-radius: 0; padding: 14px 0; }
.dd-events--list .dd-event:last-child { border-bottom: 0; }
.dd-events--list .dd-event-excerpt { display: none; }

/* ---------- Welcome back bar ---------- */
.dd-welcome {
	display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
	background: var(--wp--preset--color--sand);
	border: 1px solid #D8CCB4; border-radius: 12px;
	padding: 16px 22px;
}
.dd-welcome-title { margin: 0; font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 20px; color: var(--wp--preset--color--navy); }
.dd-welcome-text { margin: 0; font-size: 15px; color: var(--wp--preset--color--gold-dark); }
.dd-welcome-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.dd-welcome-list li { margin: 0; }
.dd-welcome-list a {
	display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
	background: #FFFFFF; border: 1px solid #D8CCB4; border-radius: 999px;
	color: var(--wp--preset--color--navy); font-weight: 600; font-size: 14px; text-decoration: none;
}
.dd-welcome-list a:hover { border-color: var(--wp--preset--color--navy); }

/* 1.9.1: align welcome bar with banner, remove gap above it */
.dd-welcome, .dd-production-status, .dd-events-box { box-sizing: border-box; }
.screen-reader-text + * { margin-block-start: 0 !important; }

/* ---------- Gallery captions: text at the bottom of each image ---------- */
.wp-block-gallery.has-nested-images figure.wp-block-image { position: relative; overflow: hidden; border-radius: 10px; }
.wp-block-gallery.has-nested-images figure.wp-block-image figcaption,
.wp-block-gallery.has-nested-images figure.wp-block-image .wp-element-caption {
	position: absolute !important; left: 0; right: 0; bottom: 0;
	margin: 0 !important; padding: 28px 12px 10px !important;
	max-height: 60%; overflow: hidden;
	background: linear-gradient(to top, rgba(0,26,61,0.88) 0%, rgba(0,26,61,0.55) 60%, rgba(0,26,61,0) 100%) !important;
	color: #FFFFFF !important; text-align: left !important;
	font-size: 14px !important; font-weight: 600; line-height: 1.35;
	text-shadow: 0 1px 2px rgba(0,0,0,0.35);
	border-radius: 0 0 10px 10px;
	pointer-events: none;
}
.wp-block-gallery.has-nested-images figure.wp-block-image figcaption a,
.wp-block-gallery.has-nested-images figure.wp-block-image .wp-element-caption a { color: #FFFFFF; pointer-events: auto; }
/* Gallery-wide caption (under the whole gallery) stays normal text */
.wp-block-gallery > figcaption.blocks-gallery-caption { position: static !important; background: none !important; color: var(--wp--preset--color--muted) !important; text-shadow: none; padding: 8px 0 0 !important; font-weight: 400; }

/* Welcome bar: close button */
.dd-welcome { position: relative; padding-right: 64px; }
.dd-welcome-close {
	position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
	width: 44px; height: 44px; border: 0; border-radius: 999px;
	background: transparent; color: var(--wp--preset--color--gold-dark);
	font-size: 28px; line-height: 1; cursor: pointer;
}
.dd-welcome-close:hover { background: rgba(160,137,94,0.18); color: var(--wp--preset--color--navy); }

/* Folder opened from a "what's new" link */
.wp-block-details.dd-folder { scroll-margin-top: 24px; transition: box-shadow .3s ease; }
.wp-block-details.dd-folder-highlight { box-shadow: 0 0 0 3px var(--wp--preset--color--gold); }
