/* =========================================================
   VILLORA
   Global Design System

   File:
   assets/css/global.css

   Purpose:
   - Design tokens
   - Reset
   - Typography
   - Layout primitives
   - Buttons
   - Forms
   - Global accessibility
   - Reusable utilities
========================================================= */


/* =========================================================
   01. DESIGN TOKENS
========================================================= */

:root {

    /* -----------------------------------------------------
       FONT FAMILY
       -----------------------------------------------------
       Imported from index.html:

       Manrope
       Cormorant Garamond

       Kalau nanti mau ganti font:
       cukup ubah variables di bawah.
    ----------------------------------------------------- */

    --font-primary: "Manrope", Arial, Helvetica, sans-serif;
    --font-accent: "Cormorant Garamond", Georgia, "Times New Roman", serif;

    --font-body: var(--font-primary);
    --font-heading: var(--font-primary);


    /* -----------------------------------------------------
       FONT WEIGHT
    ----------------------------------------------------- */

    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;


    /* -----------------------------------------------------
       COLORS
    ----------------------------------------------------- */

    --color-black: #0b0d0f;
    --color-black-soft: #121518;

    --color-navy: #101820;
    --color-navy-light: #1a242d;

    --color-gold: #b59a5a;
    --color-gold-light: #d2c08c;
    --color-gold-dark: #8f7845;

    --color-ivory: #f4f1ea;
    --color-ivory-dark: #e9e4da;

    --color-white: #fafaf8;
    --color-pure-white: #ffffff;

    --color-text: #141414;
    --color-text-soft: #474747;
    --color-muted: #747474;

    --color-border: rgba(20, 20, 20, 0.14);
    --color-border-light: rgba(255, 255, 255, 0.18);

    --color-overlay: rgba(4, 7, 10, 0.48);
    --color-overlay-strong: rgba(4, 7, 10, 0.68);

    --color-success: #2f6d4f;
    --color-danger: #a34343;


    /* -----------------------------------------------------
       BACKGROUNDS
    ----------------------------------------------------- */

    --background-body: var(--color-white);
    --background-dark: var(--color-navy);
    --background-soft: var(--color-ivory);


    /* -----------------------------------------------------
       TYPOGRAPHY SIZE
       Fluid where appropriate.
    ----------------------------------------------------- */

    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-md: 1.0625rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;

    --heading-xs: clamp(1.5rem, 2vw, 2rem);
    --heading-sm: clamp(2rem, 3vw, 3rem);
    --heading-md: clamp(2.5rem, 5vw, 4.75rem);
    --heading-lg: clamp(3.25rem, 7vw, 7rem);
    --heading-xl: clamp(4rem, 9vw, 9rem);


    /* -----------------------------------------------------
       LINE HEIGHT
    ----------------------------------------------------- */

    --line-tight: 1;
    --line-heading: 1.06;
    --line-title: 1.12;
    --line-body: 1.75;
    --line-relaxed: 1.9;


    /* -----------------------------------------------------
       LETTER SPACING
    ----------------------------------------------------- */

    --tracking-tight: -0.04em;
    --tracking-heading: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.08em;
    --tracking-eyebrow: 0.18em;


    /* -----------------------------------------------------
       LAYOUT
    ----------------------------------------------------- */

    --container-width: 1380px;
    --container-wide: 1560px;

    --container-padding: clamp(1.25rem, 4vw, 4.5rem);

    --section-space: clamp(6rem, 10vw, 10rem);
    --section-space-small: clamp(4rem, 7vw, 7rem);


    /* -----------------------------------------------------
       SPACING SCALE
    ----------------------------------------------------- */

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;


    /* -----------------------------------------------------
       BORDER RADIUS
    ----------------------------------------------------- */

    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-xl: 32px;
    --radius-pill: 999px;


    /* -----------------------------------------------------
       SHADOW
    ----------------------------------------------------- */

    --shadow-soft:
        0 14px 40px rgba(11, 13, 15, 0.08);

    --shadow-medium:
        0 24px 70px rgba(11, 13, 15, 0.13);

    --shadow-dark:
        0 30px 80px rgba(0, 0, 0, 0.24);


    /* -----------------------------------------------------
       MOTION
    ----------------------------------------------------- */

    --duration-fast: 180ms;
    --duration-normal: 350ms;
    --duration-slow: 700ms;
    --duration-luxury: 1100ms;

    --ease-default: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-luxury: cubic-bezier(0.16, 1, 0.3, 1);


    /* -----------------------------------------------------
       Z INDEX
    ----------------------------------------------------- */

    --z-base: 1;
    --z-content: 10;
    --z-header: 100;
    --z-sticky: 200;
    --z-overlay: 500;
    --z-modal: 1000;
}


