/* ============================================================
   BASE.CSS - Reset, Typography & Global Styles
   Sakshi's Secret Garden
   ============================================================ */

/* ---- Font Faces ---- */
@font-face {
  font-family: 'Quicksand';
  src: url('../fonts/Quicksand-Regular.woff2') format('woff2'),
       url('../fonts/Quicksand-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Quicksand';
  src: url('../fonts/Quicksand-Medium.woff2') format('woff2'),
       url('../fonts/Quicksand-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Quicksand';
  src: url('../fonts/Quicksand-SemiBold.woff2') format('woff2'),
       url('../fonts/Quicksand-SemiBold.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Quicksand';
  src: url('../fonts/Quicksand-Bold.woff2') format('woff2'),
       url('../fonts/Quicksand-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Caveat';
  src: url('../fonts/Caveat-Regular.woff2') format('woff2'),
       url('../fonts/Caveat-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Caveat';
  src: url('../fonts/Caveat-Bold.woff2') format('woff2'),
       url('../fonts/Caveat-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  height: 100%;
}

body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg);
  min-height: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-ui);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--text-3xl);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-2xl);
}

h3 {
  font-size: var(--text-xl);
}

h4 {
  font-size: var(--text-lg);
}

h5 {
  font-size: var(--text-md);
}

h6 {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

p {
  margin-bottom: var(--space-md);
  line-height: var(--leading-normal);
}

p:last-child {
  margin-bottom: 0;
}

small {
  font-size: var(--text-sm);
}

strong, b {
  font-weight: var(--weight-bold);
}

/* ---- Links ---- */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---- Selection ---- */
::selection {
  background-color: var(--accent-light);
  color: var(--text-primary);
}

::-moz-selection {
  background-color: var(--accent-light);
  color: var(--text-primary);
}

/* ---- Focus Styles ---- */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---- Images & Media ---- */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

/* ---- Form Elements Reset ---- */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

textarea {
  resize: vertical;
}

/* ---- Lists ---- */
ul, ol {
  list-style: none;
}

/* ---- Tables ---- */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ---- Misc ---- */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-lg) 0;
}

[hidden] {
  display: none !important;
}

/* ---- Scrollbar Styling ---- */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-light) transparent;
}

/* WebKit / Blink */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background-color: var(--accent-light);
  border-radius: 3px;
  transition: background-color var(--transition-fast);
}

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

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

/* Hide scrollbar on touch devices but keep scrolling */
@media (pointer: coarse) {
  ::-webkit-scrollbar {
    width: 3px;
    height: 3px;
  }
}

/* ---- Love / Handwriting Text ---- */
.love-text {
  font-family: var(--font-handwriting);
  font-size: var(--text-xl);
  color: var(--accent);
  line-height: var(--leading-normal);
}

.love-text-lg {
  font-family: var(--font-handwriting);
  font-size: var(--text-2xl);
  color: var(--accent);
}

.love-text-sm {
  font-family: var(--font-handwriting);
  font-size: var(--text-lg);
  color: var(--accent);
}

/* ---- 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-width: 0;
}

/* ---- Utility: Text Helpers ---- */
.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-accent {
  color: var(--accent);
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Print Styles ---- */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  a,
  a:visited {
    color: #000 !important;
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }

  p, h2, h3 {
    orphans: 3;
    widows: 3;
  }

  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  .app-header,
  .app-nav,
  .fab,
  .no-print {
    display: none !important;
  }

  .main-content {
    padding: 0 !important;
    margin: 0 !important;
  }
}
