/*
Theme Name: DSG-tema
Theme URI: https://aandersen.eu
Author: Andreas Andersen
Author URI: https://aandersen.eu
Description: Bloktema til Dansk Selskab for Geriatri. Fælles redigerbar header, blå sekundær navigation, sidebar på alle sider og footer. Kompatibelt med Geriatri Site Plugin.
Version: 0.0.0.16
Requires at least: 6.6
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dsg-tema
Tags: full-site-editing, block-patterns, custom-logo, right-sidebar, accessibility-ready, wide-blocks
*/

:root {
  --dsg-navy: #00306c;
  --dsg-dark: #00224d;
  --dsg-link: #1a5aa0;
  --dsg-accent: #2f6db5;
  --dsg-text: #3c3c3c;
  --dsg-muted: #6c6c6c;
  --dsg-soft: #f3f6fa;
  --dsg-border: #dde4ec;
  --dsg-shadow: 0 2px 10px rgb(0 34 77 / 8%);
  --dsg-radius: 8px;
  --dsg-card-radius: 13px;
  --dsg-card-shadow: 0 4px 16px rgb(0 34 77 / 6%);
}
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;overflow-wrap:break-word}
.wp-site-blocks{min-height:100vh;display:flex;flex-direction:column}
.wp-site-blocks > * {width:100%;margin-block-start:0}
.wp-site-blocks > .dsg-main{flex:1 0 auto}
img{max-width:100%;height:auto}
:where(a){text-underline-offset:3px}
:where(a:hover,a:focus-visible){text-decoration:underline}
:where(h1,h2,h3,h4,h5,h6){line-height:1.25}
:where(.dsg-main,.dsg-top-header,.dsg-blue-bar,.dsg-site-footer) .alignwide{max-width:100%}

