/* ==========================================================================
   Prof. Dr. Fuat Demirkıran – Digital Business Card
   Mobile-first stylesheet
   Design language matches https://demirkiranfuat.com/
   (colours converted from the site's OKLCH theme tokens)
   ========================================================================== */

/* ---------- 1. Fonts (self-hosted, SIL OFL – see assets/fonts/OFL.txt) ---------- */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/fraunces-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- 2. Design tokens ---------- */
:root {
  --color-primary: #153d4f;        /* petrol blue  – oklch(34% .055 232) */
  --color-primary-hover: #1e5068;
  --color-primary-fg: #fbf8f2;     /* text on primary – oklch(98% .008 85) */
  --color-sand: #f7f1e8;           /* warm cream   – oklch(96% .014 80) */
  --color-bg: #fcfaf6;             /* light ground – oklch(98.5% .006 85) */
  --color-surface: #ffffff;
  --color-secondary: #e2f2f3;      /* light turquoise – oklch(95% .017 200) */
  --color-champagne: #dbc8a2;      /* gold-beige accent – oklch(84% .055 85) */
  --color-text: #122733;           /* oklch(26% .035 236) */
  --color-text-muted: #5b6c75;     /* oklch(52% .025 235) */
  --color-eyebrow: #56656e;        /* teal-foreground at 70% */
  --color-border: #d6e0e3;         /* oklch(90% .012 220) */
  --color-ring: #477a8a;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.25rem;
  --space-xl: 2rem;

  --tap-min: 48px;
  --bottom-nav-height: 56px;
}

/* ---------- 3. Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem; /* 17px */
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-sand);
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--color-primary);
}

a {
  color: var(--color-primary);
}

a:focus-visible,
.btn:focus-visible,
.qr-link:focus-visible,
.qr-dialog-close:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 3px;
}

address {
  font-style: normal;
}

.container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

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

.skip-link:focus {
  left: var(--space-md);
  top: var(--space-md);
}

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

/* ---------- 4. Cards ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

/* ---------- 5. Hero / profile card ---------- */
.hero {
  padding: var(--space-md) 0 var(--space-xs);
}

.hero-card {
  text-align: center;
  padding: var(--space-md) var(--space-lg) var(--space-xs);
}

/* Portrait frame, same treatment as the personal website (rounded, champagne border) */
.portrait {
  display: block;
  width: 128px;
  height: 160px;
  margin: 0 auto 0.625rem;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--color-secondary);
  border: 1px solid var(--color-champagne);
}

/* Source photo is a close-up with about the frame's aspect ratio: no zoom */
.portrait-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  transform: none;
}

.doctor-name {
  font-size: 1.875rem;
  line-height: 1.15;
}

/* Gold-beige accent rule under the name */
.doctor-name::after {
  content: "";
  display: block;
  width: 44px;
  height: 2px;
  margin: var(--space-xs) auto 0;
  background: var(--color-champagne);
}

.doctor-title {
  margin-top: var(--space-xs);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.doctor-summary {
  margin: 0.25rem auto 0;
  max-width: 34ch;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}

/* ---------- 6. Buttons ---------- */
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-width: 0;
  min-height: var(--tap-min);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.25;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

/* Hero buttons: icon above label so long labels fit in two columns */
.actions:not(.actions-inline) .btn {
  flex-direction: column;
  gap: 0.375rem;
  min-height: 72px;
}

/* A lone hero button spans the full card width */
.actions > .btn:only-child {
  grid-column: 1 / -1;
}

.btn-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: currentColor;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-primary-fg);
  border: 1px solid var(--color-primary);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.btn-secondary:hover {
  background: var(--color-secondary);
}

.actions-inline {
  margin-top: var(--space-sm);
}

.actions-inline .btn-wide {
  grid-column: 1 / -1;
}

/* Small secondary link under the hero buttons */
.qr-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 44px;
  margin-top: 0.25rem;
  padding: 0 var(--space-sm);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  cursor: pointer;
}

.qr-link:hover {
  color: var(--color-primary);
  background: var(--color-secondary);
}

.qr-link-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ---------- 7. Sections ---------- */
.section {
  padding: var(--space-md) 0;
}

/* Serif heading with a short gold-beige rule underneath */
.section-title {
  margin-bottom: var(--space-sm);
  font-size: 1.5rem;
}

.section-title::after {
  content: "";
  display: block;
  width: 32px;
  height: 2px;
  margin-top: var(--space-xs);
  background: var(--color-champagne);
}

/* ---------- 8. Clinic & contact ---------- */
/* Address with "Yol Tarifi" beside it; the button wraps below, right-aligned, when space runs out */
.address-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-sm);
}

.address {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--color-text);
}

.address-directions {
  flex-shrink: 0;
  margin-left: auto;
}

.contact-list {
  margin: var(--space-xs) 0 0;
}

.contact-row {
  padding: var(--space-xs) 0 0;
  border-top: 1px solid var(--color-border);
}

.contact-list:first-child {
  margin-top: 0;
}

.contact-list:first-child .contact-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.contact-row dt {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--color-eyebrow);
}

.contact-row dd {
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--space-md);
  margin: 0;
}

