
/* 
   Shared Styles for Privacy Pages 
   Targeting: privacy.php, privacy-policy.php, privacy-policy-de.php
*/

/* 1. Layout Shells */
.layout, .page-shell {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  min-height: 0;
}

.logo-inline {
  margin-top: -3px !important; /* Global nudge to move logo slightly up on all devices */
}


/* 2. Main Privacy Cards */
main, .policy-card {
  max-width: 920px;
  width: min(920px, 100%);
  max-height: 680px; /* Fixed maximum height for desktop */
  background: #FFFFFF;
  padding: 0;
  border-radius: var(--card-border-radius);
  position: relative;
  color: #111;
  overflow: hidden; /* Use internal scrolling now */
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
}

.policy-content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1.5rem 1.3rem 0; /* Space for scrollbar if any */
}

/* 3. Scrollbar Handling: Hidden by default for Mobile/Tablet to keep clean UI */
@media screen and (max-width: 1024px) {
  *::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
  }
  html, body, main, .policy-card, .policy-content {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
  }
}

/* 3b. Refined Visible Scrollbar for ALL Laptops and Desktops (min-width: 1025px) */
@media screen and (min-width: 1025px) {
  .policy-content {
    scrollbar-width: auto !important;
  }
  .policy-content::-webkit-scrollbar {
    display: block !important;
    width: 10px !important;
  }
  .policy-content::-webkit-scrollbar-track {
    background: transparent !important;
    border-radius: 0;
    margin: 0 !important;
  }
  .policy-content::-webkit-scrollbar-thumb {
    background-color: rgba(15, 53, 88, 0.15) !important;
    border-radius: 8px !important;
    border: 0 !important; /* Ensure no gap on the right */
    margin: 0 !important;
  }
  .policy-content::-webkit-scrollbar-thumb:hover {
    background-color: rgba(15, 53, 88, 0.8) !important;
  }
  .policy-content::-webkit-scrollbar-thumb:active {
    background-color: rgba(15, 53, 88, 1) !important;
  }
}

/* 4. Global Typography for Cards */
h1, .page-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.meta, .meta-info {
  color: #6B7280;
  margin: 0;
  font-size: 14px;
}

h2 { font-size: 20px; margin-top: 1.2rem; margin-bottom: 0.75rem; }
h3 { font-size: 18px; margin-top: 1.5rem; margin-bottom: 0.5rem; }
p { line-height: 1.5; margin-bottom: 0.85rem; font-size: 16px; }
ul { margin-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.5rem; font-size: 16px; }

/* 5. Return/Close Links */
.close-return-link {
  display: inline-block;
  color: var(--ink-orange);
  text-decoration: underline;
  cursor: pointer;
  font-size: 15px;
  position: absolute;
  top: 85px;
  right: 1.5rem;
  z-index: 20;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 4px;
  padding: 2px 6px;
  transition: background 0.2s ease, color 0.2s ease;
}

.close-return-link:hover {
  background: rgba(254, 130, 21, 1);
  color: #fff;
  text-decoration: none;
}

/* Link color for privacy pages text */
main a:not(.close-return-link):not(.btn), 
.policy-card a:not(.close-return-link):not(.btn) {
  color: #0f6ad8 !important;
}

/* 5. LAPTOP (1367px - 1599px) */
@media screen and (min-width: 1367px) and (max-width: 1599px) {
  h1, .page-title {
    font-size: 32px !important;
  }
  .subtitle {
    font-size: 15px !important;
  }
  h2 {
    font-size: 21px !important;
  }
  p, li {
    font-size: 14px !important;
  }
}

/* 6. DESKTOP (min-width: 1600px) */
@media screen and (min-width: 1600px) {
  h1, .page-title {
    font-size: 32px !important;
  }
  .subtitle {
    font-size: 15.2px !important;
  }
  .meta, .meta-info {
    font-size: 14.4px !important;
  }
  h2 {
    font-size: 22.4px !important;
  }
  p, li {
    font-size: 16px !important;
  }
}

/* ==========================================================================
   SPECIFIC TABLET & IPAD QUERIES (REFINED)
   ========================================================================== */

/* 1. TABLET PORTRAIT (768px - 1023px) */
@media screen and (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) {
  main, .policy-card {
    width: 90%;
    max-height: 750px;
    padding: 0;
  }
  h1, .page-title {
    font-size: 32px !important;
  }
  p, li, .meta {
    font-size: 14px !important;
  }
  .subtitle {
    font-size: 15px !important;
  }
  .close-return-link {
    font-size: 15px !important;
  }
  h2 { font-size: 21px !important; }
  h3 { font-size: 20px !important; }
}

