/*
 Theme Name:   Phase3 Solar
 Description:  Child theme for Phase3 Solar GmbH
 Template:     extendable
 Version:      1.0.0
 Text Domain:  phase3-solar
*/

/* ============================================
   GLOBAL BUTTON STYLES
   Based on .p3-all-inclusive-content button
   ============================================ */
.wp-block-button .wp-block-button__link {
    background: linear-gradient(135deg, #00851a, #167b35) !important;
    color: #fff !important;
    border: none !important;
    padding: 14px 32px !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 14px rgba(11, 98, 0, 0.25);
    text-decoration: none !important;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.wp-block-button .wp-block-button__link:hover {
    box-shadow: 0 6px 20px rgba(11, 98, 0, 0.35);
    transform: translateY(-2px);
}

/* Homepage H2 — removed color/weight override, let theme default apply */

/* Team columns: remove white background (scoped in #team section below) */

/* Partner logo marquee */
.p3-partner-grid {
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
    flex-wrap: nowrap !important;
    gap: 0 !important;
}
.p3-partner-grid .p3-marquee-track {
    display: flex;
    gap: 3rem;
    align-items: center;
    width: max-content;
    will-change: transform;
}
.p3-partner-grid .wp-block-image {
    flex-shrink: 0;
    max-width: 180px;
    margin: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 65px;
}
.p3-partner-grid .wp-block-image figure {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.p3-partner-grid .wp-block-image img {
    max-height: 60px;
    width: auto;
    object-fit: contain;
    display: block;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}
.p3-partner-grid .wp-block-image img:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* ============================================
   SUBPAGE HEADER COVERS
   ============================================ */
body:not(.home) .entry-content > .wp-block-group:first-child .wp-block-cover {
    min-height: 500px !important;
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
@media (max-width: 768px) {
    body:not(.home) .entry-content > .wp-block-group:first-child .wp-block-cover {
        min-height: 250px !important;
    }
    body:not(.home) .entry-content > .wp-block-group:first-child .wp-block-cover .wp-block-cover__inner-container {
        padding-left: var(--wp--preset--spacing--30, 1.25rem) !important;
        padding-right: var(--wp--preset--spacing--30, 1.25rem) !important;
    }
}
body:not(.home) .entry-content > .wp-block-group:first-child .wp-block-cover .wp-block-cover__background {
    opacity: 0.45 !important;
}
body:not(.home) .entry-content > .wp-block-group:first-child .wp-block-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 40%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
    z-index: 1;
}
body:not(.home) .entry-content > .wp-block-group:first-child .wp-block-cover .wp-block-cover__inner-container {
    display: flex;
    align-items: flex-end;
    position: relative;
    z-index: 2;
    max-width: var(--wp--style--global--wide-size, 80rem);
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
    width: 100%;
    box-sizing: border-box;
}
body:not(.home) .entry-content > .wp-block-group:first-child .wp-block-cover h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem) !important;
    font-weight: 700 !important;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    letter-spacing: -0.02em;
}

/* ============================================
   PER-PAGE HEADER IMAGE POSITIONING
   ============================================ */
/* Über uns — show more of the solar panels, less sky */
.page-id-19 .entry-content > .wp-block-group:first-child .wp-block-cover__image-background {
    object-position: center 65% !important;
}
/* Beratung — show more of the lower part */
.page-id-20 .entry-content > .wp-block-group:first-child .wp-block-cover__image-background {
    object-position: 61% 35% !important;
}
/* Finanzierung — same framing as Beratung (same photo) */
.page-id-517 .entry-content > .wp-block-group:first-child .wp-block-cover__image-background {
    object-position: 61% 35% !important;
}

/* ============================================
   PRODUKTE PAGE — Product Section Cards
   ============================================ */

/* Product section images — rounded corners + shadow */
.page-id-23 .entry-content .wp-block-columns .wp-block-image img {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.page-id-23 .entry-content .wp-block-columns .wp-block-image img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

/* Product section headings — add green accent line */
.page-id-23 .entry-content > .wp-block-group:not(:first-child) h2 {
    position: relative;
    padding-bottom: 0.5rem;
}
.page-id-23 .entry-content > .wp-block-group:not(:first-child) h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: #167b35;
    border-radius: 2px;
}

/* Reduce excessive spacing between product sections */
.page-id-23 .entry-content > .wp-block-group:not(:first-child) {
    padding-top: var(--wp--preset--spacing--50) !important;
    padding-bottom: var(--wp--preset--spacing--50) !important;
}

/* Subtle separator between white sections */
.page-id-23 .entry-content > .wp-block-group.has-background-background-color + .wp-block-group.has-tertiary-background-color,
.page-id-23 .entry-content > .wp-block-group.has-tertiary-background-color + .wp-block-group.has-background-background-color {
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* ============================================
   ÜBER UNS PAGE — Spacing & Card Polish
   ============================================ */

/* Reduce excessive whitespace between sections */
.page-id-19 .entry-content > .wp-block-group {
    padding-top: var(--wp--preset--spacing--50) !important;
    padding-bottom: var(--wp--preset--spacing--50) !important;
}
/* Keep header cover spacing intact */
.page-id-19 .entry-content > .wp-block-group:first-child {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Team section — clean modern layout, no card boxes */
#team {
    background-color: #f8f9fa !important; /* soft neutral instead of lavender */
}
#team .wp-block-columns {
    gap: 2rem;
}
#team .wp-block-column {
    text-align: center;
    background: transparent !important;
    padding: 0 !important;
}
/* Rectangular rounded photos instead of circles */
#team .is-style-rounded img {
    border-radius: 16px !important;
    aspect-ratio: 3/4 !important;
    object-fit: cover !important;
    width: 100% !important;
    max-width: 260px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.10);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
