/*
Theme Name: Aldavyn
Author: IT-Winkel
Description: A cinematic dark fantasy art gallery with a quiet, image-first layout.
Version: 0.5.46
Requires at least: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: aldavyn
*/

/* 1. Root variables */
:root { --aldavyn-content-width: 1360px; --aldavyn-page-gutter: 24px; --aldavyn-logo-width: 180px; --aldavyn-container-margin-top: 25px; --aldavyn-container-margin-bottom: 25px; --aldavyn-container-padding: 60px; --aldavyn-hero-overlay-light: .35; --aldavyn-hero-overlay-medium: .65; --aldavyn-hero-overlay-strong: .85; }

/* 2. Reset / base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 24px; scrollbar-gutter: stable; }
body { margin: 0; overflow-wrap: break-word; }
/* A fixed viewport layer keeps cover independent of the document's length. */
body.aldavyn-has-background { position: relative; isolation: isolate; min-height: 100svh; }
body.aldavyn-has-background::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background-image: var(--aldavyn-background-image); background-position: center; background-repeat: no-repeat; background-size: var(--aldavyn-background-size, cover); }
/* With a global image, the outer header/footer share the same viewport backdrop. */
body.aldavyn-has-background .site-header,
body.aldavyn-has-background .site-footer { background: transparent; }
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }

button, input[type="submit"] { cursor: pointer; }

[hidden] { display: none; }
.screen-reader-text, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 16px; left: 20px; z-index: 100; padding: 12px 20px; }

/* 3. Typography */
h1, h2, h3, h4, h5, h6 { margin: 0 0 .55em; text-wrap: balance; }

p { margin: 0 0 1.3em; }
p:last-child { margin-bottom: 0; }
.eyebrow, .aldavyn-eyebrow { margin-bottom: 18px; }
.text-content { max-width: 760px; }

/* 4. Containers: only these two layout widths */
.container, .aldavyn-inner { width: min(var(--aldavyn-content-width), calc(100% - (var(--aldavyn-page-gutter) * 2))); margin-inline: auto; }
.fullwidth { width: 100%; }

/* Full-width wrapper shared by builder output and legacy page content. */
.aldavyn-container { width: 100%; }

/* 5. Sections */
.section, .aldavyn-section { width: 100%; padding-block: clamp(60px, 8vw, 120px); }
.section-tight { padding-block: clamp(40px, 5vw, 70px); }
/* Flex stacking prevents margin collapse; each container keeps both configured margins. */
.aldavyn-builder-page { display: flex; flex-direction: column; }
.aldavyn-container.aldavyn-builder-container { margin-top: var(--aldavyn-container-margin-top, 25px); margin-bottom: var(--aldavyn-container-margin-bottom, 25px); }
.section-heading { margin-bottom: clamp(28px, 4vw, 48px); }
.section-heading h1, .section-heading h2 { margin-bottom: 0; }
.section-heading .text-content { margin-top: 24px; }

/* 6. Grid: mobile first */
.grid, .aldavyn-grid { display: grid; gap: clamp(20px, 3vw, 40px); }
.grid-2, .grid-3, .grid-4, .aldavyn-grid-2, .aldavyn-grid-3, .aldavyn-grid-4 { grid-template-columns: minmax(0, 1fr); }
.grid > *, .aldavyn-grid > * { min-width: 0; }

/* 7. Cards */
.card, .aldavyn-content-card, .aldavyn-image-card, .aldavyn-character-card { position: relative; overflow: hidden; }
.card-text, .aldavyn-content-card { padding: clamp(24px, 4vw, 48px); }

