/* Elementor adapter for the Derma Klinika design.
   Header/footer/popups are styled in Elementor itself (widget settings + per-element
   Custom CSS). This file only resolves global conflicts between the design CSS and
   Elementor's markup. Keep it short. */

/* Design sets p { margin: 0 0 1em }; Elementor heading titles rendered as <p> must not inherit it. */
p.elementor-heading-title { margin: 0; }

/* Design sets img { display:block }; Elementor's icon-list/icon SVGs stay inline-sized. */
.elementor-icon svg { display: block; }

/* ---- Generic subpage conversion (scripts/build-pages.php) ----
   Converted containers carry the design classes and must behave like the source's
   block elements: the design CSS sets display/width/spacing where it wants them. */
.e-con.dk-l2 {
  --display: block !important;
  --width: auto;
  --padding-top: 0; --padding-bottom: 0; --padding-left: 0; --padding-right: 0;
  --gap: 0; --row-gap: 0; --column-gap: 0;
  padding-inline: 0; min-height: 0;
  /* Elementor sizes flex children with these vars (100% by default): let the design's
     flex/grid rules size widgets and child containers like the source elements. */
  --container-widget-width: auto; --container-widget-flex-grow: 0; --container-widget-align-self: auto;
  /* Elementor's flex defaults (column etc.) must not leak into design flex rules that rely on CSS defaults */
  --flex-direction: row !important; --flex-wrap: nowrap !important; --justify-content: normal !important;
  --align-items: normal !important; --align-content: normal !important;
}
.e-con.dk-l2 > .e-con { --width: auto; }
/* Widget wrappers are position:relative; absolutely positioned design images
   (hero media, card media) must resolve against the design element instead. */
