/* Magazine Manager – front end */
.mgm {
	--mgm-font: Roboto, sans-serif;
	--mgm-accent: #0094E9;
	--mgm-btn-border: #02A4E2;
	--mgm-heading: #54595F;
	--mgm-text: #444444;
	--mgm-card-title: #1A1A1A;
	--mgm-cols-d: 5; --mgm-cols-t: 3; --mgm-cols-m: 2;
	--mgm-slides-d: 6; --mgm-slides-t: 3; --mgm-slides-m: 2;
	--mgm-cols: var(--mgm-cols-d);
	--mgm-slides: var(--mgm-slides-d);
	font-family: var(--mgm-font);
	box-sizing: border-box;
}
.mgm *, .mgm *::before, .mgm *::after { box-sizing: border-box; }
.mgm a { text-decoration: none; box-shadow: none; }
.mgm img { max-width: 100%; height: auto; display: block; border: 0; }
.mgm-note { padding: 10px 14px; border: 1px dashed #c3c4c7; color: #646970; font-size: 14px; }

/* Buttons */
.mgm .mgm-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 12px 24px; border: 2px solid var(--mgm-btn-border); border-radius: 3px;
	background: transparent; color: #000; font-family: var(--mgm-font);
	font-size: 15px; font-weight: 500; line-height: 1; transition: background .2s, color .2s;
}
.mgm .mgm-btn:hover, .mgm .mgm-btn:focus-visible { background: var(--mgm-btn-border); color: #fff; }

/* ---------- Latest issue ---------- */
.mgm-latest {
	display: grid; grid-template-columns: minmax(0, 350px) minmax(0, 1fr);
	gap: 40px 70px; align-items: start; width: 100%;
}
.mgm-latest__cover img { width: 100%; }
.mgm-latest--shadow .mgm-latest__cover img {
	border: 2px solid var(--mgm-heading); border-radius: 5px;
	box-shadow: rgba(7, 138, 201, .5) 5px 5px 34px 2px;
}
.mgm .mgm-latest__label {
	margin: 0 0 16px; color: var(--mgm-heading); font-size: 20px; font-weight: 400; line-height: 1;
}
.mgm .mgm-latest__title {
	margin: 0 0 8px; padding: 0; color: var(--mgm-heading); font-family: var(--mgm-font);
	font-size: 27px; font-weight: 100; line-height: 1; letter-spacing: 0; text-transform: none;
}
.mgm .mgm-latest__volume {
	margin: 0 0 24px; color: var(--mgm-heading); font-size: 20px; font-weight: 500; line-height: 1;
}
.mgm .mgm-latest__content,
.mgm .mgm-readmore__body { color: var(--mgm-text); font-size: 16px; line-height: 24px; }
.mgm .mgm-latest__content p,
.mgm .mgm-readmore__body p { margin: 0 0 20px; font-size: inherit; line-height: inherit; color: inherit; }
.mgm .mgm-latest__content strong { color: #333; }

.mgm .mgm-readmore { margin: 0 0 24px; border-bottom: 1px solid #D5D8DC; }
.mgm .mgm-readmore summary {
	padding: 15px 0; cursor: pointer; list-style: none;
	color: #000; font-size: 14px; font-weight: 700; line-height: 1;
}
.mgm .mgm-readmore summary::-webkit-details-marker { display: none; }
.mgm .mgm-readmore[open] summary { border-bottom: 1px solid #D5D8DC; }
.mgm .mgm-readmore__body { padding: 15px 0 0; }

.mgm-latest__buttons { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 8px; }

/* ---------- Archive slider ---------- */
.mgm-archive { position: relative; padding: 0 36px 34px; width: 100%; }
.mgm-archive__viewport { overflow: hidden; }
.mgm-archive__track {
	display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
	scroll-behavior: smooth; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.mgm-archive__track::-webkit-scrollbar { display: none; }
.mgm-archive__slide {
	flex: 0 0 calc((100% - (var(--mgm-slides) - 1) * 10px) / var(--mgm-slides));
	scroll-snap-align: start; display: block;
}
.mgm-archive__slide img { width: 100%; }
.mgm .mgm-archive__nav {
	position: absolute; top: calc(50% - 17px); transform: translateY(-50%);
	width: 32px; height: 48px; padding: 0; margin: 0; border: 0; border-radius: 0;
	background: transparent; color: #000; font-size: 44px; line-height: 1; cursor: pointer; box-shadow: none;
}
.mgm .mgm-archive__nav:hover { color: var(--mgm-accent); background: transparent; }
.mgm-archive__prev { left: 0; }
.mgm-archive__next { right: 0; }
.mgm-archive__dots { position: absolute; left: 0; right: 0; bottom: 6px; display: flex; justify-content: center; gap: 10px; }
.mgm .mgm-archive__dots button {
	width: 6px; height: 6px; padding: 0; margin: 0; border: 0; border-radius: 50%;
	background: #000; opacity: .2; cursor: pointer; box-shadow: none;
}
.mgm .mgm-archive__dots button[aria-current="true"] { opacity: 1; }

/* Lightbox */
.mgm-lightbox {
	position: fixed; inset: 0; z-index: 999999; display: flex; align-items: center; justify-content: center;
	background: rgba(0, 0, 0, .88); padding: 40px 60px;
}
.mgm-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.mgm-lightbox button {
	position: absolute; border: 0; background: transparent; color: #fff; cursor: pointer;
	font-size: 44px; line-height: 1; padding: 8px 14px;
}
.mgm-lightbox .mgm-lb-close { top: 8px; right: 10px; font-size: 36px; }
.mgm-lightbox .mgm-lb-prev { left: 6px; top: 50%; transform: translateY(-50%); }
.mgm-lightbox .mgm-lb-next { right: 6px; top: 50%; transform: translateY(-50%); }

/* ---------- Previous issues ---------- */
.mgm-prev {
	display: grid; grid-template-columns: repeat(var(--mgm-cols), minmax(0, 1fr));
	gap: 28px 24px; width: 100%;
}
.mgm-card { display: flex; flex-direction: column; align-items: stretch; text-align: center; }
.mgm .mgm-card__title {
	margin: 0 0 14px; padding: 0; font-family: var(--mgm-font);
	font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: 0; text-transform: none;
}
.mgm .mgm-card__title a { color: var(--mgm-card-title); }
.mgm .mgm-card__title a:hover { color: var(--mgm-accent); }
.mgm .mgm-card__volume { margin: -8px 0 12px; color: var(--mgm-heading); font-size: 15px; font-weight: 500; }
.mgm-card__img { display: block; width: 90%; margin: 0 auto 18px; }
.mgm-card__img img { width: 100%; aspect-ratio: 187 / 264; object-fit: cover; }

/* bar style */
.mgm-card__bar {
	display: flex; margin-top: auto; border: 2px solid var(--mgm-accent); background: var(--mgm-accent); min-height: 54px;
}
.mgm .mgm-card__read {
	flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 10px;
	color: #fff; font-size: 18px; font-weight: 400; line-height: 1.2;
}
.mgm .mgm-card__read:hover { color: #fff; text-decoration: underline; }
.mgm .mgm-card__dl {
	flex: 0 0 30%; display: flex; align-items: center; justify-content: center;
	background: #fff; color: var(--mgm-accent); font-size: 25px;
}
.mgm .mgm-card__dl:hover { color: #000; }

/* simple style */
.mgm-prev--simple .mgm-card__img { width: 100%; margin-bottom: 0; }

/* buttons style */
.mgm-prev--buttons .mgm-card__img { width: 100%; margin-bottom: 14px; }
.mgm-prev--buttons .mgm-card__title { font-size: 18px; margin-bottom: 10px; }
.mgm-prev--buttons .mgm-card__volume { margin: -4px 0 12px; }
.mgm-card__buttons { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: auto; }
.mgm .mgm-card__buttons .mgm-btn { padding: 10px 14px; font-size: 14px; }
.mgm .mgm-card__buttons .mgm-btn--icon { font-size: 18px; padding: 8px 12px; color: var(--mgm-accent); }
.mgm .mgm-card__buttons .mgm-btn--icon:hover { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.mgm { --mgm-cols: var(--mgm-cols-t); --mgm-slides: var(--mgm-slides-t); }
	.mgm-latest { gap: 32px 36px; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
}
@media (max-width: 767px) {
	.mgm { --mgm-cols: var(--mgm-cols-m); --mgm-slides: var(--mgm-slides-m); }
	.mgm-latest { grid-template-columns: minmax(0, 1fr); }
	.mgm-latest__cover { max-width: 300px; margin: 0 auto; width: 100%; }
	.mgm-latest__buttons { gap: 12px; }
	.mgm-latest__buttons .mgm-btn { flex: 1 1 auto; }
	.mgm-prev { gap: 24px 14px; }
	.mgm .mgm-card__title { font-size: 17px; }
	.mgm .mgm-card__read { font-size: 15px; }
	.mgm .mgm-card__dl { font-size: 20px; }
	.mgm-archive { padding: 0 28px 30px; }
}
