/*
 * Base primitives and utilities.
 */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.site-shell {
    width: min(100% - 2rem, var(--wp-theme-max-width));
    margin-inline: auto;
}

.site-shell--narrow {
    width: min(100% - 2rem, 860px);
}

.site-shell--wide {
    width: min(100% - 2rem, 1320px);
}

.site-shell--full {
    width: min(100% - 2rem, 1640px);
}

.site-shell--bleed {
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.section-block {
    --section-padding-top: var(--wp-theme-section-padding-top);
    --section-padding-bottom: var(--wp-theme-section-padding-bottom);
    --section-background-color: transparent;
    --section-background-gradient: none;
    --section-background-image: none;
    --section-background-blend: normal;
    --section-overlay: rgba(31, 20, 32, 0);
    position: relative;
    padding-top: var(--section-padding-top);
    padding-bottom: var(--section-padding-bottom);
    background-color: var(--section-background-color);
    background-image: var(--section-background-image), var(--section-background-gradient);
    background-blend-mode: var(--section-background-blend);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.site-main > .section-block {
    scroll-margin-top: 88px;
}

.section-block::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--section-overlay);
    pointer-events: none;
    z-index: 0;
}

.section-block > .site-shell,
.section-block > .site-shell--narrow,
.section-block > .site-shell--wide,
.section-block > .site-shell--full {
    position: relative;
    z-index: 1;
}

.section-block--hero {
    padding-top: max(2rem, calc(var(--section-padding-top) * 0.75));
}

.efeito-papel {
    display: block;
    width: min(1100px, 92vw);
    height: auto;
    margin: 0 auto;
    opacity: 0.55;
    pointer-events: none;
}

.site-main > .section-block--paper-effect {
    overflow: visible;
}

.site-main > .section-block--paper-effect:not(:first-child)::after {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -52%);
    width: min(1200px, 130vw);
    height: var(--section-paper-height, 52px);
    background-image: var(--wp-theme-paper-effect-image);
    background-repeat: repeat-x;
    background-size: auto 100%;
    background-position: center top;
    opacity: var(--section-paper-opacity, 0.58);
    pointer-events: none;
    z-index: 2;
}

.section-block--style-card .wedding-platform-rsvp,
.section-block--style-card .wedding-platform-gifts,
.section-block--style-card .wedding-platform-gallery,
.section-block--style-card .wedding-platform-faq {
    background:
        linear-gradient(170deg, rgba(255, 255, 255, 0.98) 0%, rgba(251, 248, 244, 0.98) 100%);
    border: 1px solid var(--wp-theme-color-border);
    border-radius: max(14px, var(--wp-theme-radius));
    box-shadow: 0 12px 28px var(--wp-theme-color-shadow);
    padding: clamp(1.25rem, 3.2vw, 2rem);
    position: relative;
}

.section-block--style-card .wedding-platform-rsvp::after,
.section-block--style-card .wedding-platform-gifts::after,
.section-block--style-card .wedding-platform-gallery::after,
.section-block--style-card .wedding-platform-faq::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.55));
    clip-path: polygon(100% 0, 0 0, 100% 100%);
    border-top-right-radius: max(14px, var(--wp-theme-radius));
}

.section-block--style-alternate {
    --section-background-color: var(--wp-theme-color-surface-soft);
}