.contact-row a,
.contact-value {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1.0625rem;
  line-height: 1.4;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact-row a.contact-website {
  font-weight: 700;
}

.contact-row a:hover {
  text-decoration: underline;
  text-decoration-color: var(--color-champagne);
  text-underline-offset: 4px;
}

/* ---------- 10. Footer ---------- */
.footer {
  margin-top: var(--space-md);
  padding: var(--space-lg) 0 var(--space-md);
  background: var(--color-primary);
  color: var(--color-primary-fg);
  text-align: center;
  line-height: 1.5;
}

.footer-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
}

.footer-specialty {
  margin-top: 0.125rem;
  font-size: 0.9375rem;
  color: var(--color-champagne);
}

.disclaimer {
  margin: var(--space-sm) auto 0;
  max-width: 44ch;
  font-size: 0.875rem;
  color: rgba(251, 248, 242, 0.8);
}

.copyright {
  margin-top: var(--space-xs);
  font-size: 0.875rem;
  color: rgba(251, 248, 242, 0.8);
}

/* ---------- 11. Bottom navigation ---------- */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-height: var(--bottom-nav-height);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
}

.bottom-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--bottom-nav-height);
  padding: 0 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  color: var(--color-text-muted);
}

.bottom-nav-link:hover,
.bottom-nav-link.is-active {
  color: var(--color-primary);
}

.bottom-nav-link.is-active {
  font-weight: 700;
}

/* Short, centred gold-beige marker above the active item */
.bottom-nav-link.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 40px;
  height: 3px;
  transform: translateX(-50%);
  border-radius: 0 0 3px 3px;
  background: var(--color-champagne);
}

/* ---------- 12. Toast (short notices) ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + var(--space-md));
  transform: translateX(-50%);
  z-index: 60;
  width: calc(100% - 2rem);
  max-width: 420px;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: var(--color-primary-fg);
  text-align: center;
  font-size: 1rem;
}

.toast[hidden] {
  display: none;
}

/* ---------- 13. QR page (qr.html) and QR modal ---------- */
html.qr-modal-open,
body.qr-modal-open {
  overflow: hidden;
}

.qr-dialog {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: var(--space-md);
  border: none;
  background: transparent;
}

.qr-dialog[open] {
  display: grid;
  place-items: center;
}

.qr-dialog::backdrop {
  background: rgba(18, 39, 51, 0.56);
}

.qr-dialog-inner {
  position: relative;
  width: 100%;
  max-width: 320px;
}

.qr-dialog .qr-card {
  position: relative;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  padding-top: 2.75rem;
  overflow-y: auto;
}

.qr-dialog .qr-card form {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  margin: 0;
}

.qr-dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.qr-dialog-close:hover {
  color: var(--color-primary);
  background: var(--color-secondary);
}

.qr-dialog .toast {
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--space-md));
}

.page-qr {
  padding-bottom: 0;
}

.page-qr .toast {
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--space-md));
}

.qr-page {
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--space-md) 0;
}

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

.qr-card .doctor-name::after {
  margin-top: var(--space-sm);
}

.qr-subtitle {
  margin-top: var(--space-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-eyebrow);
}

/* QR stays pure black on white for reliable scanning */
.qr-code {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1 / 1;
  margin: var(--space-md) auto 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
}

.qr-code svg {
  display: block;
  width: 100%;
  height: 100%;
}

.qr-hint {
  margin: var(--space-md) auto 0;
  max-width: 30ch;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.qr-actions {
  display: grid;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.qr-actions .btn {
  width: 100%;
  cursor: pointer;
}

/* Off-screen textarea used by the copy-to-clipboard fallback */
.copy-helper {
  position: fixed;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
  font-size: 16px; /* prevents iOS zoom on focus */
}

/* ---------- 14. Responsive ---------- */

/* Very small screens (320px) */
@media (max-width: 359px) {
  body {
    font-size: 1rem;
  }

  .card {
    padding: var(--space-md);
  }

  .hero-card {
    padding: var(--space-md) var(--space-md) var(--space-xs);
  }

  .doctor-name {
    font-size: 1.625rem;
  }

  .section-title {
    font-size: 1.375rem;
  }

  .btn {
    font-size: 0.875rem;
  }
}

/* Narrow or short screens (e.g. 320px, iPhone SE): keep the QR card on one screen */
@media (max-width: 359px), (max-height: 700px) {
  .qr-page {
    padding: var(--space-xs) 0;
  }

  .qr-code {
    max-width: 228px;
  }

  .qr-hint,
  .qr-actions {
    margin-top: var(--space-sm);
  }
}

/* Tablets and up */
@media (min-width: 600px) {
  .card {
    padding: 1.5rem;
  }

  .hero-card {
    padding: 1.5rem 1.5rem var(--space-sm);
  }

  .doctor-name {
    font-size: 2.25rem;
  }

  .portrait {
    width: 144px;
    height: 180px;
  }
}

/* Desktop */
@media (min-width: 900px) {
  .hero {
    padding-top: var(--space-xl);
  }

  .bottom-nav {
    left: 50%;
    right: auto;
    bottom: var(--space-md);
    transform: translateX(-50%);
    width: 420px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding-bottom: 0;
    overflow: hidden;
  }

  body {
    padding-bottom: calc(var(--bottom-nav-height) + var(--space-xl));
  }
}
