/*
 * Psychotherapiepraxis Dr. Rico Pohling - Responsive Redesign
 * Based on original "Coffee N Cream" color scheme
 * Mobile-first responsive design with CSS custom properties
 */

/* ===== Custom Properties ===== */
:root {
  --color-bg: #655A46;
  --color-container: #F5F0E8;
  --color-container-border: #C8BDA8;
  --color-text: #543;
  --color-text-dark: #420;
  --color-heading: #654;
  --color-link: #963;
  --color-link-hover: #C60;
  --color-header-bg: #4A3F30;
  --color-header-text: #E4DBCF;
  --color-nav-bg: #E8E0D0;
  --color-nav-border: #C8BDA8;
  --color-nav-hover: #CEBDA1;
  --color-footer-bg: #958463;
  --color-footer-text: #FED;
  --color-footer-link: #FFD;
  --color-sidebar-heading: #BCB39F;
  --color-sidebar-link: #CCC3AF;
  --color-sidebar-link-hover: #D6CCB9;
  --color-button-bg: #BCB39F;
  --color-button-border: #654;
  --color-input-border: #654;
  --font-main: "Segoe UI", "Lucida Sans Unicode", sans-serif;
  --font-heading: "Segoe UI", "Lucida Sans Unicode", "Trebuchet MS", sans-serif;
  --max-width: 1080px;
  --nav-height: 56px;
  --header-padding: 2rem;
}

/* ===== Reset ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== Base ===== */
html {
  font-size: 87.5%;
  scroll-behavior: smooth;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-main);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--color-link);
  transition: color 0.2s;
}

a:hover {
  color: var(--color-link-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== Layout Container ===== */
.site-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  background: var(--color-container);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Header ===== */
.site-header {
  background: var(--color-header-bg);
  background: linear-gradient(135deg, #3D3425 0%, #5A4D3A 50%, #4A3F30 100%);
  padding: 1.25rem var(--header-padding);
  color: var(--color-header-text);
}

.site-header h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-header-text);
  margin-bottom: 0.15rem;
  line-height: 1.3;
}

.site-header h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--color-header-text);
  margin-bottom: 0.1rem;
  line-height: 1.3;
}

.site-header h3 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--color-header-text);
  opacity: 0.9;
  line-height: 1.3;
}

/* ===== Navigation ===== */
.site-nav {
  background: var(--color-nav-bg);
  border-bottom: 1px solid var(--color-nav-border);
  position: relative;
  z-index: 100;
}

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

.nav-phone {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.9rem;
  white-space: nowrap;
  padding: 0.75rem 0;
}

.nav-phone a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.nav-phone a::before {
  content: "☎ ";
}

.nav-phone a:hover {
  color: var(--color-link-hover);
}

/* Hamburger Toggle */
.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: none;
  cursor: pointer;
  padding: 0.75rem 0;
  z-index: 101;
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  display: block;
  background: var(--color-text);
  height: 2px;
  width: 24px;
  border-radius: 2px;
  position: relative;
  transition: all 0.3s;
}

.nav-toggle-label span::before,
.nav-toggle-label span::after {
  content: "";
  position: absolute;
}

.nav-toggle-label span::before {
  top: -7px;
}

.nav-toggle-label span::after {
  top: 7px;
}

.nav-toggle:checked ~ .nav-toggle-label span {
  background: transparent;
}

.nav-toggle:checked ~ .nav-toggle-label span::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle:checked ~ .nav-toggle-label span::after {
  top: 0;
  transform: rotate(-45deg);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 0;
}

.nav-links a {
  display: block;
  padding: 0.85rem 0.9rem;
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--color-nav-hover);
  color: var(--color-text-dark);
}