.section-block--style-folha {
    --section-background-color: color-mix(in srgb, #f6f1ea 90%, var(--wp-theme-color-bg) 10%);
}

.section-block--style-carta {
    --section-background-color: color-mix(in srgb, #fdf6ea 85%, var(--wp-theme-color-bg) 15%);
}

.section-block--style-pergaminho {
    --section-background-color: color-mix(in srgb, #efe5d6 84%, var(--wp-theme-color-bg) 16%);
}

.section-block--style-editorial {
    --section-background-color: color-mix(in srgb, #f8f8f8 84%, var(--wp-theme-color-bg) 16%);
}

.section-block--style-decorative {
    border-top: 1px solid color-mix(in srgb, var(--wp-theme-color-primary) 24%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--wp-theme-color-secondary) 22%, transparent);
}

.section-block--style-divider::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: min(320px, 54vw);
    height: 1px;
    transform: translateX(-50%);
    background: color-mix(in srgb, var(--wp-theme-color-primary) 32%, transparent);
    z-index: 1;
}

.section-block--style-highlighted {
    --section-background-color: color-mix(in srgb, var(--wp-theme-color-accent) 6%, #fffdf9);
}

.section-block--style-highlighted .content-card {
    background:
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.95),
            rgba(255, 255, 255, 0.95) 26px,
            rgba(247, 240, 232, 0.95) 26px,
            rgba(247, 240, 232, 0.95) 27px
        );
    border: 1px solid color-mix(in srgb, var(--wp-theme-color-border) 85%, #c8b49f 15%);
}

.section-block--style-folha .content-card,
.section-block--style-folha .wedding-platform-rsvp,
.section-block--style-folha .wedding-platform-gifts,
.section-block--style-folha .wedding-platform-gallery,
.section-block--style-folha .wedding-platform-faq {
    background:
        linear-gradient(178deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 242, 235, 0.97) 100%);
    border: 1px solid color-mix(in srgb, var(--wp-theme-color-border) 86%, #d8cab8 14%);
    border-radius: 18px 18px 22px 22px;
    box-shadow: 0 10px 24px var(--wp-theme-color-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.75);
    position: relative;
}

.section-block--style-folha .content-card::before,
.section-block--style-folha .wedding-platform-rsvp::before,
.section-block--style-folha .wedding-platform-gifts::before,
.section-block--style-folha .wedding-platform-gallery::before,
.section-block--style-folha .wedding-platform-faq::before {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    top: 10px;
    border-top: 1px dashed color-mix(in srgb, var(--wp-theme-color-primary) 22%, transparent);
    opacity: 0.45;
}

.section-block--style-carta .content-card,
.section-block--style-carta .wedding-platform-rsvp,
.section-block--style-carta .wedding-platform-gifts,
.section-block--style-carta .wedding-platform-gallery,
.section-block--style-carta .wedding-platform-faq {
    background: linear-gradient(180deg, #fffdf9 0%, #f6eee5 100%);
    border: 1px solid color-mix(in srgb, var(--wp-theme-color-border) 82%, #d4b999 18%);
    border-radius: 8px;
    box-shadow: 0 8px 20px var(--wp-theme-color-shadow);
    position: relative;
}

.section-block--style-carta .content-card::after,
.section-block--style-carta .wedding-platform-rsvp::after,
.section-block--style-carta .wedding-platform-gifts::after,
.section-block--style-carta .wedding-platform-gallery::after,
.section-block--style-carta .wedding-platform-faq::after {
    content: "";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--wp-theme-color-accent) 50%, #d6b78b 50%);
    box-shadow: 0 0 0 2px #fff6e8;
}

.section-block--style-pergaminho .content-card,
.section-block--style-pergaminho .wedding-platform-rsvp,
.section-block--style-pergaminho .wedding-platform-gifts,
.section-block--style-pergaminho .wedding-platform-gallery,
.section-block--style-pergaminho .wedding-platform-faq {
    background:
        radial-gradient(circle at 25% 20%, rgba(255, 245, 218, 0.9), rgba(246, 232, 196, 0.9) 65%),
        repeating-linear-gradient(
            90deg,
            rgba(233, 213, 170, 0.16),
            rgba(233, 213, 170, 0.16) 3px,
            rgba(247, 234, 204, 0.12) 3px,
            rgba(247, 234, 204, 0.12) 8px
        );
    border: 1px solid color-mix(in srgb, var(--wp-theme-color-border) 60%, #b69158 40%);
    border-radius: 10px;
    box-shadow: 0 10px 24px var(--wp-theme-color-shadow);
    position: relative;
}

.section-block--style-pergaminho .content-card::before,
.section-block--style-pergaminho .wedding-platform-rsvp::before,
.section-block--style-pergaminho .wedding-platform-gifts::before,
.section-block--style-pergaminho .wedding-platform-gallery::before,
.section-block--style-pergaminho .wedding-platform-faq::before {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid color-mix(in srgb, var(--wp-theme-color-accent) 26%, transparent);
    border-radius: 6px;
    pointer-events: none;
}

.section-block--style-editorial .content-card,
.section-block--style-editorial .wedding-platform-rsvp,
.section-block--style-editorial .wedding-platform-gifts,
.section-block--style-editorial .wedding-platform-gallery,
.section-block--style-editorial .wedding-platform-faq {
    background: #fffdfa;
    border: 0;
    border-top: 3px solid color-mix(in srgb, var(--wp-theme-color-primary) 75%, #000 25%);
    border-radius: 0;
    box-shadow: 0 6px 18px rgba(10, 10, 10, 0.05);
    padding: clamp(1rem, 3vw, 1.6rem);
}

.section-block--intensity-suave .content-card,
.section-block--intensity-suave .wedding-platform-rsvp,
.section-block--intensity-suave .wedding-platform-gifts,
.section-block--intensity-suave .wedding-platform-gallery,
.section-block--intensity-suave .wedding-platform-faq {
    box-shadow: 0 6px 16px color-mix(in srgb, var(--wp-theme-color-shadow) 70%, transparent);
    filter: saturate(0.96);
}

.section-block--intensity-medio .content-card,
.section-block--intensity-medio .wedding-platform-rsvp,
.section-block--intensity-medio .wedding-platform-gifts,
.section-block--intensity-medio .wedding-platform-gallery,
.section-block--intensity-medio .wedding-platform-faq {
    box-shadow: 0 12px 26px color-mix(in srgb, var(--wp-theme-color-shadow) 95%, transparent);
    filter: saturate(1);
}

.section-block--intensity-marcante .content-card,
.section-block--intensity-marcante .wedding-platform-rsvp,
.section-block--intensity-marcante .wedding-platform-gifts,
.section-block--intensity-marcante .wedding-platform-gallery,
.section-block--intensity-marcante .wedding-platform-faq {
    box-shadow: 0 18px 34px color-mix(in srgb, var(--wp-theme-color-shadow) 100%, rgba(0, 0, 0, 0.14));
    filter: saturate(1.04);
    transform: translateY(-1px);
}

.content-card {
    background: linear-gradient(170deg, #ffffff 0%, #fbf6f0 100%);
    border: 1px solid var(--wp-theme-color-border);
    border-radius: max(14px, var(--wp-theme-radius));
    box-shadow: 0 8px 20px var(--wp-theme-color-shadow);
    padding: var(--wp-theme-space-4);
}

.content-card--empty {
    border-style: dashed;
    background: var(--wp-theme-color-surface-soft);
}

.content-title {
    margin-top: 0;
    text-align: center;
}

.content-body > :first-child {
    margin-top: 0;
}

.content-body > :last-child {
    margin-bottom: 0;
}

.grid {
    display: grid;
    gap: 1rem;
}

.grid--details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shortcode-wrap {
    display: grid;
    gap: 1rem;
    padding-inline: clamp(0.85rem, 2.1vw, 1.35rem);
}

.section-block--messages .shortcode-wrap,
.section-block--gifts .shortcode-wrap {
    padding-inline: clamp(1rem, 2.4vw, 1.6rem);
}

.shortcode-wrap > .wedding-platform-gifts,
.shortcode-wrap > .wedding-platform-rsvp,
.shortcode-wrap > .wedding-platform-messages,
.shortcode-wrap > .wedding-platform-gallery,
.shortcode-wrap > .wedding-platform-faq {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.shortcode-wrap input,
.shortcode-wrap select,
.shortcode-wrap textarea {
    max-width: 100%;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.8rem;
    padding: 0.58rem 1.05rem;
    border-radius: var(--wp-theme-button-radius);
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
}

.btn--primary {
    background: var(--wp-theme-color-button);
    color: #ffffff;
}

.btn--primary:hover,
.btn--primary:focus {
    background: var(--wp-theme-color-button-hover);
    color: #ffffff;
}

.btn--ghost {
    background: #ffffff;
    border-color: var(--wp-theme-color-secondary);
    color: var(--wp-theme-color-secondary);
}

.btn--outline {
    background: transparent;
    border-color: var(--wp-theme-color-secondary);
    color: var(--wp-theme-color-secondary);
}

.crest-card {
    text-align: center;
    border-top: 3px solid var(--wp-theme-color-primary);
}

.crest-meaning {
    text-align: left;
    display: grid;
    gap: 0.85rem;
    line-height: 1.7;
}

.crest-meaning h1,
.crest-meaning h2,
.crest-meaning h3 {
    margin: 0.2rem 0 0;
    text-align: center;
    color: var(--wp-theme-color-title);
}

.crest-meaning p {
    margin: 0;
}

.crest-meaning strong {
    color: var(--wp-theme-color-title);
}

.crest-image-wrap {
    margin: 0 0 0.75rem;
}

.crest-image {
    width: min(160px, 100%);
    max-height: 160px;
    object-fit: contain;
}

.crest-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--wp-theme-color-primary), var(--wp-theme-color-secondary));
    color: #ffffff;
    font-weight: 800;
    margin-bottom: 0.6rem;
}

.crest-symbol--fallback::before {
    content: "*";
    font-size: 0.78rem;
    opacity: 0.78;
    margin-right: 0.25rem;
}

.event-map-embed {
    margin-top: 12px;
    border: 1px solid var(--wp-theme-color-border);
    border-radius: 12px;
    overflow: hidden;
}

.event-map-embed iframe {
    display: block;
    width: 100%;
    min-height: 280px;
    border: 0;
}

@media (max-width: 900px) {
    .grid--details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .site-shell,
    .site-shell--narrow,
    .site-shell--wide,
    .site-shell--full {
        width: min(100% - 1.25rem, var(--wp-theme-max-width));
    }

    .site-shell--bleed {
        width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
    }

    .shortcode-wrap {
        padding-inline: 0.75rem;
    }

    .site-main > .section-block--paper-effect:not(:first-child)::after {
        width: min(980px, 165vw);
        transform: translate(-50%, -48%);
    }
}
