/* ═══════════════════════════════════════════════════════════
   TARIF DEFTERİ — style.css
   aiseveali.com/tarifler
   Aesthetic: Warm Artisan Cookbook
═══════════════════════════════════════════════════════════ */

/* ── TOKENS ───────────────────────────────────────────────── */
:root {
  --cream:      #FAF7F0;
  --cream-dark: #F0EBE0;
  --terra:      #C4622D;
  --terra-dark: #A04E22;
  --terra-soft: #E8C4AA;
  --olive:      #4A5240;
  --olive-light:#6B7360;
  --gold:       #C8973A;
  --ink:        #2C1810;
  --ink-soft:   #5A3E35;
  --white:      #FFFFFF;
  --shadow-sm:  0 2px 8px rgba(44,24,16,.08);
  --shadow-md:  0 8px 32px rgba(44,24,16,.14);
  --shadow-lg:  0 20px 60px rgba(44,24,16,.18);
  --radius-sm:  10px;
  --radius:     16px;
  --radius-lg:  24px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Crimson Text', Georgia, serif;
  --font-ui:      'DM Sans', sans-serif;
  --transition:   .25s cubic-bezier(.4,0,.2,1);
}

/* ── RESET ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-ui); border: none; background: none; }
input, textarea, select {
  font-family: var(--font-body);
  font-size: inherit;
  color: var(--ink);
}
a { text-decoration: none; color: inherit; }

/* ── CONTAINER ────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 100px;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .02em;
  transition: var(--transition);
  white-space: nowrap;
  text-align: center;
  justify-content: center;
}
.btn__icon { font-size: 17px; line-height: 1; }
.btn--primary {
  background: var(--terra);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(196,98,45,.35);
}
.btn--primary:hover {
  background: var(--terra-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(196,98,45,.4);
}
.btn--primary:active { transform: translateY(0); }
.btn--outline {
  background: transparent;
  color: var(--terra);
  border: 2px solid var(--terra);
}
.btn--outline:hover {
  background: var(--terra);
  color: var(--white);
  transform: translateY(-2px);
}
.btn--ghost {
  background: var(--cream-dark);
  color: var(--ink-soft);
}
.btn--ghost:hover { background: #E0D9CE; }
.btn--danger {
  background: #FFF0EC;
  color: #C4622D;
  border: 1.5px solid #F0C4B0;
}
.btn--danger:hover { background: #FFE0D4; }
.btn--lg { padding: 16px 32px; font-size: 16px; }
.btn--sm { padding: 9px 18px; font-size: 13px; }

/* ── SECTION LABELS ──────────────────────────────────────── */
.section-label {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: 10px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 36px;
  line-height: 1.15;
}

/* ── TAGS ─────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  background: var(--cream-dark);
  color: var(--olive);
  border: 1px solid #D8CEBC;
  border-radius: 100px;
  padding: 4px 12px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}
.tag--sm { font-size: 11px; padding: 3px 9px; }

/* ─────────────────────────────────────────────────────────── */
/* ░░░░░░░░░░░░░░░░░░  HERO  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ */
/* ─────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--ink);
}

.hero__bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 30% 30%, rgba(196,98,45,.45) 0%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 75% 70%, rgba(74,82,64,.5) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 60% 20%, rgba(200,151,58,.2) 0%, transparent 55%);
  background-color: #1A0F08;
}

/* Paper grain texture via pseudo */
.hero__bg::after {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: .5;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 40px 24px;
  max-width: 520px;
}

.hero__eyebrow {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--terra-soft);
  margin-bottom: 20px;
  opacity: .9;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 14vw, 6.5rem);
  font-weight: 700;
  color: var(--cream);
  line-height: 1;
  margin-bottom: 20px;
}
.hero__title em {
  font-style: italic;
  color: var(--terra-soft);
  display: block;
}

.hero__sub {
  font-family: var(--font-body);
  font-size: clamp(1rem, 3vw, 1.2rem);
  color: rgba(250,247,240,.65);
  margin-bottom: 40px;
  font-style: italic;
}

.hero__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero__actions .btn--outline {
  color: var(--cream);
  border-color: rgba(250,247,240,.4);
}
.hero__actions .btn--outline:hover {
  background: rgba(250,247,240,.12);
  color: var(--cream);
  border-color: rgba(250,247,240,.7);
}

/* Decorative rings */
.hero__decor { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.decor-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(196,98,45,.15);
}
.r1 { width: 600px; height: 600px; top: -200px; left: -200px; }
.r2 { width: 400px; height: 400px; bottom: -100px; right: -100px; border-color: rgba(74,82,64,.2); }
.r3 { width: 200px; height: 200px; top: 60%; left: 65%; border-color: rgba(200,151,58,.12); }

