/*
Theme Name: Portugal Property
Theme URI: https://portugalproperty.com
Author: Telex
Description: A luxury real estate consulting theme built for international property investors in Portugal. Deep contrast palette, editorial typography, and refined gold accents convey private-wealth sophistication with single-point accountability.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: portugal-property
Tags: full-site-editing, block-themes, custom-colors, custom-fonts, one-column, wide-blocks
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.0
*/

/* ==========================================================================
   Root & body resets
   ========================================================================== */

:root,
body,
.wp-site-blocks {
    overflow: visible;
}

html {
    scroll-behavior: smooth;
}

/* ==========================================================================
   Global typography polish
   ========================================================================== */

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Headings — Cormorant Garamond gets a touch of negative tracking at display sizes */
h1, .wp-block-post-title,
h2, h3 {
    letter-spacing: -0.02em;
}

h4, h5 {
    letter-spacing: 0;
}

/* H6 already has uppercase + wide tracking in theme.json */

p {
    max-width: 72ch;
}

/* Figcaption styling */
figcaption {
    font-family: var(--wp--preset--font-family--body);
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--preset--color--warm-gray);
    margin-top: var(--wp--preset--spacing--20);
}

/* ==========================================================================
   Link & inline treatments
   ========================================================================== */

a {
    transition: color 0.3s ease;
}

/* Body-copy links: gold with a subtle underline offset */
.entry-content a:not(.wp-block-button__link),
.wp-block-group a:not(.wp-block-button__link):not(.wp-block-navigation-item__content):not(.wp-block-site-title a) {
    text-decoration-thickness: 1px;
    text-underline-offset: 0.25em;
    text-decoration-color: var(--wp--preset--color--gold);
}

.entry-content a:not(.wp-block-button__link):hover,
.wp-block-group a:not(.wp-block-button__link):not(.wp-block-navigation-item__content):hover {
    text-decoration-color: var(--wp--preset--color--off-white);
}

/* ==========================================================================
   Button variants
   ========================================================================== */

/* Primary button base transitions */
.wp-block-button__link {
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.25s ease, box-shadow 0.3s ease;
}

.wp-block-button__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(10, 10, 10, 0.35);
}

.wp-block-button__link:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Outline button style */
.wp-block-button.is-style-outline .wp-block-button__link {
    background-color: transparent;
    border: 1px solid var(--wp--preset--color--gold);
    color: var(--wp--preset--color--gold);
    box-shadow: none;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--gold);
    color: var(--wp--preset--color--black);
    transform: translateY(-2px);
}

/* Secondary text-link CTA (inline style matching the reference) */
.btn-secondary,
a.btn-secondary {
    font-family: var(--wp--preset--font-family--body);
    font-size: var(--wp--preset--font-size--small);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--wp--preset--color--off-white);
    text-decoration: none;
    position: relative;
    padding-bottom: 0.35rem;
    transition: color 0.3s ease;
}

.btn-secondary::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--wp--preset--color--gold);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
}

.btn-secondary:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ==========================================================================
   Header — fixed overlay + translucent-blur on scroll
   ========================================================================== */

.wp-site-blocks > header.wp-block-template-part {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

/* Backdrop pseudo — paints the scrolled-state chrome without turning
   the header into a containing block for the mobile overlay's fixed inset. */
.wp-site-blocks > header.wp-block-template-part::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    transition: background 0.4s ease, backdrop-filter 0.4s ease, -webkit-backdrop-filter 0.4s ease;
}

/* Scrolled state: translucent cobalt + blur
   Cobalt provides strong contrast against the off-white / black body content */
