/*
Theme Name: Real Pakistan
Theme URI: https://new.realpakistan.com.pk
Author: Real Pakistan
Author URI: https://new.realpakistan.com.pk
Description: Custom editorial travel-guide theme for Real Pakistan. Northern Trail design direction: pine green, warm cream and a burnt-amber accent, built for regional travel guides and food content.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: realpakistan
*/

/* -------------------------------------------------------------- */
/* 1. Design tokens (Northern Trail)                              */
/* -------------------------------------------------------------- */
:root {
  --color-bg: #F6F2E9;
  --color-surface: #FFFFFF;
  --color-ink: #20261F;
  --color-accent: #C1682B;
  --color-accent-ink: #FFFFFF;
  --color-pine: #1F4436;
  --color-pine-ink: #F6F2E9;
  --color-stone: #8C9186;
  --color-stone-light: #DAD5C6;
  --color-border: rgba(32, 38, 31, 0.12);

  --font-heading: 'Cabinet Grotesk', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'General Sans', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 32px;
  --space-xl: 64px;

  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --container-width: 1200px;
  --measure: 65ch;

  --shadow-card: 0 12px 30px -18px rgba(31, 68, 54, 0.35);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/*
  Brand fonts are not yet uploaded to the theme. Once the real Cabinet
  Grotesk / General Sans font files are provided, drop them in
  assets/fonts/ and uncomment the @font-face blocks below. Until then,
  the --font-heading / --font-body stacks fall back to solid system fonts.

@font-face {
  font-family: 'Cabinet Grotesk';
  src: url('assets/fonts/CabinetGrotesk-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('assets/fonts/GeneralSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
*/

/* -------------------------------------------------------------- */
/* 2. Reset                                                        */
/* -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
:where(html) { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
:where(body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol) { margin: 0; }
:where(ul, ol)[class] { list-style: none; padding: 0; }
:where(html) { font: inherit; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol, li, figure, blockquote, dl, dd {
  font: inherit;
}
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }
:where(blockquote, figure) { margin: 0; padding: 0; border: 0; }

@media (prefers-reduced-motion: reduce) {
  :where(html) { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* -------------------------------------------------------------- */
/* 3. Base typography                                              */
/* -------------------------------------------------------------- */
body {
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-ink);
}

h1, .h1 { font-size: clamp(2.25rem, 1.7rem + 2.2vw, 3.75rem); font-weight: 800; }
h2, .h2 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.75rem); }
h3, .h3 { font-size: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem); }
h4, .h4 { font-size: 1.125rem; }

p { max-width: var(--measure); }
p + p { margin-top: var(--space-md); }

a.link, .entry-content a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: rgba(193, 104, 43, 0.4);
  text-underline-offset: 0.15em;
}
a.link:hover, .entry-content a:hover { text-decoration-color: currentColor; }

.eyebrow, .label-upper {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-stone);
}

/* -------------------------------------------------------------- */
/* 4. Layout                                                       */
/* -------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

@media (min-width: 782px) {
  .container { padding-inline: var(--space-lg); }
}

.site-main { padding-block: var(--space-xl); }
.section { padding-block: var(--space-xl); }
.section--tight { padding-block: var(--space-lg); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-pine);
  color: var(--color-pine-ink);
  padding: var(--space-sm) var(--space-md);
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}
.screen-reader-text:focus {
  position: static;
  width: auto; height: auto;
  clip: auto;
  background: var(--color-surface);
  padding: var(--space-sm);
}

.archive-description { color: var(--color-stone); max-width: var(--measure); margin-top: var(--space-sm); }
.comments-title { margin-bottom: var(--space-md); }
.no-comments { color: var(--color-stone); }
.page-links { margin-top: var(--space-lg); font-weight: 600; }
.page-links a { color: var(--color-accent); margin-left: var(--space-sm); }
.entry-tags-plain { margin-top: var(--space-md); color: var(--color-stone); font-size: 0.9rem; }
.edit-link a { color: var(--color-accent); font-size: 0.85rem; }
.comment-author-line { display: flex; align-items: center; gap: var(--space-sm); }
.comment-author-line img { border-radius: var(--radius-pill); }
.comment-content > * + * { margin-top: var(--space-sm); }
.reply a { font-size: 0.85rem; font-weight: 600; color: var(--color-accent); }

/* -------------------------------------------------------------- */
/* 5. Site header / nav                                            */
/* -------------------------------------------------------------- */
.site-header {
  background: var(--color-pine);
  color: var(--color-pine-ink);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-block: var(--space-md);
}