/* Scroll cue */
.hero__scroll {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  color: rgba(250,247,240,.45);
  animation: bounce 2s infinite;
}
.hero__scroll svg { width: 24px; height: 24px; }
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

/* ─────────────────────────────────────────────────────────── */
/* ░░░░░░░░░░░░░░  FORM SECTION  ░░░░░░░░░░░░░░░░░░░░░░░░░░ */
/* ─────────────────────────────────────────────────────────── */
.form-section {
  padding: 80px 0 100px;
  background: var(--cream);
  position: relative;
}
.form-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--terra), var(--gold));
}

/* ── FORM ─────────────────────────────────────────────────── */
.recipe-form {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(196,98,45,.08);
}

.form-group {
  margin-bottom: 24px;
}
.form-group label {
  display: block;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--ink-soft);
  margin-bottom: 7px;
  text-transform: uppercase;
}
.form-group .hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #9E8B7D;
  font-size: 12px;
}
.req { color: var(--terra); }

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--cream);
  border: 1.5px solid #E0D8CE;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 16px;
  font-family: var(--font-body);
  color: var(--ink);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  resize: vertical;
  -webkit-appearance: none;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--terra);
  box-shadow: 0 0 0 3px rgba(196,98,45,.12);
  background: var(--white);
}
.form-group textarea { min-height: 100px; }

/* Tags preview */
.tags-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  min-height: 10px;
}

/* Row layout for 3 short inputs */
.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* Photo upload */
.photo-upload {
  border: 2px dashed #D5CABC;
  border-radius: var(--radius);
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  overflow: hidden;
  position: relative;
  background: var(--cream);
}
.photo-upload:hover { border-color: var(--terra); background: #FDF8F4; }
.photo-upload.drag-over { border-color: var(--terra); background: #FDF4EC; }
.photo-upload__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #9E8B7D;
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 24px;
  text-align: center;
}
.photo-icon { font-size: 32px; }
.photo-upload__preview {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.form-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 8px;
  flex-wrap: wrap;
}

/* ─────────────────────────────────────────────────────────── */
/* ░░░░░░░░░░░░░░  BOOK SECTION  ░░░░░░░░░░░░░░░░░░░░░░░░░░ */
/* ─────────────────────────────────────────────────────────── */
.book-section {
  padding: 80px 0 100px;
  background: var(--cream-dark);
  min-height: 60vh;
}

/* ── TOOLBAR ──────────────────────────────────────────────── */
.book-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.search-wrap {
  flex: 1;
  position: relative;
  min-width: 200px;
}
.search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: #9E8B7D;
  pointer-events: none;
}
.search-input {
  width: 100%;
  background: var(--white);
  border: 1.5px solid #E0D8CE;
  border-radius: 100px;
  padding: 12px 18px 12px 42px;
  font-size: 15px;
  font-family: var(--font-ui);
  color: var(--ink);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.search-input:focus {
  border-color: var(--terra);
  box-shadow: 0 0 0 3px rgba(196,98,45,.12);
}

/* Column switcher */
.col-switcher {
  display: flex;
  background: var(--white);
  border: 1.5px solid #E0D8CE;
  border-radius: 100px;
  padding: 4px;
  gap: 2px;
}
.col-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 100px;
  color: #9E8B7D;
  transition: var(--transition);
}
.col-btn svg { width: 16px; height: 16px; fill: currentColor; }
.col-btn:hover { background: var(--cream); color: var(--ink-soft); }
.col-btn.active { background: var(--terra); color: var(--white); }

/* ── GRID ─────────────────────────────────────────────────── */
.recipe-grid {
  display: grid;
  gap: 18px;
}
.recipe-grid.cols-1 { grid-template-columns: 1fr; }
.recipe-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.recipe-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ── CARD ─────────────────────────────────────────────────── */
.recipe-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,.04);
  transition: transform var(--transition), box-shadow var(--transition);
}
.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.recipe-card:active { transform: translateY(-2px); }

.recipe-card__photo {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--cream-dark);
}
.recipe-card__photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.recipe-card:hover .recipe-card__photo img { transform: scale(1.04); }
.recipe-card__no-photo {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  color: #C8B89A;
  background: linear-gradient(135deg, #F5EFE4, #EDE4D6);
}

.recipe-card__info {
  padding: 14px 14px 16px;
}
.recipe-card__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.recipe-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* 3-column: smaller info area */
.cols-3 .recipe-card__title { font-size: .88rem; }
.cols-3 .recipe-card__no-photo { font-size: 2rem; }

/* ── EMPTY / NO RESULTS ───────────────────────────────────── */
.empty-state, .no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 60px 20px;
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 15px;
  text-align: center;
}
.empty-state__icon { font-size: 3rem; }

