/*
 * GoToPlace Design System 1.0.1
 * Scope: body.gtp-design-system
 * Safety: no layout rewriting, no iframe styling, no content/SEO changes.
 */

body.gtp-design-system {
    --gtp-bg: #f6f8fb;
    --gtp-surface: #ffffff;
    --gtp-surface-soft: #f8fafc;
    --gtp-text: #172033;
    --gtp-text-secondary: #5f6b7c;
    --gtp-text-muted: #8b95a5;
    --gtp-brand: #2563eb;
    --gtp-brand-hover: #1d4ed8;
    --gtp-brand-active: #1e40af;
    --gtp-brand-soft: #eff6ff;
    --gtp-accent: #0f9fa3;
    --gtp-border: #e4e9f0;
    --gtp-border-strong: #cfd7e3;
    --gtp-success: #16803c;
    --gtp-warning: #b76e00;
    --gtp-danger: #c93636;
    --gtp-radius-sm: 8px;
    --gtp-radius-md: 12px;
    --gtp-radius-lg: 16px;
    --gtp-radius-xl: 22px;
    --gtp-shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
    --gtp-shadow-sm: 0 4px 14px rgba(16, 24, 40, 0.06);
    --gtp-shadow-md: 0 12px 30px rgba(16, 24, 40, 0.09);
    --gtp-focus: 0 0 0 3px rgba(37, 99, 235, 0.17);
    --gtp-content-width: 1240px;
    --gtp-reading-width: 780px;

    background: var(--gtp-bg);
    color: var(--gtp-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body.gtp-design-system *,
body.gtp-design-system *::before,
body.gtp-design-system *::after {
    box-sizing: border-box;
}

body.gtp-design-system ::selection {
    background: rgba(37, 99, 235, 0.18);
    color: var(--gtp-text);
}

/* Never alter embedded partner documents. */
body.gtp-design-system iframe {
    max-width: 100%;
}

/* Links */
body.gtp-design-system a {
    color: var(--gtp-brand);
    text-underline-offset: 0.16em;
    text-decoration-thickness: 1px;
    transition: color .16s ease, opacity .16s ease;
}

body.gtp-design-system a:hover {
    color: var(--gtp-brand-hover);
}

body.gtp-design-system a:focus-visible,
body.gtp-design-system button:focus-visible,
body.gtp-design-system input:focus-visible,
body.gtp-design-system select:focus-visible,
body.gtp-design-system textarea:focus-visible,
body.gtp-design-system [tabindex]:focus-visible {
    outline: 2px solid var(--gtp-brand);
    outline-offset: 2px;
}

/* Header / navigation: appearance only, no positional rewrite. */
body.gtp-design-system :where(.site-header, #masthead, header.header) {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--gtp-border);
    box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
}

body.gtp-design-system :where(.site-header, #masthead, header.header) a {
    color: var(--gtp-text);
    font-weight: 600;
    text-decoration: none;
}

body.gtp-design-system :where(.site-header, #masthead, header.header) a:hover,
body.gtp-design-system :where(.site-header, #masthead, header.header) .current-menu-item > a,
body.gtp-design-system :where(.site-header, #masthead, header.header) .current-menu-ancestor > a {
    color: var(--gtp-brand);
}

/* Main page surface */
body.gtp-design-system :where(.site-content, #content, main.site-main) {
    color: var(--gtp-text);
}

/* Typography */
body.gtp-design-system :where(main, .entry-content, .page-content) h1,
body.gtp-design-system :where(main, .entry-content, .page-content) h2,
body.gtp-design-system :where(main, .entry-content, .page-content) h3,
body.gtp-design-system :where(main, .entry-content, .page-content) h4 {
    color: var(--gtp-text);
    font-weight: 750;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

body.gtp-design-system :where(main, .entry-content, .page-content) h1 {
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    line-height: 1.12;
    margin-top: 0;
    margin-bottom: .65em;
}

body.gtp-design-system :where(main, .entry-content, .page-content) h2 {
    font-size: clamp(1.55rem, 2.5vw, 2rem);
    line-height: 1.2;
    margin-top: 1.65em;
    margin-bottom: .7em;
}

body.gtp-design-system :where(main, .entry-content, .page-content) h3 {
    font-size: clamp(1.2rem, 2vw, 1.42rem);
    line-height: 1.28;
    margin-top: 1.4em;
    margin-bottom: .6em;
}

body.gtp-design-system :where(main, .entry-content, .page-content) h4 {
    font-size: 1.075rem;
    line-height: 1.35;
}

body.gtp-design-system :where(.entry-content, .page-content) p,
body.gtp-design-system :where(.entry-content, .page-content) li {
    color: var(--gtp-text-secondary);
}

body.gtp-design-system :where(.entry-content, .page-content) strong {
    color: var(--gtp-text);
}

body.gtp-design-system :where(.entry-content, .page-content) hr {
    border: 0;
    border-top: 1px solid var(--gtp-border);
    margin: 2rem 0;
}

/* Breadcrumbs */
body.gtp-design-system :where(.breadcrumbs, .breadcrumb, .yoast-breadcrumb) {
    color: var(--gtp-text-muted);
    font-size: .875rem;
    line-height: 1.45;
}

body.gtp-design-system :where(.breadcrumbs, .breadcrumb, .yoast-breadcrumb) a {
    color: var(--gtp-text-secondary);
    text-decoration: none;
}

body.gtp-design-system :where(.breadcrumbs, .breadcrumb, .yoast-breadcrumb) a:hover {
    color: var(--gtp-brand);
}

/* Forms: visual polish without fixed widths or display changes. */
body.gtp-design-system :where(input, select, textarea) {
    font: inherit;
}

body.gtp-design-system :where(
    input[type="text"],
    input[type="search"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    select,
    textarea
) {
    color: var(--gtp-text);
    background-color: var(--gtp-surface);
    border-color: var(--gtp-border-strong);
    border-radius: var(--gtp-radius-md);
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

body.gtp-design-system :where(
    input[type="text"],
    input[type="search"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    select,
    textarea
):hover {
    border-color: #b8c3d2;
}

body.gtp-design-system :where(
    input[type="text"],
    input[type="search"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    select,
    textarea
):focus {
    border-color: var(--gtp-brand);
    box-shadow: var(--gtp-focus);
}

body.gtp-design-system input::placeholder,
body.gtp-design-system textarea::placeholder {
    color: var(--gtp-text-muted);
    opacity: 1;
}

/* Buttons: custom plugin buttons keep their geometry and behaviour. */
body.gtp-design-system :where(button, input[type="button"], input[type="submit"], input[type="reset"]) {
    font-family: inherit;
}

body.gtp-design-system :where(button, input[type="button"], input[type="submit"]):disabled {
    cursor: not-allowed;
    opacity: .55;
}

/* WordPress editorial CTA buttons only. */
body.gtp-design-system :where(.wp-block-button__link, .wp-element-button) {
    border-radius: var(--gtp-radius-md);
    font-family: inherit;
    font-weight: 650;
    text-decoration: none;
    transition: box-shadow .14s ease, border-color .14s ease, background-color .14s ease, color .14s ease;
    background: var(--gtp-brand);
    color: #fff;
    border: 1px solid var(--gtp-brand);
    box-shadow: var(--gtp-shadow-xs);
}

body.gtp-design-system :where(.wp-block-button__link, .wp-element-button):hover {
    background: var(--gtp-brand-hover);
    color: #fff;
    box-shadow: var(--gtp-shadow-sm);
}

/* Cards and content boxes: style only known generic card patterns. */
body.gtp-design-system :where(.card, .post-card, .entry-card, .article-card) {
    background: var(--gtp-surface);
    border-color: var(--gtp-border);
    border-radius: var(--gtp-radius-lg);
    box-shadow: var(--gtp-shadow-xs);
    transition: box-shadow .18s ease, border-color .18s ease;
}

body.gtp-design-system :where(.card, .post-card, .entry-card, .article-card):hover {
    border-color: #d7dee8;
    box-shadow: var(--gtp-shadow-sm);
}

/* Media in editorial content only; no changes to widget media. */
body.gtp-design-system :where(.entry-content, .page-content) img:not(.avatar):not(.emoji) {
    height: auto;
    max-width: 100%;
}

body.gtp-design-system :where(.entry-content, .page-content) figure img {
    border-radius: var(--gtp-radius-lg);
}

body.gtp-design-system :where(.entry-content, .page-content) figcaption {
    color: var(--gtp-text-muted);
    font-size: .875rem;
    line-height: 1.5;
}

/* Quotes / notices */
body.gtp-design-system :where(.entry-content, .page-content) blockquote {
    margin-left: 0;
    margin-right: 0;
    padding: 1rem 1.15rem;
    color: var(--gtp-text-secondary);
    background: var(--gtp-brand-soft);
    border-left: 4px solid var(--gtp-brand);
    border-radius: 0 var(--gtp-radius-md) var(--gtp-radius-md) 0;
}

/* Tables */
body.gtp-design-system :where(.entry-content, .page-content) table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--gtp-surface);
    border: 1px solid var(--gtp-border);
    border-radius: var(--gtp-radius-lg);
    overflow: hidden;
}

body.gtp-design-system :where(.entry-content, .page-content) th,
body.gtp-design-system :where(.entry-content, .page-content) td {
    border-color: var(--gtp-border);
    padding: .8rem .9rem;
    vertical-align: top;
}

body.gtp-design-system :where(.entry-content, .page-content) th {
    color: var(--gtp-text);
    background: var(--gtp-surface-soft);
    font-weight: 700;
}

/* Pagination */
body.gtp-design-system :where(.pagination, .nav-links, .page-numbers) {
    font-variant-numeric: tabular-nums;
}

body.gtp-design-system :where(.pagination, .nav-links) .page-numbers {
    border-radius: var(--gtp-radius-sm);
    text-decoration: none;
}

body.gtp-design-system :where(.pagination, .nav-links) .page-numbers.current {
    color: #fff;
    background: var(--gtp-brand);
}

/* Search/autocomplete surfaces: appearance only; no visibility, z-index, dimensions or positioning. */
body.gtp-design-system :where(
    [role="listbox"],
    .autocomplete-suggestions,
    .ui-autocomplete,
    .suggestions,
    .search-suggestions
) {
    color: var(--gtp-text);
    background: var(--gtp-surface);
    border-color: var(--gtp-border);
    border-radius: var(--gtp-radius-md);
    box-shadow: var(--gtp-shadow-md);
}

body.gtp-design-system :where(
    [role="option"],
    .autocomplete-suggestion,
    .ui-menu-item
):hover {
    background: var(--gtp-brand-soft);
}

/* Footer */
body.gtp-design-system :where(.site-footer, #colophon, footer.footer) {
    color: var(--gtp-text-secondary);
    background: #fff;
    border-top: 1px solid var(--gtp-border);
}

body.gtp-design-system :where(.site-footer, #colophon, footer.footer) a {
    color: var(--gtp-text-secondary);
    text-decoration: none;
}

body.gtp-design-system :where(.site-footer, #colophon, footer.footer) a:hover {
    color: var(--gtp-brand);
}

/* Gentle polish for common WP blocks. */
body.gtp-design-system :where(.wp-block-separator) {
    border-color: var(--gtp-border);
}

body.gtp-design-system :where(.wp-block-code, pre) {
    border-radius: var(--gtp-radius-md);
}

/* Mobile: typography only; no component geometry overrides. */
@media (max-width: 767px) {
    body.gtp-design-system {
        font-size: 15px;
        line-height: 1.62;
    }

    body.gtp-design-system :where(main, .entry-content, .page-content) h1 {
        font-size: clamp(1.85rem, 8vw, 2.2rem);
        line-height: 1.14;
    }

    body.gtp-design-system :where(main, .entry-content, .page-content) h2 {
        font-size: clamp(1.45rem, 6vw, 1.75rem);
    }

    body.gtp-design-system :where(.entry-content, .page-content) table {
        font-size: .93rem;
    }
}

/* Accessibility: honor user motion preferences. */
@media (prefers-reduced-motion: reduce) {
    body.gtp-design-system *,
    body.gtp-design-system *::before,
    body.gtp-design-system *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
