
:root {
	--crasy-font: 'Comfortaa', cursive;
	--crasy-bg-light: #D6CFE1;     /* Hauptfarbe hell */
	--crasy-accent: #896F99;       /* Akzentfarbe dunkel */
	--crasy-text-dark: #333333;
	--bg-gradient-start: #896F99;
	--bg-gradient-end: #D67AA3;
	--card-bg: #ffffff;
	--text-color: #2c3e50;
	--accent-color: #009688;
	--border-radius: 16px;
}

body {
	//background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
	min-height: 100vh;
	margin: 0;
	padding: 20px 0;
	box-sizing: border-box;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	color: var(--text-color);
}


/* Das Hauptnetz (Grid) */
.download-list, #grid {
    box-sizing: border-box;
}

/* Sobald der Bildschirm schmaler als 900px ist (Tablets & Smartphones) */
@media (max-width: 900px) {
    .download-list, #grid {
        /* Wir überschreiben das automatische Grid und erzwingen genau EINE Spalte untereinander */
        grid-template-columns: 1fr !important; 
        width: 100% !important;
        padding: 0 15px;
    }
}

/* 1. Den übergeordneten Container aufbrechen und auf volle Breite zwingen */
#anleitungen-grid {
    display: grid;
    /* Nutzt die Automatik: Passt so viele Spalten an, wie auf den Monitor passen */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    grid-gap: 20px;
    grid-auto-rows: 10px;
    align-items: start;
    
    /* DIESE ZEILEN SIND JETZT ENTSCHEIDEND: */
    width: 100vw !important;
    max-width: 1400px;
    padding: 0 40px 90px 40px;            /* Ein schicker, kleiner Sicherheitsabstand zu den Bildschirmrändern */
    box-sizing: border-box;
}

/* 2. Falls das übergeordnete Element (z.B. der <main> oder <div> Tag) das Grid einengt: */
.shop-bibliothek-wrapper, 
main, 
.content-area { 
    /* Ersetze diese Klassen falls nötig mit dem Namen deines Haupt-Containers */
    max-width: 100% !important; 
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}


/* Das Haupt-Item auf dem PC flexibel halten */
.download-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: #ffffff;
    border-radius: 12px;
    
    /* ÄNDERUNG: Von 'hidden' auf 'visible' ändern, damit ausgeklappte 
       Inhalte das Grid-System mathematisch sauber nach unten drücken können! */
    overflow: visible !important; 
    
    position: relative;
    box-sizing: border-box;
}

/* Der Container, der den Text und die Buttons hält */
.download-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 15px;
    /* Damit die absolute Trennlinie oder Footer-Buttons niemals über den Text rutschen */
    position: relative; 
    box-sizing: border-box;
}


/* DIE FIXIERUNG FÜR DIE HASHTAG-BOX */
.tags-container-shared { /* Tausche das ggf. gegen deine echte Cloud-Klasse aus */
    width: 100%;
    margin-bottom: 15px !important; /* Erzwingt einen Sicherheitsabstand nach unten zur Trennlinie */
    display: block;
    clear: both;
}

/* REPARATUR FÜR DEN TITEL */
.download-title,
.download-item h3, /* Falls es ein H3 oder H2 Tag ist */
.download-item [class*="title"] {
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box !important;
	
	/* Das hier bricht lange Titel und endlose Wörter radikal auf! */
	white-space: normal !important;
	overflow-wrap: break-word !important;
	word-break: break-word !important;
	hyphens: auto !important;
	
	/* Optional: Leicht kleinere Schriftgröße für Handys, 
	   damit es bei zwei Spalten harmonisch aussieht */
	font-size: 14px !important; 
}