.site-branding { display: flex; align-items: center; gap: var(--space-sm); }
.site-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.375rem;
  color: var(--color-pine-ink);
  letter-spacing: -0.01em;
}
.site-title a { color: inherit; }
.site-description { display: none; }

.main-navigation { display: none; }

@media (min-width: 900px) {
  .main-navigation { display: block; }
  .main-navigation ul {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
  }
  .main-navigation a {
    font-weight: 500;
    font-size: 0.95rem;
    padding-block: var(--space-sm);
    position: relative;
  }
  .main-navigation a::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 2px;
    background: var(--color-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s var(--ease);
  }
  .main-navigation a:hover::after,
  .main-navigation .current-menu-item a::after,
  .main-navigation .current_page_item a::after {
    transform: scaleX(1);
  }
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: transparent;
  border: 1px solid rgba(246, 242, 233, 0.35);
  color: var(--color-pine-ink);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
}
@media (min-width: 900px) { .menu-toggle { display: none; } }

.main-navigation.is-open { display: block; }
@media (max-width: 899px) {
  .main-navigation {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background: var(--color-pine);
    padding: var(--space-md);
  }
  .main-navigation ul { display: flex; flex-direction: column; gap: var(--space-sm); }
  .main-navigation a { display: block; padding: var(--space-sm) 0; }
}

/* -------------------------------------------------------------- */
/* 6. Buttons, pills, forms                                        */
/* -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75em 1.4em;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); }
.btn--primary:hover { transform: translateY(-1px); }
.btn--ghost { background: transparent; border-color: currentColor; color: var(--color-accent); }

.pill, .category-pill {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-accent-ink);
  background: var(--color-accent);
  padding: 0.35em 0.9em;
  border-radius: var(--radius-pill);
}

/* Base text-input reset (Tailwind preflight is off site-wide). Zero specificity,
   so Tailwind utility classes and the scoped legacy rule below both override it. */
:where(input[type="text"], input[type="search"], input[type="email"], input[type="url"], input[type="tel"], input[type="number"], textarea) {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  min-width: 0;
}
:where(input[type="search"])::-webkit-search-cancel-button,
:where(input[type="search"])::-webkit-search-decoration {
  -webkit-appearance: none;
}

:where(button) {
  border: 0;
}

/* Legacy form styling, scoped to the older (non-Tailwind) forms so it no longer
   overrides the Tailwind-styled inputs in the header, hero, sidebars and newsletter. */
:where(.search-form, .comment-form, .comment-respond, .wpcf7, .entry-content, .widget, .wp-block-search) :where(input[type="text"], input[type="search"], input[type="email"], input[type="url"], textarea) {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.75em 1em;
  color: var(--color-ink);
}
input:focus-visible, textarea:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.search-form { display: flex; gap: var(--space-sm); }
.search-form input[type="search"] { flex: 1; }

/* -------------------------------------------------------------- */
/* 7. Post cards & archive grid                                    */
/* -------------------------------------------------------------- */
.content-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}
@media (min-width: 1080px) {
  .content-layout--with-sidebar {
    grid-template-columns: 2fr 1fr;
    align-items: start;
  }
}

.page-header { margin-bottom: var(--space-lg); }

.no-results { max-width: 60ch; }
.no-results h2 { margin-bottom: var(--space-sm); }
.no-results .search-form { margin-top: var(--space-lg); max-width: 480px; }