/* =========================================================
   02. RESET
========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;

    scroll-behavior: smooth;

    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;

    scroll-padding-top: 100px;
}

body {
    margin: 0;
    padding: 0;

    min-width: 320px;
    min-height: 100vh;

    background: var(--background-body);

    color: var(--color-text);

    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-weight-regular);

    line-height: var(--line-body);

    text-rendering: optimizeLegibility;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    overflow-x: clip;
}

main {
    display: block;
}

article,
aside,
footer,
header,
main,
nav,
section {
    display: block;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
    margin: 0;
}

ul,
ol {
    margin: 0;
    padding: 0;
}

ul,
ol {
    list-style: none;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

button,
input,
textarea,
select {
    margin: 0;

    color: inherit;

    font: inherit;
}

button {
    border: 0;

    background: none;

    cursor: pointer;
}

textarea {
    resize: vertical;
}

a {
    color: inherit;
    text-decoration: none;
}

address {
    font-style: normal;
}

fieldset {
    margin: 0;
    padding: 0;

    border: 0;
}

legend {
    padding: 0;
}

dialog {
    margin: auto;
    padding: 0;

    border: 0;
}

[hidden] {
    display: none !important;
}


/* =========================================================
   03. SELECTION
========================================================= */

::selection {
    background: var(--color-gold);
    color: var(--color-black);
}


/* =========================================================
   04. SCROLLBAR
========================================================= */

html {
    scrollbar-width: thin;
    scrollbar-color:
        var(--color-gold)
        var(--color-black);
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-black);
}

::-webkit-scrollbar-thumb {
    border: 2px solid var(--color-black);
    border-radius: var(--radius-pill);

    background: var(--color-gold);
}


/* =========================================================
   05. GLOBAL LAYOUT
========================================================= */

.container {
    width: 100%;
    max-width: var(--container-width);

    margin-inline: auto;
    padding-inline: var(--container-padding);
}

.container--wide {
    max-width: var(--container-wide);
}

.section {
    position: relative;

    padding-block: var(--section-space);
}

.section--small {
    padding-block: var(--section-space-small);
}


/* =========================================================
   06. TYPOGRAPHY
========================================================= */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: inherit;

    font-family: var(--font-heading);
    font-weight: var(--font-weight-medium);

    letter-spacing: var(--tracking-heading);

    line-height: var(--line-heading);
}

p {
    text-wrap: pretty;
}


/* ---------------------------------------------------------
   Accent Serif
--------------------------------------------------------- */

.font-accent {
    font-family: var(--font-accent);
    font-style: italic;
    font-weight: var(--font-weight-medium);

    letter-spacing: -0.02em;
}


/* ---------------------------------------------------------
   Section Eyebrow
--------------------------------------------------------- */

.section-eyebrow {
    display: inline-flex;
    align-items: center;

    gap: var(--space-3);

    color: var(--color-gold-dark);

    font-family: var(--font-primary);
    font-size: var(--text-xs);
    font-weight: var(--font-weight-semibold);

    line-height: 1.4;

    letter-spacing: var(--tracking-eyebrow);

    text-transform: uppercase;
}

.section-eyebrow::before {
    content: "";

    display: block;

    width: 28px;
    height: 1px;

    background: currentColor;
}


/* ---------------------------------------------------------
   Section Title
--------------------------------------------------------- */

.section-title {
    max-width: 900px;

    margin-top: var(--space-6);

    font-size: var(--heading-md);
    font-weight: var(--font-weight-medium);

    letter-spacing: var(--tracking-tight);

    line-height: var(--line-title);

    text-wrap: balance;
}

.section-title--large {
    font-size: var(--heading-lg);
}


/* ---------------------------------------------------------
   Section Description
--------------------------------------------------------- */

.section-description {
    max-width: 640px;

    color: var(--color-text-soft);

    font-size: var(--text-md);

    line-height: var(--line-body);

    text-align: justify;
    text-align-last: left;

    text-wrap: pretty;
}


/* =========================================================
   07. SECTION HEADER
========================================================= */

.section-header {
    display: flex;
    flex-direction: column;

    gap: var(--space-8);

    margin-bottom: clamp(3rem, 6vw, 6rem);
}

