/*
Theme Name: Favorek
Theme URI: https://favorekperearstikeskus.ee
Author: Favorek Perearstikeskus
Description: Favorek Perearstikeskus OÜ veebilehe teema
Version: 1.0.0
License: Private
Text Domain: favorek
*/

/* ============================================================
   CUSTOM CSS — replicated from React index.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Playfair+Display:wght@400;500;600;700&display=swap');

/* CSS Custom Properties */
:root {
  --background: hsl(150, 10%, 98%);
  --foreground: hsl(160, 25%, 12%);
  --card: hsl(0, 0%, 100%);
  --card-foreground: hsl(160, 25%, 12%);
  --primary: hsl(155, 70%, 30%);
  --primary-foreground: hsl(0, 0%, 100%);
  --secondary: hsl(150, 20%, 94%);
  --secondary-foreground: hsl(160, 25%, 12%);
  --muted: hsl(150, 15%, 93%);
  --muted-foreground: hsl(160, 10%, 45%);
  --accent: hsl(155, 60%, 92%);
  --accent-foreground: hsl(155, 70%, 22%);
  --border: hsl(150, 15%, 88%);
  --input: hsl(150, 15%, 88%);
  --ring: hsl(155, 70%, 30%);
  --radius: 0.75rem;
  --hero-overlay: hsl(155, 50%, 15%);
  --footer-bg: hsl(160, 30%, 10%);
  --footer-fg: hsl(150, 10%, 85%);
  --font-display: 'Playfair Display', serif;
  --font-body: 'DM Sans', sans-serif;
}

html, body {
  overflow-x: hidden;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
}

/* ============================================================
   COMPONENT CLASSES
   ============================================================ */

.page-banner {
  background-color: var(--primary);
  color: var(--primary-foreground);
  padding-top: 4rem;
  padding-bottom: 4rem;
}
@media (min-width: 768px) {
  .page-banner {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }
}
.page-banner h1 {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.2;
}
@media (min-width: 768px) {
  .page-banner h1 { font-size: 2.25rem; }
}
@media (min-width: 1024px) {
  .page-banner h1 { font-size: 3rem; }
}

.section-container {
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 640px) {
  .section-container { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 1024px) {
  .section-container { padding-left: 2rem; padding-right: 2rem; }
}

.content-section {
  padding-top: 3rem;
  padding-bottom: 3rem;
}
@media (min-width: 768px) {
  .content-section { padding-top: 4rem; padding-bottom: 4rem; }
}
@media (min-width: 1024px) {
  .content-section { padding-top: 5rem; padding-bottom: 5rem; }
}

.info-card {
  background-color: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
  border: 1px solid var(--border);
  transition: box-shadow 0.3s;
}
@media (min-width: 768px) {
  .info-card { padding: 2rem; }
}
.info-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
}

.nav-link {
  color: rgba(0,0,0,0.7);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.2s;
  text-decoration: none;
}
.nav-link:hover {
  color: var(--primary);
}
.nav-link-active {
  color: var(--primary) !important;
  font-weight: 600;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

/* ============================================================
   ENTRY-CONTENT — info-card wrapper
   Replicates React .info-card: bg-card rounded-xl p-6 md:p-8
   shadow-sm border border-border hover:shadow-md
   ============================================================ */

.entry-content {
  background-color: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
  border: 1px solid var(--border);
  transition: box-shadow 0.3s;
}
@media (min-width: 768px) {
  .entry-content { padding: 2rem; }
}

/* ============================================================
   HEADINGS
   h2 → React: text-2xl font-bold text-primary mb-6
   h3 → React: font-semibold text-lg mb-3 text-foreground
   ============================================================ */

.entry-content h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 2rem;
  margin-bottom: 1.25rem;
  line-height: 1.25;
}
.entry-content h2:first-child,
.entry-content hr + h2 {
  margin-top: 0;
}
.entry-content h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}
.entry-content h3:first-child { margin-top: 0; }