.card-media { position: relative; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.aspect-portrait { aspect-ratio: 4 / 5; }
.aspect-landscape { aspect-ratio: 16 / 9; }
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-tall { aspect-ratio: 9 / 16; }
.card-image-content, .aldavyn-image-card-content, .aldavyn-character-card-content { padding: 24px; }
.card-image-content .eyebrow, .aldavyn-image-card-content .aldavyn-eyebrow, .aldavyn-character-card-content .aldavyn-eyebrow { margin-bottom: 10px; }
.card-image-content h3, .aldavyn-image-card-content h3, .aldavyn-character-card-content h3 { margin-bottom: 12px; }

.card-image-content h3 a::after, .aldavyn-image-card-content h3 a::after, .aldavyn-character-card-content h3 a::after { content: ""; position: absolute; inset: 0; }

.card-hero { min-height: clamp(420px, 60vw, 700px); display: flex; align-items: end; }
.card-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.card-hero-content { position: relative; z-index: 1; padding: clamp(24px, 5vw, 64px); }

.card-cta, .aldavyn-content-card--cta { padding: clamp(28px, 5vw, 64px); }
.card-cta .button, .aldavyn-content-card--cta .aldavyn-button { margin-top: 28px; }

.aldavyn-eyebrow { display: block; }
.aldavyn-content-card > :not(.aldavyn-button) { max-width: 760px; }
.aldavyn-content-card--cta > p { margin-bottom: 0; }
.aldavyn-image-card-image { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }

.aldavyn-character-card-media { position: relative; overflow: hidden; aspect-ratio: 4 / 5; }
.aldavyn-character-card-media img { display: block; width: 100%; height: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

/* Compact notice: colors and visual typography belong to the active design pack. */
.aldavyn-alert { width: 100%; min-width: 0; padding: clamp(16px, 2vw, 24px); overflow-wrap: anywhere; }
.aldavyn-alert-label { margin: 0 0 .5rem; }
.aldavyn-alert-label:last-child, .aldavyn-alert-text { margin: 0; }

/* 8. One button style */
.button, .aldavyn-button, .wp-block-button__link, input[type="submit"] { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 24px; }

/* 9. Header */
.site-header { position: relative; z-index: 10; }

.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-block: 10px; }
.site-branding { min-width: 0; max-width: calc(100% - 110px); }
.site-branding a { display: inline-block; max-width: 100%; }
.site-branding img { width: var(--aldavyn-logo-width, 180px); max-width: 100%; height: auto; }
.header-game-navigation { flex: 1 1 100%; min-width: 0; max-width: 100%; }
.header-game-navigation nav { max-width: 100%; }
.header-game-navigation .av-app-links { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.header-game-navigation .av-app-links > a { overflow-wrap: anywhere; }
/* The header uses a wrapping mobile navigation instead of a second hamburger. */
.header-game-navigation .av-app-mobile-bar { display: none; }
@media (min-width: 768px) {
  .header-game-navigation { flex: 1 1 auto; }
  .header-game-navigation .av-app-links { justify-content: flex-start; }
}
@media (max-width: 767px) {
  .header-inner { position: relative; flex-wrap: nowrap; gap: 12px; }
  .header-inner .site-branding { flex: 0 1 auto; max-width: min(45%, var(--aldavyn-logo-width, 180px)); }
  .header-game-navigation { flex: 1 1 0; display: flex; align-items: center; justify-content: flex-end; }
  .header-game-navigation > * { min-width: 0; max-width: 100%; }
  /* Keep the plugin's existing disclosure and open-state logic; only position its panel. */
  .header-game-navigation .av-app-nav-embed .av-app-navigation[data-nav-ready] .av-app-links {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 1;
    margin-top: 0; padding: 12px; background: var(--aldavyn-bg);
    border: 1px solid var(--aldavyn-border);
  }
}

.menu { list-style: none; margin: 0; padding: 0; }
.main-navigation { width: 100%; min-width: 0; }
.main-navigation ul { display: flex; flex-direction: column; align-items: stretch; gap: .6rem; list-style: none; margin: 0; padding: 0; }
.main-navigation li { min-width: 0; }
.main-navigation .menu-item-has-children { position: relative; }
.main-navigation .sub-menu { flex-direction: column; align-items: stretch; flex-wrap: nowrap; justify-content: flex-start; gap: .35rem; margin-top: .35rem; margin-left: 1rem; padding: .4rem; }
.main-navigation .menu-item-has-children > a { gap: .65rem; }
.main-navigation .menu-item-has-children > a::after { content: ""; width: .45rem; height: .45rem; flex: 0 0 auto; }
.submenu-toggle { display: none; position: absolute; right: 0; top: 0; width: 44px; height: 44px; padding: 0; align-items: center; justify-content: center; cursor: pointer; }
.main-navigation a { display: inline-flex; align-items: center; justify-content: flex-start; width: 100%; min-height: 44px; padding: .65rem 1rem; }

.menu-toggle { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; }
.menu-toggle-icon { width: 18px; height: 12px; position: relative; }
.menu-toggle-icon::after { content: ""; position: absolute; top: 4px; left: 0; width: 18px; height: 1px; }
.menu-toggle[hidden] { display: none; }

/* 10. Hero and immersive imagery */
.home-hero, .aldavyn-hero { position: relative; isolation: isolate; display: flex; align-items: center; min-height: clamp(580px, 80svh, 960px); }
.hero-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.home-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; }
.home-hero > .hero-media { z-index: -2; }
.hero-content, .aldavyn-hero-content { padding-block: 80px; }

.hero-claim, .aldavyn-hero-content > p { max-width: 540px; margin-bottom: 32px; }
.world-scene { position: relative; }
.world-scene > img { width: 100%; height: clamp(400px, 54vw, 780px); object-fit: cover; }
.world-scene::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.world-scene figcaption { position: absolute; bottom: clamp(28px, 5vw, 64px); left: 0; right: 0; z-index: 1; }
.world-scene figcaption p { max-width: 760px; }

.entry-featured img { width: 100%; height: auto; max-height: 760px; object-fit: cover; }

/* Builder Hero and legacy markup share the original geometry, type and gradients. */

.aldavyn-hero > .hero-media { z-index: 0; }

.aldavyn-hero-overlay { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.aldavyn-hero-content { position: relative; z-index: 2; width: min(var(--aldavyn-content-width), calc(100% - (var(--aldavyn-page-gutter) * 2))); margin-inline: auto; }
.aldavyn-hero-text { width: 100%; max-width: 100%; }
.aldavyn-hero-content .aldavyn-hero-text > p { max-width: none; margin-bottom: 32px; }
.card-hero-content.aldavyn-builder-hero-content { width: 100%; max-width: none; }
@media (min-width: 768px) { .aldavyn-hero-text { max-width: var(--aldavyn-hero-text-width, 50%); } }
.hero-center .aldavyn-hero-content { text-align: center; }
.hero-center .aldavyn-hero-content > p { margin-inline: auto; }
.hero-right .aldavyn-hero-content { text-align: right; }
.hero-right .aldavyn-hero-content > p { margin-inline-start: auto; }

/* Structured page builder: fixed variants, using the same global components. */
.aldavyn-builder-section { position: relative; isolation: isolate; padding-block: var(--aldavyn-container-padding, 60px); }
/* The first application starts below the header without a second shell inset. */
.aldavyn-builder-page > .aldavyn-builder-container:first-child:has(.aldavyn-application[data-view]) { margin-top: 0; }
.aldavyn-builder-page > .aldavyn-builder-container:first-child > .aldavyn-builder-section:has(.aldavyn-application[data-view]) { padding-block-start: 0; }

.aldavyn-container-background { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.aldavyn-bg-image::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.aldavyn-container-overlay-light { --aldavyn-overlay-opacity: .25; }
.aldavyn-container-overlay-medium { --aldavyn-overlay-opacity: .5; }
.aldavyn-container-overlay-strong { --aldavyn-overlay-opacity: .75; }
/* A fullwidth Hero keeps its own original padding, without a second section gap. */
.aldavyn-container > .aldavyn-visual-section.aldavyn-builder-section { padding-block: 0; }
.aldavyn-align-left { text-align: left; }
.aldavyn-align-center { text-align: center; }
.aldavyn-align-right { text-align: right; }
.aldavyn-builder-blocks > * + * { margin-top: clamp(20px, 3vw, 40px); }
.aldavyn-builder-blocks > .section-heading + .aldavyn-grid { margin-top: 0; }
.aldavyn-richtext > :last-child { margin-bottom: 0; }
.aldavyn-builder-image img { width: 100%; height: auto; object-fit: cover; }
.aldavyn-format-auto img { width: auto; max-width: 100%; }
.aldavyn-builder-image.aldavyn-align-center img { margin-inline: auto; }
.aldavyn-builder-image.aldavyn-align-right img { margin-inline-start: auto; }
.aldavyn-format-portrait img { aspect-ratio: 4 / 5; }
.aldavyn-format-landscape img { aspect-ratio: 16 / 9; }
.aldavyn-format-square img { aspect-ratio: 1 / 1; }
.aldavyn-builder-image figcaption { margin-top: 12px; }
.aldavyn-builder-image figcaption p { margin-bottom: 0; }
.aldavyn-image-card-content .aldavyn-button, .aldavyn-character-card-content .aldavyn-button { position: relative; z-index: 1; margin-top: 16px; }
.aldavyn-spacer-small { height: 20px; }
.aldavyn-spacer-medium { height: 40px; }
.aldavyn-spacer-large { height: 80px; }
.aldavyn-builder-blocks > .aldavyn-spacer, .aldavyn-builder-blocks > .aldavyn-spacer + * { margin-top: 0; }
/* One strength per preset; regular and featured Hero use the same global controls. */

.aldavyn-hero-overlay-none .aldavyn-hero-overlay, .aldavyn-featured-overlay-none::after { display: none; }
/* Page builder block widths; no separate column model. */
.aldavyn-block-layout { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.aldavyn-block { min-width: 0; display: flow-root; overflow-wrap: anywhere; }
.aldavyn-block-layout > .aldavyn-block { grid-column: span 12; margin: 0; }
.aldavyn-block-layout > .aldavyn-block-quarter { grid-column: span 3; }
.aldavyn-block-layout > .aldavyn-block-third { grid-column: span 4; }
.aldavyn-block-layout > .aldavyn-block-half { grid-column: span 6; }
.aldavyn-block > .section-heading { margin-bottom: 0; }
.aldavyn-block > .aldavyn-character-card { height: 100%; }

@media (min-width: 768px) and (max-width: 899px) { .aldavyn-block-layout > .aldavyn-block-quarter, .aldavyn-block-layout > .aldavyn-block-third { grid-column: span 6; } }
@media (max-width: 767px) { .aldavyn-block-layout > .aldavyn-block-quarter, .aldavyn-block-layout > .aldavyn-block-third, .aldavyn-block-layout > .aldavyn-block-half { grid-column: span 12; } }

/* 11. Content / Gutenberg */
.entry-header { margin-bottom: 40px; }
.entry-content { display: flow-root; }
/* Legal modules share the application container edges, including legacy Global CSS. */
:is(.aldavyn-block-full, .entry-content) > .aldavyn-legal-page { width: 100%; max-width: none; }
/* Only editorial elements get a reading measure; modules keep their own layout limits. */
.entry-content { --aldavyn-reading-width: 760px; }
.entry-content > :where(p, h1, h2, h3, h4, h5, h6, ul, ol, blockquote, pre) { max-width: var(--aldavyn-reading-width); }
/* Application roots use the enclosing theme container; editorial text stays readable. */
.entry-content > :is(
  .aldavyn-account,
  .aldavyn-auth,
  .aldavyn-admin,
  .aldavyn-quiz,
  .aldavyn-discovery,
  .aldavyn-explore,
  .aldavyn-flight,
  .aldavyn-user-portal,
  .aldavyn-portal,
  .aldavyn-battle
) { width: 100%; max-width: none; }
.entry-content > .alignwide, .entry-content > .alignfull { max-width: 100%; width: 100%; }
.entry-content > .wp-block-image, .entry-content > .wp-block-gallery, .entry-content > .wp-block-cover { max-width: 100%; }
.entry-content > * + * { margin-top: 24px; }
.entry-content h2, .entry-content h3 { margin-top: 1.5em; }

.entry-content li + li { margin-top: .5em; }

.entry-content figure { margin-bottom: 32px; }

.entry-content figcaption { margin-top: 12px; }
blockquote, .wp-block-quote { margin-inline: 0; padding: 8px 0 8px 24px; }

hr, .wp-block-separator { margin-block: 40px; }
pre { overflow-x: auto; padding: 24px; }

table { width: 100%; }
td, th { padding: 14px; text-align: left; }
.wp-block-table { overflow-x: auto; }

.wp-block-cover { overflow: hidden; }

.alignleft { float: left; margin-right: 24px; margin-bottom: 24px; }
.alignright { float: right; margin-left: 24px; margin-bottom: 24px; }
.aligncenter { margin-inline: auto; }
.wp-caption { max-width: 100%; }

.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.gallery-item { min-width: 0; }
.gallery-icon img { margin-inline: auto; }

.bypostauthor > .comment-body { padding-left: 20px; }
.home-page-content { margin-top: 40px; }
.entry-taxonomy { margin-top: 48px; }
.navigation { margin-top: 48px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.post-navigation .nav-links > * { flex: 1 1 240px; }
.post-navigation span { display: block; }
.page-numbers { padding: 8px 14px; }

input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]), textarea, select { width: 100%; min-height: 48px; padding: 12px 14px; }

label { display: block; }
textarea { min-height: 160px; }
.search-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; max-width: 760px; margin-top: 28px; }
.search-form label { flex: 1 1 230px; }
.search-form label span { display: block; margin-bottom: 8px; }
.comments-area { margin-top: 64px; padding-top: 40px; }
.comment-list { padding-left: 24px; }
.comment-list .children { padding-left: 20px; }
.comment-body { margin-bottom: 32px; }
.comment-author .avatar { display: inline-block; vertical-align: middle; margin-right: 10px; }
.comment-metadata { margin-block: 8px; }
.comment-form-cookies-consent { display: flex; align-items: start; gap: 12px; }
.comment-form-cookies-consent input { margin-top: 8px; }

/* 12. Footer */
.site-footer { padding-block: 32px 24px; }
.footer-inner { display: block; }
.footer-inner > * { min-width: 0; }
.footer-content { overflow-wrap: anywhere; }
.footer-content > :first-child { margin-top: 0; }
.footer-content > :last-child { margin-bottom: 0; }
.footer-content img { max-width: 100%; height: auto; }

@media (min-width: 768px) { .grid-2, .grid-3, .grid-4, .aldavyn-grid-2, .aldavyn-grid-3, .aldavyn-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main-navigation { display: block; width: auto; flex: 1 1 auto; }
  .main-navigation > ul { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .6rem; }
  .main-navigation > ul > li > a { width: auto; justify-content: center; }
  .main-navigation .sub-menu { display: none; position: absolute; top: 100%; left: 0; z-index: 20; width: max-content; min-width: 220px; max-width: min(320px, calc(100vw - 48px)); margin: 0; padding: .5rem; }
  .main-navigation .sub-menu .sub-menu { top: 0; left: 100%; }
  .main-navigation > ul > li:last-child > .sub-menu { left: auto; right: 0; }
  .main-navigation .menu-item-has-children:hover > .sub-menu,
  .main-navigation .menu-item-has-children:focus-within > .sub-menu { display: flex; }
  .main-navigation .sub-menu a { width: 100%; justify-content: flex-start; overflow-wrap: anywhere; }
  .site-branding { flex: 0 1 auto; }
  .menu-toggle { display: none; }
  .header-inner { flex-wrap: nowrap; } }
@media (min-width: 900px) { .grid-3, .aldavyn-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4, .aldavyn-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Frontend only: override WordPress's important admin-bar offset on mobile.
   wp-admin uses .wp-toolbar on html and .wp-admin on body. */
@media (max-width: 767px) {
  body:not(.wp-admin) #wpadminbar { display: none; }
  html:not(.wp-toolbar) { margin-top: 0 !important; }
}

@media (max-width: 767px) { .card-hero .hero-media { object-position: 60% center; }
  .card-hero { min-height: 0; display: block; }
  .card-hero .hero-media { position: relative; height: auto; aspect-ratio: 16 / 10; }
  .card-hero::after { display: none; }
  
  .alignleft, .alignright { float: none; margin-inline: 0; } }

/* Single Dashboard destination replaces the former top navigation. */
.header-game-navigation .av-header-dashboard{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:7px 14px;border:1px solid var(--ald-color-gold,#b99a60);border-radius:5px;background:#182127;color:#eadcc5;text-decoration:none;font-weight:600;line-height:1.3}
.header-game-navigation .av-header-dashboard:hover{background:#2d302a;color:#fff0ce}
.header-game-navigation .av-header-dashboard:focus-visible{outline:2px solid #e0bd76;outline-offset:3px}