/* No hover effect on team photos */
/* Mobile: square crop + capped size to avoid exceeding source resolution (800x533) */
@media (max-width: 768px) {
    #team .wp-block-columns {
        gap: 2.5rem;
    }
    #team .is-style-rounded img {
        aspect-ratio: 1/1 !important;
        max-width: 280px;
        margin: 0 auto;
    }
}
/* Fabio — zoom in so he fills more of the frame */
#team .is-style-rounded:has(.wp-image-455) {
    overflow: hidden;
    border-radius: 16px;
}
#team .wp-image-455 {
    transform: scale(1.2) !important;
    transform-origin: center 38%;
}

/* Name styling */
#team h3 {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    margin-top: 1.25rem !important;
    margin-bottom: 0 !important;
    letter-spacing: -0.01em;
}
/* Role label — subtle, WCAG AA compliant on #f8f9fa bg */
#team .has-primary-color {
    color: #596574 !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* CTA button — now handled by global button styles */

/* ============================================
   BERATUNG PAGE — Contact Form Styling
   ============================================ */
.page-id-20 .wpcf7 {
    max-width: 600px;
    margin: 0 auto;
}
.page-id-20 .wpcf7 input[type="text"],
.page-id-20 .wpcf7 input[type="email"],
.page-id-20 .wpcf7 textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.page-id-20 .wpcf7 input[type="text"]:focus,
.page-id-20 .wpcf7 input[type="email"]:focus,
.page-id-20 .wpcf7 textarea:focus {
    border-color: #167b35;
    box-shadow: 0 0 0 3px rgba(0,133,26,0.15);
    outline: none;
}
.page-id-20 .wpcf7 input[type="submit"] {
    background: linear-gradient(135deg, #00851a, #167b35) !important;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(11, 98, 0, 0.25);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.page-id-20 .wpcf7 input[type="submit"]:hover {
    box-shadow: 0 6px 20px rgba(11, 98, 0, 0.35);
    transform: translateY(-2px);
}

/* Booking page — white background instead of tertiary */
.page-id-20 .entry-content > .wp-block-group.has-tertiary-background-color {
    background-color: #fff !important;
}

/* Tighter spacing between sections (match Referenzen/Produkte/Über uns) */
.page-id-20 .entry-content > .wp-block-group:not(:first-child) {
    padding-top: var(--wp--preset--spacing--50) !important;
    padding-bottom: var(--wp--preset--spacing--50) !important;
}

/* ============================================
   BERATUNG PAGE — Reonic GDPR Consent Wrapper
   ============================================ */
.p3-reonic-wrapper {
    max-width: 1540px;
    margin: 0 auto;
    min-height: 500px;
}

/* Consent placeholder */
.p3-reonic-consent {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 500px;
    padding: 3rem 2rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.p3-reonic-consent-icon {
    margin-bottom: 1rem;
    opacity: 0.8;
}
.p3-reonic-consent-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
    color: #0b0620;
}
.p3-reonic-consent-text {
    font-size: 0.95rem;
    color: #64748b;
    max-width: 420px;
    line-height: 1.6;
    margin: 0 0 1.5rem;
}
.p3-reonic-consent-btn {
    background: linear-gradient(135deg, #00851a, #167b35);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 14px rgba(11, 98, 0, 0.25);
}
.p3-reonic-consent-btn:hover {
    background: linear-gradient(135deg, #167b35, #00851a);
    transform: translateY(-2px);
}
.p3-reonic-consent-legal {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 1rem;
}
.p3-reonic-consent-link {
    margin-top: 1rem;
    font-size: 0.85rem;
}
.p3-reonic-consent-link a {
    color: #64748b;
    text-decoration: underline;
}

/* Loading spinner — hidden until JS triggers it */
.p3-reonic-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    color: #64748b;
    font-size: 0.95rem;
}
.p3-reonic-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #167b35;
    border-radius: 50%;
    animation: p3-spin 0.8s linear infinite;
    margin-bottom: 1rem;
}
@keyframes p3-spin {
    to { transform: rotate(360deg); }
}

/* Loaded widget container — hidden until JS triggers it */
#p3-reonic-contact {
    display: none;
    min-height: 500px;
}
#p3-reonic-contact iframe {
    min-height: 480px;
}