/* 3. SMARTPHONE-ANPASSUNG (Damit es auf dem Handy nicht an den Rand klatscht) */
@media (max-width: 576px) {
    /* 1. Hauptcontainer befreien */
    #main {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .content-main, .content-main--inner, .container, .shop-bibliothek-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* 2. DAS GRID BLIEBT EIN NATIVES GRID (Wie am PC, nur mit 2 Spalten) */
    #anleitungen-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important; /* 2 Spalten auf dem Handy */
        grid-gap: 12px !important; /* Identischer Abstand wie am PC */
        grid-auto-rows: 4px !important; /* WICHTIG: Das muss exakt derselbe Pixel-Wert sein, mit dem dein JS am PC rechnet! (z.B. 4px oder 5px) */
        
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 12px !important;
        box-sizing: border-box !important;
    }

    /* 3. Karten-Stabilität (Das JS bestimmt wieder den Span!) */
    .download-item {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: hidden; /* Verhindert das Zucken beim ersten Laden */
        box-sizing: border-box !important;
        
        /* WICHTIG: KEIN "grid-row-end: auto" mehr! Das JS darf hier wieder reinschreiben */
    }

    /* 4. Bilder anpassen */
    .download-item img,
    .download-cover,
    .download-cover-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    /* 5. BUTTON-REPARATUR FÜR MOBILE ENGASSSE */
    .download-item .btn,
    .download-item button,
    .download-item a[class*="btn"] {
        display: inline-flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px !important;
        
        /* ÄNDERUNG: Absoluter Riegel vor das Ausbrechen */
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        
        /* Erlaubt dem Text, bei Platzmangel zweizeilig zu werden */
        white-space: normal !important; 
        word-break: break-word !important;
        hyphens: auto !important; /* Trennt lange Wörter wie "Anleitung" falls nötig */
        
        padding: 8px 4px !important; /* Leicht reduzierter Innenabstand, damit mehr Text reinpasst */
        font-size: 12px !important;  /* Schmeichelt kleinen Smartphone-Displays */
    }

    /* Sicherstellen, dass das Icon und der Text kompakt bleiben */
    .download-item .btn i,
    .download-item button i {
        flex-shrink: 0 !important; /* Icon darf niemals kleiner gequetscht werden */
    }
	
	.download-title {
		font-size: 1rem;
	}
	
	
	.download-tag-wrapper {
		padding: 0 5px 15px 5px !important;
	}
	
	.download-content {
		padding: 5px !important;
	}
	
	
	.download-sub-actions {
		background: #fff !important;
    }
}


/* NEU: Eine CSS-Klasse, die das JavaScript anhängt, um die Karte einzublenden */
.download-item.crasy-is-visible {
    opacity: 1;
    visibility: visible;
}

/* Bereich 1: Hält Bild & Text nebeneinander */
.download-main-content {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	/*gap: 15px;*/
	width: 100%;
}

/* Das Cover-Foto (und dessen Wrapper aus JS) */
/* BILDER IN DEN FOKUS RÜCKEN */
.download-cover-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
    /* aspect-ratio entfernen! */

    /* NEU: Ein kleiner Platzhalter, damit die Box nicht '0' hoch ist,
       bevor das Bild geladen ist. So rechnet das Skript nicht mit 0-Werten. */

}

/* Wenn der Kunde mit der Maus über die Karte oder das Bild fährt */
.download-item:hover .download-cover-wrapper {
    transform: translateY(-4px); /* Karte hebt sich leicht an */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15); /* Schatten wird intensiver */
}

.download-cover {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease; /* Weicher Zoom-Effekt */
}

.download-item:hover .download-cover {
    transform: scale(1.04); /* Das Bild zoomt ganz dezent rein */
}

/* EINHEITLICHER LOOK FÜR DIE TAG-BADGES */
.tag-badge {
    display: inline-block;
    background: #f0f4f8;
    color: #007bff;
    padding: 4px 10px;
    margin: 3px 4px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
    border: 1px solid #e1e8ed;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap; /* Verhindert hässliche Zeilenumbrüche IM Tag */
}

.tag-badge:hover {
    background: #e1e8ed;
    color: #0056b3;
}

