/* =========================================================
   Shibafan.de – bereinigte style.css
   Moderne responsive Basis + fehlerfreie Slideshow-Navigation
   ========================================================= */

/* ---------- Variablen ---------- */
:root {
  --content-width: 1100px;
  --media-width: 900px;
  --radius-lg: 18px;
  --gap: clamp(0.75rem, 2vw, 1.25rem);

  --bg: #fff8eb;
  --paper: #ffffff;
  --text: #2f2f2f;
  --muted: #666666;
  --gold: #d6a529;
  --gold-dark: #a97808;
  --green: #7aa63a;
  --line: #efd69a;
  --shadow: 0 12px 32px rgba(67, 45, 11, 0.14);
}

/* ---------- Reset / Basis ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #fffdf7 0%, var(--bg) 45%, #fff7df 100%);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

.site-header a,
.mainnav a,
.slideshow-dot {
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Kopfbereich ---------- */
.site-header,
.mainnav,
footer {
  width: min(var(--content-width), calc(100% - 32px));
  max-width: none;
}

.site-header {
  margin: 24px auto 0;
  padding: 0;
}

.hero-image {
  width: 100%;
  height: auto;
  border: 6px solid var(--gold);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  box-shadow: var(--shadow);
}

/* ---------- Navigation ---------- */
.mainnav {
  margin: 0 auto 28px;
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  background: var(--gold);
  border: 6px solid var(--gold);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  box-shadow: var(--shadow);
}

.mainnav a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  padding: 8px 13px;
  border-radius: 999px;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.mainnav a.active,
.mainnav a[aria-current="page"],
.mainnav a:hover,
.mainnav a:focus-visible {
  background: var(--gold-dark);
}

.mainnav a:hover,
.mainnav a:focus-visible {
  transform: translateY(-1px);
}

/* ---------- Layout ---------- */
main {
  width: min(100% - 2rem, var(--content-width));
  margin-inline: auto;
  padding-bottom: 32px;
}

.intro,
.feature,
.card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.intro {
  padding: clamp(22px, 4vw, 42px);
  text-align: center;
}