/* ===== Main Content ===== */
.site-main {
  flex: 1;
  padding: 1.5rem var(--header-padding);
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.site-main h1 {
  color: var(--color-heading);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  padding-top: 0.5rem;
}

.site-main h2 {
  color: var(--color-heading);
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
  padding-top: 0.5rem;
}

.site-main h3 {
  color: var(--color-heading);
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
  padding-top: 0.35rem;
}

.site-main p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.site-main ul,
.site-main ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.site-main li {
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

/* ===== Content with Image Float ===== */
.content-image-left {
  float: left;
  margin: 0 1.5rem 1rem 0;
  max-width: 280px;
  border-radius: 4px;
}

.content-image-right {
  float: right;
  margin: 0 0 1rem 1.5rem;
  max-width: 280px;
  border-radius: 4px;
}

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--color-footer-bg);
  background: linear-gradient(to bottom, #A08E70 0%, #958463 30%);
  color: var(--color-footer-text);
  padding: 1rem var(--header-padding);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--color-footer-link);
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer a:hover {
  color: #FFF;
  text-decoration: underline;
}

.footer-left {
  display: flex;
  gap: 1.5rem;
}

.footer-right,
.footer-right a {
  color: #C0B8A6;
  font-size: 0.85rem;
}

.footer-right a:hover {
  color: #FFE;
}

/* ===== Tables ===== */
.responsive-table {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.responsive-table table {
  width: 100%;
  border-collapse: collapse;
}

.responsive-table td,
.responsive-table th {
  padding: 0.5rem 0.75rem;
  vertical-align: top;
  text-align: left;
  border-bottom: 1px solid #E0D8C8;
}

.responsive-table tr:last-child td {
  border-bottom: none;
}

/* CV table specific */
.cv-table,
.cv-table tr,
.cv-table td {
  border: 0 !important;
  border-collapse: collapse;
}

.responsive-table .cv-table td,
.cv-table td {
  border: 0 !important;
  padding-bottom: 0.6rem;
}

.cv-table td:first-child {
  white-space: nowrap;
  font-weight: 600;
  width: 20%;
  min-width: 120px;
}

/* CV photo: centered on mobile, floated right on desktop so text wraps around it */
.cv-photo-float {
  display: block;
  max-width: 265px;
  width: 100%;
  height: auto;
  margin: 0 auto 1rem auto;
}

/* Price table */
.price-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.price-table td {
  padding: 0.4rem 0.75rem;
  vertical-align: top;
  border-bottom: 1px solid #E0D8C8;
}

.price-table td:first-child {
  width: 35%;
}

/* Info table (impressum etc.) */
.info-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.info-table td {
  padding: 0.3rem 0.75rem 0.3rem 0;
  vertical-align: top;
}

.info-table td:first-child {
  font-weight: 600;
  padding-right: 1rem;
}

/* ===== Contact Form ===== */
.contact-form {
  max-width: 600px;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.85rem;
}

.form-group label {
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--color-heading);
  font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
  color: var(--color-heading);
  background: #FFF;
  border: 1px solid var(--color-input-border);
  font-family: var(--font-main);
  font-size: 1rem;
  padding: 0.6rem 0.75rem;
  border-radius: 3px;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-link);
  box-shadow: 0 0 0 2px rgba(153, 102, 51, 0.2);
}

.form-group textarea {
  resize: vertical;
  min-height: 150px;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.btn {
  color: var(--color-heading);
  background: var(--color-button-bg);
  border: 1px solid var(--color-button-border);
  font-family: var(--font-main);
  font-size: 1rem;
  padding: 0.6rem 1.5rem;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.btn:hover {
  background: #D6CCB9;
  color: var(--color-text-dark);
}

/* ===== Google Maps Responsive ===== */
.map-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin-bottom: 1rem;
  border-radius: 4px;
}

.map-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ===== Address Image (email obfuscation) ===== */
.address img {
  border: none;
  vertical-align: middle;
  display: inline;
  max-width: 220px;
}

/* ===== Utility ===== */
.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;
}

