/*
 * GG Daengku 1.5.1 — Dynamic Editorial Palette
 * The GGtheme header already exposes --gtheme-dark, --gtheme-mid,
 * --gtheme-soft and --gtheme-accent from the journal's Base Colour option.
 * Reuse those same values for all Daengku homepage accent surfaces.
 * Keep the four differently coloured editorial navigation tiles deliberately
 * unchanged, as requested for the Daengku reference composition.
 * Scope: public homepage only. No OJS editorial/login/workflow overrides.
 */
body.gtheme-body .gd-home.gd-reference-home {
    --gd-brand-dark: var(--gtheme-dark, #0f172a);
    --gd-brand-mid: var(--gtheme-mid, #1e3a8a);
    --gd-brand-soft: var(--gtheme-soft, #f0f6ff);
    --gd-brand-accent: var(--gtheme-accent, #93c5fd);
    --gd-brand-border: color-mix(in srgb, var(--gd-brand-mid) 18%, #ffffff);
    --gd-brand-wash: color-mix(in srgb, var(--gd-brand-soft) 75%, #ffffff);
    --gd-brand-wash-strong: color-mix(in srgb, var(--gd-brand-accent) 22%, #ffffff);
    --gd-brand-muted: color-mix(in srgb, var(--gd-brand-dark) 72%, #ffffff);
    /* Override the old fixed-colour Daengku tokens, only on the homepage. */
    --gd-ref-green: var(--gd-brand-dark);
    --gd-ref-leaf: var(--gd-brand-mid);
    --gd-ref-link: var(--gd-brand-mid);
    --gd-ref-border: var(--gd-brand-border);
    --gd-blue: var(--gd-brand-mid);
    --gd-blue-dark: var(--gd-brand-dark);
    --gd-teal: var(--gd-brand-mid);
    --gd-light: var(--gd-brand-soft);
}

/* Common accent marks and in-page links. */
body.gtheme-body .gd-reference-home .gd-ref-oa > span,
body.gtheme-body .gd-reference-home .gd-ref-profile-header h2,
body.gtheme-body .gd-reference-home .gd-ref-description :is(strong, b),
body.gtheme-body .gd-reference-home .gd-ref-subjects > span {
    color: var(--gd-brand-dark) !important;
}
body.gtheme-body .gd-reference-home .gd-ref-profile-header p,
body.gtheme-body .gd-reference-home .gd-ref-subjects,
body.gtheme-body .gd-reference-home .gd-featured .gd-kicker,
body.gtheme-body .gd-reference-home .gd-ref-section-tags a {
    color: var(--gd-brand-mid) !important;
}
body.gtheme-body .gd-reference-home .gd-ref-utility-links a,
body.gtheme-body .gd-reference-home .gd-feature-read,
body.gtheme-body .gd-reference-home .gd-section-header > a,
body.gtheme-body .gd-reference-home .gd-ref-text-link,
body.gtheme-body .gd-reference-home .gd-ref-current-header > a,
body.gtheme-body .gd-reference-home .gd-ref-current-card h3 a,
body.gtheme-body .gd-reference-home .gd-ref-current-read,
body.gtheme-body .gd-reference-home .gd-ref-more-label {
    color: var(--gd-brand-mid) !important;
}
body.gtheme-body .gd-reference-home .gd-ref-utility-links a:hover,
body.gtheme-body .gd-reference-home .gd-ref-text-link:hover,
body.gtheme-body .gd-reference-home .gd-ref-current-card h3 a:hover,
body.gtheme-body .gd-reference-home .gd-ref-more-label:hover {
    color: var(--gd-brand-dark) !important;
}
body.gtheme-body .gd-reference-home .gd-ref-section-tags a {
    background: var(--gd-brand-soft);
    border-color: var(--gd-brand-border);
}

/* Cover placeholder and submission/template buttons. */
body.gtheme-body .gd-reference-home .gd-ref-cover-fallback {
    background: linear-gradient(155deg, var(--gd-brand-dark), var(--gd-brand-mid) 75%, var(--gd-brand-dark));
}
body.gtheme-body .gd-reference-home .gd-ref-cover-fallback > span,
body.gtheme-body .gd-reference-home .gd-ref-cover-fallback > small {
    color: var(--gd-brand-accent);
}
body.gtheme-body .gd-reference-home .gd-ref-journal-cover {
    border-color: var(--gd-brand-border);
}
body.gtheme-body .gd-reference-home .gd-ref-btn {
    border-color: var(--gd-brand-dark);
    color: var(--gd-brand-dark) !important;
}
body.gtheme-body .gd-reference-home .gd-ref-btn:hover {
    background: var(--gd-brand-soft);
}
body.gtheme-body .gd-reference-home .gd-ref-btn-primary {
    background: var(--gd-brand-dark);
    border-color: var(--gd-brand-dark);
    color: #ffffff !important;
}
body.gtheme-body .gd-reference-home .gd-ref-btn-primary:hover {
    background: var(--gd-brand-mid);
    border-color: var(--gd-brand-mid);
    color: #ffffff !important;
}

/* Publication facts — one strong accent card and softer companion cards. */
body.gtheme-body .gd-reference-home .gd-ref-identity-tile {
    background: var(--gd-brand-wash);
    border-color: var(--gd-brand-border);
}
body.gtheme-body .gd-reference-home .gd-ref-identity-tile:nth-child(even) {
    background: var(--gd-brand-wash-strong);
}
body.gtheme-body .gd-reference-home .gd-ref-identity-tile.gd-ref-indexed {
    background: linear-gradient(125deg, var(--gd-brand-dark), var(--gd-brand-mid));
    border-color: var(--gd-brand-mid);
}
body.gtheme-body .gd-reference-home .gd-ref-identity-tile:not(.gd-ref-indexed) > strong {
    color: var(--gd-brand-dark);
}
body.gtheme-body .gd-reference-home .gd-ref-identity-tile:not(.gd-ref-indexed) > span,
body.gtheme-body .gd-reference-home .gd-ref-identity-tile:not(.gd-ref-indexed) > small {
    color: var(--gd-brand-muted);
}
body.gtheme-body .gd-reference-home .gd-ref-indexed > strong {
    color: #ffffff !important;
}
body.gtheme-body .gd-reference-home .gd-ref-indexed > span,
body.gtheme-body .gd-reference-home .gd-ref-indexed > small {
    color: var(--gd-brand-accent);
}

/* Aims & Scope and Journal Info side-by-side: subtle themed borders and rails. */
body.gtheme-body .gd-reference-home .gd-ref-profile-panel,
body.gtheme-body .gd-reference-home .gd-ref-aims,
body.gtheme-body .gd-reference-home .gd-ref-info-side {
    border-color: var(--gd-brand-border);
}
body.gtheme-body .gd-reference-home .gd-ref-info-item {
    background: var(--gd-brand-wash);
    border-left-color: var(--gd-brand-mid);
}
body.gtheme-body .gd-reference-home .gd-ref-info-item > strong {
    color: var(--gd-brand-dark);
}

/* Journal Metrics strip and numeric indicators. */
body.gtheme-body .gd-reference-home .gd-ref-metrics {
    border-color: var(--gd-brand-border);
}
body.gtheme-body .gd-reference-home .gd-ref-metrics h2 {
    background: linear-gradient(102deg, var(--gd-brand-dark), var(--gd-brand-mid));
    color: #ffffff !important;
}
body.gtheme-body .gd-reference-home .gd-ref-metric-cards > div {
    background: var(--gd-brand-wash);
}
body.gtheme-body .gd-reference-home .gd-ref-metric-cards strong {
    color: var(--gd-brand-dark);
}

/* Article listings and small publication badges. */
body.gtheme-body .gd-reference-home .gd-ref-current-card-meta b {
    color: var(--gd-brand-mid);
}
body.gtheme-body .gd-reference-home .gd-ref-document-icon {
    background: var(--gd-brand-soft);
    color: var(--gd-brand-mid);
}

/* Featured Editorial Spotlight retains its borderless 1+3 layout. */
body.gtheme-body .gd-reference-home .gd-feature-card--lead,
body.gtheme-body .gd-reference-home .gd-feature-card--lead:hover {
    background: linear-gradient(145deg, var(--gd-brand-soft), #ffffff 86%) !important;
    border-top-color: var(--gd-brand-mid) !important;
}
body.gtheme-body .gd-reference-home .gd-feature-card--lead .gd-feature-number,
body.gtheme-body .gd-reference-home .gd-feature-eyebrow {
    color: var(--gd-brand-mid) !important;
}
body.gtheme-body .gd-reference-home .gd-feature-card h3 a:hover,
body.gtheme-body .gd-reference-home .gd-feature-card h3 a:focus-visible {
    color: var(--gd-brand-mid) !important;
}
body.gtheme-body .gd-reference-home .gd-feature-card:focus-within {
    outline-color: var(--gd-brand-mid);
}

/* Dark mode: palette-tinted accents with dark, readable surfaces. */
html.dark body.gtheme-body .gd-home.gd-reference-home {
    --gd-dark-wash: color-mix(in srgb, var(--gd-brand-mid) 16%, #19232f);
    --gd-dark-wash-alt: color-mix(in srgb, var(--gd-brand-dark) 24%, #263241);
    --gd-dark-border: color-mix(in srgb, var(--gd-brand-mid) 38%, #364455);
}
html.dark body.gtheme-body .gd-reference-home .gd-ref-profile-panel,
html.dark body.gtheme-body .gd-reference-home .gd-ref-aims,
html.dark body.gtheme-body .gd-reference-home .gd-ref-info-side,
html.dark body.gtheme-body .gd-reference-home .gd-ref-metrics,
html.dark body.gtheme-body .gd-reference-home .gd-ref-more,
html.dark body.gtheme-body .gd-reference-home .gd-ref-current-card {
    background: #1e293b !important;
    border-color: var(--gd-dark-border) !important;
}
html.dark body.gtheme-body .gd-reference-home .gd-ref-identity-tile:not(.gd-ref-indexed),
html.dark body.gtheme-body .gd-reference-home .gd-ref-info-item,
html.dark body.gtheme-body .gd-reference-home .gd-ref-metric-cards > div {
    background: var(--gd-dark-wash) !important;
    border-color: var(--gd-dark-border) !important;
}
html.dark body.gtheme-body .gd-reference-home .gd-ref-identity-tile:nth-child(even):not(.gd-ref-indexed) {
    background: var(--gd-dark-wash-alt) !important;
}
html.dark body.gtheme-body .gd-reference-home .gd-ref-identity-tile.gd-ref-indexed {
    background: linear-gradient(125deg, var(--gd-brand-dark), var(--gd-brand-mid)) !important;
    border-color: var(--gd-brand-mid) !important;
}
html.dark body.gtheme-body .gd-reference-home .gd-ref-indexed > strong { color: #ffffff !important; }
html.dark body.gtheme-body .gd-reference-home .gd-ref-indexed > :is(span,small) { color: var(--gd-brand-accent) !important; }
html.dark body.gtheme-body .gd-reference-home .gd-ref-info-item strong,
html.dark body.gtheme-body .gd-reference-home .gd-ref-identity-tile:not(.gd-ref-indexed) strong,
html.dark body.gtheme-body .gd-reference-home .gd-ref-metric-cards strong { color: #f5f8fc !important; }
html.dark body.gtheme-body .gd-reference-home .gd-ref-profile-header p,
html.dark body.gtheme-body .gd-reference-home .gd-ref-subjects,
html.dark body.gtheme-body .gd-reference-home .gd-ref-subjects > span,
html.dark body.gtheme-body .gd-reference-home .gd-feature-eyebrow,
html.dark body.gtheme-body .gd-reference-home .gd-feature-card--lead .gd-feature-number,
html.dark body.gtheme-body .gd-reference-home .gd-featured .gd-kicker,
html.dark body.gtheme-body .gd-reference-home .gd-ref-utility-links a,
html.dark body.gtheme-body .gd-reference-home .gd-ref-text-link,
html.dark body.gtheme-body .gd-reference-home .gd-ref-current-header > a,
html.dark body.gtheme-body .gd-reference-home .gd-ref-current-card h3 a,
html.dark body.gtheme-body .gd-reference-home .gd-ref-current-read,
html.dark body.gtheme-body .gd-reference-home .gd-ref-more-label {
    color: var(--gd-brand-accent) !important;
}
html.dark body.gtheme-body .gd-reference-home .gd-feature-card--lead,
html.dark body.gtheme-body .gd-reference-home .gd-feature-card--lead:hover {
    background: linear-gradient(145deg, var(--gd-dark-wash-alt), #1e293b 95%) !important;
    border-top-color: var(--gd-brand-accent) !important;
}
html.dark body.gtheme-body .gd-reference-home .gd-ref-btn:not(.gd-ref-btn-primary) {
    background: #1e293b;
    color: var(--gd-brand-accent) !important;
    border-color: var(--gd-brand-accent);
}
html.dark body.gtheme-body .gd-reference-home .gd-ref-btn-primary {
    background: var(--gd-brand-mid);
    color: #ffffff !important;
    border-color: var(--gd-brand-mid);
}
html.dark body.gtheme-body .gd-reference-home .gd-ref-section-tags a {
    background: var(--gd-dark-wash);
    color: var(--gd-brand-accent) !important;
    border-color: var(--gd-dark-border);
}
html.dark body.gtheme-body .gd-reference-home .gd-ref-document-icon {
    background: var(--gd-dark-wash);
    color: var(--gd-brand-accent);
}
html.dark body.gtheme-body .gd-reference-home .gd-ref-metrics h2 {
    background: linear-gradient(102deg, var(--gd-brand-dark), var(--gd-brand-mid));
}