/* Rechter Textbereich (fängt sowohl PHP als auch JS-Klassen ab) */
.download-details,
.download-content {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

/* Titel & Meta */
.download-title {
	font-weight: 700;
	font-size: 14px;
	color: var(--crasy-text-dark);
	text-transform: uppercase; 
	letter-spacing: 0.5px;
	margin-bottom: 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.download-meta {
	font-size: 11px;
	color: #666666;
	font-weight: 400;
	margin-bottom: 10px;
}

.download-meta strong {
	color: var(--crasy-accent);
}

/* Haupt-Download-Buttons (PHP- & JS-Bereich) */
.download-actions,
.download-action-area {
	margin-top: auto; /* Schiebt den Button ans untere Ende des Textbereichs */
}

.btn-download, .crasy-btn, .shop-now-btn {
	display: inline-block;
	text-align: center;
	background-color: var(--crasy-accent);
	color: #FFFFFF !important;
	text-decoration: none;
	font-size: 12px;
	font-weight: 700;
	padding: 8px 16px;
	border-radius: 20px;
	transition: background-color 0.2s ease;
	width: 100%;
	box-sizing: border-box;
}

.shop-now-btn {
	background-color: #82AD63; /* Andere Farbe für Shop-Links */
}

.btn-download:hover, .crasy-btn:hover {
	background-color: #735a82;
}

/* ==========================================================================
   NEU & FIX: Die untere Link-Leiste (Absolut linksbündig unter dem Foto)
   ========================================================================== */
.download-sub-actions {
		display: flex;
        flex-wrap: wrap;          /* Bricht bei Handys sauber um */
        gap: 8px 15px;            /* Platz zwischen den Links */
        padding-top: 10px;
		padding: 12px 20px;
        border-top: 1px dashed var(--crasy-bg-light); /* Trennlinie über den Links */
        width: 100%;
		margin-top: 0;
		justify-content: space-between;
		background: #fafafa;
    }
	

    /* Die kleinen Action-Links */
    .link-sub-action {
        display: inline-flex;
        align-items: center;
        color: var(--crasy-text-dark);
        text-decoration: none;
        font-size: 11px;
        font-weight: 400;
        transition: color 0.2s ease;
        white-space: nowrap;
    }

    .link-sub-action i {
        margin-right: 5px;        /* Platz zwischen Icon und Text */
        font-size: 12px;
        transition: transform 0.2s ease;
    }

    /* Hover-Effekte */
    .link-sub-action:hover {
        color: var(--crasy-accent);
    }

    .link-sub-action:hover i {
        transform: scale(1.15);   /* Icon hüpft minimal beim Hovern */
    }

    /* Spezifisch fürs Herz */
    .link-sub-action.link-like:hover {
        color: #E91E63;           /* Galerie-Herz-Rosa */
    }

    .link-sub-action.link-like:hover .icon-heart::before {
        content: "\f004";         /* FontAwesome solid heart */
        font-weight: 900;
    }

    .link-sub-action.link-bookmark:hover .icon-bookmark::before {
        content: "\f02e";         /* FontAwesome solid heart */
        font-weight: 900;
    }
	
	.link-sub-action.link-bookmark:hover {
        color: #ffc16b;           /* Galerie-Herz-Rosa */
    }

    .link-sub-action.link-bookmark:hover .icon-heart::before {
        content: "\f02e";         /* FontAwesome solid heart */
        font-weight: 900;
    }
	
	/* Styling für den Merken-Link */
	.link-sub-action.link-save {
		transition: color 0.2s ease;
	}

	/* Hover-Zustand */
	.link-sub-action.link-save:hover {
		color: #2ecc71; /* Schönes "Erfolgs-Grün" beim Hovern */
	}

	/* Wenn das Element aktiv (bereits gemerkt) ist */
	.link-sub-action.link-save.is-active {
		color: #27ae60; /* Dauerhaft grün gefärbt */
		font-weight: 700;
	}
	
	/* Container zentriert den Inhalt und agiert als Flexbox */
.toggle-tags-container-shared {
    display: flex;
    align-items: center;
    text-align: center;
    margin-top: 12px;
    width: 100%;
}

/* Der Button selbst übernimmt den Look von .link-sub-action / merken */
.toggle-tags-btn-shared {
    font-size: 0.85rem;      /* Gleiche Größe wie 'merken' */
    color: #777;             /* Dezentes Grau, passend zur unteren Leiste */
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;     /* Verhindert, dass der Text umbricht */
    padding: 0 15px;         /* Abstand links/rechts, damit die Linien nicht an den Text kleben */
    transition: color 0.2s ease;
}

.toggle-tags-btn-shared:hover {
    color: #007bff;          /* Wird beim Drüberfahren blau */
}

/* Die magischen Linien links und rechts auf Texthöhe */
.toggle-tags-container-shared::before,
.toggle-tags-container-shared::after {
    content: "";
    flex: 1;                 /* Füllt den restlichen Platz links und rechts komplett aus */
    border-bottom: 1px solid #e1e8ed; /* Die feine Trennlinie auf halber Texthöhe */
    height: 0;
}

/* Wenn die Tag-Cloud geöffnet ist, geben wir der Karte temporär den Vortritt */
.download-item:focus-within,
.download-item:hover {
    z-index: 10; /* Schiebt die Karte visuell über die darunterliegenden Blöcke */
}

/* MODERNES CARD LAYOUT */
.download-item {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.download-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
}

/* BILDER VOLL IM FOKUS OBERHALB */
.download-main-content {
    display: flex;
    flex-direction: column; /* Bild oben, Text unten */
}

.download-cover-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.download-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.download-item:hover .download-cover {
    transform: scale(1.05);
}

/* TEXTBEREICH UNTER DEM BILD */
.download-content {
	width: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.download-content.feed {
	padding: 0 20px 10px 20px;
}

.download-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 8px 0;
    color: #222;
}

.download-meta {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 15px;
}

/* HASHTAG WRAPPER MIT FADE-OUT EFFEFT */
.download-tag-wrapper {
    padding: 0 20px 15px 20px;
    background: #ffffff;
    position: relative;
}

.download-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    transition: max-height 0.3s ease;
}

/* Erste Zeile im eingeklappten Zustand + Soft-Ausblenden */
.download-tag-cloud.collapsed {
    max-height: 32px; 
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, black 70%, transparent 100%);
    mask-image: linear-gradient(to right, black 70%, transparent 100%);
}

