/**
 * Ticketa Theme — assets/css/base.css
 *
 * RESPONSIBILITY:
 *   CSS reset, RTL base rules, and global typography.
 *   No component-specific rules here — only global/inherited styles.
 *
 * RTL APPROACH:
 *   The entire site is RTL. We set `direction: rtl` on <html> and
 *   use CSS logical properties (margin-inline-start, padding-inline-end)
 *   where available for future-proof layout. Where logical properties
 *   are not yet universal, we use explicit RTL overrides.
 *
 * @package Ticketa
 * @since   1.0.0
 */

@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Secular+One&family=Barlow+Condensed:wght@600;700;800;900&display=swap');

/* ═══════════════════════════════════════════════════════════════════════════
   MODERN CSS RESET (opinionated)
   ═══════════════════════════════════════════════════════════════════════════ */

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

html {
    /* RTL-first — all Hebrew content */
    direction: rtl;
    lang: he;

    /* Smooth scrolling for anchor links */
    scroll-behavior: smooth;

    /* Prevent font size inflation on mobile */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;

    /* Base font size for rem calculations */
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--ticketa-white);
    background-color: var(--ticketa-bg);

    /* Prevent horizontal scroll */
    overflow-x: hidden;

    /* Smooth font rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Images never overflow their container */
img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Lists reset (navigation, cards, etc.) */
ul, ol {
    list-style: none;
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--ticketa-orange);
}

/* Focus styles — visible for keyboard nav, hidden for mouse */
:focus-visible {
    outline: 2px solid var(--ticketa-orange);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Button base reset */
button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
}

/* Input reset */
input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* SVG fills inherit color */
svg {
    fill: currentColor;
}

/* Horizontal rule */
hr {
    border: none;
    border-top: 1px solid var(--ticketa-border);
}

/* ═══════════════════════════════════════════════════════════════════════════
   GLOBAL LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

/**
 * .container
 *   Standard centred content wrapper.
 *   Used on all pages for consistent horizontal padding.
 */
.container {
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

/**
 * .container--narrow
 *   Narrower container for text-heavy content (about, contact).
 */
.container--narrow {
    max-width: 800px;
}

/**
 * .visually-hidden
 *   Accessible hide: invisible but readable by screen readers.
 *   Use instead of display:none for meaningful content.
 */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════════════ */

/**
 * Heading defaults.
 * All headings use --font-display (Hebrew serif/display).
 * Override per component as needed.
 */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--ticketa-white);
}

h1 { font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl)); }
h2 { font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl)); }
h3 { font-size: clamp(var(--text-xl),  3vw, var(--text-3xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

/**
 * .en-heading
 *   English uppercase headings (e.g., "WHAT'S ON").
 *   Uses condensed sans-serif for bold visual impact.
 */
.en-heading {
    font-family: var(--font-en-head);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    direction: ltr; /* English content always LTR */
}

/**
 * .text-muted
 *   Subdued secondary text colour.
 */
.text-muted { color: var(--ticketa-grey-muted); }

/**
 * .text-orange
 *   Highlighted text in brand orange.
 */
.text-orange { color: var(--ticketa-orange); }

/**
 * .text-gold
 *   VIP/premium content in gold.
 */
.text-gold { color: var(--ticketa-gold); }

/* Paragraph spacing */
p + p { margin-top: var(--space-4); }

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════════════════ */

/* Direction overrides */
.ltr { direction: ltr; text-align: left; }
.rtl { direction: rtl; text-align: right; }

/* Display */
.d-none    { display: none; }
.d-block   { display: block; }
.d-flex    { display: flex; }
.d-grid    { display: grid; }
.d-inline  { display: inline; }
.d-inline-block { display: inline-block; }

/* Text alignment */
.text-center { text-align: center; }
.text-start  { text-align: start; }  /* RTL-aware: right in RTL */
.text-end    { text-align: end; }    /* RTL-aware: left in RTL */

/* Overflow */
.overflow-hidden { overflow: hidden; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.sticky   { position: sticky; }

/* ═══════════════════════════════════════════════════════════════════════════
   SKIP LINK (Accessibility)
   ═══════════════════════════════════════════════════════════════════════════ */

.skip-to-content {
    position: absolute;
    inset-block-start: -999px;        /* Off-screen until focused */
    inset-inline-start: var(--space-4);
    z-index: var(--z-modal);
    background: var(--ticketa-orange);
    color: var(--ticketa-white);
    padding: var(--space-3) var(--space-6);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    font-weight: 700;
    text-decoration: none;
    transition: inset-block-start var(--transition-fast);
}

.skip-to-content:focus {
    inset-block-start: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SELECTION
   ═══════════════════════════════════════════════════════════════════════════ */

::selection {
    background: var(--ticketa-orange);
    color: var(--ticketa-white);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCROLLBAR (Webkit)
   ═══════════════════════════════════════════════════════════════════════════ */

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--ticketa-bg-panel); }
::-webkit-scrollbar-thumb {
    background: var(--ticketa-grey-mid);
    border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--ticketa-grey-muted);
}

/* Defensive page-edge padding: ensures content on standalone page templates
 * (login, personal-zone, terms, privacy, about, etc.) never sticks to the
 * viewport edges on small/medium screens, even if the inner component
 * forgets its own horizontal padding. */
.tk-page,
.personal-zone-page,
.ticketa-login-main {
    padding-inline: clamp(.75rem, 3vw, 1.5rem);
}
@media (min-width: 768px) {
    .tk-page,
    .personal-zone-page,
    .ticketa-login-main {
        padding-inline: clamp(1.25rem, 4vw, 2.5rem);
    }
}