/* ===== Mobile Breakpoint (< 768px) ===== */
@media (max-width: 900px) {
  :root {
    --header-padding: 1.25rem;
  }

  .site-header h1 {
    font-size: 1.2rem;
  }

  /* Phone link: subtle tap target on mobile — only in nav bar */
  .site-nav .nav-phone a {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    background: #DDD4C2;
    color: var(--color-text);
    border-radius: 4px;
    text-decoration: none;
    font-size: 1rem;
  }

  .site-nav .nav-phone a:hover,
  .site-nav .nav-phone a:active {
    background: #D4C9B5;
    color: var(--color-text);
  }

  .site-header h2 {
    font-size: 1.05rem;
  }

  .site-header h3 {
    font-size: 0.85rem;
  }

  /* Hamburger visible */
  .nav-toggle-label {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-nav-bg);
    border-bottom: 2px solid var(--color-nav-border);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  }

  .nav-toggle:checked ~ .nav-links {
    display: flex;
  }

  .nav-links a {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--color-nav-border);
  }

  .nav-links li:last-child a {
    border-bottom: none;
  }

  /* Images */
  .content-image-left,
  .content-image-right {
    float: none;
    margin: 0 auto 1rem auto;
    max-width: 100%;
  }

  /* Tables */
  .cv-table td:first-child {
    white-space: normal;
  }

  /* CV table stacked on mobile */
  .cv-mobile-stack td {
    display: block;
    width: 100%;
    padding: 0.25rem 0.5rem;
  }

  .cv-mobile-stack td:first-child {
    white-space: nowrap;
  }

  .cv-mobile-stack tr {
    display: block;
    border-bottom: 1px solid #E0D8C8;
    padding: 0.5rem 0;
  }

  .cv-mobile-stack td:first-child {
    font-weight: 700;
  }

  /* Info table stacked on mobile */
  .info-table td {
    display: block;
    width: 100%;
    padding: 0.2rem 0;
  }

  .info-table tr {
    display: block;
    border-bottom: 1px solid #E0D8C8;
    padding: 0.5rem 0;
  }

  .info-table td:first-child {
    font-weight: 700;
    padding-bottom: 0;
  }

  /* Price table: service name full-width, duration+price side-by-side */
  .price-table tr {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid #E0D8C8;
    padding: 0.4rem 0;
  }

  .price-table td,
  .responsive-table .price-table td {
    border-bottom: none;
    padding: 0.1rem 0.5rem 0.1rem 0;
  }

  .price-table td:first-child {
    flex-basis: 100%;
    font-weight: 700;
    width: auto;
  }

  /* Prevent horizontal overflow */
  .site-main {
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Footer stacked */
  .site-footer {
    flex-direction: column;
    text-align: center;
  }

  .footer-left {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* ===== Tablet (768px - 1024px) ===== */
@media (min-width: 901px) and (max-width: 1024px) {
  :root {
    --header-padding: 1.5rem;
  }

  .content-image-left,
  .content-image-right {
    max-width: 240px;
  }
}

/* ===== Desktop (> 1024px) ===== */
@media (min-width: 1025px) {
  .site-header h1 {
    font-size: 1.8rem;
  }

  .site-header h2 {
    font-size: 1.5rem;
  }

  .site-header h3 {
    font-size: 1.05rem;
  }

  .nav-links a {
    font-size: 0.85rem;
    padding: 0.85rem 0.75rem;
  }
}

/* ===== CV photo float (desktop/tablet landscape) =====
   Convert the CV table to block layout so the copy flows around
   the right-floated portrait. */
@media (min-width: 901px) {
  .cv-photo-float {
    float: right;
    width: 265px;
    max-width: 35%;
    margin: 0 0 1rem 1.5rem;
    border-radius: 4px;
  }

  .cv-wrap {
    overflow: visible;
  }

  .cv-wrap .cv-table,
  .cv-wrap .cv-table tbody,
  .cv-wrap .cv-table tr,
  .cv-wrap .cv-table td {
    display: block;
  }

  .cv-wrap .cv-table td {
    padding: 0;
    border: 0 !important;
    width: auto;
  }

  .cv-wrap .cv-table tr {
    margin-bottom: 0.7rem;
  }

  .cv-wrap .cv-table td.cv-year {
    float: left;
    clear: left;
    width: 180px;
    font-weight: 600;
  }

  .cv-wrap .cv-table td.cv-content {
    margin-left: 195px;
  }

  /* Clear the float so following headings don't overlap the photo */
  .cv-photo-float ~ h2,
  .cv-photo-float ~ h3 {
    clear: both;
  }
}

/* ===== Print ===== */
@media print {
  .site-nav,
  .nav-toggle-label {
    display: none;
  }

  .site-wrapper {
    max-width: 100%;
  }

  .site-main {
    padding: 1rem;
  }
}
