/*
Theme Name: Dr Wolfinger
Theme URI: https://drwolfingerclinic.pl
Description: Motyw kliniki dr Wolfingera — klasyczny motyw PHP, treści i sekcje z pól ACF (model danych: mu-plugin dw-core)
Version: 2.0.0
Requires at least: 6.6
Requires PHP: 8.2
Author: DW Core Team
Text Domain: drwolfinger
*/

/* ==========================================================================
   0. Custom Properties
   ========================================================================== */

:root {
    --dw-radius-sm:         6px;
    --dw-radius-md:         12px;
    --dw-radius-lg:         24px;
    --dw-shadow-sm:         0 2px 8px rgba(0,0,0,.08);
    --dw-shadow-md:         0 4px 24px rgba(0,0,0,.10);
    --dw-shadow-gold:       0 8px 40px rgba(196,163,90,.35);
}

/* ==========================================================================
   1. Base Reset & Body
   ========================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--wp--preset--color--cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Offset body for header */

/* Admin bar adjustment */

@media (max-width: 782px) {
    body.admin-bar {
        padding-top: calc(var(--dw-total-header) + 46px);
    }
}

/* Mobile bottom bar space */

img, video, svg {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

a {
    text-decoration: none;
}

p { margin-top: 0; }

/* ==========================================================================
   2. Typography Utilities
   ========================================================================== */

.dw-label {
    font-family: var(--wp--preset--font-family--jost);
    font-size: var(--wp--preset--font-size--xs);
    font-weight: 500;
}

.dw-section-title {
    font-family: var(--wp--preset--font-family--cormorant-garamond);
    font-size: clamp(var(--wp--preset--font-size--2xl), 4vw, var(--wp--preset--font-size--4xl));
    font-weight: 600;
    line-height: 1.1;
    margin-top: 0;
}

.dw-section-lead {
    font-size: var(--wp--preset--font-size--md);
    line-height: 1.7;
}

.dw-page-title {
    font-family: var(--wp--preset--font-family--cormorant-garamond);
    font-size: clamp(var(--wp--preset--font-size--3xl), 5vw, var(--wp--preset--font-size--5xl));
    font-weight: 600;
    line-height: 1.05;
    margin-bottom: var(--wp--preset--spacing--10);
}

/* ==========================================================================
   3. Layout Utilities
   ========================================================================== */

@media (max-width: 768px) {
    .dw-container {
        padding-left: var(--wp--preset--spacing--5);
        padding-right: var(--wp--preset--spacing--5);
    }
}

.dw-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--wp--preset--spacing--8);
}

@media (max-width: 1024px) {
    .dw-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .dw-grid-3 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   4. Buttons
   ========================================================================== */

.dw-btn {
    line-height: 1;
}

.dw-btn--ghost-light {
    background: transparent;
    color: var(--wp--preset--color--white);
    border: 1.5px solid rgba(255,255,255,.6);
}

.dw-btn--ghost-light:hover {
    background: rgba(255,255,255,.15);
    border-color: rgba(255,255,255,.9);
    color: var(--wp--preset--color--white);
}

.dw-btn:focus-visible {
    outline: 3px solid var(--wp--preset--color--gold);
    outline-offset: 3px;
}

/* Główny kontener treści */
.dw-main {
    display: block;
    min-height: 60vh;
}

.dw-breadcrumbs {
    padding: var(--wp--preset--spacing--5) 0 var(--wp--preset--spacing--4);
    font-size: var(--wp--preset--font-size--xs);
    color: var(--wp--preset--color--warm-gray);
}

/* ==========================================================================
   11. Card Component
   ========================================================================== */

.dw-card {
    background: var(--wp--preset--color--white);
    border-radius: var(--dw-radius-md);
    overflow: hidden;
    box-shadow: var(--dw-shadow-sm);
    transition: box-shadow var(--dw-transition-base), transform var(--dw-transition-base);
    display: flex;
    flex-direction: column;
}

.dw-card:hover {
    box-shadow: var(--dw-shadow-md);
    transform: translateY(-3px);
}

.dw-card__image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    background: var(--wp--preset--color--light-gray);
}

