/* ============================================================
   TTP — BASE STYLES
   The Travel Place | base.css
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--duration-slow) var(--ease-in-out),
              color var(--duration-slow) var(--ease-in-out);
}

/* Prevent layout shift during page load */
body.is-loading {
  overflow: hidden;
}

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-snug);
  color: var(--color-text);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p {
  line-height: var(--leading-relaxed);
  color: var(--color-text-2);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

img, video, svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
  object-fit: cover;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: none;
  background: none;
}

/* ── Selection ───────────────────────────────────────────── */
::selection {
  background: var(--ttp-red);
  color: #fff;
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-2);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-muted);
}

/* ── Focus ───────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--ttp-red);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* ── Material Symbols ────────────────────────────────────── */
.material-symbols-outlined {
  font-variation-settings:
    'FILL' 0,
    'wght' 300,
    'GRAD' 0,
    'opsz' 24;
  vertical-align: middle;
  user-select: none;
  pointer-events: none;
  flex-shrink: 0;
}

.material-symbols-outlined.fill-1 {
  font-variation-settings:
    'FILL' 1,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
}

/* ── Utility: Screen Reader Only ─────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Utility: Visually Hidden Until Focus ─────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--ttp-red);
  color: #fff;
  padding: var(--space-3) var(--space-6);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-weight: var(--weight-semi);
  z-index: calc(var(--z-cursor) + 1);
  transition: top var(--duration-fast);
}

.skip-link:focus {
  top: 0;
}

/* ── Page Loader ─────────────────────────────────────────── */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--loader-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-6);
  z-index: 9999;
  transition: opacity var(--duration-slow) var(--ease-out-expo),
              visibility var(--duration-slow) var(--ease-out-expo);
}

#page-loader.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  animation: loaderPulse 1.4s var(--ease-in-out) infinite;
}

.loader-logo-mark {
  width: 48px;
  height: 48px;
  background: var(--ttp-red);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-logo-mark span {
  font-size: 22px;
  font-weight: var(--weight-extra);
  color: #fff;
  letter-spacing: -0.03em;
}

.loader-wordmark {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: #fff;
  letter-spacing: var(--tracking-snug);
}

.loader-bar {
  width: 180px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.loader-bar-fill {
  height: 100%;
  background: var(--ttp-red);
  border-radius: var(--radius-full);
  width: 0%;
  animation: loaderFill 1.6s var(--ease-out-expo) forwards;
}

@keyframes loaderPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes loaderFill {
  0%   { width: 0%; }
  60%  { width: 80%; }
  100% { width: 100%; }
}

/* ── Custom Cursor ───────────────────────────────────────── */
.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--ttp-red);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: var(--z-cursor);
  transform: translate(-50%, -50%);
  transition: transform var(--duration-fast) var(--ease-out-expo),
              width var(--duration-fast) var(--ease-out-expo),
              height var(--duration-fast) var(--ease-out-expo),
              background var(--duration-fast);
}

.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(208,2,27,0.5);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: var(--z-cursor);
  transform: translate(-50%, -50%);
  transition: transform 0.12s var(--ease-out-expo),
              width var(--duration-base) var(--ease-spring),
              height var(--duration-base) var(--ease-spring),
              border-color var(--duration-base);
}

.cursor-dot.is-hovering {
  width: 10px;
  height: 10px;
  background: var(--ttp-red);
}

.cursor-ring.is-hovering {
  width: 52px;
  height: 52px;
  border-color: rgba(208,2,27,0.35);
}

.cursor-dot.is-clicking {
  transform: translate(-50%, -50%) scale(0.7);
}

@media (hover: none) {
  .cursor-dot, .cursor-ring { display: none; }
}