.feature {
  padding: clamp(24px, 4vw, 38px);
  margin-bottom: 34px;
  background: linear-gradient(135deg, #ffffff 0%, #fff1c8 100%);
}

.card {
  padding: 24px;
  overflow: hidden;
}

.card-grid {
  margin: 32px 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

/* ---------- Typografie ---------- */
.eyebrow {
  display: inline-block;
  color: var(--green);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

h1,
h2,
h3 {
  line-height: 1.2;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  color: var(--gold-dark);
}

h2,
h3,
.card h2,
.feature h2 {
  color: var(--gold-dark);
}

.card h2,
.feature h2 {
  margin-top: 0;
}

.intro > p,
.feature p,
.card p {
  color: var(--muted);
}

.intro > p {
  max-width: 780px;
  margin: 0 auto 24px;
  font-size: 1.08rem;
}

.feature p {
  max-width: 760px;
}

/* ---------- Links in Karten ---------- */
.card a {
  display: inline-block;
  margin-top: 8px;
  color: #ffffff;
  background: var(--green);
  text-decoration: none;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 999px;
}

.card a:hover,
.card a:focus-visible {
  background: #5d8427;
}

/* ---------- Bildbereiche ---------- */
.responsive-media,
.photo-grid,
.slideshow {
  width: min(100%, var(--media-width));
  margin: 1rem auto;
}

.responsive-media {
  margin-block: 1rem;
}

.responsive-media img,
.photo-grid img,
.slideshow-frame img {
  width: 100%;
  border-radius: 14px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

.photo-grid figure,
.responsive-media {
  margin-inline: auto;
}

.photo-grid .wide {
  grid-column: 1 / -1;
}


/* Zwei Hochformatbilder nebeneinander */
.portrait-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 440px));
  gap: 20px;
  justify-content: center;
  align-items: start;
  width: min(100%, var(--media-width));
  margin: 1rem auto;
}

.portrait-pair figure {
  margin: 0;
}

.portrait-pair img {
  width: 100%;
  max-width: 440px;
  height: auto;
  display: block;
}

/* ---------- JavaScript-Slideshow mit Punkten ---------- */
.slideshow {
  position: relative;
  margin: 1rem auto 2rem;
}

.slideshow-frame {
  position: relative;
  overflow: hidden;
  border: 6px solid var(--gold);
  border-radius: var(--radius-lg);
  background: #f3f3f3;
  box-shadow: var(--shadow);
  aspect-ratio: 18 / 13;
  isolation: isolate;
}

.slideshow-frame img {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 900ms ease-in-out;
}

.slideshow-frame img.active {
  opacity: 1;
  z-index: 1;
}

.slideshow-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.slideshow-dot {
  width: 0.75rem;
  height: 0.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #c9c9c9;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.slideshow-dot:hover,
.slideshow-dot:focus-visible {
  background: #999999;
  transform: scale(1.15);
}

.slideshow-dot.active {
  background: #555555;
}

/* ---------- Alte CSS-Slideshow-Unterstützung ----------
   Nur für ältere Seiten, die noch .slide / .slide-1 usw. nutzen.
   Auf der Freunde-Seite wird stattdessen .slideshow-frame img.active verwendet.
*/
.slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  animation: slideshow 36s infinite;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-1 { animation-delay: 0s; }
.slide-2 { animation-delay: 6s; }
.slide-3 { animation-delay: 12s; }
.slide-4 { animation-delay: 18s; }
.slide-5 { animation-delay: 24s; }
.slide-6 { animation-delay: 30s; }

@keyframes slideshow {
  0% { opacity: 0; }
  4% { opacity: 1; }
  16% { opacity: 1; }
  20% { opacity: 0; }
  100% { opacity: 0; }
}

/* ---------- Rasse-/Infobox ---------- */
.breed-box {
  width: min(900px, 100%);
  margin: 0 auto;
  text-align: left;
  border: 4px solid var(--gold);
  background: var(--paper);
  border-radius: 14px;
  overflow: hidden;
}

.breed-headline {
  text-align: center;
  padding: 24px 24px 18px;
  border-bottom: 4px solid var(--gold);
  background: linear-gradient(135deg, #fff8df, #ffffff);
}

.breed-headline h2 {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 4vw, 3rem);
  color: #3d3d3d;
}

.breed-headline h3 {
  margin: 0;
  color: var(--gold-dark);
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
}

.breed-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.breed-columns > div {
  padding: 24px;
}

.breed-columns > div + div {
  border-left: 4px solid var(--gold);
}

.breed-columns h3 {
  margin: 0 0 6px;
  color: var(--gold-dark);
  font-size: 1.1rem;
}

.breed-columns p,
.breed-columns ul {
  margin: 0 0 18px;
}

.breed-columns ul {
  padding-left: 22px;
}

/* ---------- Puppy Gallery ---------- */
.puppy-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.puppy-photo {
  display: block;
  overflow: hidden;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.puppy-photo:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.puppy-photo img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.puppy-photo span {
  display: block;
  padding: 0.8rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}

/* ---------- Footer ---------- */
footer {
  margin: 0 auto 24px;
  padding: 30px 16px;
  text-align: center;
  color: #ffffff;
  background: var(--gold);
  border-radius: 18px;
}

footer p {
  margin: 0;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-nav a {
  display: inline-block;
  padding: 9px 14px;
  background: var(--gold);
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 999px;
  transition: 0.2s ease;
}

.footer-nav a:hover {
  background: var(--gold-dark);
}

/* ---------- Fokus ---------- */
.slideshow-dot:focus-visible,
.mainnav a:focus-visible,
.card a:focus-visible,
.footer-nav a:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 4px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .puppy-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 820px) {
  .breed-columns {
    grid-template-columns: 1fr;
  }

  .breed-columns > div + div {
    border-left: 0;
    border-top: 4px solid var(--gold);
  }

  .mainnav {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 700px) {
  main {
    width: min(100% - 1rem, var(--content-width));
  }

  .photo-grid,
  .puppy-gallery {
    grid-template-columns: 1fr;
  }

  .portrait-pair {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 1rem;
  }

  .slideshow-frame {
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 560px) {
  .puppy-photo img {
    height: auto;
  }
}

@media (max-width: 540px) {
  .site-header {
    margin-top: 10px;
  }

  .intro,
  .card,
  .feature {
    border-radius: 14px;
  }

  .slideshow-frame {
    border-width: 4px;
    border-radius: 12px;
  }

  .breed-box {
    border-width: 3px;
  }

  .breed-headline,
  .breed-columns > div {
    padding: 18px;
  }
}

/* ---------- Bewegungsreduktion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  .slideshow-frame img {
    transition: none;
  }

  .slide {
    animation: none;
  }

  .slide-1 {
    opacity: 1;
  }
}
.back-top-box {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 36px 16px;
  margin: 32px 0;
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  width: auto;
  height: auto;
  min-width: 160px;
  padding: 12px 24px;

  border-radius: 999px;
  background: var(--green);
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1;
  white-space: nowrap;

  box-shadow: var(--shadow);
  transition: 0.25s ease;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: #5d8427;
  transform: translateY(-2px);
}
.back-top-box{
    width: min(var(--content-width), calc(100% - 32px));
    margin: 20px auto 16px;
    padding: 24px 16px;

    display: flex;
    justify-content: center;
    align-items: center;

    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}
footer{
    width: min(var(--content-width), calc(100% - 32px));
    margin: 0 auto 24px;
}
/* Einheitliches Design für externe Links */
.external-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;

    min-width:180px;
    padding:12px 24px;

    background:var(--gold);
    color:#fff;
    text-decoration:none;
    font-weight:700;
    font-size:1rem;
    line-height:1;

    border-radius:999px;
    box-shadow:var(--shadow);
    transition:all .25s ease;
}

.external-button:hover,
.external-button:focus-visible{
    background:var(--gold-dark);
    transform:translateY(-2px);
}
.button-center{
    text-align:center;
    margin-top:20px;
    margin-bottom:20px;
}


/* ---------- Startseiten-Slideshow: responsive, Shibafan-Layout ---------- */
.intro .slideshow {
  position: relative;
  width: min(100%, var(--media-width));
  margin: 1rem auto 2rem;
  overflow: hidden;
  border: 6px solid var(--gold);
  border-radius: var(--radius-lg);
  background: #f3f3f3;
  box-shadow: var(--shadow);
  aspect-ratio: 18 / 13;
  isolation: isolate;
}

.intro .slideshow .slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  animation-name: slideshow;
  animation-duration: 36s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.intro .slideshow .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.intro .slideshow .slide-1 { animation-delay: 0s; }
.intro .slideshow .slide-2 { animation-delay: 6s; }
.intro .slideshow .slide-3 { animation-delay: 12s; }
.intro .slideshow .slide-4 { animation-delay: 18s; }
.intro .slideshow .slide-5 { animation-delay: 24s; }
.intro .slideshow .slide-6 { animation-delay: 30s; }

@keyframes slideshow {
  0% { opacity: 0; }
  4% { opacity: 1; }
  16% { opacity: 1; }
  20% { opacity: 0; }
  100% { opacity: 0; }
}

@media (max-width: 700px) {
  .intro .slideshow {
    aspect-ratio: 4 / 3;
    border-width: 4px;
    border-radius: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro .slideshow .slide {
    animation: none;
  }

  .intro .slideshow .slide-1 {
    opacity: 1;
  }
}


/* Korrektur: Hauptnavigation bleibt auf allen Bildschirmgrößen mittig */
.mainnav {
  justify-content: center;
  text-align: center;
}

@media (max-width: 820px) {
  .mainnav {
    justify-content: center;
    text-align: center;
  }
}