.section-header--split {
    display: grid;

    grid-template-columns:
        minmax(0, 1.4fr)
        minmax(280px, 0.6fr);

    gap: clamp(2rem, 6vw, 7rem);

    align-items: end;
}

.section-header--split .section-description {
    justify-self: end;
}

.section-header--center {
    align-items: center;

    text-align: center;
}

.section-header--center .section-title,
.section-header--center .section-description {
    margin-inline: auto;

    text-align: center;
}


/* =========================================================
   08. BUTTON SYSTEM
========================================================= */

.button {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: var(--space-3);

    min-height: 54px;

    padding: 0.95rem 1.6rem;

    border: 1px solid transparent;
    border-radius: var(--radius-pill);

    font-family: var(--font-primary);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);

    line-height: 1;

    letter-spacing: 0.01em;

    white-space: nowrap;

    cursor: pointer;

    transition:
        color var(--duration-normal) var(--ease-default),
        background-color var(--duration-normal) var(--ease-default),
        border-color var(--duration-normal) var(--ease-default),
        transform var(--duration-normal) var(--ease-default),
        box-shadow var(--duration-normal) var(--ease-default);
}

.button:hover {
    transform: translateY(-2px);
}

.button:active {
    transform: translateY(0);
}


/* ---------------------------------------------------------
   Primary
--------------------------------------------------------- */

.button--primary {
    background: var(--color-gold);

    color: var(--color-black);

    border-color: var(--color-gold);
}

.button--primary:hover {
    background: var(--color-gold-light);

    border-color: var(--color-gold-light);

    box-shadow:
        0 12px 35px rgba(181, 154, 90, 0.24);
}


/* ---------------------------------------------------------
   Dark
--------------------------------------------------------- */

.button--dark {
    background: var(--color-black);

    color: var(--color-white);

    border-color: var(--color-black);
}

.button--dark:hover {
    background: var(--color-navy-light);

    border-color: var(--color-navy-light);
}


/* ---------------------------------------------------------
   Ghost
--------------------------------------------------------- */

.button--ghost {
    background: transparent;

    color: var(--color-white);

    border-color: rgba(255, 255, 255, 0.42);
}

.button--ghost:hover {
    background: rgba(255, 255, 255, 0.1);

    border-color: rgba(255, 255, 255, 0.72);
}


/* ---------------------------------------------------------
   Icon
--------------------------------------------------------- */

.button__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    transition:
        transform var(--duration-normal)
        var(--ease-default);
}

.button:hover .button__icon {
    transform: translate(3px, -3px);
}


/* =========================================================
   09. TEXT LINK
========================================================= */

.text-link {
    position: relative;

    display: inline-flex;
    align-items: center;

    gap: var(--space-3);

    width: fit-content;

    color: var(--color-text);

    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);

    line-height: 1.4;
}

.text-link::after {
    content: "";

    position: absolute;

    right: 0;
    bottom: -6px;
    left: 0;

    height: 1px;

    background: currentColor;

    transform: scaleX(1);
    transform-origin: right center;

    transition:
        transform var(--duration-normal)
        var(--ease-luxury);
}

.text-link:hover::after {
    transform: scaleX(0);
}

.text-link > span {
    transition:
        transform var(--duration-normal)
        var(--ease-default);
}

.text-link:hover > span {
    transform: translate(3px, -3px);
}


/* =========================================================
   10. FORM SYSTEM
========================================================= */

.form-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: var(--space-5);
}

.form-field {
    display: flex;
    flex-direction: column;

    gap: var(--space-3);
}

.form-field label,
.booking-form__legend {
    color: var(--color-text);

    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);

    line-height: 1.4;
}

.form-field label span {
    color: var(--color-gold-dark);
}


/* ---------------------------------------------------------
   Inputs
--------------------------------------------------------- */

.form-field input,
.form-field select,
.form-field textarea,
.hero-search__input {
    width: 100%;

    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);

    outline: none;

    background: transparent;

    color: var(--color-text);

    transition:
        border-color var(--duration-fast) ease,
        box-shadow var(--duration-fast) ease,
        background-color var(--duration-fast) ease;
}

.form-field input,
.form-field select {
    min-height: 56px;

    padding: 0 1rem;
}

.form-field textarea {
    min-height: 140px;

    padding: 1rem;
}


/* ---------------------------------------------------------
   Placeholder
--------------------------------------------------------- */

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: var(--color-muted);

    opacity: 0.72;
}