.pagination {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}
@media (min-width: 700px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1080px) {
  .post-grid { grid-template-columns: repeat(3, 1fr); }
  .post-grid > :first-child.post-grid__feature {
    grid-column: span 2;
    grid-row: span 2;
  }
}

.post-card { display: flex; flex-direction: column; gap: var(--space-sm); }
.post-card__media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--color-stone-light);
}
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
.post-card__meta { display: flex; align-items: center; gap: var(--space-sm); color: var(--color-stone); font-size: 0.85rem; }
.post-card__title { font-size: 1.25rem; }
.post-card__title a:hover { color: var(--color-accent); }
.post-card__excerpt { color: var(--color-ink); opacity: 0.85; font-size: 0.95rem; }

/* -------------------------------------------------------------- */
/* 8. Single post / page                                           */
/* -------------------------------------------------------------- */
.entry-header { padding-block: var(--space-xl) var(--space-lg); }
.entry-header .eyebrow { margin-bottom: var(--space-sm); }
.entry-title { max-width: 20ch; }
.entry-meta { display: flex; flex-wrap: wrap; gap: var(--space-md); color: var(--color-stone); font-size: 0.9rem; margin-top: var(--space-md); }

.entry-thumbnail {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-block: var(--space-lg);
}

.entry-content { max-width: var(--measure); }
.entry-content > * + * { margin-top: var(--space-md); }
.entry-content h2, .entry-content h3 { margin-top: var(--space-xl); }
.entry-content img { border-radius: var(--radius-md); }
.entry-content blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-md);
  font-style: italic;
  color: var(--color-ink);
}

.entry-tags { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-lg); }

/* -------------------------------------------------------------- */
/* 9. Sidebar                                                      */
/* -------------------------------------------------------------- */
.widget-area { display: flex; flex-direction: column; gap: var(--space-xl); }
.widget-title { font-size: 1.05rem; margin-bottom: var(--space-md); }
.widget ul { display: flex; flex-direction: column; gap: var(--space-sm); }

/* -------------------------------------------------------------- */
/* 10. Comments                                                    */
/* -------------------------------------------------------------- */
.comments-area { border-top: 1px solid var(--color-border); padding-top: var(--space-lg); margin-top: var(--space-xl); }
.comment-list { display: flex; flex-direction: column; gap: var(--space-lg); }
.comment-body { display: flex; flex-direction: column; gap: var(--space-sm); }
.comment-author { font-weight: 600; }
.comment-metadata { color: var(--color-stone); font-size: 0.85rem; }
.comment-respond { margin-top: var(--space-lg); }
.comment-form p { margin-top: var(--space-md); }

/* -------------------------------------------------------------- */
/* 11. 404                                                          */
/* -------------------------------------------------------------- */
.error-404 {
  text-align: left;
  padding-block: var(--space-xl);
}
.error-404__code {
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--color-accent);
  font-size: clamp(3rem, 2rem + 4vw, 6rem);
  line-height: 1;
}

/* -------------------------------------------------------------- */
/* 12. Footer                                                      */
/* -------------------------------------------------------------- */
.site-footer {
  background: var(--color-pine);
  color: var(--color-pine-ink);
  margin-top: var(--space-xl);
}
.footer-inner {
  padding-block: var(--space-xl) var(--space-lg);
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
}
@media (min-width: 700px) {
  .footer-inner { grid-template-columns: 1.3fr repeat(3, 1fr); }
}
.footer-col .widget-title, .footer-col .site-title { color: var(--color-pine-ink); }
.footer-col a:hover { color: var(--color-accent); }
.footer-bottom {
  border-top: 1px solid rgba(246, 242, 233, 0.15);
  padding-block: var(--space-md);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: rgba(246, 242, 233, 0.7);
}

/* -------------------------------------------------------------- */
/* 13. Reveal-on-scroll (progressive enhancement)                  */
/* -------------------------------------------------------------- */
html:not(.js) .reveal,
html.js .reveal.is-visible,
html.no-js .reveal {
  opacity: 1;
  transform: none;
}
html.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