/* ============================================
   REFERENZEN PAGE — Minor Polish
   ============================================ */

/* Tighter spacing between project sections */
.page-id-192 .entry-content > .wp-block-group:not(:first-child) {
    padding-top: var(--wp--preset--spacing--50) !important;
    padding-bottom: var(--wp--preset--spacing--50) !important;
}

/* ============================================
   LEGAL PAGES — Impressum, Datenschutz, AGB
   ============================================ */

/* Align content left edge with header logo/nav (alignwide = 80rem centered).
   Use same side padding as header's alignwide position so content starts at same x. */
.page-id-108 .entry-content > .wp-block-group:not(:first-child),
.page-id-3 .entry-content > .wp-block-group:not(:first-child),
.page-id-148 .entry-content > .wp-block-group:not(:first-child) {
    padding-left: max(var(--wp--preset--spacing--30), calc((100vw - var(--wp--style--global--wide-size, 80rem)) / 2)) !important;
    padding-right: max(var(--wp--preset--spacing--30), calc((100vw - var(--wp--style--global--wide-size, 80rem)) / 2)) !important;
}
/* Left-align content blocks at readable width within the wide area */
.page-id-108 .entry-content > .wp-block-group:not(:first-child) > *,
.page-id-3 .entry-content > .wp-block-group:not(:first-child) > *,
.page-id-148 .entry-content > .wp-block-group:not(:first-child) > * {
    max-width: 42rem;
    margin-left: 0 !important;
    margin-right: auto !important;
}

/* Section headings — visual separator + breathing room */
.page-id-108 .entry-content h2,
.page-id-3 .entry-content h2,
.page-id-148 .entry-content h2 {
    font-size: 24px !important;
    font-weight: 700 !important;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}