.dw-card__body {
    padding: var(--wp--preset--spacing--6);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dw-card__label {
    font-size: var(--wp--preset--font-size--xs);
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--wp--preset--color--gold);
    margin-bottom: var(--wp--preset--spacing--3);
}

.dw-card__title {
    font-family: var(--wp--preset--font-family--cormorant-garamond);
    font-size: var(--wp--preset--font-size--xl);
    font-weight: 600;
    line-height: 1.2;
    color: var(--wp--preset--color--charcoal);
    margin: 0 0 var(--wp--preset--spacing--4);
}

.dw-card__excerpt {
    font-size: var(--wp--preset--font-size--sm);
    line-height: 1.65;
    color: var(--wp--preset--color--warm-gray);
    flex: 1;
    margin-bottom: var(--wp--preset--spacing--5);
}

.dw-card__link {
    font-size: var(--wp--preset--font-size--xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--wp--preset--color--gold);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap var(--dw-transition-fast), color var(--dw-transition-fast);
}

.dw-card__link:hover {
    gap: 10px;
    color: #b8923f;
}

.dw-card__link::after {
    content: '→';
}

@media (prefers-reduced-motion: reduce) {
    .dw-card { transition: none; }
    .dw-card__link { transition: none; }
}

/* ==========================================================================
   12. Section Spacing & Dividers
   ========================================================================== */

.dw-section-header {
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--4);
    margin-bottom: var(--wp--preset--spacing--12);
}

.dw-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--dw-radius-pill);
    font-size: var(--wp--preset--font-size--xs);
    font-weight: 500;
    font-family: var(--wp--preset--font-family--jost);
    line-height: 1.4;
    white-space: nowrap;
    text-decoration: none;
}

.dw-chip--outline {
    border: 1px solid var(--wp--preset--color--light-gray);
    color: var(--wp--preset--color--warm-gray);
    background: transparent;
}

a.dw-chip:hover {
    background: rgba(196,163,90,.22);
    color: var(--wp--preset--color--gold);
}

/* ==========================================================================
   17. Loading Spinner
   ========================================================================== */

@keyframes dw-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   18. Accessibility
   ========================================================================== */

.dw-reduced-motion *,
.dw-reduced-motion *::before,
.dw-reduced-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 16px;
    background: var(--wp--preset--color--gold);
    color: var(--wp--preset--color--white);
    padding: 8px 16px;
    border-radius: 0 0 var(--dw-radius-sm) var(--dw-radius-sm);
    font-size: var(--wp--preset--font-size--sm);
    font-weight: 500;
    z-index: 9999;
    transition: top var(--dw-transition-fast);
}

.skip-link:focus {
    top: 0;
}

/* ==========================================================================
   19. WordPress Core Block Overrides
   ========================================================================== */

/* Buttons */
.wp-block-button__link {
    font-family: var(--wp--preset--font-family--jost);
    font-size: var(--wp--preset--font-size--sm);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: var(--dw-radius-pill);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 14px 32px;
    transition: background var(--dw-transition-base), transform var(--dw-transition-fast), box-shadow var(--dw-transition-base);
}

.wp-block-button__link:hover {
    transform: translateY(-2px);
}

.wp-block-button.is-style-fill .wp-block-button__link {
    box-shadow: var(--dw-shadow-gold);
}

.wp-block-button.is-style-outline .wp-block-button__link {
    background: transparent;
}

/* Separator */
.wp-block-separator {
    border-color: var(--wp--preset--color--light-gray);
    opacity: 1;
}

/* Columns */
.wp-block-columns:not(.is-not-stacked-on-mobile) {
    flex-wrap: wrap;
}


/* ==========================================================================
   20. Print
   ========================================================================== */

@media print {
    .dw-site-header,
    .dw-mobile-bar,
    .dw-hero-video__pause-btn {
        display: none !important;
    }
    body {
        padding-top: 0;
        color: #000;
        background: #fff;
    }
    a[href]::after {
        content: ' (' attr(href) ')';
        font-size: 0.8em;
        color: #555;
    }
}
