/* =========================================================
   Pershin Book Cafe | About Page
   style.css (file 2 of 3: index.html / style.css / script.js)
   Mobile-first, RTL layout
   ========================================================= */

/* =========================================================
   1. Design tokens
   ========================================================= */
:root {
  /* Brand colors */
  --cream: #f7f1e5;
  --green: #2f4a34;
  --green-dark: #22362a;
  --green-soft: #4f6b52;
  --beige: #ede3d0;
  --beige-dark: #e2d5bd;
  --brown: #7b5534;
  --gold: #b8924e;
  --charcoal: #2a2826;

  /* Supporting colors */
  --text: #3a3734;
  --text-muted: #6b6560;
  --tan: #d8c3a0;
  --card-gray: #ebe8e2;
  --placeholder: #dedede;
  --white: #ffffff;

  /* Radii */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 4px 14px rgba(42, 40, 38, 0.06);
  --shadow-md: 0 12px 30px rgba(42, 40, 38, 0.1);
  --shadow-lg: 0 20px 44px rgba(42, 40, 38, 0.16);

  /* Layout */
  --header-h: 64px;
  --page-max: 640px;
  --gutter: 1.5rem;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast: 0.25s;
  --dur: 0.4s;
  --dur-slow: 0.8s;
}

/* =========================================================
   2. Reset & base
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 2;
  color: var(--text);
  background-color: var(--cream);
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3 {
  margin: 0 0 0.75rem;
  color: var(--charcoal);
  line-height: 1.75;
  font-weight: 800;
}

p {
  margin: 0 0 1rem;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

svg {
  display: block;
}

blockquote {
  margin: 0;
}

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

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* =========================================================
   3. Utilities
   ========================================================= */

/* Hidden SVG sprite (icons + line art definitions) */
.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.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;
}

/* Page frame: keeps the mobile design centered on wide screens */
.page {
  display: block;
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
}

.container {
  width: 100%;
  padding-inline: var(--gutter);
  margin-inline: auto;
}
.philosophy {
  position: relative;
}
/* Empty image spot (fill with your own image) */
.img-placeholder {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background-color: var(--placeholder);
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

/* If you drop an <img> inside a placeholder, it fills the box */
.img-placeholder > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================================================
   4. Header
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  padding-top: env(safe-area-inset-top, 0);
  background-color: var(--green);
  color: var(--cream);
  transition:
    box-shadow var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.site-header.is-scrolled {
  background-color: rgba(47, 74, 52, 0.96);
  box-shadow: 0 6px 20px rgba(34, 54, 42, 0.25);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* RTL grid: menu (right) | logo (center) | leaf (left) */
.header-inner {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  width: 100%;
  max-width: var(--page-max);
  height: 100%;
  margin-inline: auto;
  padding-inline: 1rem;
}

/* Logo */
.logo {
  grid-column: 2;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--cream);
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1;
  white-space: nowrap;
  transition: opacity var(--dur-fast);
}

.logo:hover {
  opacity: 0.85;
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--gold);
  flex-shrink: 0;
}

.logo-text {
  letter-spacing: 0;
}

/* Decorative leaf on the left edge */
.header-leaf {
  grid-column: 3;
  justify-self: end;
  width: 64px;
  height: 38px;
  color: var(--beige);
  opacity: 0.55;
  pointer-events: none;
}

/* =========================================================
   5. Hamburger toggle
   ========================================================= */
.menu-toggle {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  position: relative;
  z-index: 110;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background-color var(--dur-fast);
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
  background-color: rgba(247, 241, 229, 0.12);
}

.menu-toggle-bar,
.menu-toggle-bar::before,
.menu-toggle-bar::after {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background-color: var(--cream);
  transition:
    transform 0.35s var(--ease),
    background-color 0.2s,
    top 0.35s var(--ease);
}

.menu-toggle-bar {
  position: relative;
}

.menu-toggle-bar::before,
.menu-toggle-bar::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
}

.menu-toggle-bar::before {
  top: -7px;
}

.menu-toggle-bar::after {
  top: 7px;
}