/* ============================================================
   PARAGRAPHS
   React: text-muted-foreground text-sm md:text-base leading-relaxed
   ============================================================ */

.entry-content p {
  color: var(--muted-foreground);
  font-size: 0.9375rem;
  line-height: 1.75;
  margin-bottom: 1rem;
}
.entry-content p:last-child { margin-bottom: 0; }

.entry-content p strong {
  color: var(--foreground);
  font-weight: 600;
}

/* Italic text — notes and disclaimers */
.entry-content p em,
.entry-content em { font-style: italic; }

/* ============================================================
   BLOCKQUOTE — teal CTA box
   React: bg-primary text-primary-foreground rounded-xl p-6 md:p-8 text-center
   Used in Vaktsineerimine for phone registration CTA
   ============================================================ */

.entry-content blockquote {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  text-align: center;
  margin: 1.5rem 0 0;
  border: none;
}
.entry-content blockquote p {
  color: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content blockquote a {
  color: inherit;
  font-size: 1.375rem;
  font-weight: 700;
  text-decoration: none;
  display: block;
  margin-top: 0.375rem;
}
.entry-content blockquote a:hover { text-decoration: underline; }

/* ============================================================
   HORIZONTAL RULE — section separator between logical groups
   Visually separates multi-section pages (Vajalik info,
   Vaktsineerimine, Kasulik teada, Keel)
   ============================================================ */

.entry-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ============================================================
   LISTS — clean document default
   Plain disc bullets, no backgrounds. Matches the document-like
   React layout used on Isikuandmete, Kasulik teada, Keel, etc.
   ============================================================ */

.entry-content ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin: 0 0 1rem;
}
.entry-content ul:last-child { margin-bottom: 0; }

.entry-content ul li {
  color: var(--muted-foreground);
  font-size: 0.9375rem;
  line-height: 1.75;
  margin-bottom: 0.375rem;
  background: none;
  padding: 0;
}

/* Link-only li rows — always styled as card links with arrow,
   regardless of page. Covers Info lapsevanemale and any other
   link list (li > a is the only child of that li). */
.entry-content ul li:has(> a:only-child) {
  list-style: none;
    margin: 0 0 0.5rem;
}
.entry-content ul li > a:only-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background-color: hsl(150, 20%, 94%, 0.5);
  color: var(--primary);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background-color 0.15s;
}
.entry-content ul li > a:only-child:hover {
  background-color: hsl(155, 60%, 92%);
  text-decoration: none;
}
.entry-content ul li > a:only-child::after {
  content: '→';
  flex-shrink: 0;
  opacity: 0.6;
}

/* ============================================================
   STYLED LISTS — vajalik-info only
   Scoped to .page-vajalik-info body class (added via filter).
   Applies card-row background to ALL li items, plus the teal
   phone-number badge for <li><strong>112</strong> — text</li>
   ============================================================ */

.page-vajalik-info .entry-content ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.page-vajalik-info .entry-content ul li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background-color: hsl(150, 20%, 94%, 0.5);
  margin-bottom: 0;
}

/* Phone number badge: <li><strong>112</strong> — description</li>
   React: font-bold text-primary text-lg min-w-[70px] font-body */
.page-vajalik-info .entry-content ul li strong:first-child {
  color: var(--primary);
  font-weight: 700;
  font-size: 1.125rem;
  font-family: var(--font-body);
  min-width: 4.375rem;
  flex-shrink: 0;
  line-height: 1.625;
}

/* Link-only items within vajalik-info — override the card-row li
   so the <a> itself is the full-width card */
.page-vajalik-info .entry-content ul li:has(> a:only-child) {
  padding: 0;
  background: transparent;
  gap: 0;
}

/* ============================================================
   ORDERED LISTS
   ============================================================ */