/* ─────────────────────────────────────────────────────────── */
/* ░░░░░░░░░░░░░░░░  MODAL  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ */
/* ─────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20,10,5,.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--cream);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 640px;
  max-height: 92svh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(40px);
  transition: transform .35s cubic-bezier(.22,1,.36,1);
  position: relative;
  overscroll-behavior: contain;
}
.modal-overlay.open .modal { transform: translateY(0); }

/* Pull handle */
.modal::before {
  content: '';
  display: block;
  width: 44px; height: 4px;
  background: rgba(44,24,16,.18);
  border-radius: 2px;
  margin: 14px auto 0;
}

.modal__close {
  position: sticky; top: 16px;
  float: right;
  margin: 6px 16px 0 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(44,24,16,.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: var(--ink-soft);
  z-index: 2;
  transition: background var(--transition);
}
.modal__close:hover { background: rgba(44,24,16,.15); }

.modal__photo-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--cream-dark);
  margin-top: -2px;
}
.modal__photo-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.modal__photo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem;
  background: linear-gradient(135deg, #F0E8D8, #E4D9C4);
}

.modal__body {
  padding: 24px 24px 40px;
}

.modal__tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 12px;
}
.modal__title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 12px;
}
.modal__meta {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 24px;
}
.modal__divider {
  height: 1px;
  background: linear-gradient(90deg, var(--terra-soft), transparent);
  margin: 0 0 22px;
}
.modal__subtitle {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--terra-dark);
  margin-bottom: 12px;
  margin-top: 24px;
}
.modal__subtitle:first-of-type { margin-top: 0; }

.modal__ingredients ul, .modal__instructions ol {
  padding-left: 22px;
}
.modal__ingredients li, .modal__instructions li {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}
.modal__instructions li::marker { color: var(--terra); font-weight: 600; }
.modal__ingredients li::marker { color: var(--olive-light); }

.modal__notes {
  background: #FFF8ED;
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 16px;
  font-style: italic;
  color: var(--ink-soft);
  white-space: pre-line;
  font-size: 15px;
}

.modal__delete {
  margin-top: 0;
  display: flex;
}

.modal__actions {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.modal__edit {
  display: flex;
}

/* ─────────────────────────────────────────────────────────── */
/* ░░░░░░░░░░░░░░░  TOAST  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ */
/* ─────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink);
  color: var(--cream);
  padding: 12px 24px;
  border-radius: 100px;
  font-family: var(--font-ui);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  transition: transform .35s cubic-bezier(.22,1,.36,1), opacity .35s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 2000;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast--error { background: #C4351D; }

/* ─────────────────────────────────────────────────────────── */
/* ░░░░░░░░░░░░░░  RESPONSIVE  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░ */
/* ─────────────────────────────────────────────────────────── */

/* Tablet */
@media (max-width: 700px) {
  .recipe-form { padding: 28px 20px; }
  .form-row { grid-template-columns: repeat(2, 1fr); }
  .form-row .form-group:last-child { grid-column: 1 / -1; }
  .hero__actions { flex-direction: column; align-items: stretch; max-width: 280px; margin: 0 auto; }
  .recipe-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .section-title { margin-bottom: 28px; }
}

/* Mobile */
@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
  .form-row .form-group:last-child { grid-column: auto; }
  .recipe-grid.cols-2,
  .recipe-grid.cols-3 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .col-btn:last-child { display: none; } /* 3-col hidden on very small screens */
  .form-footer { flex-direction: column; align-items: stretch; }
  .form-footer .btn { width: 100%; justify-content: center; }
  .modal__body { padding: 20px 18px 36px; }
  .modal__title { font-size: 1.4rem; }
  .recipe-form { padding: 24px 16px; }
  .container { padding: 0 16px; }
  .book-section, .form-section { padding: 60px 0 80px; }
}

/* ─────────────────────────────────────────────────────────── */
/* ░░  SCROLLBAR  ░░ */
/* ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--terra-soft); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--terra); }

/* ─────────────────────────────────────────────────────────── */
/* ░░  FOCUS VISIBLE  ░░ */
/* ─────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--terra);
  outline-offset: 3px;
  border-radius: 4px;
}