/* Open state: bars turn into an X */
.menu-toggle[aria-expanded="true"] .menu-toggle-bar {
  background-color: transparent;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar::after {
  top: 0;
  transform: rotate(-45deg);
}

/* =========================================================
   6. Slide-out navigation
   ========================================================= */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background-color: rgba(34, 54, 42, 0.45);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--dur) var(--ease),
    visibility var(--dur);
}

/* Slides in from the right (menu side in RTL) */
.main-nav {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 95;
  display: flex;
  flex-direction: column;
  width: min(80vw, 300px);
  height: 100vh;
  height: 100dvh;
  padding: calc(var(--header-h) + 1.5rem) 1.5rem 2rem;
  background-color: var(--green-dark);
  color: var(--cream);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.45s var(--ease);
}

.main-nav-list {
  display: grid;
  gap: 0.35rem;
}

.main-nav-list a {
  display: block;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--cream);
  transition:
    background-color var(--dur-fast),
    padding var(--dur-fast) var(--ease),
    color var(--dur-fast);
}

.main-nav-list a:hover,
.main-nav-list a:focus-visible {
  background-color: rgba(247, 241, 229, 0.1);
  color: var(--gold);
  padding-inline-start: 1.4rem;
}

/* Open state (class added to <body> by script.js) */
body.nav-open {
  overflow: hidden;
}

body.nav-open .main-nav {
  transform: translateX(0);
}

body.nav-open .nav-overlay {
  opacity: 1;
  visibility: visible;
}

/* =========================================================
   7. Shared section styles
   ========================================================= */
section {
  padding-block: 2rem;
}

/* Heading with a green accent bar on the reading edge.
   Uses logical properties, so the bar sits at the start of the line in RTL. */
.section-heading {
  position: relative;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.8;
  color: var(--green);
}

/* Leaf & flower divider */
.divider {
  display: flex;
  justify-content: center;
  padding-block: 0.25rem;
}

.divider svg {
  width: min(240px, 68%);
  height: auto;
  aspect-ratio: 280 / 44;
  color: var(--green-soft);
  opacity: 0.85;
  transition:
    color var(--dur),
    transform 0.6s var(--ease);
}

.divider:hover svg {
  color: var(--gold);
  transform: scale(1.04);
}

/* =========================================================
   8. Hero
   ========================================================= */
.hero {
  padding-top: 2rem;
  padding-bottom: 1rem;
  text-align: center;
}

.hero-title {
  margin-bottom: 0.4rem;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.6;
  color: var(--green);
}

.hero-intro {
  margin-bottom: 0.25rem;
  font-size: 1.02rem;
  color: var(--brown);
}

.hero-tagline {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-bottom: .5rem;
  font-size: 1.2rem;
  line-height: 1.9;
  color: var(--charcoal);
}

.hero-tagline strong {
  font-weight: 800;
  color: var(--green);
}

.hero-tagline span {
  font-weight: 700;
}

.hero-media {
  padding-inline: 0;
  margin-top: -6rem;
}

/* Curved bottom edge, like the original mobile design */
.hero-image {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg) var(--radius-lg) 50% 50% / var(--radius-lg) var(--radius-lg) 16% 16%;
  box-shadow: var(--shadow-md);
}

.hero-image:hover {
  transform: scale(1.01);
}

/* =========================================================
   9. Story
   ========================================================= */
.story {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  margin-top: 0;
  padding-top: 0;
}

.gol-2 {
  position: absolute;
  left: -10px;
  top: auto;
  bottom: auto;
}

.story-text {
  max-width: 34rem;
  margin-inline: auto;
}

.story-text p {
  font-size: 11px;
  font-weight: 500;
}

.story-highlight {
  margin-top: 1.25rem;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--green);
}

/* =========================================================
   10. Philosophy (books & people)
   ========================================================= */

/* RTL: text on the right, image on the left */
.split {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  align-items: center;
  gap: 1.25rem;
}

.split-text p {
  font-size: 10px;
}