.entry-content ol {
  padding-left: 1.5rem;
  margin: 0 0 1rem;
}
.entry-content ol li {
  color: var(--muted-foreground);
  font-size: 0.9375rem;
  line-height: 1.75;
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

/* ============================================================
   LINKS — inline links within paragraphs
   ============================================================ */

.entry-content a {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}
.entry-content a:hover { text-decoration: underline; }

/* ============================================================
   IMAGES
   React: w-full rounded-lg mb-6
   ============================================================ */

.entry-content img,
.entry-content .wp-block-image img {
  width: 100%;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  display: block;
}

/* ============================================================
   TABLES — pricing tables (Hinnakiri)
   React: shadcn/ui Table with tinted thead, hover rows
   ============================================================ */

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  font-size: 0.9375rem;
}
.entry-content table:last-child { margin-bottom: 0; }

.entry-content thead th {
  text-align: left;
  padding: 0.75rem 1rem;
  background-color: hsl(155, 70%, 30%, 0.08);
  font-weight: 600;
  color: var(--foreground);
  border-bottom: 2px solid hsl(155, 70%, 30%, 0.2);
  font-family: var(--font-body);
}
.entry-content td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--foreground);
  vertical-align: top;
}
.entry-content tbody tr:last-child td { border-bottom: none; }
.entry-content tbody tr:hover td {
  background-color: hsl(150, 20%, 94%, 0.5);
}

/* ============================================================
   HINNAKIRI — CPT-based pricing page
   ============================================================ */

/* Effective date line — text-center text-muted-foreground mb-10 text-lg */
.hinnakiri-date {
  text-align: center;
  color: var(--muted-foreground);
  font-size: 1.125rem;
  margin-bottom: 2.5rem;
}

/* Each table section = info-card equivalent */
.hinnakiri-card {
  background-color: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
  border: 1px solid var(--border);
  transition: box-shadow 0.3s;
  margin-bottom: 2rem;
}
@media (min-width: 768px) {
  .hinnakiri-card { padding: 2rem; }
}
.hinnakiri-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
}
.hinnakiri-card:last-child { margin-bottom: 0; }

/* Heading inside each card — text-2xl font-bold text-primary mb-6 */
.hinnakiri-card h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 1.5rem;
}

/* Disclaimer card — smaller text, italic sentences */
.hinnakiri-disclaimer { background-color: hsl(150, 10%, 98%); }
.hinnakiri-disclaimer p {
  color: var(--muted-foreground);
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
}
.hinnakiri-disclaimer p:last-child { margin-bottom: 0; }

/* Pricing table — replicates React shadcn/ui Table */
.favorek-price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.favorek-price-table thead th {
  text-align: left;
  padding: 0.75rem 1rem;
  background-color: hsl(155, 70%, 30%, 0.08);
  font-weight: 600;
  color: var(--foreground);
  border-bottom: 2px solid hsl(155, 70%, 30%, 0.2);
  font-family: var(--font-body);
}
.favorek-price-table thead th.price-col {
  text-align: right;
  width: 8rem;
}
.favorek-price-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--foreground);
  vertical-align: top;
}
.favorek-price-table td.price-col {
  text-align: right;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}
.favorek-price-table tbody tr:last-child td { border-bottom: none; }
.favorek-price-table tbody tr:hover td {
  background-color: hsl(150, 20%, 94%, 0.5);
}

/* ============================================================
   TABLE STYLES (replicating shadcn/ui Table)
   ============================================================ */