body.is-scrolled .wp-site-blocks > header.wp-block-template-part::before {
    background: color-mix(in srgb, var(--wp--preset--color--cobalt) 82%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Header inner group transitions */
.site-header {
    transition: padding 0.3s ease;
}

/* ==========================================================================
   Navigation polish
   ========================================================================== */

.wp-block-navigation a {
    transition: color 0.3s ease;
}

.wp-block-navigation a:hover {
    color: var(--wp--preset--color--gold);
}

/* Active page indicator */
.wp-block-navigation .current-menu-item > a {
    color: var(--wp--preset--color--gold);
}

/* Text shadow for nav over hero imagery */
.site-header .wp-block-navigation a {
    text-shadow: 0 2px 10px rgba(10, 10, 10, 0.5);
}

body.is-scrolled .site-header .wp-block-navigation a {
    text-shadow: none;
}

/* ==========================================================================
   Mobile hamburger overlay
   ========================================================================== */

.wp-block-navigation__responsive-container.is-menu-open {
    padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--50);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
    gap: var(--wp--preset--spacing--40);
    align-items: flex-start;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
    font-size: var(--wp--preset--font-size--large);
}

/* ==========================================================================
   Separator / divider
   ========================================================================== */

.wp-block-separator {
    border-color: var(--wp--preset--color--gold);
    opacity: 0.4;
}

.wp-block-separator.is-style-wide {
    border-bottom-width: 1px;
}

.wp-block-separator.is-style-dots::before {
    color: var(--wp--preset--color--gold);
}

/* ==========================================================================
   Image treatments — luxury editorial
   ========================================================================== */

.wp-block-image img {
    border-radius: 0;
}

.wp-block-image.is-style-rounded img {
    border-radius: 0;
}

/* Cover block overlays — deepen the cinematic wash */
.wp-block-cover::after {
    pointer-events: none;
}

/* Gallery block refinements */
.wp-block-gallery {
    gap: var(--wp--preset--spacing--20);
}

.wp-block-gallery .wp-block-image img {
    transition: transform 0.5s ease, filter 0.5s ease;
}

.wp-block-gallery .wp-block-image:hover img {
    transform: scale(1.03);
    filter: brightness(1.08);
}

/* ==========================================================================
   Quote block — editorial luxury
   ========================================================================== */

.wp-block-quote cite,
.wp-block-quote footer {
    font-family: var(--wp--preset--font-family--body);
    font-size: var(--wp--preset--font-size--small);
    font-style: normal;
    color: var(--wp--preset--color--warm-gray);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: var(--wp--preset--spacing--30);
    display: block;
}

/* Pullquote */
.wp-block-pullquote {
    border-top: 3px solid var(--wp--preset--color--gold);
    border-bottom: 3px solid var(--wp--preset--color--gold);
    padding: var(--wp--preset--spacing--50) 0;
}

.wp-block-pullquote blockquote p {
    font-family: var(--wp--preset--font-family--heading);
    font-size: var(--wp--preset--font-size--xx-large);
    font-style: italic;
    line-height: 1.35;
}

/* ==========================================================================
   Hero composition helpers (matching reference design)
   ========================================================================== */

/* Brand subtitle in hero — gold small caps */
.brand-subtitle {
    font-family: var(--wp--preset--font-family--body);
    font-size: var(--wp--preset--font-size--small);
    font-weight: 400;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--wp--preset--color--gold);
}

/* Hero split: gold divider between panels */
.hero-divider {
    border-left: 4px solid var(--wp--preset--color--gold);
}

/* Cover block used as hero: ensure full-bleed and viewport height */
.wp-block-cover.hero-cover {
    min-height: 100vh;
}

.wp-block-cover.hero-cover .wp-block-cover__inner-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 12vh;
}

/* ==========================================================================
   Card / surface treatments
   ========================================================================== */

/* Service cards, project cards — subtle hover lift */
.wp-block-group.is-style-card,
.wp-block-column.is-style-card {
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.wp-block-group.is-style-card:hover,
.wp-block-column.is-style-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(10, 10, 10, 0.25);
}

/* Gold top-border accent on cards */
.wp-block-group.has-gold-border-top {
    border-top: 3px solid var(--wp--preset--color--gold);
}

/* ==========================================================================
   Cobalt section surface
   ========================================================================== */

.has-cobalt-background-color a:not(.wp-block-button__link) {
    color: var(--wp--preset--color--gold);
}

.has-cobalt-background-color a:not(.wp-block-button__link):hover {
    color: var(--wp--preset--color--off-white);
}

/* ==========================================================================
   Details / accordion block
   ========================================================================== */

.wp-block-details {
    border-bottom: 1px solid var(--wp--preset--color--surface);
    padding: var(--wp--preset--spacing--30) 0;
}

.wp-block-details summary {
    font-family: var(--wp--preset--font-family--body);
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wp-block-details summary::-webkit-details-marker {
    display: none;
}

.wp-block-details summary::after {
    content: '+';
    font-size: var(--wp--preset--font-size--large);
    color: var(--wp--preset--color--gold);
    transition: transform 0.3s ease;
}

.wp-block-details[open] summary::after {
    content: '−';
}

/* ==========================================================================
   Table block
   ========================================================================== */

.wp-block-table table {
    border-collapse: collapse;
}

.wp-block-table td,
.wp-block-table th {
    border-color: var(--wp--preset--color--surface);
    padding: var(--wp--preset--spacing--30);
}

.wp-block-table thead {
    border-bottom: 2px solid var(--wp--preset--color--gold);
}

.wp-block-table thead th {
    font-family: var(--wp--preset--font-family--body);
    font-size: var(--wp--preset--font-size--small);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

/* ==========================================================================
   Selection color
   ========================================================================== */

::selection {
    background-color: var(--wp--preset--color--gold);
    color: var(--wp--preset--color--black);
}

::-moz-selection {
    background-color: var(--wp--preset--color--gold);
    color: var(--wp--preset--color--black);
}

/* ==========================================================================
   Focus styles — visible accessibility ring
   ========================================================================== */

:focus-visible {
    outline: 2px solid var(--wp--preset--color--gold);
    outline-offset: 3px;
}

.wp-block-button__link:focus-visible {
    outline-offset: 4px;
}

/* ==========================================================================
   Scrollbar (webkit + firefox)
   ========================================================================== */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--wp--preset--color--black);
}