/* White DSG header: logo + existing top menu + contextual member button. */
.dsg-top-header{background:#fff;border-bottom:1px solid var(--dsg-border);box-shadow:var(--dsg-shadow);position:relative;z-index:4}
.dsg-top-header-inner{max-width:1200px;margin-inline:auto;padding:16px 20px;gap:clamp(12px,2vw,26px)}
.dsg-brand{min-width:0;gap:12px}
.dsg-brand .wp-block-site-logo{margin:0;flex-shrink:0}
.dsg-brand .wp-block-site-logo img{width:auto;max-width:min(300px,35vw);max-height:92px;object-fit:contain}
.dsg-brand-copy{min-width:0}
.dsg-brand-copy .wp-block-site-title{font-weight:750;font-size:clamp(1.2rem,2vw,1.75rem);line-height:1.18;margin:0}
.dsg-brand-copy .wp-block-site-tagline{font-size:.86rem;margin:2px 0 0;color:var(--dsg-muted)}
/* Logo in the old DSG design already contains the name: hide the text duplicate. */
.dsg-brand:has(.wp-block-site-logo img) .dsg-brand-copy{display:none}
.dsg-primary-navigation{font-weight:650;min-width:0}
.dsg-primary-navigation .wp-block-navigation-item__content{padding:9px 11px;border-radius:8px;text-decoration:none;color:var(--dsg-text)}
.dsg-primary-navigation .wp-block-navigation-item__content:hover,
.dsg-primary-navigation .wp-block-navigation-item__content:focus-visible,
.dsg-primary-navigation .current-menu-item > .wp-block-navigation-item__content{background:var(--dsg-soft);color:var(--dsg-navy)}
.dsg-primary-navigation .wp-block-navigation__submenu-container{border:1px solid var(--dsg-border);box-shadow:var(--dsg-shadow);border-radius:8px;min-width:190px;padding:5px}
.dsg-primary-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content{white-space:nowrap}
.dsg-member-link{display:inline-block;border-radius:8px;padding:10px 15px;background:var(--dsg-navy);color:#fff!important;font-weight:700;line-height:1.3;text-decoration:none;white-space:nowrap}
.dsg-member-link:hover,.dsg-member-link:focus-visible{background:var(--dsg-dark);text-decoration:none}
.dsg-member-link-editor{padding:10px 14px;border-radius:8px;background:var(--dsg-navy);color:#fff;font-weight:650}

/* Persistent blue secondary nav on every page; never collapses into a hamburger. */
.dsg-blue-bar{background:var(--dsg-navy);color:white;border-bottom:3px solid var(--dsg-accent)}
.dsg-blue-bar-inner{max-width:1200px;margin-inline:auto;padding:0 20px;overflow-x:auto;scrollbar-width:thin;scrollbar-color:#85abd5 var(--dsg-navy)}
.dsg-secondary-navigation{min-width:max-content;font-size:.95rem;font-weight:650}
.dsg-secondary-navigation .wp-block-navigation__container{gap:0!important;flex-wrap:nowrap!important}
.dsg-secondary-navigation .wp-block-navigation-item{flex-shrink:0}
.dsg-secondary-navigation .wp-block-navigation-item__content{display:inline-block;color:white!important;padding:13px 16px;white-space:nowrap;text-decoration:none}
.dsg-secondary-navigation .wp-block-navigation-item__content:hover,
.dsg-secondary-navigation .wp-block-navigation-item__content:focus-visible,
.dsg-secondary-navigation .current-menu-item > .wp-block-navigation-item__content{background:rgba(255,255,255,.16);color:white!important}
.dsg-secondary-navigation .wp-block-navigation__submenu-container{background:var(--dsg-navy);border:1px solid #4474af;box-shadow:var(--dsg-shadow);z-index:10}
.dsg-secondary-navigation .wp-block-navigation__submenu-icon{fill:#fff;color:#fff}

/* Two-column layout is used by every public page template, including 404. */
.dsg-main{width:100%;max-width:1240px;margin-inline:auto;padding:42px 20px 58px}
.dsg-main-grid{display:flex;align-items:flex-start;gap:clamp(22px,3.1vw,42px)}
.dsg-main-grid > .dsg-content-column{flex:1 1 0!important;min-width:0}
.dsg-main-grid > .dsg-sidebar-column{flex:0 0 305px!important;min-width:0}
.dsg-content-column{overflow-wrap:anywhere}
.dsg-content-column .wp-block-post-content{max-width:100%;overflow-wrap:anywhere}
.dsg-content-column .wp-block-post-content > :where(*){max-width:100%}
.dsg-content-column .wp-block-post-content > .alignfull{width:100%;margin-inline:0}
.dsg-content-column .wp-block-post-content :where(input,textarea,select){max-width:100%}
.dsg-content-column .wp-block-post-featured-image img{border-radius:var(--dsg-radius)}
.dsg-page-title,.dsg-archive-title,.dsg-post-title{margin:0 0 24px;font-size:clamp(1.6rem,2.4vw,2.2rem);color:var(--dsg-dark)}
.dsg-page-title::after,.dsg-archive-title::after,.dsg-post-title::after{content:"";display:block;background:var(--dsg-accent);height:3px;width:155px;max-width:45%;margin-top:12px}
.dsg-post-meta{font-size:.9rem;color:var(--dsg-muted);margin-top:-8px;margin-bottom:18px}
.dsg-page-content{min-height:80px}
.dsg-content-column .wp-block-post-content > :first-child{margin-block-start:0}
.dsg-content-column .wp-block-query{margin-block-start:0}
.dsg-query-cards{margin:0;padding:0;list-style:none}
.dsg-query-cards > .wp-block-post{background:#fff;border:1px solid var(--dsg-border);border-radius:var(--dsg-card-radius);box-shadow:var(--dsg-card-shadow);padding:23px 26px;margin-block-end:20px}
.dsg-query-cards .wp-block-post-title{font-size:1.4rem;line-height:1.3;margin:0 0 8px}
.dsg-query-cards .wp-block-post-date{color:var(--dsg-muted);font-size:.87rem}
.dsg-query-cards .wp-block-post-excerpt{margin-top:14px}
.dsg-query-cards .wp-block-post-excerpt__more-link{font-weight:700}
.dsg-content-column .wp-block-query-pagination{margin-block-start:20px}
.dsg-content-column .wp-block-query-pagination a{text-decoration:none}
.dsg-content-column .wp-block-query-pagination a:hover{text-decoration:underline}
.dsg-content-column .wp-block-search__input,
.dsg-sidebar-surface .wp-block-search__input{min-width:0;padding:9px 12px;border:1px solid var(--dsg-border);border-radius:6px}
.dsg-content-column .wp-block-search__button,
.dsg-sidebar-surface .wp-block-search__button{border-radius:6px;background:var(--dsg-navy);color:#fff}
/* A complete article is presented as one white card on the light-blue canvas.
   Keep a fallback for users who have saved a customized Single template in Site Editor,
   because WordPress stores those changes in the database instead of reading single.html. */
.dsg-content-column > .dsg-single-card,
body.single .dsg-content-column:not(:has(> .dsg-single-card)){
  background:#fff;border:1px solid var(--dsg-border);border-radius:var(--dsg-card-radius);
  padding:clamp(22px,3vw,36px);box-shadow:var(--dsg-card-shadow);
  min-width:0;max-width:100%;overflow-wrap:anywhere;
}
.dsg-single-card > :first-child{margin-block-start:0}
.dsg-single-card > :last-child{margin-block-end:0}
.dsg-single-card .dsg-post-title{margin-block-start:0}
.dsg-comments{margin-block-start:36px}
.dsg-comments .wp-block-comment-template{padding-left:0}

/* Normal WordPress Pages share the white, rounded article surface with posts.
   The dedicated page.html template wraps the page heading, featured image and
   content together. A fallback covers Page templates saved in the Site Editor:
   those customisations live in the database and are not replaced on upgrade. */
.dsg-content-column > .dsg-page-card,
body.page:not(.home) .dsg-content-column:not(:has(> .dsg-page-card)):not(:has(.dsg-home-section)){
  background:#fff;border:1px solid var(--dsg-border);border-radius:var(--dsg-card-radius);
  padding:clamp(22px,3vw,36px);box-shadow:var(--dsg-card-shadow);
  min-width:0;max-width:100%;overflow-wrap:anywhere;
}
.dsg-page-card > :first-child{margin-block-start:0}
.dsg-page-card > :last-child{margin-block-end:0}
.dsg-page-card > .dsg-page-title{margin-block-start:0}

/* Only actual organisation landing pages (as identified from the plugin's
   linked homepage metadata) display their title on the light-blue canvas.
   All other Pages, including Skriv besked / Kontakt and pages linked from the
   organisation navigation, keep the complete white rounded page card. */
body.dsg-organisation-landing.page:not(.home) .dsg-content-column > .dsg-page-card,
body.dsg-organisation-landing.page:not(.home) .dsg-content-column:not(:has(> .dsg-page-card)){
  background:transparent;border:0;border-radius:0;box-shadow:none;padding:0;
}
body.dsg-organisation-landing.page:not(.home) .dsg-page-card > .dsg-page-title,
body.dsg-organisation-landing.page:not(.home) .dsg-content-column > .dsg-page-title{
  background:transparent;border:0;border-radius:0;box-shadow:none;padding:0;
  margin-block:0 24px;
}
/* A manually customised organisation homepage may use simple paragraphs instead
   of the supplied independent sections. Give that content its own white card. */
body.dsg-organisation-landing.page:not(.home) .dsg-page-card:not(:has(.dsg-home-section)) > .dsg-page-content,
body.dsg-organisation-landing.page:not(.home) .dsg-content-column:not(:has(> .dsg-page-card)):not(:has(.dsg-home-section)) > .dsg-page-content{
  background:#fff;border:1px solid var(--dsg-border);border-radius:var(--dsg-card-radius);
  box-shadow:var(--dsg-card-shadow);padding:clamp(22px,3vw,36px);
}
/* A plain, static site homepage also receives a card; a homepage made from
   DSG/organisation cards retains its separate section surfaces. */
body.home.page .dsg-content-column:not(:has(> .dsg-page-card)):not(:has(.dsg-home-section)):not(:has(.dsg-widget-card)){
  background:#fff;border:1px solid var(--dsg-border);border-radius:var(--dsg-card-radius);
  padding:clamp(22px,3vw,36px);box-shadow:var(--dsg-card-shadow);
  min-width:0;max-width:100%;overflow-wrap:anywhere;
}

/* Every sidebar widget is its own white card, including blocks added later
   in the global Sidebar template part. Handle both this theme's stack and
   saved/older Site Editor sidebar markup. Keep the column itself light-blue. */
.dsg-sidebar-column{min-width:0;background:transparent;display:flex;flex-direction:column;align-items:stretch;gap:18px}
.dsg-sidebar-column > .wp-block-template-part{display:flex;flex-direction:column;gap:18px;width:100%;max-width:100%}
.dsg-sidebar-column :is(.dsg-sidebar-stack,.dsg-sidebar-surface){
  display:flex;flex-direction:column;align-items:stretch;gap:18px;
  width:100%;max-width:100%;min-width:0;background:transparent;
  border:0;border-radius:0;box-shadow:none;padding:0;
}
/* White cards for direct children of the shared sidebar, including legacy
   .dsg-sidebar-surface content and loose blocks outside an existing stack. */
.dsg-sidebar-column :is(.dsg-sidebar-stack,.dsg-sidebar-surface) > :not(.wp-block-spacer):not(.wp-block-separator),
.dsg-sidebar-column > :not(.dsg-sidebar-stack):not(.dsg-sidebar-surface):not(.wp-block-template-part):not(.wp-block-spacer):not(.wp-block-separator),
.dsg-sidebar-column > .wp-block-template-part > :not(.dsg-sidebar-stack):not(.dsg-sidebar-surface):not(.wp-block-spacer):not(.wp-block-separator){
  background:#fff;border:1px solid var(--dsg-border);border-radius:var(--dsg-card-radius);
  padding:23px;box-shadow:var(--dsg-card-shadow);margin-block:0!important;
  width:100%;max-width:100%;min-width:0;overflow-wrap:anywhere;
}
.dsg-sidebar-column :is(.dsg-sidebar-stack,.dsg-sidebar-surface) > .wp-block-separator{margin-block:0!important}
.dsg-sidebar-column :is(.dsg-sidebar-stack,.dsg-sidebar-surface) > :not(.wp-block-spacer):not(.wp-block-separator) > :first-child{margin-block-start:0}
.dsg-sidebar-column :is(.dsg-sidebar-stack,.dsg-sidebar-surface) > :not(.wp-block-spacer):not(.wp-block-separator) > :last-child{margin-block-end:0}
.dsg-sidebar-column :is(.dsg-sidebar-stack,.dsg-sidebar-surface) :is(h2,h3,.dsg-sidebar-heading){
  font-size:1.12rem;color:var(--dsg-dark);line-height:1.3;margin-block-end:12px;
  padding-bottom:8px;border-bottom:2px solid var(--dsg-accent);
}
.dsg-sidebar-column :is(.dsg-sidebar-stack,.dsg-sidebar-surface) .wp-block-search{margin:0}
.dsg-sidebar-column :is(.dsg-sidebar-stack,.dsg-sidebar-surface) .wp-block-separator{border-color:var(--dsg-border);opacity:.85}
.dsg-sidebar-column :is(.dsg-sidebar-stack,.dsg-sidebar-surface) .gsp-user-panel{max-width:100%;min-width:0}
.dsg-sidebar-column :is(.dsg-sidebar-stack,.dsg-sidebar-surface) .gsp-login input{max-width:100%}

/* Gutenberg groups and Geriatri Syd Plugin widgets within page content get
   independent white cards; the page background between them remains light blue.
   Explicitly colored Gutenberg blocks preserve their editor-selected background. */
.dsg-content-column .wp-block-post-content > :is(
  .dsg-widget-card,.wp-block-group,.wp-block-search,.wp-block-calendar,
  .wp-block-table,.wp-block-media-text,.wp-block-cover,.wp-block-shortcode,
  .wp-block-latest-posts,.wp-block-archives,.wp-block-categories,.wp-block-rss,
  [class^="gsp-"],[class*=" gsp-"]
):not(.has-background),
.dsg-content-column .wp-block-post-content > .wp-block-columns > .wp-block-column > :is(
  .dsg-widget-card,.wp-block-group,.wp-block-search,.wp-block-calendar,
  .wp-block-table,.wp-block-shortcode,[class^="gsp-"],[class*=" gsp-"]
):not(.has-background){
  background:#fff;border:1px solid var(--dsg-border);border-radius:var(--dsg-card-radius);
  box-shadow:var(--dsg-card-shadow);padding:24px;min-width:0;max-width:100%;
  overflow-wrap:anywhere;
}
.dsg-content-column .wp-block-post-content > .dsg-widget-card:where(:not(.has-background)){
  background:#fff;
}
.dsg-content-column .wp-block-post-content > :is(.wp-block-group,.dsg-widget-card) > :first-child{margin-block-start:0}
.dsg-content-column .wp-block-post-content > :is(.wp-block-group,.dsg-widget-card) > :last-child{margin-block-end:0}


/* DSG front-page patterns: independent white cards on the same light-blue canvas.
   Sections may be inserted individually or all at once from DSG – Forside. */
.dsg-content-column .wp-block-post-content > .dsg-home-section{
  background:#fff;border:1px solid var(--dsg-border);border-radius:var(--dsg-card-radius);
  box-shadow:var(--dsg-card-shadow);padding:clamp(22px,3vw,34px);
  min-width:0;max-width:100%;margin-block:0 22px;
}
.dsg-home-section > :first-child{margin-block-start:0}
.dsg-home-section > :last-child{margin-block-end:0}
.dsg-home-section h2{font-size:clamp(1.4rem,2vw,1.8rem);color:var(--dsg-dark);margin:0 0 10px}
.dsg-home-section .dsg-home-eyebrow{font-size:.77rem;letter-spacing:.095em;text-transform:uppercase;
  color:var(--dsg-accent);font-weight:800;margin:0 0 8px}
.dsg-home-section .dsg-home-summary{font-size:1.08rem;line-height:1.65;color:var(--dsg-text);font-weight:550}
.dsg-home-section .dsg-home-rule{border:0;background:var(--dsg-accent);height:3px;
  width:125px;max-width:35%;margin:12px 0 20px;opacity:1}
.dsg-home-news :where(.wp-block-post-template){margin:0;padding:0;list-style:none}
.dsg-home-news .wp-block-post-template > li{margin:0;padding:17px 0;border-bottom:1px solid var(--dsg-border)}
.dsg-home-news .wp-block-post-template > li:first-child{padding-top:0}
.dsg-home-news .wp-block-post-template > li:last-child{padding-bottom:0;border-bottom:0}
.dsg-home-news .wp-block-post-date{font-size:.85rem;color:var(--dsg-muted);margin:0 0 4px}
.dsg-home-news .wp-block-post-title{font-size:1.18rem;margin:0 0 5px;line-height:1.35}
.dsg-home-news .wp-block-post-title a{color:var(--dsg-navy);text-decoration:none}
.dsg-home-news .wp-block-post-title a:hover{text-decoration:underline}
.dsg-home-news .wp-block-post-excerpt{margin:0;color:var(--dsg-text);font-size:.95rem}
.dsg-home-news .wp-block-post-excerpt__excerpt{margin:0}
.dsg-home-news .wp-block-post-excerpt__more-text{margin:4px 0 0}
.dsg-home-news .wp-block-post-excerpt__more-link{font-weight:700}

/* Compact DSG footer: one centered, white copyright line. */
.dsg-site-footer{
  background:var(--dsg-dark);color:#fff;margin-top:auto;
  padding:24px 16px 26px;text-align:center;
}
.dsg-site-footer .dsg-footer-copyright{
  margin:0!important;padding:0;color:#fff!important;text-align:center!important;
  font-size:.93rem;line-height:1.5;font-weight:500;
}

/* Accessibility & mobile/tablet. */
:focus-visible{outline:3px solid #65a7ed;outline-offset:3px}
@media(max-width:1100px){
  .dsg-top-header-inner{gap:14px}
  .dsg-primary-navigation .wp-block-navigation-item__content{padding:9px 7px}
  .dsg-brand .wp-block-site-logo img{max-width:min(230px,32vw)}
}
@media(max-width:930px){
  .dsg-main-grid{flex-direction:column}
  .dsg-main-grid > .dsg-content-column,.dsg-main-grid > .dsg-sidebar-column{flex:0 1 auto!important;width:100%}
  .dsg-main{padding-top:28px;padding-bottom:40px}
  .dsg-brand .wp-block-site-logo img{max-width:230px}
}
@media(max-width:650px){
  .dsg-top-header-inner{padding:12px 16px;gap:12px}
  .dsg-brand .wp-block-site-logo img{max-height:62px;max-width:min(190px,42vw)}
  .dsg-brand-copy .wp-block-site-title{font-size:1.18rem}
  .dsg-primary-navigation{margin-left:auto}
  .dsg-member-link{padding:8px 10px;font-size:.83rem}
  .dsg-blue-bar-inner{padding:0 8px}
  .dsg-secondary-navigation .wp-block-navigation-item__content{padding:11px 13px}
  .dsg-main{padding-inline:16px}
  .dsg-content-column > .dsg-single-card,
  body.single .dsg-content-column:not(:has(> .dsg-single-card)),
  .dsg-content-column > .dsg-page-card:not(:has(> .dsg-page-content > .dsg-home-section)),
  body.page:not(.home) .dsg-content-column:not(:has(> .dsg-page-card)):not(:has(.dsg-home-section)),
  body.home.page .dsg-content-column:not(:has(> .dsg-page-card)):not(:has(.dsg-home-section)):not(:has(.dsg-widget-card)) {padding:20px}
  /* The landing-page heading stays outside cards also on small screens. */
  body.dsg-organisation-landing.page:not(.home) .dsg-content-column > .dsg-page-card,
  body.dsg-organisation-landing.page:not(.home) .dsg-content-column:not(:has(> .dsg-page-card)){padding:0}
  body.dsg-organisation-landing.page:not(.home) .dsg-page-card:not(:has(.dsg-home-section)) > .dsg-page-content,
  body.dsg-organisation-landing.page:not(.home) .dsg-content-column:not(:has(> .dsg-page-card)):not(:has(.dsg-home-section)) > .dsg-page-content{padding:20px}
  .dsg-sidebar-column :is(.dsg-sidebar-stack,.dsg-sidebar-surface) > :not(.wp-block-spacer):not(.wp-block-separator),
  .dsg-sidebar-column > :not(.dsg-sidebar-stack):not(.dsg-sidebar-surface):not(.wp-block-template-part):not(.wp-block-spacer):not(.wp-block-separator),
  .dsg-sidebar-column > .wp-block-template-part > :not(.dsg-sidebar-stack):not(.dsg-sidebar-surface):not(.wp-block-spacer):not(.wp-block-separator){padding:18px}
  .dsg-content-column .wp-block-post-content > :is(.wp-block-group,.wp-block-search,.wp-block-calendar,.wp-block-table,.wp-block-media-text,.wp-block-cover,.wp-block-shortcode,.wp-block-latest-posts,.wp-block-archives,.wp-block-categories,.wp-block-rss,[class^="gsp-"],[class*=" gsp-"]):not(.has-background),
  .dsg-content-column .wp-block-post-content > .wp-block-columns > .wp-block-column > :is(.wp-block-group,.wp-block-search,.wp-block-calendar,.wp-block-table,.wp-block-shortcode,[class^="gsp-"],[class*=" gsp-"]):not(.has-background){padding:18px}
}

/* White top header: dynamic organisation links use the same styling as the
 * existing primary navigation. They remain visible on narrow screens. */
.dsg-organisation-navigation{min-width:0;max-width:100%;flex:1 1 260px}
.dsg-organisation-navigation .wp-block-navigation__container{display:flex;flex-wrap:wrap;gap:3px 7px;align-items:center;justify-content:flex-end}
.dsg-organisation-navigation .wp-block-navigation-item{margin:0;flex-shrink:0}
.dsg-organisation-navigation .wp-block-navigation-item__content{display:block;white-space:normal}
@media(max-width:700px){
  .dsg-organisation-navigation{order:3;flex-basis:100%;width:100%}
  .dsg-organisation-navigation .wp-block-navigation__container{justify-content:flex-start}
}


/* v0.0.0.11 – Blue organisation navigation: accessible dropdowns.
 * Never scroll/clip the parent of a submenu: overflow-x:auto also clips in Y.
 * Instead allow top-level links to wrap if there is insufficient room.
 * The actual opening/closing is performed by core/navigation (click/keyboard).
 */
.dsg-blue-bar{position:relative;z-index:40}
.dsg-blue-bar-inner{overflow:visible;scrollbar-width:auto}
.dsg-secondary-navigation{min-width:0;width:100%}
.dsg-secondary-navigation .wp-block-navigation__container{
  flex-wrap:wrap!important;align-items:center;gap:0!important;
}
.dsg-secondary-navigation .wp-block-navigation__container > .wp-block-navigation-item{
  position:relative;
}
.dsg-secondary-navigation .wp-block-navigation__submenu-container{
  min-width:220px;max-width:min(340px,calc(100vw - 24px));
  background:var(--dsg-navy);color:#fff;
  border:1px solid #4474af;border-radius:0 0 9px 9px;
  box-shadow:0 8px 22px rgba(0,21,50,.24);
  padding:5px 0;z-index:90;
}
.dsg-secondary-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content{
  display:block;white-space:normal;line-height:1.35;padding:11px 16px;
}
.dsg-secondary-navigation .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container{
  border-radius:9px;
}
.dsg-secondary-navigation .wp-block-navigation-submenu__toggle{
  color:#fff!important;cursor:pointer;
}
.dsg-secondary-navigation .wp-block-navigation__submenu-icon,
.dsg-secondary-navigation .wp-block-navigation__submenu-icon svg{
  color:#fff;fill:currentColor;stroke:currentColor;
}
/* Keep the flyout within the viewport for right-most top-level items. */
.dsg-secondary-navigation .wp-block-navigation__container > .wp-block-navigation-item:last-child > .wp-block-navigation__submenu-container{
  right:0;left:auto;
}
.dsg-secondary-navigation .wp-block-navigation-item:focus-within{z-index:91}
@media(max-width:650px){
  .dsg-secondary-navigation .wp-block-navigation__container{
    justify-content:flex-start;row-gap:0;
  }
  .dsg-secondary-navigation .wp-block-navigation__submenu-container{
    min-width:190px;max-width:min(300px,calc(100vw - 20px));
  }
}

/* v0.0.0.12 – Core Navigation can set a WHITE submenu background via its own
 * color preset, while this theme historically forced WHITE link text.
 * Make the opened flyout deliberately white with readable navy items in all
 * normal, active, hover and keyboard-focus states; leave toggling to WordPress.
 */
.dsg-blue-bar .dsg-secondary-navigation .wp-block-navigation__submenu-container,
.dsg-blue-bar .dsg-secondary-navigation .wp-block-navigation__submenu-container.has-background{
  background:#fff!important;background-color:#fff!important;
  color:#00306c!important;border:1px solid #dce5ef!important;
  box-shadow:0 9px 24px rgba(0,27,63,.22);
}
.dsg-blue-bar .dsg-secondary-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item,
.dsg-blue-bar .dsg-secondary-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__label,
.dsg-blue-bar .dsg-secondary-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content,
.dsg-blue-bar .dsg-secondary-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content:link,
.dsg-blue-bar .dsg-secondary-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content:visited{
  color:#00306c!important;
}
.dsg-blue-bar .dsg-secondary-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
.dsg-blue-bar .dsg-secondary-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content:focus-visible,
.dsg-blue-bar .dsg-secondary-navigation .wp-block-navigation__submenu-container .current-menu-item > .wp-block-navigation-item__content{
  background:#edf4fb!important;color:#00224d!important;
}
.dsg-blue-bar .dsg-secondary-navigation .wp-block-navigation__submenu-container .wp-block-navigation-submenu__toggle,
.dsg-blue-bar .dsg-secondary-navigation .wp-block-navigation__submenu-container .wp-block-navigation__submenu-icon,
.dsg-blue-bar .dsg-secondary-navigation .wp-block-navigation__submenu-container .wp-block-navigation__submenu-icon svg{
  color:#00306c!important;fill:currentColor;stroke:currentColor;
}
.dsg-blue-bar .dsg-secondary-navigation .wp-block-navigation__submenu-container a:focus-visible,
.dsg-blue-bar .dsg-secondary-navigation .wp-block-navigation__submenu-container button:focus-visible{
  outline:2px solid #2f6db5;outline-offset:-2px;
}


/* v0.0.0.13 – Extra breathing room between top-level links in the blue bar.
 * Keep the dropdown list itself compact and preserve the existing flyout styles.
 * In particular, a submenu arrow must not visually run into the next item.
 */
.dsg-blue-bar .dsg-secondary-navigation > .wp-block-navigation__container{
  column-gap:16px!important;
  row-gap:0!important;
}
.dsg-blue-bar .dsg-secondary-navigation > .wp-block-navigation__container > .wp-block-navigation-submenu > .wp-block-navigation__submenu-icon,
.dsg-blue-bar .dsg-secondary-navigation > .wp-block-navigation__container > .wp-block-navigation-submenu > .wp-block-navigation-submenu__toggle{
  margin-inline-end:4px;
}
@media(max-width:650px){
  .dsg-blue-bar .dsg-secondary-navigation > .wp-block-navigation__container{
    column-gap:10px!important;
  }
}