.favorek-table { width: 100%; border-collapse: collapse; }
.favorek-table th {
  text-align: left;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.favorek-table th.text-right { text-align: right; }
.favorek-table td {
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  border-bottom: 1px solid var(--border);
  color: var(--foreground);
}
.favorek-table td.text-right { text-align: right; }
.favorek-table td.font-semibold { font-weight: 600; color: var(--primary); }
.favorek-table td.text-muted { color: var(--muted-foreground); }
.favorek-table td.font-medium { font-weight: 500; }
.favorek-table tr:last-child td { border-bottom: none; }
.favorek-table tr:hover td { background-color: rgba(0,0,0,0.02); }

/* ============================================================
   FORM STYLES
   ============================================================ */

.favorek-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
  color: var(--foreground);
}
.favorek-input, .favorek-textarea {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 0.25rem);
  background: var(--card);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--foreground);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.favorek-input:focus, .favorek-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px hsl(155 70% 30% / 0.2);
}
.favorek-textarea { resize: vertical; }
.favorek-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.625rem 1.5rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  border: none;
  border-radius: calc(var(--radius) - 0.25rem);
  cursor: pointer;
  transition: opacity 0.2s;
}
.favorek-btn:hover { opacity: 0.9; }
.favorek-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Alert messages */
.favorek-alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
}
.favorek-alert-success {
  background: hsl(155, 60%, 92%);
  color: hsl(155, 70%, 22%);
  border: 1px solid hsl(155, 50%, 75%);
}
.favorek-alert-error {
  background: hsl(0, 84%, 95%);
  color: hsl(0, 84%, 35%);
  border: 1px solid hsl(0, 84%, 80%);
}

/* Honeypot */
.favorek-honeypot { display: none !important; }

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}
@media (min-width: 768px) {
  .header-inner { height: 5rem; }
}
.site-logo img {
  height: 4rem;
  width: 4rem;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  border: 2px solid hsl(155 70% 30% / 0.2);
}
@media (min-width: 768px) {
  .site-logo img { height: 5rem; width: 5rem; }
}

/* Desktop nav */
.desktop-nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
}
@media (min-width: 1024px) {
  .desktop-nav { display: flex; }
}

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 100;
}
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
}
.nav-dropdown-inner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  padding: 0.5rem 0;
  min-width: 220px;
}
.nav-dropdown-inner a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: background 0.15s;
}
.nav-dropdown-inner a:hover { background: var(--accent); }
.nav-dropdown-inner a.current-item { color: var(--primary); font-weight: 500; }

.chevron-icon {
  display: inline-block;
  transition: transform 0.2s;
}
.nav-dropdown:hover .chevron-icon { transform: rotate(180deg); }

/* CTA button in nav */
.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-foreground) !important;
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  transition: opacity 0.2s;
  text-transform: none !important;
  letter-spacing: 0 !important;
}
.nav-cta:hover { opacity: 0.9; color: var(--primary-foreground) !important; }

/* Mobile toggle */
.mobile-toggle {
  display: flex;
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--foreground);
}
@media (min-width: 1024px) {
  .mobile-toggle { display: none; }
}

/* Mobile nav */
.mobile-nav {
  background: var(--card);
  border-top: 1px solid var(--border);
}
.mobile-nav-inner {
  padding-top: 1rem;
  padding-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.mobile-nav a, .mobile-nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
}
.mobile-sub-menu {
  padding-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.mobile-sub-menu a { font-size: 0.875rem; }
.mobile-nav .nav-cta {
  margin-top: 0.5rem;
  justify-content: center;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  background-color: var(--footer-bg);
  color: var(--footer-fg);
}
.footer-links a {
  color: var(--footer-fg);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 0.875rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--primary); }
.footer-copy {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ============================================================
   HERO
   ============================================================ */

.hero-section {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
@media (min-width: 768px) {
  .hero-section { min-height: 80vh; }
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background-color: hsl(155, 50%, 15%, 0.7);
}
.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  color: #fff;
}
.hero-heading {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.15;
}
@media (min-width: 768px) { .hero-heading { font-size: 3rem; } }
@media (min-width: 1024px) { .hero-heading { font-size: 3.75rem; } }

/* ============================================================
   MISC UTILITIES
   ============================================================ */

.bg-secondary-50 { background-color: hsl(150, 20%, 94%, 0.5); }
.bg-accent-50 { background-color: hsl(155, 60%, 92%, 0.5); }
.text-primary-color { color: var(--primary); }
.text-muted-color { color: var(--muted-foreground); }
.border-color { border-color: var(--border); }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-2xl { max-width: 42rem; }

/* News bullet dot */
.bullet-dot {
  display: inline-block;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 0.5rem;
}