/* ---------------------------------------------------------
   Focus
--------------------------------------------------------- */

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.hero-search__input:focus {
    border-color: var(--color-gold);

    box-shadow:
        0 0 0 3px rgba(181, 154, 90, 0.12);
}


/* ---------------------------------------------------------
   Invalid
--------------------------------------------------------- */

.form-field input.is-invalid,
.form-field select.is-invalid,
.form-field textarea.is-invalid {
    border-color: var(--color-danger);

    box-shadow:
        0 0 0 3px rgba(163, 67, 67, 0.1);
}


/* ---------------------------------------------------------
   Hint
--------------------------------------------------------- */

.form-field__hint {
    min-height: 1.3em;

    color: var(--color-muted);

    font-size: var(--text-xs);

    line-height: 1.5;
}


/* ---------------------------------------------------------
   Select
--------------------------------------------------------- */

.form-field select {
    appearance: none;
    -webkit-appearance: none;

    padding-right: 3rem;

    background-image:
        linear-gradient(
            45deg,
            transparent 50%,
            currentColor 50%
        ),
        linear-gradient(
            135deg,
            currentColor 50%,
            transparent 50%
        );

    background-position:
        calc(100% - 20px) 50%,
        calc(100% - 15px) 50%;

    background-size:
        5px 5px,
        5px 5px;

    background-repeat: no-repeat;
}


/* =========================================================
   11. FORM STATES
========================================================= */

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;

    opacity: 0.55;
}

.booking-form__message:empty {
    display: none;
}

.booking-form__message {
    margin-top: var(--space-4);

    font-size: var(--text-sm);

    line-height: 1.6;
}

.booking-form__message.is-success {
    color: var(--color-success);
}

.booking-form__message.is-error {
    color: var(--color-danger);
}


/* =========================================================
   12. HONEYPOT
========================================================= */

.form-honeypot {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;

    margin: -1px !important;
    padding: 0 !important;

    overflow: hidden !important;

    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;

    white-space: nowrap !important;

    border: 0 !important;
}


/* =========================================================
   13. DIALOG BASE
========================================================= */

dialog {
    width: min(
        calc(100% - 2rem),
        1200px
    );

    max-height: calc(100dvh - 2rem);

    overflow: auto;

    border-radius: var(--radius-lg);

    background: var(--color-white);

    color: var(--color-text);

    box-shadow: var(--shadow-dark);
}

dialog::backdrop {
    background: rgba(4, 6, 8, 0.78);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.dialog-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.08);

    color: inherit;

    font-size: 1.6rem;

    line-height: 1;

    transition:
        background-color var(--duration-normal)
        var(--ease-default),
        transform var(--duration-normal)
        var(--ease-default);
}

.dialog-close:hover {
    transform: rotate(6deg);

    background: rgba(255, 255, 255, 0.15);
}


/* =========================================================
   14. ACCESSIBILITY
========================================================= */

:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 4px;
}

.skip-link {
    position: fixed;

    top: 1rem;
    left: 1rem;

    z-index: calc(var(--z-modal) + 100);

    padding: 0.75rem 1rem;

    border-radius: var(--radius-sm);

    background: var(--color-gold);

    color: var(--color-black);

    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);

    transform: translateY(-200%);

    transition:
        transform var(--duration-normal)
        var(--ease-default);
}

.skip-link:focus {
    transform: translateY(0);
}


/* =========================================================
   15. GLOBAL MEDIA
========================================================= */

.media-cover {
    position: relative;

    overflow: hidden;
}

.media-cover img,
.media-cover video {
    width: 100%;
    height: 100%;

    object-fit: cover;
}


/* =========================================================
   16. GLOBAL UTILITIES
========================================================= */

.is-hidden {
    display: none !important;
}

.is-invisible {
    visibility: hidden !important;
}

.no-scroll {
    overflow: hidden !important;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-justify {
    text-align: justify;
    text-align-last: left;
}

.full-width {
    width: 100%;
}

.sr-only {
    position: absolute;

    width: 1px;
    height: 1px;

    margin: -1px;
    padding: 0;

    overflow: hidden;

    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);

    white-space: nowrap;

    border: 0;
}


/* =========================================================
   17. LOADING STATES
========================================================= */

.is-loading {
    pointer-events: none;

    cursor: wait;
}

.button.is-loading {
    opacity: 0.72;
}


/* =========================================================
   18. REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;

        scroll-behavior: auto !important;

        transition-duration: 0.01ms !important;
    }

}