.e-con.dk-l2 > .elementor-widget-image { position: static; }
.e-con.dk-l2 > .elementor-widget-image img { display: block; }
/* UGC caption (design .ugc figcaption) */
.dk-ugc { position: relative; overflow: hidden; border-radius: var(--r-card); background: var(--dark); }
.dk-ugc .elementor-widget-text-editor { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 1; pointer-events: none; }
.dk-ugc-cap { margin: 0; padding: 8px 12px; border-radius: 8px; background: rgba(0, 64, 79, 0.82); color: #fff; font-size: 0.875rem; font-weight: 600; display: flex; flex-direction: column; gap: 1px; }
.dk-ugc-cap span { font-weight: 400; font-size: 0.8125rem; opacity: .85; }
.dk-ugc .elementor-widget-video.e-playing ~ .elementor-widget-text-editor { display: none; }
/* A text widget holding ONE inline element (span.stars, a, small...) must not create a line box:
   in the design that element is a blockified flex/grid item (e.g. 16px stars, not 27px). */
.dk-l2 .elementor-widget-text-editor:has(> :is(span, a, strong, small, em, b, i, svg, time):only-child),
.dk-l2 .elementor-widget-text-editor:has(> .elementor-widget-container > :is(span, a, strong, small, em, b, i, svg, time):only-child) { display: flex; flex-direction: column; align-items: flex-start; }
/* Sibling rules between TEXT elements (each now alone in its widget wrapper):
   .crumbs li + li::before and .tech-copy > p + p (mobile) re-expressed on the wrappers. */
.crumbs .elementor-widget + .elementor-widget li::before { content: "/"; margin: 0 8px; opacity: 0.6; }
@media (max-width: 599px) {
  .tech-copy > .elementor-widget:has(p) + .elementor-widget:has(p) { display: none; }
}


/* Blog article body (.prose from the design + WP content): lists keep markers, rhythm like the design */
.dk-post-body ul, .dk-post-body ol { margin: 0 0 1em; padding-left: 1.3em; color: var(--ink-muted); }
.dk-post-body ul { list-style: disc; } .dk-post-body ol { list-style: decimal; }
.dk-post-body li { margin: 0 0 0.4em; padding-left: 0.2em; }
.dk-post-body li::marker { color: var(--accent); }
.dk-post-body li strong { color: var(--ink); }
.dk-post-body p, .dk-post-body li { font-size: 1.0625rem; line-height: 1.7; }
/* Text links (design .link-arrow) stretch like buttons in flex columns but keep their text on the left */
.elementor-widget-button.dk-link .elementor-button { justify-content: flex-start !important; }

/* ---- Authors (byline / author box / author archive), design tokens only ---- */
.dk-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; color: var(--ink-muted); font-size: 0.9688rem; }
.dk-byline a { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.dk-byline a:hover { color: var(--accent); }
.dk-byline-avatar img, .dk-author-box-photo img { display: block; border-radius: 50%; object-fit: cover; }
.dk-byline-avatar img { width: 36px; height: 36px; }
.dk-dot { opacity: 0.5; }
.dk-author-box { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 20px; max-width: 68ch; margin-top: clamp(32px, 4vw, 48px); padding: 24px; background: var(--surface); border-radius: var(--r-card); }
.dk-author-box-photo img { width: 72px; height: 72px; }
.dk-author-box h3 { margin: 0 0 2px; font-size: 1.25rem; }
.dk-author-box h3 a { color: var(--ink); text-decoration: none; }
.dk-author-box h3 a:hover { color: var(--accent); }
.dk-author-role { margin: 0 0 10px; font-size: 0.9375rem; font-weight: 600; color: var(--accent); }
.dk-author-bio p { margin: 0 0 0.8em; color: var(--ink-muted); }
.dk-author-bio p:empty, .dk-author-bio p:has(> br:only-child) { display: none; }
.dk-author-box .link-arrow { gap: 8px; }
.dk-author-head { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; margin-top: 8px; }
.dk-author-head h1 { margin: 0 0 14px; font-size: clamp(2.25rem, 1.6rem + 2.8vw, 3.75rem); }
.dk-author-head .lead { margin: 0 0 16px; max-width: 62ch; color: var(--ink-muted); font-size: 1.125rem; }
.dk-author-head .dk-author-bio { max-width: 68ch; }
.dk-avatar-lg { display: block; width: 160px; height: 160px; border-radius: 50%; object-fit: cover; }
@media (max-width: 599px) {
  .dk-author-box { grid-template-columns: 56px minmax(0, 1fr); gap: 14px; padding: 20px; }
  .dk-author-box-photo img { width: 56px; height: 56px; }
  .dk-author-head { grid-template-columns: 1fr; }
  .dk-avatar-lg { width: 112px; height: 112px; }
}
/* author images: beat Elementor's `.elementor img { height:auto; border-radius:0 }` */
.elementor .dk-author-head img.dk-avatar-lg { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; }
.elementor .dk-byline-avatar img, .elementor .dk-author-box-photo img { border-radius: 50%; object-fit: cover; aspect-ratio: 1; }
.elementor .dk-byline-avatar img { width: 36px; height: 36px; }
.elementor .dk-author-box-photo img { width: 72px; height: 72px; }
@media (max-width: 599px) { .elementor .dk-author-head img.dk-avatar-lg { width: 112px; height: 112px; } .elementor .dk-author-box-photo img { width: 56px; height: 56px; } }
.dk-author-head .lead { margin: 0 0 16px !important; } /* design .page-head .lead sets margin 0 */
/* Blog card: category · date on one line; "Preberi več" pinned to the card bottom */
.dk-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.dk-card-meta .elementor-widget, .dk-card-meta .elementor-heading-title { line-height: 1.4; margin: 0; }
.dk-card-meta .elementor-widget + .elementor-widget::before { content: "·"; margin-right: 10px; color: var(--ink-muted); font-size: 14px; line-height: 1.4; }
.dk-card-meta .elementor-widget + .elementor-widget { align-items: center; }
.dk-card-meta .elementor-widget + .elementor-widget { display: flex; }
.dk-blog-card .card-body { flex: 1; }

/* Legal pages (pogoji, zasebnost, piškotki, avtorske pravice, reklamacija): text spans the full .wrap width */
.dk-legal.prose:not(.dk-b):not(.dk-b):not(.dk-b):not(.dk-b),
.dk-legal.prose :is(p, li, h2, h3, .lead):not(.dk-b):not(.dk-b):not(.dk-b):not(.dk-b) {max-width: none;}
/* Legal tables (cookie list): clean rows; on narrow screens the table scrolls inside itself instead of the page */
.dk-legal table { width: 100%; border-collapse: collapse; margin: 0 0 1.5em; font-size: 0.9375rem; }
.dk-legal :is(th, td) { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.dk-legal th { font-weight: 700; color: var(--ink); }
@media (max-width: 767px) { .dk-legal table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; } }

/* FAQ (Nested Accordion): Elementor wraps every answer panel in a default 1px #d5d8dc border
   (:where(.e-n-accordion-item > .e-con)). The design has no box, only the lines between questions. */
.elementor-widget-n-accordion .e-n-accordion-item > .e-con { border: 0; }

/* Gallery: the design's img{height:100%} fills the figure and the overflow:hidden figure clips the
   caption. In Elementor the img sits inside a widget wrapper with no height, so the image fell back to
   its own height and the caption showed as a white strip. Give the wrapper the figure's height. */
.gallery > .dk-t-figure > .elementor-widget-image { height: 100%; }
.gallery > .dk-t-figure > .elementor-widget-image img { height: 100%; }
.gallery > .dk-t-figure.g-wide > .elementor-widget-image img { aspect-ratio: auto; }

/* Same cause in every design frame that stretches its photo with img{height:100%} (.package-media,
   .price-feature figure, .other-clinic figure): when the image is the only thing in the frame, the
   widget wrapper takes the frame's height, so the photo fills it instead of leaving an empty band.
   Frames without a fixed height are unaffected (100% of auto = auto). */
.dk-t-figure > .elementor-widget-image:only-child { height: 100%; }