/* No border on the first heading */
.page-id-108 .entry-content h2:first-of-type,
.page-id-3 .entry-content h2:first-of-type,
.page-id-148 .entry-content h2:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}
/* Body text spacing for readability */
.page-id-108 .entry-content p,
.page-id-3 .entry-content p,
.page-id-148 .entry-content p {
    line-height: 1.75;
    margin-bottom: 1rem;
}
/* Lists */
.page-id-108 .entry-content ul,
.page-id-108 .entry-content ol,
.page-id-3 .entry-content ul,
.page-id-3 .entry-content ol,
.page-id-148 .entry-content ul,
.page-id-148 .entry-content ol {
    line-height: 1.75;
    margin-bottom: 1rem;
}

/* ============================================
   ÜBER UNS — Einsatzgebiet Map Card
   ============================================ */
.p3-map-card {
    max-width: 320px;
    margin: 0 auto;
}
.p3-map-wrap {
    position: relative;
    line-height: 0;
}
.p3-map-img {
    width: 100%;
    height: auto;
    display: block;
}
/* Pin at Monheim: x≈11.1%, y≈71.6% of the cropped SVG */
.p3-map-pin {
    position: absolute;
    top: 71.6%;
    left: 11.1%;
}
.p3-map-pin-dot {
    display: block;
    width: 12px;
    height: 12px;
    background: #00851a;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    transform: translate(-50%, -50%);
}
.p3-map-pin-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 133, 26, 0.12);
}
.p3-map-pin-label {
    position: absolute;
    top: calc(71.6% + 14px);
    left: 11.1%;
    transform: translateX(-20%);
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

/* First heading needs no top margin */
.page-id-108 .entry-content h2:first-of-type,
.page-id-3 .entry-content h2:first-of-type,
.page-id-148 .entry-content h2:first-of-type {
    margin-top: 0;
}

/* ============================================
   EINSATZGEBIET MAP SECTION
   ============================================ */
.p3-map-card {
    max-width: 600px;
    margin: 1.5rem auto 0;
    text-align: center;
    padding: 0 1rem;
}
.p3-map-wrap {
    position: relative;
    display: flex;
    justify-content: center;
}
.p3-map-img {
    width: 100%;
    max-width: 500px;
    height: auto;
}
/* Zoom lens: small rect follows cursor showing detail map */
.p3-map-hover {
    display: none;
}
@media (hover: hover) {
    .p3-map-wrap {
        cursor: zoom-in;
    }
    .p3-map-lens {
        position: absolute;
        width: 180px;
        height: 180px;
        border-radius: 8px;
        border: 2px solid rgba(0, 133, 26, 0.4);
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 10;
        background: #fff;
    }
    .p3-map-wrap:hover .p3-map-lens {
        opacity: 1;
    }
    .p3-map-lens img {
        position: absolute;
        pointer-events: none;
    }
}
.p3-map-legend {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 1rem;
    font-size: 15px;
    font-weight: 600;
    color: #0b0620;
}
.p3-map-legend-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    background-color: #00851a;
}
.p3-map-legend-label {
    letter-spacing: 0.02em;
}
.p3-map-regions {
    margin-top: 0.75rem;
    font-size: 13px;
    color: #64748b;
    line-height: 1.8;
    letter-spacing: 0.01em;
}
.p3-map-attribution {
    margin-top: 0.5rem;
    font-size: 11px;
    color: #6b7280;
}
.p3-map-attribution a {
    color: #6b7280;
    text-decoration: underline;
}
.p3-map-attribution a:hover {
    color: #64748b;
}

/* Mobile: let map fill available width */
@media (max-width: 600px) {
    .p3-map-card {
        max-width: 100%;
        padding: 0 0.5rem;
    }
    .p3-map-img {
        max-width: 100%;
    }
    .p3-map-regions {
        font-size: 12px;
        line-height: 1.6;
    }
}