.split-image {
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.split-image:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* =========================================================
   11. Callout (quote box)
   ========================================================= */
.callout-section {
  padding-top: 2.5rem;
}

.callout {
  position: relative;
  padding: 2.75rem 1.5rem 1.75rem;
  background-color: #dbd8c5;
  border: 1px solid #dbd8c5;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.callout:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Flower line art at the top center of the box */
.callout-flower {
  position: absolute;
  top: -28px;
  left: 50%;
  width: 46px;
  height: 54px;
  padding: 2px 4px;
  color: var(--green-soft);
  background-color: var(--cream);
  border-radius: var(--radius-sm);
  transform: translateX(-50%);
}

/* Faint quote mark in the corner */
.callout-quote-icon {
  position: absolute;
  top: 0.9rem;
  inset-inline-start: 1rem;
  width: 26px;
  height: 26px;
  color: var(--gold);
  opacity: 0.35;
}

.callout p {
  position: relative;
  font-size: 1rem;
  color: var(--text);
}

.callout .callout-strong {
  margin-top: 1rem;
  font-weight: 700;
  color: var(--brown);
}

/* =========================================================
   12. Vision
   ========================================================= */
.vision {
  position: relative;
}

.vision-text {
  max-width: 34rem;
  margin-inline: auto;
}
.gol-6 {
  position: absolute;
  left: 0;
  top: 30px;
}
.p-40 {
  padding-left: 40px;
}
.vision-text .section-heading {
  display: inline-block;
  text-align: right;
}

.vision-text p {
  font-size: 12px;
}

.vision-closing {
  margin-top: 1.25rem;
  font-weight: 700;
  color: var(--green);
}

/* =========================================================
   13. Instagram card
   ========================================================= */
.instagram {
  padding-top: 0;
  padding-bottom: 2.5rem;
}

/* RTL: text on the right, image on the left */
.insta-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  background-color: #dbd8c5;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur) var(--ease);
}

.insta-card:hover {
  box-shadow: var(--shadow-md);
}

.insta-title {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.8;
  color: var(--charcoal);
}

.insta-text p {
  font-size: 10px;
  color: #1a3d2b;
  font-weight: 600;
}

.insta-image {
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md);
}

.insta-card:hover .insta-image {
  transform: scale(1.02);
}

/* =========================================================
   14. Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: var(--radius-pill);
  background-color: var(--green);
  color: var(--cream);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  transition:
    background-color var(--dur-fast),
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast);
}

.btn:hover,
.btn:focus-visible {
  background-color: var(--brown);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(123, 85, 52, 0.3);
}

.btn:active {
  transform: translateY(0);
}

.btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* =========================================================
   15. Footer
   ========================================================= */
.site-footer {
  margin-top: 1rem;
  padding: 1.75rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0));
  background-color: var(--tan);
  color: var(--charcoal);
}

/* RTL grid: contact icons (right) | tagline + insta (center) | badge (left) */
.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
}

/* Contact icons, stacked */
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-contact a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(42, 40, 38, 0.06);
  color: var(--charcoal);
  transition:
    background-color var(--dur-fast),
    color var(--dur-fast),
    transform var(--dur-fast) var(--ease);
}

.footer-contact svg {
  width: 20px;
  height: 20px;
}

.footer-contact a:hover,
.footer-contact a:focus-visible {
  background-color: var(--green);
  color: var(--cream);
  transform: translateX(-3px);
}

/* Center: tagline + Instagram link */
.footer-center {
  text-align: center;
}

.footer-tagline {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--green-dark);
}

.footer-insta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-bottom: 2px;
  border-bottom: 1px dashed rgba(42, 40, 38, 0.35);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--charcoal);
  transition:
    color var(--dur-fast),
    border-color var(--dur-fast);
}

.footer-insta svg {
  width: 20px;
  height: 20px;
}

.footer-insta:hover,
.footer-insta:focus-visible {
  color: var(--brown);
  border-color: var(--brown);
}

/* Left: e-namad badge with a separating line */
.footer-badge {
  padding-inline-start: 1rem;
  border-inline-start: 1px solid rgba(42, 40, 38, 0.2);
}

.enamad-placeholder {
  width: 72px;
  height: 80px;
  border-radius: var(--radius-sm);
}

.copyright {
  max-width: var(--page-max);
  margin: 1.25rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(42, 40, 38, 0.12);
  font-size: 0.8rem;
  text-align: center;
  color: rgba(42, 40, 38, 0.7);
}

/* =========================================================
   16. Back to top
   ========================================================= */
