/* =====================================================
   1. BASE
   ===================================================== */
:root {
	--bg: #f6f7f9;
	--surface: #ffffff;
	--text: #111827;
	--muted: #6b7280;
	--border: #e5e7eb;
	--primary: #0b57d0;
	--radius: 14px;
	--shadow: 0 12px 30px rgba(0, 0, 0, .08);
}

* {
	box-sizing: border-box;
}

body {
	font-family: system-ui, sans-serif;
	margin: 24px;
	background: var(--bg);
	color: var(--text);
}

h1, h2, h3 {
	margin-top: 0;
	letter-spacing: .2px;
}

.muted {
	color: var(--muted);
}

.hidden {
	display: none;
}

code {
	background: #f5f5f5;
	padding: 2px 6px;
	border-radius: 6px;
}

/* =====================================================
   2. LAYOUT + COMPONENTS
   ===================================================== */
.row {
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
}

.grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-top: 16px;
}

.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 14px;
	box-shadow: var(--shadow);
}

/* ---------- buttons ---------- */
.btn {
	padding: 8px 12px;
	border-radius: 10px;
	border: 1px solid var(--border);
	background: #fff;
	cursor: pointer;
	text-decoration: none;
}

.btn:hover {
	box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
}

.btn-primary {
	background: var(--primary);
	color: #fff;
	border-color: rgba(11, 87, 208, .3);
}

/* ---------- tables ---------- */
table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

th, td {
	padding: 8px;
	border-bottom: 1px solid #eee;
}

th {
	background: #fafafa;
}

/* ---------- forms ---------- */
input, select, textarea {
	font-family: inherit;
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 8px;
	min-width: 220px;
	width: 100%;
}

textarea {
	width: 100%;
}

input:focus, select:focus, textarea:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 2px rgba(11, 87, 208, .15);
}

label {
	font-weight: 600;
	margin-top: 10px;
	display: block;
}

.msg {
	padding: 10px;
	border-radius: 10px;
	background: #ecfdf3;
	border: 1px solid #bbf7d0;
	max-width: 900px;
}

.save-row {
	padding: 10px;
}
/* ---------- media ---------- */
.thumb {
	width: 320px;
	max-width: 100%;
	border-radius: 12px;
	border: 1px solid #ddd;
}

.preview {
	margin-bottom: 10px;
}

.drop {
	border: 2px dashed #aaa;
	border-radius: 12px;
	padding: 18px;
	text-align: center;
}

/* =====================================================
   3. TOPBAR NAV (clean modern)
   ===================================================== */
.topbar {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 14px;
	background: rgba(255, 255, 255, .85);
	border: 1px solid var(--border);
	border-radius: 16px;
	box-shadow: 0 10px 26px rgba(0, 0, 0, .06);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	margin-bottom: 18px;
}

.main-nav {
	display: flex;
	align-items: center;
}

/* menu row */
.menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 8px;
}

/* links */
.menu-link {
	text-decoration: none;
	color: var(--text);
	padding: 8px 12px;
	border-radius: 12px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
}

.menu-link:hover {
	background: #f2f4f7;
}

/* dropdown caret */
.dropdown>.menu-link::after {
	content: "▾";
	font-size: 12px;
	opacity: .6;
	margin-top: 1px;
}

/* right side controls */
.topbar-right {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 10px;
}

/* language form */
.lang {
	display: flex;
	align-items: center;
	gap: 8px;
}

.lang label {
	margin: 0;
	font-weight: 600;
}

/* dropdown base */
.menu-item {
	position: relative;
}

/* submenu panel */
.submenu {
	list-style: none;
	margin: 10px 0 0 0;
	padding: 8px;
	position: absolute;
	left: 0;
	min-width: 200px;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: 14px;
	box-shadow: 0 18px 40px rgba(0, 0, 0, .12);
	display: none;
	z-index: 50;
}

.submenu li a {
	display: block;
	padding: 10px 10px;
	border-radius: 12px;
	text-decoration: none;
	color: var(--text);
	font-weight: 500;
}

.submenu li a:hover {
	background: #f2f4f7;
}