::-webkit-scrollbar-thumb {
    background: var(--wp--preset--color--surface);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--wp--preset--color--cobalt);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--wp--preset--color--surface) var(--wp--preset--color--black);
}

/* ==========================================================================
   Invert-on-scroll header variant (uses palette tokens, safe for style.css)
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
    .wp-site-blocks > header.wp-block-template-part > .wp-block-group {
        transition: color 0.3s ease;
    }
}

/* ==========================================================================
   Media-text block polish
   ========================================================================== */

.wp-block-media-text {
    gap: var(--wp--preset--spacing--50);
}

.wp-block-media-text .wp-block-media-text__media img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   Site title — wordmark refinement
   ========================================================================== */

.wp-block-site-title a {
    text-decoration: none;
    transition: color 0.3s ease;
}

/* ==========================================================================
   Post / page meta
   ========================================================================== */

.wp-block-post-date,
.wp-block-post-terms {
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--preset--color--warm-gray);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.wp-block-post-terms a {
    color: var(--wp--preset--color--gold);
    text-decoration: none;
}

.wp-block-post-terms a:hover {
    color: var(--wp--preset--color--off-white);
}

/* ==========================================================================
   Footer refinements
   ========================================================================== */

footer.wp-block-template-part a {
    transition: color 0.3s ease;
}

/* ==========================================================================
   Loop layout utilities
   ========================================================================== */

/* Horizontal scrollable rail */
.wp-block-query.is-style-loop-rail .wp-block-post-template {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    padding-bottom: var(--wp--preset--spacing--20);
}

.wp-block-query.is-style-loop-rail .wp-block-post-template > * {
    flex: 0 0 320px;
    scroll-snap-align: start;
}

/* Compact list with hairline row dividers */
.wp-block-query.is-style-loop-list .wp-block-post-template > * {
    border-bottom: 1px solid var(--wp--preset--color--surface);
    padding-block: var(--wp--preset--spacing--30);
}

.wp-block-query.is-style-loop-list .wp-block-post-template > *:last-child {
    border-bottom: 0;
}

/* Zigzag — flip columns inside every even entry */
.wp-block-query.is-style-loop-zigzag .wp-block-post-template > *:nth-child(even) .wp-block-columns {
    flex-direction: row-reverse;
}

/* Timeline — vertical line with node markers per entry */
.wp-block-query.is-style-loop-timeline .wp-block-post-template {
    position: relative;
    padding-inline-start: 2.5rem;
}

.wp-block-query.is-style-loop-timeline .wp-block-post-template::before {
    content: '';
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0.5rem;
    width: 2px;
    background: var(--wp--preset--color--gold);
    opacity: 0.15;
}

.wp-block-query.is-style-loop-timeline .wp-block-post-template > * {
    position: relative;
}

.wp-block-query.is-style-loop-timeline .wp-block-post-template > *::before {
    content: '';
    position: absolute;
    inset-inline-start: -2.25rem;
    inset-block-start: 0.6rem;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--wp--preset--color--gold);
    border-radius: 50%;
    background: var(--wp--preset--color--black);
}

/* Magazine — first child spans 2 columns of the grid */
.wp-block-query.is-style-loop-magazine .wp-block-post-template > *:first-child {
    grid-column: span 2;
}

@media (max-width: 600px) {
    .wp-block-query.is-style-loop-magazine .wp-block-post-template > *:first-child {
        grid-column: auto;
    }
}

/* ==========================================================================
   Responsive adjustments
   ========================================================================== */

@media (max-width: 781px) {
    /* Tighter hero composition on tablet / mobile */
    .wp-block-cover.hero-cover .wp-block-cover__inner-container {
        padding-bottom: 8vh;
    }

    /* Stack media-text cleanly */
    .wp-block-media-text {
        gap: var(--wp--preset--spacing--30);
    }

    /* Reduce gallery gap */
    .wp-block-gallery {
        gap: var(--wp--preset--spacing--10);
    }
}

@media (max-width: 600px) {
    /* Paragraphs can fill mobile width */
    p {
        max-width: none;
    }
}