/* =====================================================================
   style.css — schlankes Styling, mobil-tauglich
   Wird in Schritt 16 weiter ausgebaut.
   ===================================================================== */

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
    color: #222;
    background: #fafafa;
}

h1 { margin-top: 0; }

/* --- Top-Navigation ------------------------------------------------- */
.topnav {
    display: flex;
    gap: 1.2rem;
    padding-bottom: 0.6rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #ddd;
}
.topnav a {
    color: #2a6ebb;
    text-decoration: none;
    font-weight: 600;
}
.topnav a:hover { text-decoration: underline; }

small { color: #777; font-weight: normal; }

.meta { color: #777; font-size: 0.9rem; margin-top: -0.5rem; }

/* --- Tabs ----------------------------------------------------------- */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 1.5rem;
    border-bottom: 1px solid #ccc;
}
.tab-btn {
    margin: 0;
    padding: 0.5rem 1rem;
    background: #eee;
    color: #333;
    border: 1px solid transparent;
    border-bottom: 0;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-weight: 500;
}
.tab-btn:hover { background: #ddd; }
.tab-btn.active {
    background: #fff;
    border-color: #ccc;
    color: #2a6ebb;
}

.tab-pane {
    display: none;
    padding: 1rem 0;
}
.tab-pane.active { display: block; }

textarea.output {
    width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.95rem;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.8rem;
    resize: vertical;
}

.copy-btn {
    margin-top: 0.6rem;
}
.copy-btn.success {
    background: #3a9d2c;
}

/* --- Newsletter-Preview --------------------------------------------- */
.newsletter-preview {
    width: 100%;
    height: 600px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f4f4f4;
}

/* --- Bilder-Grid mit plattform-typischem Seitenverhältnis ----------- */
.bilder-hint {
    color: #666;
    font-size: 0.9rem;
    margin: 0.6rem 0 0.4rem 0;
    font-style: italic;
}
.bilder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}
.bild {
    margin: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.5rem;
    text-align: center;
}
.bild-frame {
    width: 100%;
    background: #222;
    overflow: hidden;
    margin-bottom: 0.5rem;
    border-radius: 2px;
}
.bild-frame img {
    width: 100%;
    height: 100%;
    display: block;
}

/* Plattform-spezifische Seitenverhältnisse:
   - cover beschneidet so wie es die Plattform tun würde
   - bei "original" wird nicht beschnitten */
.ratio-fb       .bild-frame { aspect-ratio: 1.91 / 1; }
.ratio-fb       .bild-frame img { object-fit: cover; }

.ratio-square   .bild-frame { aspect-ratio: 1 / 1; }
.ratio-square   .bild-frame img { object-fit: cover; }

/* 9:16 könnte auf Desktop riesig werden — auf max 220px Breite begrenzen */
.ratio-portrait .bild-frame {
    aspect-ratio: 9 / 16;
    max-width: 220px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 0.5rem;
}
.ratio-portrait .bild-frame img { object-fit: cover; }

.ratio-original .bild-frame { aspect-ratio: auto; background: transparent; }
.ratio-original .bild-frame img { height: auto; object-fit: contain; }

.bild figcaption {
    font-size: 0.8rem;
    color: #555;
    margin-bottom: 0.4rem;
    word-break: break-all;
}
.download-btn {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: #2a6ebb;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85rem;
}
.download-btn:hover { background: #1f5390; }

/* --- Archiv-Tabelle ------------------------------------------------- */
table.archiv {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: #fff;
}
table.archiv th,
table.archiv td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid #eee;
    text-align: left;
}
table.archiv th {
    background: #f0f0f0;
    font-weight: 600;
}
table.archiv tr:hover { background: #fafafa; }
table.archiv a {
    color: #2a6ebb;
    text-decoration: none;
    font-weight: 500;
}
table.archiv a:hover { text-decoration: underline; }

.inline-form { margin: 0; padding: 0; }
.inline-form button { margin: 0; }

button.danger {
    background: #c33;
    padding: 0.3rem 0.8rem;
    font-size: 0.9rem;
}
button.danger:hover { background: #a22; }

/* --- Formulare ------------------------------------------------------ */
label {
    display: block;
    margin-top: 1rem;
    font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="url"],
textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #bbb;
    border-radius: 4px;
    font: inherit;
    background: #fff;
}

textarea { min-height: 8rem; resize: vertical; }

button {
    margin-top: 1rem;
    padding: 0.6rem 1.2rem;
    border: 0;
    border-radius: 4px;
    background: #2a6ebb;
    color: #fff;
    font: inherit;
    cursor: pointer;
}

button:hover { background: #1f5390; }

/* --- Login-Formular spezifisch -------------------------------------- */
.login-form {
    max-width: 360px;
}

/* --- Meldungen ------------------------------------------------------ */
.error {
    padding: 0.6rem 1rem;
    background: #fde2e2;
    color: #8b1a1a;
    border-left: 4px solid #c33;
    border-radius: 4px;
}

.success {
    padding: 0.6rem 1rem;
    background: #e3f6e1;
    color: #1d6213;
    border-left: 4px solid #3a9d2c;
    border-radius: 4px;
}