/* show submenu */
.dropdown:hover>.submenu, .dropdown:focus-within>.submenu {
	display: block;
}

/* small screens: allow wrapping nicely */
@media ( max-width : 900px) {
	.topbar {
		flex-wrap: wrap;
		gap: 10px;
	}
	.topbar-right {
		margin-left: 0;
		width: 100%;
		justify-content: flex-end;
	}
}
/* =====================================================
   4. LOGIN PAGE
   ===================================================== */
body.auth-page {
	margin: 0;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f4f6f8;
}

/* container */
.auth-wrap {
	width: min(980px, 95%);
	display: grid;
	grid-template-columns: 1.2fr .8fr;
	border-radius: 18px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 25px 70px rgba(0, 0, 0, .12);
}

/* image */
.auth-image {
	min-height: 520px;
	background: linear-gradient(rgba(0, 0, 0, .15), rgba(0, 0, 0, .25)),
		url("/img/hohenwerfen.jpg") center/cover no-repeat;
}

/* login */
.auth-login {
	padding: 48px 42px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 14px;
}

.auth-title {
	font-size: 30px;
	margin: 0;
}

.auth-sub {
	color: #666;
	margin-bottom: 18px;
}

.auth-login form {
	display: grid;
	gap: 12px;
}

.auth-login button {
	padding: 12px;
	border: none;
	border-radius: 10px;
	background: var(--primary);
	color: white;
	font-weight: 600;
}

/* mobile */
@media ( max-width :850px) {
	.auth-wrap {
		grid-template-columns: 1fr;
	}
	.auth-image {
		min-height: 220px;
	}
}

/* =====================================================
   PAGE LAYOUT + SPACING
   ===================================================== */
.container {
	width: 100%;
	max-width: none;
	padding: 0 18px;
}

.section {
	margin-top: 28px;
}

.section-head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}

.section-head h2, .section-head h1 {
	margin: 0;
}

/* pushes buttons fully right */
.actions {
	margin-left: auto;
	display: flex;
	gap: 8px;
	align-items: center;
}

/* card spacing */
.card+.card {
	margin-top: 16px;
}

/* table spacing */
table {
	margin-top: 14px;
}

/* action buttons right inside tables */
td .row {
	justify-content: flex-end;
}

/* nicer table actions */
td .btn {
	padding: 6px 10px;
}

/* danger button */
.btn-danger {
	background: #fff;
	border-color: #ef4444;
	color: #b91c1c;
}

.btn-danger:hover {
	background: #fee2e2;
}

/* ====================================
   Section divider
==================================== */
.section-divider {
	margin: 28px 0 22px 0;
	height: 1px;
	background: linear-gradient(to right, transparent, #dcdfe4 15%, #dcdfe4 85%,
		transparent);
}

/* Modern back link */
.back-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: rgba(255, 255, 255, .75);
	text-decoration: none;
	color: var(--text);
	box-shadow: 0 8px 20px rgba(0, 0, 0, .06);
	margin: 6px 0 14px 0;
}

.back-link:hover {
	background: #fff;
}

/* Name + Save in one row */
.form-row {
	align-items: flex-end;
}

.field {
	flex: 1;
	min-width: 260px;
}

.field input {
	width: 100%;
	min-width: 0; /* important for flex */
}

/* =====================================
   FORM LAYOUT SYSTEM
===================================== */
.form-card {
	max-width: 900px;
	padding: 22px;
}

.form-row {
	display: flex;
	gap: 16px;
	align-items: flex-end;
	flex-wrap: wrap;
}

.field {
	flex: 1;
	min-width: 260px;
}

.field input {
	width: 100%;
}

/* =====================================
   Overlay section layout improvements
===================================== */
.section-grid {
	display: grid;
	grid-template-columns: 1.15fr .85fr;
	gap: 18px;
	margin-top: 10px;
}

.section-left, .section-right {
	min-width: 0;
}

.section-right {
	border: 1px solid var(--border);
	background: rgba(255, 255, 255, .65);
	border-radius: 14px;
	padding: 12px;
}

.section-right.is-muted {
	opacity: .85;
}

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