.back-to-top {
  position: fixed;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0));
  left: 1.25rem;
  z-index: 80;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background-color: var(--brown);
  color: var(--cream);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity var(--dur-fast),
    visibility var(--dur-fast),
    transform var(--dur-fast) var(--ease),
    background-color var(--dur-fast);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background-color: var(--green);
}

/* =========================================================
   17. Reveal-on-scroll animation
   (.js is added to <html> by script.js, so content stays
   visible if JavaScript is off)
   ========================================================= */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--dur-slow) var(--ease),
    transform var(--dur-slow) var(--ease);
  will-change: opacity, transform;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* =========================================================
   18. Responsive: tablets & large phones
   ========================================================= */
@media (max-width: 860px) {
  :root {
    --gutter: 1.25rem;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .hero-tagline {
    font-size: 1.12rem;
  }

  .section-heading {
    font-size: 16px;
  }

  .split,
  .insta-card {
    gap: 1rem;
  }
}

/* =========================================================
   19. Responsive: small phones
   ========================================================= */
@media (max-width: 520px) {
  :root {
    --header-h: 58px;
    --gutter: 1.1rem;
  }

  body {
    font-size: 0.95rem;
  }

  .logo {
    font-size: 1.02rem;
  }

  .logo-icon {
    width: 24px;
    height: 24px;
  }

  .header-leaf {
    width: 50px;
    height: 30px;
  }

  section {
    padding-block: 1.6rem;
  }

  .hero-title {
    font-size: 1.45rem;
  }

  .hero-tagline {
    font-size: 1.05rem;
  }

  .hero-media {
    padding-inline: 0;
  }

  .hero-image {
    aspect-ratio: 5 / 4;
  }

  /* Philosophy: single column, image first */

  .callout {
    padding: .5rem 1.15rem 1.5rem;
  }

  .callout p {
    font-size: 12px;
  }

  .insta-title {
    font-size: 13px;
    color: #1a3d2b;
    margin-bottom: 2rem;
  }

  .btn {
    width: 100%;
  }

  /* Footer: keep 3 columns, tighten spacing */
  .footer-inner {
    gap: 0.75rem;
  }

  .footer-contact a {
    width: 36px;
    height: 36px;
  }

  .footer-contact svg {
    width: 18px;
    height: 18px;
  }

  .footer-tagline {
    font-size: 0.95rem;
  }

  .footer-insta {
    font-size: 0.85rem;
  }

  .footer-badge {
    padding-inline-start: 0.75rem;
  }

  .enamad-placeholder {
    width: 60px;
    height: 68px;
  }

  .back-to-top {
    left: 1rem;
    width: 40px;
    height: 40px;
  }
}

/* =========================================================
   20. Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .hero-image:hover,
  .split-image:hover,
  .callout:hover,
  .insta-card:hover .insta-image,
  .divider:hover svg,
  .btn:hover {
    transform: none;
  }
}

.hamburger {
  justify-self: end;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.08);
}

.hamburger span,
.hamburger span::before,
.hamburger span::after {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--white);
  border-radius: 2px;
  position: relative;
  transition: transform var(--transition), background var(--transition);
}

.hamburger span::before,
.hamburger span::after {
  content: "";
  position: absolute;
  left: 0;
}

.hamburger span::before { top: -7px; }
.hamburger span::after  { top: 7px; }

.hamburger[aria-expanded="true"] span { background: transparent; }
.hamburger[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span::after  { transform: translateY(-7px) rotate(-45deg); }

.photo {
  display: block;
  height: auto;
  aspect-ratio: var(--ratio, 1 / 1);
  object-fit: cover;
  object-position: var(--focus, 50% 50%);
  width: 100%;
}

.photo.curved-top {
  --depth: 18%;
  border-radius: 0;

  mask-image:
          radial-gradient(ellipse 53% 24% at 50% 0,
          transparent 97%, black 97%),
          radial-gradient(ellipse 53% var(--depth) at 50% calc(95% - var(--depth)),
          black 99.5%, transparent 100%),
          linear-gradient(to bottom,
          black calc(100% - var(--depth)), transparent 0);

  mask-composite: intersect, add;
}
.gol-4 {
  position: absolute;
  top: 35%;
  right: 0;
  width: 55px;
}