.download-tag-cloud.expanded {
    max-height: 300px;
}

/* EDLER MEHR-ANZEIGEN LINK */
.toggle-tags-container {
    margin-top: 8px;
}

.toggle-tags-btn {
    font-size: 0.85rem;
    color: #007bff;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s ease;
}

.toggle-tags-btn:hover {
    color: #0056b3;
    text-decoration: underline;
}

.arrow-icon {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}
.modal-body {
    background: #fff; 
    width: 100%; 
    max-width: 1100px; 
    height: 85vh;            /* Feste Höhe statt max-height zwingt die Box, im Sichtfeld zu bleiben */
    border-radius: 12px; 
    position: relative; 
    padding: 20px;           /* Der äußere Rahmen-Abstand */
    box-sizing: border-box;  /* Ganz wichtig: Zieht das Padding von den 85vh ab */
    display: flex;           /* Aktiviert Flexbox, damit der Inhalt die Box perfekt ausfüllt */
    flex-direction: column;
}

.modal-content {
    overflow-y: auto;        /* NUR hier wird gescrollt */
    width: 100%;
    height: 100%;            /* Füllt exakt den verbleibenden Platz der .modal-body aus */
    box-sizing: border-box;
}

.detail-container {
    margin: 0px !important;
    padding: 0 10px 0 0 !important;
    border: 0 !important;
}

/* Der umschließende Container braucht ein relatives Profil */
.feed-item-options {
    position: relative;
    display: inline-block;
}

/* Der Drei-Punkte-Button selbst */
.options-trigger-btn {
    background: none;
    border: none;
    color: #718096;
    font-size: 1.2rem;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    transition: background 0.2s, color 0.2s;
}

.options-trigger-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #e066ff; /* Deine CraSy-Farbe bei Hover */
}

/* Das eigentliche Dropdown-Menü (standardmäßig unsichtbar) */
.options-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 40px;
    background: #fff;
    min-width: 160px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    z-index: 100; /* Damit es über dem Bild schwebt */
    overflow: hidden;
    padding: 6px 0;
}

/* Wenn das Menü die Klasse .is-active bekommt, wird es sichtbar */
.options-dropdown-menu.is-active {
    display: block;
}

/* Die einzelnen Links im Menü */
.options-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #4a5568;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.options-dropdown-menu a:hover {
    background: #f7fafc;
    color: #e066ff;
}

/* Spezieller Look für gefährliche Aktionen (z.B. Löschen) */
.options-dropdown-menu a.delete-option {
    color: #e53e3e;
}
.options-dropdown-menu a.delete-option:hover {
    background: #fff5f5;
    color: #c53030;
}

/* Trennlinie im Menü */
.dropdown-divider {
    border: 0;
    border-top: 1px solid #edf2f7;
    margin: 6px 0;
}

@media (max-width: 576px) {
    
    /* Wir hebeln die absolute Positionierung am Button aus */
    .options-dropdown-menu.is-active {
        position: fixed;
        left: 50% !important;
        top: auto !important;
        bottom: 20px !important; /* Schwebt elegant über dem unteren Rand */
        right: auto !important;
        transform: translateX(-50%); /* Perfekt zentriert auf dem Bildschirm */
        width: 90%; /* Nutzt den Platz auf dem Handy optimal aus */
        max-width: 320px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
        border: 1px solid #cbd5e1;
        animation: slideUp 0.2s ease-out; /* Schicker Einblende-Effekt */
    }
    
    /* Optional: Ein dezent abgedunkelter Hintergrund, wenn das Menü offen ist */
    /* Damit der Fokus voll auf den Optionen liegt */
    .options-dropdown-menu.is-active::before {
        content: '';
        position: fixed;
        top: -100vh;
        left: -100vw;
        right: -100vw;
        bottom: -100vw;
        background: rgba(0, 0, 0, 0.2);
        z-index: -1;
    }
}

/* Der Animation-Effekt für den mobilen Wow-Faktor */
@keyframes slideUp {
    from {
        transform: translate(-50(), 20px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.project-info {
	margin-top:0px;
}

@media (min-width: 700px) {
	.project-info {
		margin-top:20px;
	}
}