/* nicer preview */
.thumb-card {
	margin-top: 10px;
	border: 1px solid var(--border);
	border-radius: 14px;
	background: #fff;
	overflow: hidden;
	box-shadow: 0 10px 22px rgba(0, 0, 0, .06);
	min-height: 160px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.thumb-img {
	width: 100%;
	height: 220px;
	object-fit: cover;
	display: block;
}

.thumb-empty {
	padding: 18px;
}

/* META inline layout */
.meta-card {
	max-width: 980px;
}

.meta-row {
	display: flex;
	gap: 18px;
	align-items: flex-end;
	flex-wrap: wrap;
}

.meta-id {
	min-width: 160px;
}

.meta-title {
	flex: 1;
}

/* =====================================
   CONTENT EDITOR FLOW
===================================== */
.section-content {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-top: 12px;
}

.media-block {
	border: 1px solid var(--border);
	border-radius: 14px;
	padding: 14px;
	background: #fafafa;
}

/* bigger editorial preview */
.thumb-card {
	margin-top: 10px;
	height: 160px;
}

.thumb-img {
	width: 100%;
	height: 160px;
	object-fit: cover;
}

.thumb-video {
	width: 100%;
	display: block;
	background: #000;
}

.thumb-video--small {
	height: 160px;
	object-fit: cover;
}

/* =====================================
   MEDIA ROW (image + caption side by side)
===================================== */
.media-row {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	margin-top: 10px;
}

/* LEFT: preview */
.media-row .thumb-card {
	flex: 0 0 240px; /* fixed image width */
}

/* RIGHT: caption */
.caption-box {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.caption-box label {
	margin-bottom: 6px;
}

.caption-box textarea {
	width: 100%;
	min-height: 120px;
	resize: vertical;
}

/* responsive */
@media ( max-width :900px) {
	.media-row {
		flex-direction: column;
	}
	.media-row .thumb-card {
		width: 100%;
	}
}

/* =====================================================
   MEDIA LIBRARY (match timelines/edit)
===================================================== */
.media-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 16px;
	margin-top: 16px;
}

.media-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.media-preview img, .media-preview video {
	width: 100%;
	height: 170px;
	object-fit: contain;
	border-radius: 12px;
	border: 1px solid var(--border);
	background: #ded8d8;
	display: block;
}

.media-meta {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 10px;
}

.media-fn {
	font-weight: 700;
	font-size: 13px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.media-actions {
	margin-left: 0; /* actions block inside card */
	justify-content: flex-end;
}

/* Tag table niceties */
.th-sub{
  font-size:12px;
  font-weight:500;
  color:var(--muted);
  margin-top:4px;
}

.piece-cell{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.piece-title{
  font-weight:700;
}

.piece-desc{
  font-size:12px;
  line-height:1.2;
}

/* =====================================================
   EDI3 editor (only used for LAYOUT2)
===================================================== */

.char-counter{
  font-size:12px;
  color:#777;
  margin-left:6px;
}

.layout2-only{
  display:none;
}

.edi3{
  display:grid;
  grid-template-columns: 520px 1fr;
  gap: 18px;
  align-items:start;
}

.edi3-left textarea{
  width:100%;
  border:1px solid #cfcfcf;
  border-radius:10px;
  padding:10px;
  resize:vertical;
  font-family:inherit;
  font-size:14px;
}

/*
.edi3-right{
  border:1px solid var(--border);
  background:#fff;
  border-radius:14px;
  padding:12px;
  box-shadow:0 10px 22px rgba(0,0,0,.06);
}*/

.previewBar{
  display:flex;
  align-items:center;
  gap:10px;
  margin: 0 0 10px 0;
  font-size:14px;
}

.previewBar input[type="checkbox"]{
  width:18px;
  height:18px;
  cursor:pointer;
}

/* Preview stage */
    @font-face {
      font-family:'OpenSans';
      src:url('fonts/OpenSans-VariableFont_wdth,wght.ttf') format('truetype-variations');
      font-weight:100 900;
      font-stretch:75% 400%;
      font-display:swap;  
    }

    @font-face{
      font-family:'Rhau';
      font-style:normal;
      font-weight:400;
      src:local(''),
        url('fonts/Rhau-Regular.woff2') format('woff2');
    }
    @font-face{
      font-family:'OwnersReg';
      font-style:normal;
      font-weight:400;
      src:local(''),
        url('fonts/Owners-Regular.woff2') format('woff2');
    }
    @font-face{
      font-family:'OwnersMed';
      font-style:normal;
      font-weight:400;
      src:local(''),
        url('fonts/Owners-Medium.woff2') format('woff2');
    }
    @font-face{
      font-family:'OwnersXX';
      font-style:normal;
      font-weight:800;
      src:local(''),
        url('fonts/OwnersXXWide-Regular.woff2') format('woff2');
    }

    :root{
      --overlayGap:   3vw;
      --overlayPadd:  4vw;
      --layoutGap:    5vw;

      --fullWidth:    1920px;
      --fullHeight:   1080px; 

      --stageWidth:   calc(var(--fullWidth) * 0.86);
      --gridWidth:    calc(var(--stageWidth) - (var(--fullWidth) * 0.05) );
      --taWidth:      calc(var(--gridWidth) *.6667);

      --stageHeight:   calc(var(--fullHeight) - (var(--fullWidth) * 0.14));
      --taHeight:      var(--stageHeight);                   

      --taTitleSize:   calc( var(--fullHeight) * 0.041 );
      --taFontSize:    calc( var(--fullHeight) * 0.027 );

      --subPageTitle_Font_lyo2:           'OwnersXX';  
      --subPageTitle_fontSize_lyo2:       4.1vh;  
      --subPageTitle_lineHeight_lyo2:     1.3;  
      --subPageTitle_Color_lyo2:          var(--ciColor3);  

      --subPageText_Font_lyo2:            'OpenSans';  
      --subPageText_fontSize_lyo2:        2.7vh;  
      --subPageText_lineHeight_lyo2:      1.4;  
      --subPageText_Color_lyo2:           var(--ciColor3); 
    }

    * {border:none; padding:0; margin:0;}
    .edi {display:grid; position:relative; width:100%; height:100%; grid-template-columns:500px 1fr; grid-gap:50px;}

    textarea.text_lyo2 {width:500px; height:400px; font-family:var(--subPageText_Font_lyo2); font-size:var(--subPageText_fontSize_lyo2); line-height:var(--subPageText_lineHeight_lyo2); color:var(--subPageText_Color_lyo2); border:1px solid #aaa; resize:vertical;}
    textarea.text_lyo2 {font-size:16px; font-family:sans-serif;}  

    textarea.lyo2_headline {width:500px; height:100px; border:1px solid #aaa; resize:vertical;}

    /* Preview / Stage */
    .stage {
      width:var(--taWidth);
      height:var(--stageHeight);
      font-family:var(--subPageText_Font_lyo2);
      font-size:var(--taFontSize );
      line-height:var(--subPageText_lineHeight_lyo2);
      color:var(--subPageText_Color_lyo2);
      transform-origin:top left;
      transform:scale(.5); /* default */
      /*overflow:hidden;*/
      background:#eee;
    }

    /* wenn Switch aktiv -> scale(1) */
    .stage.isZoom1 {
      transform: scale(1);
    }

    .stage .headline {
      font-family:var(--subPageTitle_Font_lyo2);
      font-size:var(--taTitleSize);
      line-height:var(--subPageTitle_lineHeight_lyo2);
      color:var(--subPageTitle_Color_lyo2);
      width:calc( (100vw - (2 * (var(--overlayGap) + var(--overlayPadd))) - var(--layoutGap)) * 2/3);
      text-transform:uppercase;
      letter-spacing:4px;
      margin-bottom:calc(var(--fullHeight)*0.03);
      display:block;
    }

    .stage .body { white-space: pre-wrap; }

    /* Switch UI */
    .previewBar{
      display:flex;
      align-items:center;
      gap:10px;
      margin: 8px 0 8px 0;
      font-family: sans-serif;
      font-size: 14px;
    }
    .previewBar input[type="checkbox"]{
      width:18px;
      height:18px;
      cursor:pointer;
    }
    .previewBar label{
      cursor:pointer;
      user-select:none;
    }