/* 2. TABLET LANDSCAPE (768px - 1199px) */
@media screen and (min-width: 768px) and (max-width: 1199px) and (orientation: landscape) {
  main, .policy-card {
    width: 66%;
    max-height: 550px;
    padding: 0;
  }
  h1, .page-title {
    font-size: 32px !important;
  }
  p, li, .meta {
    font-size: 14px !important;
  }
  .subtitle {
    font-size: 15px !important;
  }
  h2 { font-size: 21px !important; }
  .close-return-link {
    font-size: 15px !important;
  }
  .close-return-link {
    position: absolute !important;
    top: 80px !important;
    right: 1.6rem !important;
    margin-bottom: 0 !important;
  }
}

/* 3. LARGE TABLET PORTRAIT (1024px - 1194px) */
@media screen and (min-width: 1024px) and (max-width: 1194px) and (orientation: portrait) {
  main, .policy-card {
    width: 90%;
    max-height: 750px;
    padding: 0;
  }
  h1, .page-title {
    font-size: 32px !important;
  }
  p, li, .meta {
    font-size: 14px !important;
  }
  .subtitle {
    font-size: 15px !important;
  }
  h2 {
    font-size: 21px !important;
  }
  .close-return-link {
    position: absolute !important;
    top: 85px !important;
    right: 1.4rem !important;
  }
}

/* 4. LARGE TABLET LANDSCAPE (1200px - 1366px) */
@media screen and (min-width: 1200px) and (max-width: 1366px) and (orientation: landscape) {
  main, .policy-card {
    width: 60%;
    max-height: 500px;
  }
  h1, .page-title {
    font-size: 32px !important;
  }
  p, li, .meta { font-size: 14px; }
  .subtitle { font-size: 15px !important; }
  h2 { font-size: 21px !important; }
  .close-return-link {
    position: absolute !important;
    top: 85px !important;
    right: 1.7rem !important;
  }
}


/* SHARED MOBILE LANDSCAPE (Strictly < 933px) */
@media screen and (max-width: 932px) and (orientation: landscape) {
  .layout, .page-shell {
    padding: 0.5rem;
    justify-content: center;
    min-height: auto;
  }

  main, .policy-card {
    width: 95%;
    height: 220px !important;
    overflow-y: auto !important;
    padding: 0;
    border-radius: 24px;
    margin-bottom: 0.15rem;
  }

  h1, .page-title {
    font-size: 18px !important;
  }

  p, li, strong {
    font-size: 12px !important;
    margin-bottom: 0.65rem;
  }

  .meta, .meta-info {
    font-size: 12px !important;
  }

  .subtitle {
    font-size: 12px !important;
  }

  h2 {
    font-size: 15px !important;
  }

  h3 {
    font-size: 13px !important;
  }

  .close-return-link {
    font-size: 14px !important;
    position: absolute !important;
    top: 65px !important;
    right: 1.55rem !important;
    padding: 0 !important;
  }

  .site-footer {
    padding: 0 0 1.6rem !important;
    font-size: 12px !important;
  }
}

/* SHARED MOBILE PORTRAIT (Strictly < 768px) */
@media screen and (max-width: 767px) and (orientation: portrait) {
  .layout, .page-shell {
    padding: 0;
    justify-content: center;
  }

  main, .policy-card {
    width: 92%;
    max-height: 600px;
    padding: 0;
    border-radius: 24px;
    margin-bottom: 0.25rem;
  }

  h1, .page-title {
    font-size: 18px !important;
  }

  p, li, strong {
    font-size: 12px !important;
    margin-bottom: 0.5rem;

  }

  .meta, .meta-info {
    font-size: 12px !important;
  }

  .subtitle {
    font-size: 12px !important;
  }

  h2 {
    font-size: 15px !important;
  }

  h3 {
    font-size: 13px !important;
  }

  .close-return-link {
    font-size: 13px !important;
    position: absolute !important;
    top: 65px !important;
    right: 1.4rem !important;
    padding: 0 !important;
  }
}


/* Specific adjustment for small devices (e.g., iPhone SE/375px) */
@media screen and (max-width: 375px) and (orientation: portrait) {
  main, .policy-card {
    max-height: 550px;
  }

  .page-title{
    font-size: 18px !important;
  }
}

@supports (-webkit-touch-callout: none) {
  /* Safari specific refinements to stop rubber-band/bouncy effect */
  html, body {
    overscroll-behavior: none;
  }
}